root/trunk/make/appweb.mk

Revision 7515, 12.2 kB (checked in by bzhou, 2 years ago)

appweb: reverted back to 2.1.0, probably missing file in 2.4.0 upgrade

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 ###########################################################
2 #
3 # appweb
4 #
5 ###########################################################
6 #
7 # $Header$
8
9 # You must replace "appweb" and "APPWEB-PHP" with the lower case name and
10 # upper case name of your new package.  Some places below will say
11 # "Do not change this" - that does not include this global change,
12 # which must always be done to ensure we have unique names.
13
14 #
15 # APPWEB_VERSION, APPWEB_SITE and APPWEB_SOURCE define
16 # the upstream location of the source code for the package.
17 # APPWEB_DIR is the directory which is created when the source
18 # archive is unpacked.
19 # APPWEB_UNZIP is the command used to unzip the source.
20 # It is usually "zcat" (for .gz) or "bzcat" (for .bz2)
21 #
22 # You should change all these variables to suit your package.
23 #
24 APPWEB_SITE=http://www.appwebserver.org/software
25 APPWEB_VERSION=2.1.0
26 APPWEB_VERSION_EXTRA=2
27 APPWEB_SOURCE=appWeb-src-$(APPWEB_VERSION)-$(APPWEB_VERSION_EXTRA).tar.gz
28 APPWEB_DIR=appWeb-$(APPWEB_VERSION)
29 APPWEB_UNZIP=zcat
30 APPWEB_MAINTAINER=Matt McNeill <matt_mcneill@hotmail.com>
31 APPWEB_DESCRIPTION=AppWeb is the leading web server technology for embedding in devices and applications. Supports embedded javascript, CGI, Virtual Sites, SSL, user passwords, virtual directories - all with minimal memory footprint.
32 APPWEB_SECTION=net
33 APPWEB_PRIORITY=optional
34 APPWEB_DEPENDS=openssl, php-embed
35 APPWEB_CONFLICTS=
36
37 #
38 # APPWEB_IPK_VERSION should be incremented when the ipk changes.
39 #
40 APPWEB_IPK_VERSION=1
41
42 #
43 # APPWEB_PATCHES should list any patches, in the the order in
44 # which they should be applied to the source code.
45 #
46 APPWEB_PATCHES=$(APPWEB_SOURCE_DIR)/buildutilsfortargetenv.patch \
47         $(APPWEB_SOURCE_DIR)/rpath.patch \
48         $(APPWEB_SOURCE_DIR)/http.h.patch
49
50 #
51 # If the compilation of the package requires additional
52 # compilation or linking flags, then list them here.
53 #
54 APPWEB_CPPFLAGS=
55 APPWEB_LDFLAGS=
56
57 #
58 # APPWEB_BUILD_DIR is the directory in which the build is done.
59 # APPWEB_SOURCE_DIR is the directory which holds all the
60 # patches and ipkg control files.
61 # APPWEB_IPK_DIR is the directory in which the ipk is built.
62 # APPWEB_IPK is the name of the resulting ipk files.
63 #
64 # You should not change any of these variables.
65 #
66 APPWEB_BUILD_DIR=$(BUILD_DIR)/appweb
67 APPWEB_SOURCE_DIR=$(SOURCE_DIR)/appweb
68 APPWEB_IPK_DIR=$(BUILD_DIR)/appweb-$(APPWEB_VERSION)-ipk
69 APPWEB_IPK=$(BUILD_DIR)/appweb_$(APPWEB_VERSION)-$(APPWEB_IPK_VERSION)_$(TARGET_ARCH).ipk
70
71 #
72 # This is the dependency on the source code.  If the source is missing,
73 # then it will be fetched from the site using wget.
74 #
75
76 $(DL_DIR)/$(APPWEB_SOURCE):
77         $(WGET) -P $(DL_DIR) $(APPWEB_SITE)/$(APPWEB_SOURCE)
78
79 #
80 # The source code depends on it existing within the download directory.
81 # This target will be called by the top level Makefile to download the
82 # source code's archive (.tar.gz, .bz2, etc.)
83 #
84 appweb-source: $(DL_DIR)/$(APPWEB_SOURCE) $(APPWEB_PATCHES)
85
86 #
87 # This target unpacks the source code in the build directory.
88 # If the source archive is not .tar.gz or .tar.bz2, then you will need
89 # to change the commands here.  Patches to the source code are also
90 # applied in this target as required.
91 #
92 # This target also configures the build within the build directory.
93 # Flags such as LDFLAGS and CPPFLAGS should be passed into configure
94 # and NOT $(MAKE) below.  Passing it to configure causes configure to
95 # correctly BUILD the Makefile with the right paths, where passing it
96 # to Make causes it to override the default search paths of the compiler.
97 #
98 # If the compilation of the package requires other packages to be staged
99 # first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage").
100 #
101 # ***
102 # NOTE: according to the appweb build instructions the paths for the loadable
103 #       modules must be relative paths - please dont replace the ../../../../staging
104 #       with the makefile symbol
105 #
106 #       see the following for more information:
107 #       http://www.appwebserver.org/products/appWeb/doc/source/packages.html
108 #
109 $(APPWEB_BUILD_DIR)/.configured: $(DL_DIR)/$(APPWEB_SOURCE) $(APPWEB_PATCHES)
110         $(MAKE) openssl-stage php-stage
111         rm -rf $(BUILD_DIR)/$(APPWEB_DIR) $(APPWEB_BUILD_DIR)
112         $(APPWEB_UNZIP) $(DL_DIR)/$(APPWEB_SOURCE) | tar -C $(BUILD_DIR) -xvf -
113
114         cat $(APPWEB_PATCHES) | patch -d $(BUILD_DIR)/$(APPWEB_DIR) -p1
115
116         # need to remove the appweb samples directory which
117         # can only be built statically
118         rm -rf $(BUILD_DIR)/$(APPWEB_DIR)/appWebSamples
119
120         #need to update the configure script for 2.0.3
121         #wget http://www.appwebserver.org/software/configure $(BUILD_DIR)/$(APPWEB_DIR)/configure
122         cp $(APPWEB_SOURCE_DIR)/configure $(BUILD_DIR)/$(APPWEB_DIR)/
123
124         mv $(BUILD_DIR)/$(APPWEB_DIR) $(APPWEB_BUILD_DIR)
125         (cd $(APPWEB_BUILD_DIR); \
126                 $(TARGET_CONFIGURE_OPTS) \
127                 CPPFLAGS="$(STAGING_CPPFLAGS) $(APPWEB_CPPFLAGS)" \
128                 LDFLAGS="$(STAGING_LDFLAGS) $(APPWEB_LDFLAGS)" \
129                 ./configure \
130                 --type=RELEASE \
131                 --build=$(GNU_HOST_NAME) \
132                 --host=$(GNU_TARGET_NAME) \
133                 --prefix=/opt \
134                 --docDir=/opt/var/appWeb/doc \
135                 --incDir=/opt/include \
136                 --libDir=/opt/lib \
137                 --sbinDir=/opt/sbin \
138                 --srcDir=/opt/src \
139                 --webDir=/opt/var/appWeb/web \
140                 --buildNumber=$(APPWEB_IPK_VERSION) \
141                 --port=7777 --sslPort=4443 \
142                 --disable-static \
143                 --enable-shared \
144                 --with-admin=loadable \
145                 --with-ssl=loadable \
146                 --with-openssl=loadable \
147                 --with-openssl-iflags="-I$(STAGING_PREFIX)/include/" \
148                 --with-openssl-dir="../../staging/opt/lib" \
149                 --with-openssl-libs="crypto ssl" \
150                 --with-php5=loadable \
151                 --with-php5-dir="../../staging/opt/lib" \
152                 --with-php5-iflags="-I$(STAGING_PREFIX)/include/php/ -I$(STAGING_PREFIX)/include/php/Zend -I$(STAGING_PREFIX)/include/php/TSRM -I$(STAGING_PREFIX)/include/php/main -I$(STAGING_PREFIX)/include/php/regex" \
153                 --with-php5-ldflags="$(STAGING_LDFLAGS)" \
154                 --with-php5-libs="php5 dl crypt db m xml2 z c" \
155                 --disable-test \
156         )
157         touch $(APPWEB_BUILD_DIR)/.configured
158
159
160 appweb-unpack: $(APPWEB_BUILD_DIR)/.configured
161
162 #
163 # This builds the actual binary.  You should change the target to refer
164 # directly to the main binary which is built.
165 #
166 $(APPWEB_BUILD_DIR)/bin/appWeb: $(APPWEB_BUILD_DIR)/.configured
167         $(MAKE) -C $(APPWEB_BUILD_DIR)
168
169 #
170 # You should change the dependency to refer directly to the main binary
171 # which is built.
172 #
173 appweb: $(APPWEB_BUILD_DIR)/bin/appWeb
174
175 # This rule creates a control file for ipkg.  It is no longer
176 # necessary to create a seperate control file under sources/appweb
177 #
178 $(APPWEB_IPK_DIR)/CONTROL/control:
179         @install -d $(APPWEB_IPK_DIR)/CONTROL
180         @rm -f $@
181         @echo "Package: appweb" >>$@
182         @echo "Architecture: $(TARGET_ARCH)" >>$@
183         @echo "Priority: $(APPWEB_PRIORITY)" >>$@
184         @echo "Section: $(APPWEB_SECTION)" >>$@
185         @echo "Version: $(APPWEB_VERSION)-$(APPWEB_IPK_VERSION)" >>$@
186         @echo "Maintainer: $(APPWEB_MAINTAINER)" >>$@
187         @echo "Source: $(APPWEB_SITE)/$(APPWEB_SOURCE)" >>$@
188         @echo "Description: $(APPWEB_DESCRIPTION)" >>$@
189         @echo "Depends: $(APPWEB_DEPENDS)" >>$@
190         @echo "Conflicts: $(APPWEB_CONFLICTS)" >>$@
191
192 #
193 #
194 # This builds the IPK file.
195 #
196 # Binaries should be installed into $(APPWEB_IPK_DIR)/opt/sbin or $(APPWEB_IPK_DIR)/opt/bin
197 # (use the location in a well-known Linux distro as a guide for choosing sbin or bin).
198 # Libraries and include files should be installed into $(APPWEB_IPK_DIR)/opt/{lib,include}
199 # Configuration files should be installed in $(APPWEB_IPK_DIR)/opt/etc/appweb/...
200 # Documentation files should be installed in $(APPWEB_IPK_DIR)/opt/doc/appweb/...
201 # Daemon startup scripts should be installed in $(APPWEB_IPK_DIR)/opt/etc/init.d/S??appweb
202 #
203 # You may need to patch your application to make it use these locations.
204 #
205 $(APPWEB_IPK): $(APPWEB_BUILD_DIR)/bin/appWeb
206         rm -rf $(APPWEB_IPK_DIR) $(BUILD_DIR)/appweb_*_$(TARGET_ARCH).ipk
207
208         # Copy shared libraries
209         install -d $(APPWEB_IPK_DIR)/opt/lib
210         install -m 755 $(APPWEB_BUILD_DIR)/bin/libadminModule.so $(APPWEB_IPK_DIR)/opt/lib
211         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libadminModule.so
212         install -m 755 $(APPWEB_BUILD_DIR)/bin/libappWeb.so.1.0.0 $(APPWEB_IPK_DIR)/opt/lib
213         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libappWeb.so.1.0.0
214         ( cd $(APPWEB_IPK_DIR)/opt/lib ; ln -s libappWeb.so.1.0.0 libappWeb.so.1 )
215         ( cd $(APPWEB_IPK_DIR)/opt/lib ; ln -s libappWeb.so.1 libappWeb.so )
216         install -m 755 $(APPWEB_BUILD_DIR)/bin/libauthModule.so $(APPWEB_IPK_DIR)/opt/lib
217         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libauthModule.so
218         install -m 755 $(APPWEB_BUILD_DIR)/bin/libcapiModule.so $(APPWEB_IPK_DIR)/opt/lib
219         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libcapiModule.so
220         install -m 755 $(APPWEB_BUILD_DIR)/bin/libcgiModule.so $(APPWEB_IPK_DIR)/opt/lib
221         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libcgiModule.so
222         install -m 755 $(APPWEB_BUILD_DIR)/bin/libcopyModule.so $(APPWEB_IPK_DIR)/opt/lib
223         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libcopyModule.so
224         install -m 755 $(APPWEB_BUILD_DIR)/bin/libegiModule.so $(APPWEB_IPK_DIR)/opt/lib
225         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libegiModule.so
226         install -m 755 $(APPWEB_BUILD_DIR)/bin/libejs.so $(APPWEB_IPK_DIR)/opt/lib
227         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libejs.so
228         install -m 755 $(APPWEB_BUILD_DIR)/bin/libespModule.so $(APPWEB_IPK_DIR)/opt/lib
229         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libespModule.so
230         install -m 755 $(APPWEB_BUILD_DIR)/bin/libmpr.so $(APPWEB_IPK_DIR)/opt/lib
231         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libmpr.so
232         install -m 755 $(APPWEB_BUILD_DIR)/bin/libopenSslModule.so $(APPWEB_IPK_DIR)/opt/lib
233         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libopenSslModule.so
234         install -m 755 $(APPWEB_BUILD_DIR)/bin/libphp5Module.so $(APPWEB_IPK_DIR)/opt/lib
235         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libphp5Module.so
236         install -m 755 $(APPWEB_BUILD_DIR)/bin/libsslModule.so $(APPWEB_IPK_DIR)/opt/lib
237         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libsslModule.so
238         install -m 755 $(APPWEB_BUILD_DIR)/bin/libuploadModule.so $(APPWEB_IPK_DIR)/opt/lib
239         $(STRIP_COMMAND) $(APPWEB_IPK_DIR)/opt/lib/libuploadModule.so
240
241         # Copy executables
242         install -d $(APPWEB_IPK_DIR)/opt/sbin
243         $(STRIP_COMMAND) $(APPWEB_BUILD_DIR)/bin/appWeb -o $(APPWEB_IPK_DIR)/opt/sbin/appWeb
244         $(STRIP_COMMAND) $(APPWEB_BUILD_DIR)/bin/httpClient -o $(APPWEB_IPK_DIR)/opt/sbin/httpClient
245         $(STRIP_COMMAND) $(APPWEB_BUILD_DIR)/bin/httpPassword -o $(APPWEB_IPK_DIR)/opt/sbin/httpPassword
246         $(STRIP_COMMAND) $(APPWEB_BUILD_DIR)/bin/httpComp -o $(APPWEB_IPK_DIR)/opt/sbin/httpComp
247         $(STRIP_COMMAND) $(APPWEB_BUILD_DIR)/bin/charGen -o $(APPWEB_IPK_DIR)/opt/sbin/charGen
248
249         # Create log directories
250         install -d $(APPWEB_IPK_DIR)/opt/var/appWeb/logs
251
252         # Copy default site files and certificates
253         install -d $(APPWEB_IPK_DIR)/opt/var/appWeb/web
254         cp -r $(APPWEB_BUILD_DIR)/appWeb/web $(APPWEB_IPK_DIR)/opt/var/appWeb/
255         chmod -R a+rX $(APPWEB_IPK_DIR)/opt/var/appWeb/web
256         install -m 644 $(APPWEB_BUILD_DIR)/appWeb/mime.types $(APPWEB_IPK_DIR)/opt/var/appWeb
257         install -m 644 $(APPWEB_BUILD_DIR)/appWeb/server.crt $(APPWEB_IPK_DIR)/opt/var/appWeb
258         install -m 644 $(APPWEB_BUILD_DIR)/appWeb/server.key.pem $(APPWEB_IPK_DIR)/opt/var/appWeb
259
260         # Copy documentation
261         install -d $(APPWEB_IPK_DIR)/opt/doc/appweb
262         install -m 644 $(APPWEB_BUILD_DIR)/COPYRIGHT.TXT $(APPWEB_IPK_DIR)/opt/doc/appweb/COPYRIGHT.txt
263         install -m 644 $(APPWEB_BUILD_DIR)/README_SRC.TXT $(APPWEB_IPK_DIR)/opt/doc/appweb/README.txt
264         install -m 644 $(APPWEB_BUILD_DIR)/LICENSE.TXT $(APPWEB_IPK_DIR)/opt/doc/appweb/LICENSE.txt
265
266         # Copy service startup and configuration files
267         install -d $(APPWEB_IPK_DIR)/opt/etc
268 #       install -m 644 $(APPWEB_SOURCE_DIR)/appWeb-php.conf $(APPWEB_IPK_DIR)/opt/etc/appWeb.conf
269         install -m 644 $(APPWEB_SOURCE_DIR)/appWeb-php.conf $(APPWEB_IPK_DIR)/opt/var/appWeb/appWeb.conf
270         install -d $(APPWEB_IPK_DIR)/opt/etc/init.d
271         install -m 755 $(APPWEB_SOURCE_DIR)/rc.appweb $(APPWEB_IPK_DIR)/opt/etc/init.d/S81appweb
272
273         # Copy ipkg control files
274         $(MAKE) $(APPWEB_IPK_DIR)/CONTROL/control
275         install -m 644 $(APPWEB_SOURCE_DIR)/postinst $(APPWEB_IPK_DIR)/CONTROL/postinst
276         install -m 644 $(APPWEB_SOURCE_DIR)/prerm $(APPWEB_IPK_DIR)/CONTROL/prerm
277         cd $(BUILD_DIR); $(IPKG_BUILD) $(APPWEB_IPK_DIR)
278
279 #
280 # This is called from the top level makefile to create the IPK file.
281 #
282 appweb-ipk: $(APPWEB_IPK)
283
284 #
285 # This is called from the top level makefile to clean all of the built files.
286 #
287 appweb-clean:
288         -$(MAKE) -C $(APPWEB_BUILD_DIR) clean
289
290 #
291 # This is called from the top level makefile to clean all dynamically created
292 # directories.
293 #
294 appweb-dirclean:
295         rm -rf $(BUILD_DIR)/$(APPWEB_DIR) $(APPWEB_BUILD_DIR) $(APPWEB_IPK_DIR) $(APPWEB_IPK)
Note: See TracBrowser for help on using the browser.