1 | ###########################################################################
|
---|
2 | #
|
---|
3 | # Makefile -- Makefile for packages included with Greenstone runtime
|
---|
4 | #
|
---|
5 | # A component of the Greenstone digital library software
|
---|
6 | # from the New Zealand Digital Library Project at the
|
---|
7 | # University of Waikato, New Zealand.
|
---|
8 | #
|
---|
9 | # Copyright (C) 2000 New Zealand Digital Library Project
|
---|
10 | #
|
---|
11 | # This program is free software; you can redistribute it and/or modify
|
---|
12 | # it under the terms of the GNU General Public License as published by
|
---|
13 | # the Free Software Foundation; either version 2 of the License, or
|
---|
14 | # (at your option) any later version.
|
---|
15 | #
|
---|
16 | # This program is distributed in the hope that it will be useful,
|
---|
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | # GNU General Public License for more details.
|
---|
20 | #
|
---|
21 | # You should have received a copy of the GNU General Public License
|
---|
22 | # along with this program; if not, write to the Free Software
|
---|
23 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
24 | #
|
---|
25 | ###########################################################################
|
---|
26 |
|
---|
27 |
|
---|
28 | USE_Z3950=@USE_Z3950@
|
---|
29 | USE_YAZ=@USE_YAZ@
|
---|
30 | USE_APACHE_HTTPD=@USE_APACHE_HTTPD@
|
---|
31 |
|
---|
32 |
|
---|
33 | SECURITY=security/libgpg-error-1.12
|
---|
34 | #security/libgcrypt-1.6.1
|
---|
35 |
|
---|
36 | ifeq ($(USE_Z3950), 1)
|
---|
37 | # make sure USE_YAZ is set
|
---|
38 | USE_YAZ=1
|
---|
39 | D2M=d2m
|
---|
40 | else
|
---|
41 | D2M=
|
---|
42 | endif
|
---|
43 |
|
---|
44 | ifeq ($(USE_YAZ), 1)
|
---|
45 | # we only compile the src and client dirs for now.
|
---|
46 | YAZ=yaz/yaz-2.1.4/src yaz/yaz-2.1.4/client
|
---|
47 | else
|
---|
48 | YAZ=
|
---|
49 | endif
|
---|
50 |
|
---|
51 |
|
---|
52 | USE_CORBA=@USE_CORBA@
|
---|
53 | MICO_DIR=@MICO_DIR@
|
---|
54 | ifeq ($(USE_CORBA), 1)
|
---|
55 | ifeq ($(MICO_DIR), default)
|
---|
56 | CORBA="mico/mico"
|
---|
57 | else
|
---|
58 | CORBA=
|
---|
59 | endif
|
---|
60 | else
|
---|
61 | CORBA=
|
---|
62 | endif
|
---|
63 |
|
---|
64 | GSDLOS = @gsdlos@
|
---|
65 |
|
---|
66 | ifeq ($(USE_APACHE_HTTPD), 1)
|
---|
67 | HTTPD=apache-httpd/httpd-2.2.11
|
---|
68 | else
|
---|
69 | HTTPD=
|
---|
70 | endif
|
---|
71 |
|
---|
72 |
|
---|
73 | # PACKAGEDIRS contains the packages that we want to make and install. It
|
---|
74 | # is assumed that each package will have at least four rules: all, install,
|
---|
75 | # clean, and distclean.
|
---|
76 | INSTALLDIRS = $(YAZ) $(D2M) $(CORBA) $(SECURITY)
|
---|
77 | PACKAGEDIRS = $(INSTALLDIRS) $(HTTPD)
|
---|
78 |
|
---|
79 | REPLACELIST = conf/extra/httpd-dav.conf \
|
---|
80 | conf/extra/httpd-manual.conf \
|
---|
81 | conf/extra/httpd-autoindex.conf \
|
---|
82 | conf/extra/httpd-vhosts.conf \
|
---|
83 | conf/extra/httpd-ssl.conf \
|
---|
84 | conf/extra/httpd-multilang-errordoc.conf \
|
---|
85 | conf/original/extra/httpd-dav.conf \
|
---|
86 | conf/original/extra/httpd-manual.conf \
|
---|
87 | conf/original/extra/httpd-autoindex.conf \
|
---|
88 | conf/original/extra/httpd-vhosts.conf \
|
---|
89 | conf/original/extra/httpd-ssl.conf \
|
---|
90 | conf/original/extra/httpd-multilang-errordoc.conf \
|
---|
91 | conf/original/httpd.conf\
|
---|
92 | lib/apr-util-1/apr_dbd_odbc.la \
|
---|
93 | lib/apr-util-1/apr_dbd_sqlite3.la \
|
---|
94 | lib/pkgconfig/apr-util-1.pc \
|
---|
95 | lib/pkgconfig/apr-1.pc \
|
---|
96 | lib/libaprutil-1.la \
|
---|
97 | lib/libapr-1.la \
|
---|
98 | build/config_vars.mk \
|
---|
99 | build/config.nice \
|
---|
100 | build/apr_rules.mk \
|
---|
101 | bin/dbmmanage \
|
---|
102 | bin/apu-1-config \
|
---|
103 | bin/apr-1-config \
|
---|
104 | include/ap_config_auto.h \
|
---|
105 | include/ap_config_layout.h
|
---|
106 |
|
---|
107 | all:
|
---|
108 | for odir in $(PACKAGEDIRS); do \
|
---|
109 | echo making $@ in $$odir; \
|
---|
110 | (cd $$odir && $(MAKE) $(MDEFINES) $@) || exit 1; \
|
---|
111 | done
|
---|
112 | ifeq ($(USE_APACHE_HTTPD), 1)
|
---|
113 | # Need to make install here, otherwise src/recpt won't be able
|
---|
114 | # to compile mod_gsdl.cpp with installed header files etc.
|
---|
115 | (cd $(HTTPD) && $(MAKE) $(MDEFINES) install) || exit
|
---|
116 | endif
|
---|
117 |
|
---|
118 | ifeq ($(CORBA), "mico/mico")
|
---|
119 | cd mico/mico; $(MAKE) $(MDEFINES) install
|
---|
120 | mkdir -p ../bin/linux
|
---|
121 | mkdir -p ../lib
|
---|
122 | mkdir -p ../include
|
---|
123 | mkdir -p ../man
|
---|
124 | cp -f mico/bin/* ../bin/linux
|
---|
125 | cp -f mico/lib/* ../lib/
|
---|
126 | cp -fr mico/include/* ../include
|
---|
127 | cp -fr mico/man ../man
|
---|
128 | endif
|
---|
129 | ifeq ($(USE_YAZ), 1)
|
---|
130 | # need to do make install in include and src dirs to get the header files and
|
---|
131 | # lib file into the right place
|
---|
132 | cd yaz/yaz-2.1.4/include; $(MAKE) $(MDEFINES) install
|
---|
133 | cd yaz/yaz-2.1.4/src; $(MAKE) $(MDEFINES) install
|
---|
134 | endif
|
---|
135 |
|
---|
136 | # make install all packages in the security folder
|
---|
137 |
|
---|
138 |
|
---|
139 | # now install everything except apache, since that had already been installed during "all"
|
---|
140 | install:
|
---|
141 | for idir in $(INSTALLDIRS); do \
|
---|
142 | echo installing $$idir; \
|
---|
143 | (cd $$idir && $(MAKE) install) || exit 1; \
|
---|
144 | done
|
---|
145 | ifeq ($(USE_APACHE_HTTPD), 1)
|
---|
146 | mkdir -p ../../apache-httpd/$(GSDLOS)/conf
|
---|
147 | cp -f apache-httpd/httpd.conf.in ../../apache-httpd/$(GSDLOS)/conf/.
|
---|
148 | mkdir -p ../../etc/logs-gsi
|
---|
149 | @ echo "*************** INFO ***************"
|
---|
150 | @ echo "Run: source setup.bash, to set up the environment for greenstone"
|
---|
151 | @ echo "Type: make configure-admin, to set the admin password"
|
---|
152 | @ echo "Edit: llssite.cfg files to change the port number if necessary"
|
---|
153 | @ echo "Type: make configure-web, to configure the included apache webserver"
|
---|
154 | @ echo "EITHER type: make web-start, to launch the webserver from the command-line"
|
---|
155 | @ echo "OR run: gs2-server.sh, to launch the GUI version of the included webserver"
|
---|
156 | @ echo "************************************"
|
---|
157 | endif
|
---|
158 |
|
---|
159 | clean:
|
---|
160 | for subdir in $(PACKAGEDIRS); do \
|
---|
161 | echo cleaning $@ in $$subdir; \
|
---|
162 | (cd $$subdir && $(MAKE) clean || exit 0) ; \
|
---|
163 | done
|
---|
164 |
|
---|
165 | distclean:
|
---|
166 | rm -f Makefile
|
---|
167 | for subdir in $(PACKAGEDIRS); do \
|
---|
168 | echo cleaning $@ in $$subdir; \
|
---|
169 | (cd $$subdir && $(MAKE) distclean || exit 0) ; \
|
---|
170 | done
|
---|
171 |
|
---|
172 | apache-for-dist:
|
---|
173 | ( httpddir=`cd ./apache-httpd/httpd* ; pwd` ; \
|
---|
174 | cp $$httpddir/support/apxs.in ../../apache-httpd/$(GSDLOS)/apxs.in ; \
|
---|
175 | cp apache-httpd/install-bindist.sh ../../apache-httpd/$(GSDLOS)/install-bindist.sh ; \
|
---|
176 | chmod 755 ../../apache-httpd/$(GSDLOS)/install-bindist.sh ; \
|
---|
177 | gsdldir=`cd ../.. ; pwd` ; \
|
---|
178 | pre="$$gsdldir/apache-httpd/$(GSDLOS)" ; \
|
---|
179 | for one_file in apachectl envvars envvars-std; do \
|
---|
180 | sed -e "s%$$pre%*\*\APACHE_HOME_OS\*\*%" "$$pre/bin/$$one_file" > "$$pre/bin/$$one_file.in" ; \
|
---|
181 | cp "$$pre/bin/$$one_file.in" "$$pre/bin/$$one_file" ; \
|
---|
182 | done ; \
|
---|
183 | for one_file in $(REPLACELIST); do \
|
---|
184 | sed -e "s%$$pre%*\*\APACHE_HOME_OS\*\*%" "$$pre/$$one_file" > "$$pre/$$one_file.in" ; \
|
---|
185 | cp "$$pre/$$one_file.in" "$$pre/$$one_file" ; \
|
---|
186 | done ; \
|
---|
187 | cat "$$pre/bin/apr-1-config" \
|
---|
188 | | sed -e "s%^APR_SOURCE_DIR=.*%APR_SOURCE_DIR=%" \
|
---|
189 | | sed -e "s%^APR_BUILD_DIR=.*%APR_BUILD_DIR=%" \
|
---|
190 | > "$$pre/bin/apr-1-config.in" ; \
|
---|
191 | cp "$$pre/bin/apr-1-config.in" "$$pre/bin/apr-1-config" ; \
|
---|
192 | cat "$$pre/bin/apu-1-config" \
|
---|
193 | | sed -e "s%^APU_SOURCE_DIR=.*%APU_SOURCE_DIR=%" \
|
---|
194 | | sed -e "s%^APU_BUILD_DIR=.*%APU_BUILD_DIR=%" \
|
---|
195 | > "$$pre/bin/apu-1-config.in" ; \
|
---|
196 | cp "$$pre/bin/apu-1-config.in" "$$pre/bin/apu-1-config" ; \
|
---|
197 | sed -e "s%^EXTRA_INCLUDES\s*=.*%EXTRA_INCLUDES=%" "$$pre/build/config_vars.mk" > "$$pre/build/config_vars.mk.in" ; \
|
---|
198 | cp "$$pre/build/config_vars.mk.in" "$$pre/build/config_vars.mk" ; ) |
---|