This commit was generated by cvs2svn to compensate for changes in r3883,
[freeside.git] / rt / Makefile.in
1 # BEGIN LICENSE BLOCK
2
3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4
5 # (Except where explictly superceded by other copyright notices)
6
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
10 # from www.gnu.org.
11
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.
16
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.
21
22
23 # END LICENSE BLOCK
24 #
25 # DO NOT HAND-EDIT the file named 'Makefile'. This file is autogenerated.
26 # Have a look at "configure" and "Makefile.in" instead
27 #
28
29
30 PERL                    =       @PERL@
31
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
35
36
37 RT_VERSION_MAJOR        =       @RT_VERSION_MAJOR@
38 RT_VERSION_MINOR        =       @RT_VERSION_MINOR@
39 RT_VERSION_PATCH        =       @RT_VERSION_PATCH@
40
41 RT_VERSION =    $(RT_VERSION_MAJOR).$(RT_VERSION_MINOR).$(RT_VERSION_PATCH)
42 TAG        =    rt-$(RT_VERSION_MAJOR)-$(RT_VERSION_MINOR)-$(RT_VERSION_PATCH)
43
44
45 # This is the group that all of the installed files will be chgrp'ed to.
46 RTGROUP                 =       @RTGROUP@
47
48
49 # User which should own rt binaries.
50 BIN_OWNER               =       @BIN_OWNER@
51
52 # User that should own all of RT's libraries, generally root.
53 LIBS_OWNER              =       @LIBS_OWNER@
54
55 # Group that should own all of RT's libraries, generally root.
56 LIBS_GROUP              =       @LIBS_GROUP@
57
58 WEB_USER                =       @WEB_USER@
59 WEB_GROUP               =       @WEB_GROUP@
60
61 # {{{ Files and directories 
62
63 # DESTDIR allows you to specify that RT be installed somewhere other than
64 # where it will eventually reside
65
66 DESTDIR                 =       
67
68
69 RT_PATH                 =       @RT_PATH@
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_LIB_PATH          =       @LOCAL_LIB_PATH@
80 LOCAL_LEXICON_PATH      =       @LOCAL_LEXICON_PATH@
81 MASON_HTML_PATH         =       @MASON_HTML_PATH@
82 MASON_LOCAL_HTML_PATH   =       @MASON_LOCAL_HTML_PATH@
83 MASON_DATA_PATH         =       @MASON_DATA_PATH@
84 MASON_SESSION_PATH      =       @MASON_SESSION_PATH@
85 RT_LOG_PATH         =       @RT_LOG_PATH@
86
87 # RT_READABLE_DIR_MODE is the mode of directories that are generally meant
88 # to be accessable
89 RT_READABLE_DIR_MODE    =       0755
90
91
92
93
94 # {{{ all these define the places that RT's binaries should get installed
95
96 # RT_MODPERL_HANDLER is the mason handler script for mod_perl
97 RT_MODPERL_HANDLER      =       $(RT_BIN_PATH)/webmux.pl
98 # RT_FASTCGI_HANDLER is the mason handler script for FastCGI
99 RT_FASTCGI_HANDLER      =       $(RT_BIN_PATH)/mason_handler.fcgi
100 # RT_WIN32_FASTCGI_HANDLER is the mason handler script for FastCGI
101 RT_WIN32_FASTCGI_HANDLER        =       $(RT_BIN_PATH)/mason_handler.svc
102 # RT's CLI
103 RT_CLI_BIN              =       $(RT_BIN_PATH)/rt
104 # RT's mail gateway
105 RT_MAILGATE_BIN         =       $(RT_BIN_PATH)/rt-mailgate
106 # RT's cron tool
107 RT_CRON_BIN             =       $(RT_BIN_PATH)/rt-crontool
108
109 # }}}
110
111 SETGID_BINARIES         =       $(DESTDIR)/$(RT_FASTCGI_HANDLER) \
112                                 $(DESTDIR)/$(RT_WIN32_FASTCGI_HANDLER)
113
114 BINARIES                =       $(DESTDIR)/$(RT_MODPERL_HANDLER) \
115                                 $(DESTDIR)/$(RT_MAILGATE_BIN) \
116                                 $(DESTDIR)/$(RT_CLI_BIN) \
117                                 $(DESTDIR)/$(RT_CRON_BIN) \
118                                 $(SETGID_BINARIES)
119 SYSTEM_BINARIES         =       $(DESTDIR)/$(RT_SBIN_PATH)/
120
121 # }}}
122
123 # {{{ Database setup
124
125 #
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
130
131 DB_TYPE                 =       @DB_TYPE@
132
133 # Set DBA to the name of a unix account with the proper permissions and 
134 # environment to run your commandline SQL sbin
135
136 # Set DB_DBA to the name of a DB user with permission to create new databases 
137
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'
142
143 DB_DBA                  =       @DB_DBA@
144
145 DB_HOST                 =       @DB_HOST@
146
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 
150
151 DB_PORT                 =       @DB_PORT@
152
153
154
155
156 #
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.
162 #
163
164 DB_RT_HOST              =       @DB_RT_HOST@
165
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
168
169 DB_DATABASE             =       @DB_DATABASE@
170 DB_RT_USER              =       @DB_RT_USER@
171 DB_RT_PASS              =       @DB_RT_PASS@
172
173 # }}}
174
175
176 ####################################################################
177
178 all: default
179
180 default:
181         @echo "Please read RT's readme before installing. Not doing so could"
182         @echo "be dangerous."
183
184
185
186 instruct:
187         @echo "Congratulations. RT has been installed. "
188         @echo ""
189         @echo ""
190         @echo "You must now configure RT by editing $(SITE_CONFIG_FILE)."
191         @echo ""
192         @echo "(You will definitely need to set RT's database password before continuing."
193         @echo " Not doing so could be very dangerous)"
194         @echo ""
195         @echo "After that, you need to initialize RT's database by running" 
196         @echo " 'make initialize-database'"
197
198 #       @echo " or by executing "       
199 #       @echo " '$(RT_SBIN_PATH)/rt-setup-database --action init \ "
200 #       @echo "     --dba $(DB_DBA) --prompt-for-dba-password'"
201
202
203
204 upgrade-instruct: 
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>"
212
213
214 upgrade: config-install dirs files-install fixperms upgrade-instruct
215
216 upgrade-noclobber: config-install libs-install html-install bin-install local-install doc-install fixperms
217
218
219 # {{{ dependencies
220 testdeps:
221         $(PERL) ./sbin/rt-test-dependencies --with-$(DB_TYPE)
222
223 fixdeps:
224         $(PERL) ./sbin/rt-test-dependencies --install --with-$(DB_TYPE)
225
226 #}}}
227
228 # {{{ fixperms
229 fixperms:
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)
235
236
237         chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_BIN_PATH)
238         chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_BIN_PATH) 
239
240         chmod 0755 $(DESTDIR)/$(RT_ETC_PATH)
241         chmod 0500 $(DESTDIR)/$(RT_ETC_PATH)/*
242
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)
247
248         chmod 0550 $(DESTDIR)/$(CONFIG_FILE)
249         chmod 0550 $(DESTDIR)/$(SITE_CONFIG_FILE)
250
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)
256
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)
265
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)
273 # }}}
274
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)
280
281 # {{{ dirs
282 dirs:
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_LIB_PATH)
293         mkdir -p $(DESTDIR)/$(LOCAL_LEXICON_PATH)
294 # }}}
295
296 install: config-install dirs files-install fixperms instruct
297
298 files-install: libs-install etc-install bin-install sbin-install html-install local-install doc-install
299
300 config-install:
301         mkdir -p $(DESTDIR)/$(CONFIG_FILE_PATH) 
302         cp etc/RT_Config.pm $(DESTDIR)/$(CONFIG_FILE)
303         [ -f $(DESTDIR)/$(SITE_CONFIG_FILE) ] || cp etc/RT_SiteConfig.pm $(DESTDIR)/$(SITE_CONFIG_FILE) 
304
305         chgrp $(RTGROUP) $(DESTDIR)/$(CONFIG_FILE)
306         chown $(BIN_OWNER) $(DESTDIR)/$(CONFIG_FILE)
307
308         chgrp $(RTGROUP) $(DESTDIR)/$(SITE_CONFIG_FILE)
309         chown $(BIN_OWNER) $(DESTDIR)/$(SITE_CONFIG_FILE)
310
311         @echo "Installed configuration. about to install rt in  $(RT_PATH)"
312
313 test: 
314         $(PERL) -Ilib lib/t/00smoke.t
315
316 regression-install: config-install
317         $(PERL) -pi -e 's/Set\(\$$DatabaseName.*\);/Set\(\$$DatabaseName, "rt3regression"\);/' $(DESTDIR)/$(CONFIG_FILE)
318
319 regression-nosetgid-quiet: regression-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db  testify-pods fixperms-nosetgid apachectl
320         $(PERL) sbin/regression_harness
321
322 regression-nosetgid: regression-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db  testify-pods fixperms-nosetgid apachectl
323         $(PERL) lib/t/02regression.t
324
325 regression: regression-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db  testify-pods fixperms apachectl
326         $(PERL) lib/t/02regression.t
327
328 regression-quiet:
329         $(PERL) sbin/regression_harness
330
331 regression-instruct:
332         @echo "About to wipe your database for a regression test. ABORT NOW with Control-C"
333
334
335 # {{{ database-installation
336
337 regression-reset-db:
338         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action drop --dba $(DB_DBA) --dba-password ''
339         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action init --dba $(DB_DBA) --dba-password ''
340
341 initialize-database: 
342         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action init --dba $(DB_DBA) --prompt-for-dba-password
343
344 dropdb: 
345         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action drop --dba $(DB_DBA) --prompt-for-dba-password
346
347 insert-approval-data: 
348         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/insert_approval_scrips
349 # }}}
350
351 # {{{ libs-install
352 libs-install: 
353         [ -d $(DESTDIR)/$(RT_LIB_PATH) ] || mkdir $(DESTDIR)/$(RT_LIB_PATH)
354         -cp -rp lib/* $(DESTDIR)/$(RT_LIB_PATH)
355 # }}}
356
357 # {{{ html-install
358 html-install:
359         [ -d $(DESTDIR)/$(MASON_HTML_PATH) ] || mkdir $(DESTDIR)/$(MASON_HTML_PATH)
360         -cp -rp ./html/* $(DESTDIR)/$(MASON_HTML_PATH)
361 # }}}
362
363 # {{{ doc-install
364 doc-install:
365         # RT 3.0.0 - RT 3.0.2 would accidentally create a file instead of a dir
366         -[ -f $(DESTDIR)/$(RT_DOC_PATH) ] && rm $(DESTDIR)/$(RT_DOC_PATH) 
367         [ -d $(DESTDIR)/$(RT_DOC_PATH) ] || mkdir $(DESTDIR)/$(RT_DOC_PATH)
368         -cp -rp ./README $(DESTDIR)/$(RT_DOC_PATH)
369 # }}}
370
371 # {{{ etc-install
372
373 etc-install:
374         mkdir -p $(DESTDIR)/$(RT_ETC_PATH)
375         -cp -rp \
376                 etc/acl.* \
377                 etc/initialdata \
378                 etc/schema.* \
379                 $(DESTDIR)/$(RT_ETC_PATH)
380 # }}}
381
382 # {{{ sbin-install
383
384 sbin-install:
385         mkdir -p $(DESTDIR)/$(RT_SBIN_PATH)
386         chmod +x sbin/rt-setup-database \
387                 sbin/rt-test-dependencies
388         -cp -rp \
389                 sbin/rt-setup-database \
390                 sbin/rt-test-dependencies \
391                 $(DESTDIR)/$(RT_SBIN_PATH)
392
393 # }}}
394
395 # {{{ bin-install
396
397 bin-install:
398         mkdir -p $(DESTDIR)/$(RT_BIN_PATH)
399         chmod +x bin/rt-mailgate \
400                 bin/rt-crontool
401         -cp -rp \
402                 bin/rt-mailgate \
403                 bin/mason_handler.fcgi \
404                 bin/mason_handler.scgi \
405                 bin/mason_handler.svc \
406                 bin/rt \
407                 bin/webmux.pl \
408                 bin/rt-crontool \
409                 $(DESTDIR)/$(RT_BIN_PATH)
410 # }}}
411
412 # {{{ local-install
413 local-install:
414         -cp -rp ./local/html/* $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
415         -cp -rp ./local/po/* $(DESTDIR)/$(LOCAL_LEXICON_PATH)
416         -cp -rp ./local/etc/* $(DESTDIR)/$(LOCAL_ETC_PATH)
417 # }}}
418
419 # {{{ Best Practical Build targets -- no user servicable parts inside
420
421
422 POD2TEST_EXE = sbin/extract_pod_tests
423
424 testify-pods:
425         [ -d lib/t/autogen ] || mkdir lib/t/autogen
426         find lib -name \*pm |grep -v .svn | grep -v \*.in |xargs -n 1 $(PERL) $(POD2TEST_EXE)
427         find bin -type f |grep -v .svn | grep -v \~ | grep -v "\.in" | xargs -n 1 $(PERL) $(POD2TEST_EXE)
428
429
430
431 regenerate-catalogs:
432         $(PERL) sbin/extract-message-catalog
433
434 license-tag:
435         $(PERL) sbin/license_tag
436
437 factory: initialize-database
438         cd lib; $(PERL) ../sbin/factory  $(DB_DATABASE) RT
439
440 commit:
441         aegis -build ; aegis -diff ; aegis -test; aegis -develop_end
442
443 integrate:
444         aegis -integrate_begin; aegis -build; aegis -diff; aegis -test ; aegis -integrate_pass
445
446 predist: commit tag-and-tar
447
448 tag-and-release-baseline:
449         aegis -cp -ind Makefile -output /tmp/Makefile.tagandrelease; \
450         $(MAKE) -f /tmp/Makefile.tagandrelease tag-and-release-never-by-hand
451
452
453 # Running this target in a working directory is 
454 # WRONG WRONG WRONG.
455 # it will tag the current baseline with the version of RT defined 
456 # in the currently-being-worked-on makefile. which is wrong.
457 #  you want tag-and-release-baseline
458
459 tag-and-release-never-by-hand:
460         aegis --delta-name $(TAG)
461         rm -rf /tmp/$(TAG)
462         mkdir /tmp/$(TAG)
463         cd /tmp/$(TAG); \
464                 aegis -cp -ind -delta $(TAG) . ;\
465                 make reconfigure;\
466                 chmod 600 Makefile;\
467                 aegis --report --project rt.$(RT_VERSION_MAJOR) \
468                       --page_width 80 \
469                       --page_length 9999 \
470                       --change $(RT_VERSION_MINOR) --output Changelog Change_Log
471
472         cd /tmp; tar czvf /home/ftp/pub/rt/devel/$(TAG).tar.gz $(TAG)/
473         chmod 644 /home/ftp/pub/rt/devel/$(TAG).tar.gz
474
475
476 reconfigure:
477         aclocal -I m4
478         autoconf
479         chmod 755 ./configure
480         ./configure
481
482 rpm:
483         (cd ..; tar czvf /usr/src/redhat/SOURCES/rt.tar.gz rt)
484         rpm -ba etc/rt.spec
485
486
487 apachectl:
488         apachectl stop
489         sleep 3
490         apachectl start
491 # }}}