-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
121 lines (108 loc) · 5.81 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?xml version="1.0" encoding="UTF-8"?>
<project name="module-apache" basedir=".">
<dirname property="project.basedir" file="${ant.file.module-apache}"/>
<property name="root.dir" location="${project.basedir}/.."/>
<property name="build.properties" value="${project.basedir}/build.properties"/>
<property file="${build.properties}"/>
<!-- Bearsampp dev -->
<property name="dev.path" location="${root.dir}/dev"/>
<fail unless="dev.path" message="Project 'dev' not found in ${dev.path}"/>
<echo message="Bearsampp dev found in ${dev.path}" level="debug"/>
<!-- Import build-commons.xml -->
<import file="${dev.path}/build/build-commons.xml"/>
<!-- Import build-bundle.xml -->
<import file="${dev.path}/build/build-bundle.xml"/>
<target name="release.build">
<basename property="bundle.folder" file="${bundle.path}"/>
<replaceproperty src="bundle.folder" dest="bundle.version" replace="${bundle.name}" with=""/>
<getmoduleuntouched name="${bundle.name}" version="${bundle.version}" propSrcDest="bundle.srcdest" propSrcFilename="bundle.srcfilename"/>
<condition property="bundle.srcfinal" value="${bundle.srcdest}/Apache24"><available file="${bundle.srcdest}/Apache24" type="dir"/></condition>
<condition property="bundle.srcfinal" value="${bundle.srcdest}/Apache2.4"><available file="${bundle.srcdest}/Apache2.4" type="dir"/></condition>
<fail unless="bundle.srcfinal" message="Main folder not found"/>
<assertfile file="${bundle.srcfinal}/bin/httpd.exe"/>
<property name="apache.prep.path" location="${bundle.tmp.prep.path}/${bundle.name}${bundle.version}"/>
<delete dir="${apache.prep.path}"/>
<mkdir dir="${apache.prep.path}"/>
<copy file="${bundle.srcdest}/readme_first.html"
todir="${apache.prep.path}"
overwrite="true"
failonerror="false"
/>
<copy todir="${apache.prep.path}" overwrite="true">
<fileset dir="${bundle.srcfinal}" excludes="
cgi-bin/**,
conf/original/**,
conf/ssl/**,
error/**,
htdocs/**,
icons/**,
include/**,
lib/**,
logs/*,
tools/**"
/>
</copy>
<copy todir="${apache.prep.path}" overwrite="true">
<fileset dir="${bundle.path}" defaultexcludes="yes"/>
</copy>
<!-- Modules -->
<if>
<available file="${apache.prep.path}/modules.properties" type="file"/>
<then>
<echo message="Processing modules..."/>
<delete file="${build.tmp.path}/apache_modules.tmp"/>
<touch file="${build.tmp.path}/apache_modules.tmp"/>
<property prefix="apachemodules" file="${apache.prep.path}/modules.properties"/>
<propertyselector property="apachemodules" match="apachemodules\.(.*)" select="\1"/>
<for list="${apachemodules}" param="apachemodule">
<sequential>
<var name="apachemodule.version" unset="true"/>
<var name="apachemodule.dest" unset="true"/>
<var name="apachemodule.so" unset="true"/>
<!-- THIS IS BROKEN FOR NEWER BUILDS THAT DON'T HAVE AN APACHE*.* FOLDER IN THE MODULE -->
<propertyregex property="apachemodule.version" input="${apachemodules.@{apachemodule}}" regexp="apache-.*-.*-(.*)" select="\1"/>
<!-- Download module -->
<download url="${apachemodules.@{apachemodule}}" returnProperty="apachemodule.dest"/>
<echo message="Module path: ${apachemodule.dest}"/>
<condition property="apachemodule.so" value="${apachemodule.dest}/mod_@{apachemodule}.so">
<available file="${apachemodule.dest}/mod_@{apachemodule}.so" type="file"/>
</condition>
<condition property="apachemodule.so" value="${apachemodule.dest}/mod_@{apachemodule}/mod_@{apachemodule}.so">
<available file="${apachemodule.dest}/mod_@{apachemodule}/mod_@{apachemodule}.so" type="file"/>
</condition>
<condition property="apachemodule.so" value="${apachemodule.dest}/Apache24/modules/mod_@{apachemodule}.so">
<available file="${apachemodule.dest}/Apache24/modules/mod_@{apachemodule}.so" type="file"/>
</condition>
<condition property="apachemodule.so" value="${apachemodule.dest}/Apache24/modules/mod_@{apachemodule}.so">
<available file="${apachemodule.dest}/mod_@{apachemodule}.so" type="file"/>
</condition>
<condition property="apachemodule.so" value="${apachemodule.dest}/mod_@{apachemodule}.so">
<available file="${apachemodule.dest}/mod_@{apachemodule}.so" type="file"/>
</condition>
<fail unless="apachemodule.so" message="Main so not found"/>
<!-- Copy module -->
<echo message="Copy @{apachemodule} ${apachemodule.version} module..."/>
<copy file="${apachemodule.so}" todir="${apache.prep.path}/modules" overwrite="true"/>
<!-- Echo module string to temp file -->
<echo message="#LoadModule @{apachemodule}_module modules/mod_@{apachemodule}.so${line.separator}"
file="${build.tmp.path}/apache_modules.tmp"
append="true"/>
</sequential>
</for>
<!-- Inject in httpd.conf -->
<loadfile property="apache.modules" srcFile="${build.tmp.path}/apache_modules.tmp"/>
<echo message="${line.separator}Apache modules to inject in httpd.conf :${line.separator}${apache.modules}"/>
<copy todir="${apache.prep.path}/conf" overwrite="true">
<filterset>
<filter token="APACHE_MODULES" value="${apache.modules}"/>
</filterset>
<resources>
<file file="${bundle.path}/conf/httpd.conf"/>
<file file="${bundle.path}/conf/httpd.conf.ber"/>
</resources>
</copy>
<delete file="${apache.prep.path}/modules.properties"/>
</then>
</if>
</target>
</project>