3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 # (Except where explictly superceded by other copyright notices)
7 # This work is made available to you under the terms of Version 2 of
8 # the GNU General Public License. A copy of that license should have
9 # been provided with this software, but in any event can be snarfed
12 # This work is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # Unless otherwise specified, all modifications, corrections or
18 # extensions to this work which alter its source code become the
19 # property of Best Practical Solutions, LLC when submitted for
20 # inclusion in the work.
25 # DO NOT HAND-EDIT the file named 'Makefile'. This file is autogenerated.
26 # Have a look at "configure" and "Makefile.in" instead
32 CONFIG_FILE_PATH = @CONFIG_FILE_PATH@
33 CONFIG_FILE = $(CONFIG_FILE_PATH)/RT_Config.pm
34 SITE_CONFIG_FILE = $(CONFIG_FILE_PATH)/RT_SiteConfig.pm
37 RT_VERSION_MAJOR = @RT_VERSION_MAJOR@
38 RT_VERSION_MINOR = @RT_VERSION_MINOR@
39 RT_VERSION_PATCH = @RT_VERSION_PATCH@
41 RT_VERSION = $(RT_VERSION_MAJOR).$(RT_VERSION_MINOR).$(RT_VERSION_PATCH)
42 TAG = rt-$(RT_VERSION_MAJOR)-$(RT_VERSION_MINOR)-$(RT_VERSION_PATCH)
45 # This is the group that all of the installed files will be chgrp'ed to.
49 # User which should own rt binaries.
50 BIN_OWNER = @BIN_OWNER@
52 # User that should own all of RT's libraries, generally root.
53 LIBS_OWNER = @LIBS_OWNER@
55 # Group that should own all of RT's libraries, generally root.
56 LIBS_GROUP = @LIBS_GROUP@
59 WEB_GROUP = @WEB_GROUP@
61 # {{{ Files and directories
63 # DESTDIR allows you to specify that RT be installed somewhere other than
64 # where it will eventually reside
70 RT_ETC_PATH = @RT_ETC_PATH@
71 RT_BIN_PATH = @RT_BIN_PATH@
72 RT_SBIN_PATH = @RT_SBIN_PATH@
73 RT_LIB_PATH = @RT_LIB_PATH@
74 RT_MAN_PATH = @RT_MAN_PATH@
75 RT_VAR_PATH = @RT_VAR_PATH@
76 RT_DOC_PATH = @RT_DOC_PATH@
77 RT_LOCAL_PATH = @RT_LOCAL_PATH@
78 LOCAL_ETC_PATH = @LOCAL_ETC_PATH@
79 LOCAL_LEXICON_PATH = @LOCAL_LEXICON_PATH@
80 MASON_HTML_PATH = @MASON_HTML_PATH@
81 MASON_LOCAL_HTML_PATH = @MASON_LOCAL_HTML_PATH@
82 MASON_DATA_PATH = @MASON_DATA_PATH@
83 MASON_SESSION_PATH = @MASON_SESSION_PATH@
84 RT_LOG_PATH = @RT_LOG_PATH@
86 # RT_READABLE_DIR_MODE is the mode of directories that are generally meant
88 RT_READABLE_DIR_MODE = 0755
93 # {{{ all these define the places that RT's binaries should get installed
95 # RT_MODPERL_HANDLER is the mason handler script for mod_perl
96 RT_MODPERL_HANDLER = $(RT_BIN_PATH)/webmux.pl
97 # RT_FASTCGI_HANDLER is the mason handler script for FastCGI
98 RT_FASTCGI_HANDLER = $(RT_BIN_PATH)/mason_handler.fcgi
99 # RT_WIN32_FASTCGI_HANDLER is the mason handler script for FastCGI
100 RT_WIN32_FASTCGI_HANDLER = $(RT_BIN_PATH)/mason_handler.svc
102 RT_CLI_BIN = $(RT_BIN_PATH)/rt
104 RT_MAILGATE_BIN = $(RT_BIN_PATH)/rt-mailgate
106 RT_CRON_BIN = $(RT_BIN_PATH)/rt-crontool
110 SETGID_BINARIES = $(DESTDIR)/$(RT_FASTCGI_HANDLER) \
111 $(DESTDIR)/$(RT_WIN32_FASTCGI_HANDLER)
113 BINARIES = $(DESTDIR)/$(RT_MODPERL_HANDLER) \
114 $(DESTDIR)/$(RT_MAILGATE_BIN) \
115 $(DESTDIR)/$(RT_CLI_BIN) \
116 $(DESTDIR)/$(RT_CRON_BIN) \
118 SYSTEM_BINARIES = $(DESTDIR)/$(RT_SBIN_PATH)/
126 # DB_TYPE defines what sort of database RT trys to talk to
127 # "mysql" is known to work.
128 # "Pg" is known to work
129 # "Informix" is known to work
133 # Set DBA to the name of a unix account with the proper permissions and
134 # environment to run your commandline SQL sbin
136 # Set DB_DBA to the name of a DB user with permission to create new databases
138 # For mysql, you probably want 'root'
139 # For Pg, you probably want 'postgres'
140 # For Oracle, you want 'system'
141 # For Informix, you want 'informix'
147 # If you're not running your database server on its default port,
148 # specifiy the port the database server is running on below.
149 # It's generally safe to leave this blank
157 # Set this to the canonical name of the interface RT will be talking to the
158 # database on. If you said that the RT_DB_HOST above was "localhost," this
159 # should be too. This value will be used to grant rt access to the database.
160 # If you want to access the RT database from multiple hosts, you'll need
161 # to grant those database rights by hand.
164 DB_RT_HOST = @DB_RT_HOST@
166 # set this to the name you want to give to the RT database in
167 # your database server. For Oracle, this should be the name of your sid
169 DB_DATABASE = @DB_DATABASE@
170 DB_RT_USER = @DB_RT_USER@
171 DB_RT_PASS = @DB_RT_PASS@
176 ####################################################################
181 @echo "Please read RT's readme before installing. Not doing so could"
182 @echo "be dangerous."
187 @echo "Congratulations. RT has been installed. "
190 @echo "You must now configure RT by editing $(SITE_CONFIG_FILE)."
192 @echo "(You will definitely need to set RT's database password before continuing."
193 @echo " Not doing so could be very dangerous)"
195 @echo "After that, you need to initialize RT's database by running"
196 @echo " 'make initialize-database'"
198 # @echo " or by executing "
199 # @echo " '$(RT_SBIN_PATH)/rt-setup-database --action init \ "
200 # @echo " --dba $(DB_DBA) --prompt-for-dba-password'"
205 @echo "Congratulations. RT has been upgraded. You should now check-over"
206 @echo "$(CONFIG_FILE) for any necessary site customization. Additionally,"
207 @echo "you should update RT's system database objects by running "
208 @echo " ls etc/upgrade"
209 @echo "For each file in that directory whose name is greater than"
210 @echo "your previously installed RT version, run:"
211 @echo " $(RT_SBIN_PATH)/rt-setup-database --action insert --datafile etc/upgrade/<version>"
214 upgrade: config-install dirs files-install fixperms upgrade-instruct
216 upgrade-noclobber: config-install libs-install html-install bin-install local-install doc-install fixperms
221 $(PERL) ./sbin/rt-test-dependencies --with-$(DB_TYPE)
224 $(PERL) ./sbin/rt-test-dependencies --install --with-$(DB_TYPE)
230 # Make the libraries readable
231 chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_PATH)
232 chown -R $(LIBS_OWNER) $(DESTDIR)/$(RT_LIB_PATH)
233 chgrp -R $(LIBS_GROUP) $(DESTDIR)/$(RT_LIB_PATH)
234 chmod -R u+rwX,go-w,go+rX $(DESTDIR)/$(RT_LIB_PATH)
237 chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_BIN_PATH)
238 chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_BIN_PATH)
240 chmod 0755 $(DESTDIR)/$(RT_ETC_PATH)
241 chmod 0500 $(DESTDIR)/$(RT_ETC_PATH)/*
243 #TODO: the config file should probably be able to have its
244 # owner set seperately from the binaries.
245 chown -R $(BIN_OWNER) $(DESTDIR)/$(RT_ETC_PATH)
246 chgrp -R $(RTGROUP) $(DESTDIR)/$(RT_ETC_PATH)
248 chmod 0550 $(DESTDIR)/$(CONFIG_FILE)
249 chmod 0550 $(DESTDIR)/$(SITE_CONFIG_FILE)
251 # Make the interfaces executable and setgid rt
252 chown $(BIN_OWNER) $(BINARIES)
253 chgrp $(RTGROUP) $(BINARIES)
254 chmod 0755 $(BINARIES)
255 chmod g+s $(SETGID_BINARIES)
257 # Make the web ui readable by all.
258 chmod -R u+rwX,go-w,go+rX $(DESTDIR)/$(MASON_HTML_PATH) \
259 $(DESTDIR)/$(MASON_LOCAL_HTML_PATH) \
260 $(DESTDIR)/$(LOCAL_LEXICON_PATH)
261 chown -R $(LIBS_OWNER) $(DESTDIR)/$(MASON_HTML_PATH) \
262 $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
263 chgrp -R $(LIBS_GROUP) $(DESTDIR)/$(MASON_HTML_PATH) \
264 $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
266 # Make the web ui's data dir writable
267 chmod 0770 $(DESTDIR)/$(MASON_DATA_PATH) \
268 $(DESTDIR)/$(MASON_SESSION_PATH)
269 chown -R $(WEB_USER) $(DESTDIR)/$(MASON_DATA_PATH) \
270 $(DESTDIR)/$(MASON_SESSION_PATH)
271 chgrp -R $(WEB_GROUP) $(DESTDIR)/$(MASON_DATA_PATH) \
272 $(DESTDIR)/$(MASON_SESSION_PATH)
275 fixperms-nosetgid: fixperms
276 @echo "You should never be running RT this way. it's unsafe"
277 chmod 0555 $(SETGID_BINARIES)
278 chmod 0555 $(DESTDIR)/$(CONFIG_FILE)
279 chmod 0555 $(DESTDIR)/$(SITE_CONFIG_FILE)
283 mkdir -p $(DESTDIR)/$(RT_LOG_PATH)
284 mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)
285 mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)/cache
286 mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)/etc
287 mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)/obj
288 mkdir -p $(DESTDIR)/$(MASON_SESSION_PATH)
289 mkdir -p $(DESTDIR)/$(MASON_HTML_PATH)
290 mkdir -p $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
291 mkdir -p $(DESTDIR)/$(LOCAL_ETC_PATH)
292 mkdir -p $(DESTDIR)/$(LOCAL_LEXICON_PATH)
295 install: config-install dirs files-install fixperms instruct
297 files-install: libs-install etc-install bin-install sbin-install html-install local-install doc-install
300 mkdir -p $(DESTDIR)/$(CONFIG_FILE_PATH)
301 cp etc/RT_Config.pm $(DESTDIR)/$(CONFIG_FILE)
302 [ -f $(DESTDIR)/$(SITE_CONFIG_FILE) ] || cp etc/RT_SiteConfig.pm $(DESTDIR)/$(SITE_CONFIG_FILE)
304 chgrp $(RTGROUP) $(DESTDIR)/$(CONFIG_FILE)
305 chown $(BIN_OWNER) $(DESTDIR)/$(CONFIG_FILE)
307 chgrp $(RTGROUP) $(DESTDIR)/$(SITE_CONFIG_FILE)
308 chown $(BIN_OWNER) $(DESTDIR)/$(SITE_CONFIG_FILE)
310 @echo "Installed configuration. about to install rt in $(RT_PATH)"
313 $(PERL) -Ilib lib/t/00smoke.t
315 regression-install: config-install
316 $(PERL) -pi -e 's/Set\(\$$DatabaseName.*\);/Set\(\$$DatabaseName, "rt3regression"\);/' $(DESTDIR)/$(CONFIG_FILE)
318 regression-nosetgid-quiet: regression-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db testify-pods fixperms-nosetgid apachectl
319 $(PERL) sbin/regression_harness
321 regression-nosetgid: regression-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db testify-pods fixperms-nosetgid apachectl
322 $(PERL) lib/t/02regression.t
324 regression: regression-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db testify-pods fixperms apachectl
325 $(PERL) lib/t/02regression.t
328 $(PERL) sbin/regression_harness
331 @echo "About to wipe your database for a regression test. ABORT NOW with Control-C"
334 # {{{ database-installation
337 $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action drop --dba $(DB_DBA) --dba-password ''
338 $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action init --dba $(DB_DBA) --dba-password ''
341 $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action init --dba $(DB_DBA) --prompt-for-dba-password
344 $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action drop --dba $(DB_DBA) --prompt-for-dba-password
346 insert-approval-data:
347 $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/insert_approval_scrips
352 [ -d $(DESTDIR)/$(RT_LIB_PATH) ] || mkdir $(DESTDIR)/$(RT_LIB_PATH)
353 -cp -rp lib/* $(DESTDIR)/$(RT_LIB_PATH)
358 [ -d $(DESTDIR)/$(MASON_HTML_PATH) ] || mkdir $(DESTDIR)/$(MASON_HTML_PATH)
359 -cp -rp ./html/* $(DESTDIR)/$(MASON_HTML_PATH)
364 # RT 3.0.0 - RT 3.0.2 would accidentally create a file instead of a dir
365 -[ -f $(DESTDIR)/$(RT_DOC_PATH) ] && rm $(DESTDIR)/$(RT_DOC_PATH)
366 [ -d $(DESTDIR)/$(RT_DOC_PATH) ] || mkdir $(DESTDIR)/$(RT_DOC_PATH)
367 -cp -rp ./README $(DESTDIR)/$(RT_DOC_PATH)
373 mkdir -p $(DESTDIR)/$(RT_ETC_PATH)
378 $(DESTDIR)/$(RT_ETC_PATH)
384 mkdir -p $(DESTDIR)/$(RT_SBIN_PATH)
385 chmod +x sbin/rt-setup-database \
386 sbin/rt-test-dependencies
388 sbin/rt-setup-database \
389 sbin/rt-test-dependencies \
390 $(DESTDIR)/$(RT_SBIN_PATH)
397 mkdir -p $(DESTDIR)/$(RT_BIN_PATH)
398 chmod +x bin/rt-mailgate \
402 bin/mason_handler.fcgi \
403 bin/mason_handler.scgi \
404 bin/mason_handler.svc \
408 $(DESTDIR)/$(RT_BIN_PATH)
413 -cp -rp ./local/html/* $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
414 -cp -rp ./local/po/* $(DESTDIR)/$(LOCAL_LEXICON_PATH)
415 -cp -rp ./local/etc/* $(DESTDIR)/$(LOCAL_ETC_PATH)
418 # {{{ Best Practical Build targets -- no user servicable parts inside
421 POD2TEST_EXE = sbin/extract_pod_tests
424 [ -d lib/t/autogen ] || mkdir lib/t/autogen
425 find lib -name \*pm |grep -v \*.in |xargs -n 1 $(PERL) $(POD2TEST_EXE)
426 find bin -type f |grep -v \~ | grep -v "\.in" | xargs -n 1 $(PERL) $(POD2TEST_EXE)
431 $(PERL) sbin/extract-message-catalog
434 $(PERL) sbin/license_tag
436 factory: initialize-database
437 cd lib; $(PERL) ../sbin/factory $(DB_DATABASE) RT
440 aegis -build ; aegis -diff ; aegis -test; aegis -develop_end
443 aegis -integrate_begin; aegis -build; aegis -diff; aegis -test ; aegis -integrate_pass
445 predist: commit tag-and-tar
447 tag-and-release-baseline:
448 aegis -cp -ind Makefile -output /tmp/Makefile.tagandrelease; \
449 $(MAKE) -f /tmp/Makefile.tagandrelease tag-and-release-never-by-hand
452 # Running this target in a working directory is
454 # it will tag the current baseline with the version of RT defined
455 # in the currently-being-worked-on makefile. which is wrong.
456 # you want tag-and-release-baseline
458 tag-and-release-never-by-hand:
459 aegis --delta-name $(TAG)
463 aegis -cp -ind -delta $(TAG) . ;\
466 aegis --report --project rt.$(RT_VERSION_MAJOR) \
469 --change $(RT_VERSION_MINOR) --output Changelog Change_Log
471 cd /tmp; tar czvf /home/ftp/pub/rt/devel/$(TAG).tar.gz $(TAG)/
472 chmod 644 /home/ftp/pub/rt/devel/$(TAG).tar.gz
478 chmod 755 ./configure
482 (cd ..; tar czvf /usr/src/redhat/SOURCES/rt.tar.gz rt)