Remove pear package creation script
[phorkie.git] / build.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <project name="phorkie" default="zip" basedir=".">
3   <!--
4     phorkie phing build file.
5     This script should provide a one-stop tool for all administrative
6     tasks around phorkie, like creating a release version,
7     tagging a release
8   -->
9   <property name="version"    value="0.7.0" />
10   <property name="stability"  value="beta" />
11   <property name="releasenotes" value="
12 Version 0.7.0 - 2015-11-05
13 --------------------------
14 * Add support for elasticsearch 2.0
15 * Add text file detection for unknown file extensions
16 " />
17   <property name="libdir"      value="${phing.dir}/lib"/>
18
19   <property name="zipfile"     value="${phing.project.name}-${version}.tar.bz2" />
20   <property name="pharfile"    value="${phing.project.name}-${version}.phar" />
21   <property name="pkgfile"     value="${phing.project.name}-${version}.tgz" />
22
23   <property name="pharpath"    value="${phing.dir}/dist/${pharfile}" />
24   <property name="distfile"    value="dist/${zipfile}" />
25   <property name="distpkgfile" value="dist/pear/${pkgfile}" />
26
27   <fileset id="fs.zip" dir=".">
28    <include name="data/**"/>
29    <include name="scripts/**"/>
30    <include name="src/**"/>
31    <include name="www/**"/>
32
33    <include name="ChangeLog"/>
34    <include name="LICENSE"/>
35    <include name="NEWS.rst"/>
36    <include name="README.rst"/>
37
38    <exclude name="**/.git/"/>
39    <exclude name="**/.gitignore/"/>
40    <exclude name="data/cache/**"/>
41    <exclude name="data/config.php"/>
42    <exclude name="www/**/.phar"/>
43    <exclude name="www/repos"/>
44   </fileset>
45
46   <fileset id="fs.phar" dir="${phing.dir}">
47    <include name="data/**"/>
48    <include name="lib/**"/>
49    <include name="scripts/**"/>
50    <include name="src/**"/>
51    <include name="www/**"/>
52
53    <include name="ChangeLog"/>
54    <include name="README.rst"/>
55
56    <exclude name="**/.git/"/>
57    <exclude name="**/.gitignore/"/>
58    <exclude name="data/cache/**"/>
59    <exclude name="data/config.php"/>
60    <exclude name="www/**/.phar"/>
61    <exclude name="www/repos"/>
62   </fileset>
63
64   <fileset id="fs.doc" dir=".">
65    <include name="README.rst"/>
66    <include name="NEWS.rst"/>
67   </fileset>
68
69   <taskdef name="d51pearpkg2" classname="phing.tasks.ext.d51PearPkg2Task" />
70
71
72   <target name="phar" depends="preparedirs,collectdeps"
73           description="Create phar file for release"
74   >
75    <delete file="${pharpath}"/>
76    <exec command="php scripts/build-rewritemap.php" dir="${phing.dir}"/>
77    <pharpackage basedir="${phing.dir}"
78                 destfile="${pharpath}"
79                 stub="${phing.dir}/src/stub-phar.php"
80                 alias="phorkie.phar"
81    >
82     <fileset refid="fs.phar"/>
83    </pharpackage>
84
85    <exec executable="bzip2" dir="${phing.dir}/dist">
86     <arg value="-kf"/>
87     <arg file="${pharpath}"/>
88    </exec>
89   </target>
90
91
92   <target name="collectdeps" description="Copy package dependencies to lib/">
93    <delete dir="${libdir}"/>
94    <mkdir dir="${libdir}"/>
95
96    <!-- requires phing >= 2.8.0 -->
97    <copy todir="${libdir}">
98     <pearPackageFileset package="pear.php.net/Cache_Lite"/><!-- OpenID -->
99     <pearPackageFileset package="pear.php.net/Console_Getopt"/>
100     <pearPackageFileset package="pear.php.net/Crypt_DiffieHellman"/><!-- OpenID -->
101     <pearPackageFileset package="pear.php.net/Date_HumanDiff"/>
102     <pearPackageFileset package="pear.geshi.org/geshi">
103      <!-- remove files that are probably not needed to save space in the .phar -->
104      <exclude name="geshi/arm.php"/>
105      <exclude name="geshi/autoit.php"/>
106      <exclude name="geshi/thinbasic.php"/>
107     </pearPackageFileset>
108     <pearPackageFileset package="pear.php.net/HTTP2"/>
109     <pearPackageFileset package="pear.php.net/HTTP_Request2"/>
110     <pearPackageFileset package="pear.php.net/MIME_Type"/>
111     <pearPackageFileset package="zustellzentrum.cweiske.de/MIME_Type_PlainDetect"/>
112     <pearPackageFileset package="zustellzentrum.cweiske.de/MIME_Type_PlainDetect" role="data"/>
113     <pearPackageFileset package="pear.michelf.com/Markdown"/>
114     <pearPackageFileset package="pear.php.net/Net_URL2"/>
115     <pearPackageFileset package="pear.php.net/OpenID"/>
116     <pearPackageFileset package="pear.php.net/Pager"/>
117     <pearPackageFileset package="pear.php.net/PEAR">
118      <include name="PEAR/Exception.php"/>
119      <include name="PEAR.php"/>
120      <include name="PEAR5.php"/>
121      <include name="OS/Guess.php"/>
122      <include name="System.php"/>
123     </pearPackageFileset>
124     <pearPackageFileset package="pear.php.net/Services_Libravatar"/>
125     <pearPackageFileset package="pear2.php.net/PEAR2_Services_Linkback"/>
126     <pearPackageFileset package="pear.php.net/Services_Yadis"/>
127     <pearPackageFileset package="pear.php.net/System_Command"/>
128     <pearPackageFileset package="pear.twig-project.org/Twig"/>
129     <pearPackageFileset package="pear.php.net/Validate"/>
130     <pearPackageFileset package="pear.php.net/VersionControl_Git"/>
131    </copy>
132   </target>
133
134
135   <target name="zip" depends="preparedirs"
136    description="Create zip file for release"
137    >
138     <!--
139       The release file is for end users, so it is safe to
140       remove anything developer-related.
141
142       Test your zip with: unzip -l phorkie-0.1.0.zip
143     -->
144     <echo msg="Creating distribution zip for phorkie ${version}"/>
145     <delete file="${distfile}" failonerror="false"/>
146     <tar compression="bzip2" destfile="${distfile}"
147          prefix="${phing.project.name}-${version}/"
148     >
149      <fileset refid="fs.zip"/>
150     </tar>
151   </target>
152
153
154   <target name="docs" description="render documentation">
155    <rST format="html" uptodate="true">
156     <fileset refid="fs.doc"/>
157     <mapper type="regexp" from="^(.+?).rst$" to="dist/docs/\1.html"/>
158    </rST>
159   </target>
160
161   <target name="clean-docs" description="delete rendered documentation files">
162    <delete dir="dist/docs" includeemptydirs="yes"/>
163   </target>
164
165
166   <target name="release" depends="check,phar,zip"
167    description="Package the new version"
168    >
169    <!-- meta-target -->
170   </target>
171
172
173   <target name="preparedirs">
174     <mkdir dir="dist" />
175   </target>
176
177   <target name="check" depends="preparedirs"
178    description="Check variables"
179    >
180     <fail unless="version" message="Version not defined!" />
181   </target>
182
183 </project>