support embedding in application/xhtml+xml pages
[phorkie.git] / build.xml
index bb7b1a0..32b4f33 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -8,37 +8,31 @@
   -->
   <property file="build.properties" />
 
-  <property name="version-m"  value="0.3" />
-  <property name="version"    value="0.3.1" />
-  <property name="stability"  value="alpha" />
+  <property name="version-m"  value="0.5" />
+  <property name="version"    value="0.5.0" />
+  <property name="stability"  value="beta" />
   <property name="releasenotes" value="
-Version 0.3.1 - 2012-09-27
+Version 0.5.0 - 2015-01-29
 --------------------------
-* Check for OpenID package in SetupCheck
-* Fix bug #24: setupcheck: verify geshi installation
-* Fix bug #25: setupcheck: verify markdown
-
-Version 0.3.0 - 2012-09-27
---------------------------
-
-* Fix bug #10: error when nothing submitted [cweiske]
-* Fix bug #11: do not index edit, delete and tool pages [cweiske]
-* Fix bug #20: elasticsearch error on deletion [cweiske]
-* Fix bug #22: Edited pastes not in 'recently created' [cweiske]
-* Fix bug #23: 'work dir not found' on failed remote fork [cweiske]
-* Implement request #5: Add OpenID authentication [jnovack]
-* Implement request #9: autodetect file type [cweiske]
-* Implement request #12: DOAP and rel='vcs-git' support [cweiske]
-* Implement request #13: remote forking support [cweiske]
-* Hide additional file fields by default, button to toggle their visibility
-  [cweiske]
-* Markdown support [jnovack]
-* Added nginx rewrite rules to README [skl]
+* Implement paste embedding via JavaScript
+* Implement paste embedding via oEmbed
+* Implement single file editing
+* Implement automatic login
+* Implement Elasticsearch 1.3 compatibility
+* Work around PHP bug #68347 to parse ini files correctly
+* Move clone URLs to sidebar
+* Move additional button into text field
 " />
+  <property name="libdir"      value="${phing.dir}/lib"/>
+
   <property name="zipfile"     value="${phing.project.name}-${version}.tar.bz2" />
+  <property name="pharfile"    value="${phing.project.name}-${version}.phar" />
   <property name="pkgfile"     value="${phing.project.name}-${version}.tgz" />
+
+  <property name="pharpath"    value="${phing.dir}/dist/${pharfile}" />
   <property name="distfile"    value="dist/${zipfile}" />
   <property name="distpkgfile" value="dist/pear/${pkgfile}" />
+
   <property name="sfproject"   value="phorkie" />
   <property name="sffilepath"  value="p/ph/phorkie/" />
 
@@ -53,8 +47,28 @@ Version 0.3.0 - 2012-09-27
    <include name="NEWS.rst"/>
    <include name="README.rst"/>
 
+   <exclude name="**/.git/"/>
    <exclude name="**/.gitignore/"/>
    <exclude name="data/config.php"/>
+   <exclude name="www/**/.phar"/>
+   <exclude name="www/repos"/>
+  </fileset>
+
+  <fileset id="fs.phar" dir="${phing.dir}">
+   <include name="data/**"/>
+   <include name="lib/**"/>
+   <include name="scripts/**"/>
+   <include name="src/**"/>
+   <include name="www/**"/>
+
+   <include name="ChangeLog"/>
+   <include name="README.rst"/>
+
+   <exclude name="data/config.php"/>
+   <exclude name="**/.git/"/>
+   <exclude name="**/.gitignore/"/>
+   <exclude name="www/**/.phar"/>
+   <exclude name="www/repos"/>
   </fileset>
 
   <fileset id="fs.doc" dir=".">
@@ -62,10 +76,73 @@ Version 0.3.0 - 2012-09-27
    <include name="NEWS.rst"/>
   </fileset>
 
-  <taskdef name="rST" classname="phing.tasks.ext.rSTTask" />
   <taskdef name="d51pearpkg2" classname="phing.tasks.ext.d51PearPkg2Task" />
 
-  <target name="zip" depends="check"
+
+  <target name="phar" depends="preparedirs,collectdeps"
+          description="Create phar file for release"
+  >
+   <delete file="${pharpath}"/>
+   <exec command="php scripts/build-rewritemap.php" dir="${phing.dir}"/>
+   <pharpackage basedir="${phing.dir}"
+                destfile="${pharpath}"
+                stub="${phing.dir}/src/stub-phar.php"
+                alias="phorkie.phar"
+   >
+    <fileset refid="fs.phar"/>
+   </pharpackage>
+
+   <exec executable="bzip2" dir="${phing.dir}/dist">
+    <arg value="-kf"/>
+    <arg file="${pharpath}"/>
+   </exec>
+  </target>
+
+
+  <target name="collectdeps" description="Copy package dependencies to lib/">
+   <delete dir="${libdir}"/>
+   <mkdir dir="${libdir}"/>
+
+   <!-- requires phing >= 2.8.0 -->
+   <copy todir="${libdir}">
+    <pearPackageFileset package="pear.php.net/Cache_Lite"/><!-- OpenID -->
+    <pearPackageFileset package="pear.php.net/Console_Getopt"/>
+    <pearPackageFileset package="pear.php.net/Crypt_DiffieHellman"/><!-- OpenID -->
+    <pearPackageFileset package="pear.php.net/Date_HumanDiff"/>
+    <pearPackageFileset package="pear.geshi.org/geshi">
+     <!-- remove files that are probably not needed to save space in the .phar -->
+     <exclude name="geshi/arm.php"/>
+     <exclude name="geshi/autoit.php"/>
+     <exclude name="geshi/thinbasic.php"/>
+    </pearPackageFileset>
+    <pearPackageFileset package="pear.php.net/HTTP2"/>
+    <pearPackageFileset package="pear.php.net/HTTP_Request2"/>
+    <pearPackageFileset package="pear.php.net/MIME_Type"/>
+    <pearPackageFileset package="zustellzentrum.cweiske.de/MIME_Type_PlainDetect"/>
+    <pearPackageFileset package="zustellzentrum.cweiske.de/MIME_Type_PlainDetect" role="data"/>
+    <pearPackageFileset package="pear.michelf.com/Markdown"/>
+    <pearPackageFileset package="pear.php.net/Net_URL2"/>
+    <pearPackageFileset package="pear.php.net/OpenID"/>
+    <pearPackageFileset package="pear.php.net/Pager"/>
+    <pearPackageFileset package="pear.php.net/PEAR">
+     <include name="PEAR/Exception.php"/>
+     <include name="PEAR.php"/>
+     <include name="PEAR5.php"/>
+     <include name="OS/Guess.php"/>
+     <include name="System.php"/>
+    </pearPackageFileset>
+    <pearPackageFileset package="pear.php.net/Services_Libravatar"/>
+    <pearPackageFileset package="pear2.php.net/PEAR2_Services_Linkback"/>
+    <pearPackageFileset package="pear.php.net/Services_Yadis"/>
+    <pearPackageFileset package="pear.php.net/System_Command"/>
+    <pearPackageFileset package="pear.twig-project.org/Twig"/>
+    <pearPackageFileset package="pear.php.net/Validate"/>
+    <pearPackageFileset package="pear.php.net/VersionControl_Git"/>
+   </copy>
+  </target>
+
+
+  <target name="zip" depends="preparedirs"
    description="Create zip file for release"
    >
     <!--
@@ -85,7 +162,7 @@ Version 0.3.0 - 2012-09-27
 
 
 
-  <target name="package" depends="check"
+  <target name="pear" depends="check"
    description="Creates the pear package"
   >
    <d51pearpkg2 dir="." baseinstalldir="/">
@@ -125,6 +202,10 @@ Version 0.3.0 - 2012-09-27
                 channel="pear.php.net"
                 minimum_version="2.4.8"
                 />
+       <package name="PEAR2_Services_Linkback"
+                channel="pear2.php.net"
+                minimum_version="0.2.1"
+                />
        <package name="Services_Libravatar"
                 channel="pear.php.net"
                 minimum_version="0.2.2"
@@ -135,11 +216,11 @@ Version 0.3.0 - 2012-09-27
                 />
 
        <package name="geshi"
-                channel="mediawiki.googlecode.com/svn"
+                channel="pear.geshi.org/geshi"
                 minimum_version="1.0.0"
                 />
        <package name="Markdown"
-                channel="pear.michelf.ca"
+                channel="pear.michelf.com"
                 minimum_version="0.0.2"
                 />
        <package name="MIME_Type_PlainDetect"
@@ -241,7 +322,7 @@ Version 0.3.0 - 2012-09-27
   </target>
 
 
-  <target name="release" depends="check,zip,package,deploy-sf"
+  <target name="release" depends="check,zip,pear,deploy-sf"
    description="Release the version on sourceforge"
    >
    <!-- meta-target -->
@@ -254,13 +335,14 @@ Version 0.3.0 - 2012-09-27
   /home/frs/project/p/ph/phorkie/phorkie/v0.1/phorkie-v0.1.1.zip
   https://sourceforge.net/apps/trac/sourceforge/wiki/Release%20files%20for%20download
   -->
-  <target name="deploy-sf" depends="check,zip"
+  <target name="deploy-sf" depends="check,zip,phar"
    description="Upload release to sourceforge"
    >
     <delete dir="dist/deploy-sf" /><!-- make empty -->
     <mkdir dir="dist/deploy-sf" />
     <mkdir dir="dist/deploy-sf/v${version-m}" />
     <copy file="${distfile}" tofile="dist/deploy-sf/v${version-m}/${zipfile}"/>
+    <copy file="${pharpath}" tofile="dist/deploy-sf/v${version-m}/${pharfile}"/>
     <!-- test
     <exec command="rsync -av dist/deploy-sf/ /tmp/test/" escape="false" />
     -->
@@ -273,15 +355,17 @@ Version 0.3.0 - 2012-09-27
   </target>
 
 
-  <target name="check"
+  <target name="preparedirs">
+    <mkdir dir="dist" />
+  </target>
+
+  <target name="check" depends="preparedirs"
    description="Check variables"
    >
     <fail unless="version" message="Version not defined!" />
     <fail unless="sfuser" message="Sourceforge username not defined!" />
     <fail unless="sfproject" message="Sourceforge project name not defined!" />
     <fail unless="sffilepath" message="Sourceforge project file path not defined!" />
-
-    <mkdir dir="dist" />
   </target>
 
 </project>