more info in error message for unknown export type, fix test for sqlradius_withdomain...
[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_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@
85
86 # RT_READABLE_DIR_MODE is the mode of directories that are generally meant
87 # to be accessable
88 RT_READABLE_DIR_MODE    =       0755
89
90
91
92
93 # {{{ all these define the places that RT's binaries should get installed
94
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
101 # RT's CLI
102 RT_CLI_BIN              =       $(RT_BIN_PATH)/rt
103 # RT's mail gateway
104 RT_MAILGATE_BIN         =       $(RT_BIN_PATH)/rt-mailgate
105 # RT's cron tool
106 RT_CRON_BIN             =       $(RT_BIN_PATH)/rt-crontool
107
108 # }}}
109
110 SETGID_BINARIES         =       $(DESTDIR)/$(RT_FASTCGI_HANDLER) \
111                                 $(DESTDIR)/$(RT_WIN32_FASTCGI_HANDLER)
112
113 BINARIES                =       $(DESTDIR)/$(RT_MODPERL_HANDLER) \
114                                 $(DESTDIR)/$(RT_MAILGATE_BIN) \
115                                 $(DESTDIR)/$(RT_CLI_BIN) \
116                                 $(DESTDIR)/$(RT_CRON_BIN) \
117                                 $(SETGID_BINARIES)
118 SYSTEM_BINARIES         =       $(DESTDIR)/$(RT_SBIN_PATH)/
119
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_LEXICON_PATH)
293 # }}}
294
295 install: config-install dirs files-install fixperms instruct
296
297 files-install: libs-install etc-install bin-install sbin-install html-install local-install doc-install
298
299 config-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) 
303
304         chgrp $(RTGROUP) $(DESTDIR)/$(CONFIG_FILE)
305         chown $(BIN_OWNER) $(DESTDIR)/$(CONFIG_FILE)
306
307         chgrp $(RTGROUP) $(DESTDIR)/$(SITE_CONFIG_FILE)
308         chown $(BIN_OWNER) $(DESTDIR)/$(SITE_CONFIG_FILE)
309
310         @echo "Installed configuration. about to install rt in  $(RT_PATH)"
311
312 test: 
313         $(PERL) -Ilib lib/t/00smoke.t
314
315 regression-install: config-install
316         $(PERL) -pi -e 's/Set\(\$$DatabaseName.*\);/Set\(\$$DatabaseName, "rt3regression"\);/' $(DESTDIR)/$(CONFIG_FILE)
317
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
320
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
323
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
326
327 regression-quiet:
328         $(PERL) sbin/regression_harness
329
330 regression-instruct:
331         @echo "About to wipe your database for a regression test. ABORT NOW with Control-C"
332
333
334 # {{{ database-installation
335
336 regression-reset-db:
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 ''
339
340 initialize-database: 
341         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action init --dba $(DB_DBA) --prompt-for-dba-password
342
343 dropdb: 
344         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action drop --dba $(DB_DBA) --prompt-for-dba-password
345
346 insert-approval-data: 
347         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/insert_approval_scrips
348 # }}}
349
350 # {{{ libs-install
351 libs-install: 
352         [ -d $(DESTDIR)/$(RT_LIB_PATH) ] || mkdir $(DESTDIR)/$(RT_LIB_PATH)
353         -cp -rp lib/* $(DESTDIR)/$(RT_LIB_PATH)
354 # }}}
355
356 # {{{ html-install
357 html-install:
358         [ -d $(DESTDIR)/$(MASON_HTML_PATH) ] || mkdir $(DESTDIR)/$(MASON_HTML_PATH)
359         -cp -rp ./html/* $(DESTDIR)/$(MASON_HTML_PATH)
360 # }}}
361
362 # {{{ doc-install
363 doc-install:
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)
368 # }}}
369
370 # {{{ etc-install
371
372 etc-install:
373         mkdir -p $(DESTDIR)/$(RT_ETC_PATH)
374         -cp -rp \
375                 etc/acl.* \
376                 etc/initialdata \
377                 etc/schema.* \
378                 $(DESTDIR)/$(RT_ETC_PATH)
379 # }}}
380
381 # {{{ sbin-install
382
383 sbin-install:
384         mkdir -p $(DESTDIR)/$(RT_SBIN_PATH)
385         chmod +x sbin/rt-setup-database \
386                 sbin/rt-test-dependencies
387         -cp -rp \
388                 sbin/rt-setup-database \
389                 sbin/rt-test-dependencies \
390                 $(DESTDIR)/$(RT_SBIN_PATH)
391
392 # }}}
393
394 # {{{ bin-install
395
396 bin-install:
397         mkdir -p $(DESTDIR)/$(RT_BIN_PATH)
398         chmod +x bin/rt-mailgate \
399                 bin/rt-crontool
400         -cp -rp \
401                 bin/rt-mailgate \
402                 bin/mason_handler.fcgi \
403                 bin/mason_handler.scgi \
404                 bin/mason_handler.svc \
405                 bin/rt \
406                 bin/webmux.pl \
407                 bin/rt-crontool \
408                 $(DESTDIR)/$(RT_BIN_PATH)
409 # }}}
410
411 # {{{ local-install
412 local-install:
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)
416 # }}}
417
418 # {{{ Best Practical Build targets -- no user servicable parts inside
419
420
421 POD2TEST_EXE = sbin/extract_pod_tests
422
423 testify-pods:
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)
427
428
429
430 regenerate-catalogs:
431         $(PERL) sbin/extract-message-catalog
432
433 license-tag:
434         $(PERL) sbin/license_tag
435
436 factory: initialize-database
437         cd lib; $(PERL) ../sbin/factory  $(DB_DATABASE) RT
438
439 commit:
440         aegis -build ; aegis -diff ; aegis -test; aegis -develop_end
441
442 integrate:
443         aegis -integrate_begin; aegis -build; aegis -diff; aegis -test ; aegis -integrate_pass
444
445 predist: commit tag-and-tar
446
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
450
451
452 # Running this target in a working directory is 
453 # WRONG WRONG WRONG.
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
457
458 tag-and-release-never-by-hand:
459         aegis --delta-name $(TAG)
460         rm -rf /tmp/$(TAG)
461         mkdir /tmp/$(TAG)
462         cd /tmp/$(TAG); \
463                 aegis -cp -ind -delta $(TAG) . ;\
464                 make reconfigure;\
465                 chmod 600 Makefile;\
466                 aegis --report --project rt.$(RT_VERSION_MAJOR) \
467                       --page_width 80 \
468                       --page_length 9999 \
469                       --change $(RT_VERSION_MINOR) --output Changelog Change_Log
470
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
473
474
475 reconfigure:
476         aclocal -I m4
477         autoconf
478         chmod 755 ./configure
479         ./configure
480
481 rpm:
482         (cd ..; tar czvf /usr/src/redhat/SOURCES/rt.tar.gz rt)
483         rpm -ba etc/rt.spec
484
485
486 apachectl:
487         apachectl stop
488         sleep 3
489         apachectl start
490 # }}}