This commit was generated by cvs2svn to compensate for changes in r5562,
[freeside.git] / rt / Makefile.in
1 # BEGIN BPS TAGGED BLOCK {{{
2
3 # COPYRIGHT:
4 #  
5 # This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
6 #                                          <jesse@bestpractical.com>
7
8 # (Except where explicitly superseded by other copyright notices)
9
10
11 # LICENSE:
12
13 # This work is made available to you under the terms of Version 2 of
14 # the GNU General Public License. A copy of that license should have
15 # been provided with this software, but in any event can be snarfed
16 # from www.gnu.org.
17
18 # This work is distributed in the hope that it will be useful, but
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21 # General Public License for more details.
22
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write to the Free Software
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 # 02110-1301 or visit their web page on the internet at
27 # http://www.gnu.org/copyleft/gpl.html.
28
29
30 # CONTRIBUTION SUBMISSION POLICY:
31
32 # (The following paragraph is not intended to limit the rights granted
33 # to you to modify and distribute this software under the terms of
34 # the GNU General Public License and is only of importance to you if
35 # you choose to contribute your changes and enhancements to the
36 # community by submitting them to Best Practical Solutions, LLC.)
37
38 # By intentionally submitting any modifications, corrections or
39 # derivatives to this work, or any other work intended for use with
40 # Request Tracker, to Best Practical Solutions, LLC, you confirm that
41 # you are the copyright holder for those contributions and you grant
42 # Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
43 # royalty-free, perpetual, license to use, copy, create derivative
44 # works based on those contributions, and sublicense and distribute
45 # those contributions and any derivatives thereof.
46
47 # END BPS TAGGED BLOCK }}}
48 #
49 # DO NOT HAND-EDIT the file named 'Makefile'. This file is autogenerated.
50 # Have a look at "configure" and "Makefile.in" instead
51 #
52
53
54 PERL                    =       @PERL@
55
56 CONFIG_FILE_PATH        =       @CONFIG_FILE_PATH@
57 CONFIG_FILE             =       $(CONFIG_FILE_PATH)/RT_Config.pm
58 SITE_CONFIG_FILE                =       $(CONFIG_FILE_PATH)/RT_SiteConfig.pm
59
60
61 RT_VERSION_MAJOR        =       @RT_VERSION_MAJOR@
62 RT_VERSION_MINOR        =       @RT_VERSION_MINOR@
63 RT_VERSION_PATCH        =       @RT_VERSION_PATCH@
64
65 RT_VERSION =    $(RT_VERSION_MAJOR).$(RT_VERSION_MINOR).$(RT_VERSION_PATCH)
66 TAG        =    rt-$(RT_VERSION_MAJOR)-$(RT_VERSION_MINOR)-$(RT_VERSION_PATCH)
67
68
69 # This is the group that all of the installed files will be chgrp'ed to.
70 RTGROUP                 =       @RTGROUP@
71
72
73 # User which should own rt binaries.
74 BIN_OWNER               =       @BIN_OWNER@
75
76 # User that should own all of RT's libraries, generally root.
77 LIBS_OWNER              =       @LIBS_OWNER@
78
79 # Group that should own all of RT's libraries, generally root.
80 LIBS_GROUP              =       @LIBS_GROUP@
81
82 WEB_USER                =       @WEB_USER@
83 WEB_GROUP               =       @WEB_GROUP@
84
85
86 APACHECTL               =       @APACHECTL@
87
88 # {{{ Files and directories 
89
90 # DESTDIR allows you to specify that RT be installed somewhere other than
91 # where it will eventually reside
92
93 DESTDIR                 =       
94
95
96 RT_PATH                 =       @RT_PATH@
97 RT_ETC_PATH             =       @RT_ETC_PATH@
98 RT_BIN_PATH             =       @RT_BIN_PATH@
99 RT_SBIN_PATH            =       @RT_SBIN_PATH@
100 RT_LIB_PATH             =       @RT_LIB_PATH@
101 RT_MAN_PATH             =       @RT_MAN_PATH@
102 RT_VAR_PATH             =       @RT_VAR_PATH@
103 RT_DOC_PATH             =       @RT_DOC_PATH@
104 RT_LOCAL_PATH           =       @RT_LOCAL_PATH@
105 LOCAL_ETC_PATH          =       @LOCAL_ETC_PATH@
106 LOCAL_LIB_PATH          =       @LOCAL_LIB_PATH@
107 LOCAL_LEXICON_PATH      =       @LOCAL_LEXICON_PATH@
108 MASON_HTML_PATH         =       @MASON_HTML_PATH@
109 MASON_LOCAL_HTML_PATH   =       @MASON_LOCAL_HTML_PATH@
110 MASON_DATA_PATH         =       @MASON_DATA_PATH@
111 MASON_SESSION_PATH      =       @MASON_SESSION_PATH@
112 RT_LOG_PATH         =       @RT_LOG_PATH@
113
114 # RT_READABLE_DIR_MODE is the mode of directories that are generally meant
115 # to be accessable
116 RT_READABLE_DIR_MODE    =       0755
117
118
119
120
121 # {{{ all these define the places that RT's binaries should get installed
122
123 # RT_MODPERL_HANDLER is the mason handler script for mod_perl
124 RT_MODPERL_HANDLER      =       $(RT_BIN_PATH)/webmux.pl
125 # RT_STANDALONE_SERVER is a stand-alone HTTP server
126 RT_STANDALONE_SERVER    =       $(RT_BIN_PATH)/standalone_httpd
127 # RT_SPEEDYCGI_HANDLER is the mason handler script for SpeedyCGI
128 RT_SPEEDYCGI_HANDLER    =       $(RT_BIN_PATH)/mason_handler.scgi
129 # RT_FASTCGI_HANDLER is the mason handler script for FastCGI
130 RT_FASTCGI_HANDLER      =       $(RT_BIN_PATH)/mason_handler.fcgi
131 # RT_WIN32_FASTCGI_HANDLER is the mason handler script for FastCGI
132 RT_WIN32_FASTCGI_HANDLER        =       $(RT_BIN_PATH)/mason_handler.svc
133 # RT's CLI
134 RT_CLI_BIN              =       $(RT_BIN_PATH)/rt
135 # RT's mail gateway
136 RT_MAILGATE_BIN         =       $(RT_BIN_PATH)/rt-mailgate
137 # RT's cron tool
138 RT_CRON_BIN             =       $(RT_BIN_PATH)/rt-crontool
139
140 # }}}
141
142
143 BINARIES                =       $(DESTDIR)/$(RT_MODPERL_HANDLER) \
144                                 $(DESTDIR)/$(RT_MAILGATE_BIN) \
145                                 $(DESTDIR)/$(RT_CLI_BIN) \
146                                 $(DESTDIR)/$(RT_CRON_BIN) \
147                                 $(DESTDIR)/$(RT_STANDALONE_SERVER) \
148                                 $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \
149                                 $(DESTDIR)/$(RT_FASTCGI_HANDLER) \
150                                 $(DESTDIR)/$(RT_WIN32_FASTCGI_HANDLER)
151 SYSTEM_BINARIES         =       $(DESTDIR)/$(RT_SBIN_PATH)/
152
153 # }}}
154
155 # {{{ Database setup
156
157 #
158 # DB_TYPE defines what sort of database RT trys to talk to
159 # "mysql" is known to work.
160 # "Pg" is known to work
161 # "Informix" is known to work
162
163 DB_TYPE                 =       @DB_TYPE@
164
165 # Set DBA to the name of a unix account with the proper permissions and 
166 # environment to run your commandline SQL sbin
167
168 # Set DB_DBA to the name of a DB user with permission to create new databases 
169
170 # For mysql, you probably want 'root'
171 # For Pg, you probably want 'postgres' 
172 # For Oracle, you want 'system'
173 # For Informix, you want 'informix'
174
175 DB_DBA                  =       @DB_DBA@
176
177 DB_HOST                 =       @DB_HOST@
178
179 # If you're not running your database server on its default port, 
180 # specifiy the port the database server is running on below.
181 # It's generally safe to leave this blank 
182
183 DB_PORT                 =       @DB_PORT@
184
185
186
187
188 #
189 # Set this to the canonical name of the interface RT will be talking to the 
190 # database on.  If you said that the RT_DB_HOST above was "localhost," this 
191 # should be too. This value will be used to grant rt access to the database.
192 # If you want to access the RT database from multiple hosts, you'll need
193 # to grant those database rights by hand.
194 #
195
196 DB_RT_HOST              =       @DB_RT_HOST@
197
198 # set this to the name you want to give to the RT database in 
199 # your database server. For Oracle, this should be the name of your sid
200
201 DB_DATABASE             =       @DB_DATABASE@
202 DB_RT_USER              =       @DB_RT_USER@
203 DB_RT_PASS              =       @DB_RT_PASS@
204
205 # }}}
206
207
208 ####################################################################
209
210 all: default
211
212 default:
213         @echo "Please read RT's readme before installing. Not doing so could"
214         @echo "be dangerous."
215
216
217
218 instruct:
219         @echo "Congratulations. RT has been installed. "
220         @echo ""
221         @echo ""
222         @echo "You must now configure RT by editing $(SITE_CONFIG_FILE)."
223         @echo ""
224         @echo "(You will definitely need to set RT's database password in "
225         @echo "$(SITE_CONFIG_FILE) before continuing. Not doing so could be "
226         @echo "very dangerous.  Note that you do not have to manually add a "
227         @echo "database user or set up a database for RT.  These actions will be "
228         @echo "taken care of in the next step.)"
229         @echo ""
230         @echo "After that, you need to initialize RT's database by running" 
231         @echo " 'make initialize-database'"
232
233 #       @echo " or by executing "       
234 #       @echo " '$(RT_SBIN_PATH)/rt-setup-database --action init \ "
235 #       @echo "     --dba $(DB_DBA) --prompt-for-dba-password'"
236
237
238
239 upgrade-instruct: 
240         @echo "Congratulations. RT has been upgraded. You should now check-over"
241         @echo "$(CONFIG_FILE) for any necessary site customization. Additionally,"
242         @echo "you should update RT's system database objects by running "
243         @echo "   ls etc/upgrade"
244         @echo ""
245         @echo "For each item in that directory whose name is greater than"
246         @echo "your previously installed RT version, run:"
247         @echo "    $(RT_SBIN_PATH)/rt-setup-database --dba $(DB_DBA) --prompt-for-dba-password --action schema --datadir etc/upgrade/<version>"
248         @echo "    $(RT_SBIN_PATH)/rt-setup-database --dba $(DB_DBA) --prompt-for-dba-password --action acl --datadir etc/upgrade/<version>"
249         @echo "    $(RT_SBIN_PATH)/rt-setup-database --dba $(DB_DBA) --prompt-for-dba-password --action insert --datadir etc/upgrade/<version>"
250
251
252 upgrade: config-install dirs files-install fixperms upgrade-instruct
253
254 upgrade-noclobber: config-install libs-install html-install bin-install local-install doc-install fixperms
255
256
257 # {{{ dependencies
258 testdeps:
259         $(PERL) ./sbin/rt-test-dependencies --verbose --with-$(DB_TYPE)
260
261 depends: fixdeps
262
263 fixdeps:
264         $(PERL) ./sbin/rt-test-dependencies --verbose --install --with-$(DB_TYPE)
265
266 #}}}
267
268 # {{{ fixperms
269 fixperms:
270         # Make the libraries readable
271         chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_PATH)
272         chown -R $(LIBS_OWNER) $(DESTDIR)/$(RT_LIB_PATH)
273         chgrp -R $(LIBS_GROUP) $(DESTDIR)/$(RT_LIB_PATH)
274         chmod -R  u+rwX,go-w,go+rX      $(DESTDIR)/$(RT_LIB_PATH)
275
276
277         chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_BIN_PATH)
278         chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_BIN_PATH) 
279
280         chmod 0755 $(DESTDIR)/$(RT_ETC_PATH)
281         chmod 0500 $(DESTDIR)/$(RT_ETC_PATH)/*
282
283         #TODO: the config file should probably be able to have its
284         # owner set separately from the binaries.
285         chown -R $(BIN_OWNER) $(DESTDIR)/$(RT_ETC_PATH)
286         chgrp -R $(RTGROUP) $(DESTDIR)/$(RT_ETC_PATH)
287
288         chmod 0550 $(DESTDIR)/$(CONFIG_FILE)
289         chmod 0550 $(DESTDIR)/$(SITE_CONFIG_FILE)
290
291         # Make the interfaces executable
292         chown $(BIN_OWNER) $(BINARIES)
293         chgrp $(RTGROUP) $(BINARIES)
294         chmod 0755  $(BINARIES)
295
296         # Make the web ui readable by all. 
297         chmod -R  u+rwX,go-w,go+rX      $(DESTDIR)/$(MASON_HTML_PATH) \
298                                         $(DESTDIR)/$(MASON_LOCAL_HTML_PATH) \
299                                         $(DESTDIR)/$(LOCAL_LEXICON_PATH)
300         chown -R $(LIBS_OWNER)  $(DESTDIR)/$(MASON_HTML_PATH) \
301                                 $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
302         chgrp -R $(LIBS_GROUP)  $(DESTDIR)/$(MASON_HTML_PATH) \
303                                 $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
304
305         # Make the web ui's data dir writable
306         chmod 0770      $(DESTDIR)/$(MASON_DATA_PATH) \
307                         $(DESTDIR)/$(MASON_SESSION_PATH)
308         chown -R $(WEB_USER)    $(DESTDIR)/$(MASON_DATA_PATH) \
309                                 $(DESTDIR)/$(MASON_SESSION_PATH)
310         chgrp -R $(WEB_GROUP)   $(DESTDIR)/$(MASON_DATA_PATH) \
311                                 $(DESTDIR)/$(MASON_SESSION_PATH)
312 # }}}
313
314 # {{{ dirs
315 dirs:
316         mkdir -p $(DESTDIR)/$(RT_LOG_PATH)
317         mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)
318         mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)/cache
319         mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)/etc
320         mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)/obj
321         mkdir -p $(DESTDIR)/$(MASON_SESSION_PATH)
322         mkdir -p $(DESTDIR)/$(MASON_HTML_PATH)
323         mkdir -p $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
324         mkdir -p $(DESTDIR)/$(LOCAL_ETC_PATH)
325         mkdir -p $(DESTDIR)/$(LOCAL_LIB_PATH)
326         mkdir -p $(DESTDIR)/$(LOCAL_LEXICON_PATH)
327 # }}}
328
329 install: config-install dirs files-install fixperms instruct
330
331 files-install: libs-install etc-install bin-install sbin-install html-install local-install doc-install
332
333 config-install:
334         mkdir -p $(DESTDIR)/$(CONFIG_FILE_PATH) 
335         -cp etc/RT_Config.pm $(DESTDIR)/$(CONFIG_FILE)
336         [ -f $(DESTDIR)/$(SITE_CONFIG_FILE) ] || cp etc/RT_SiteConfig.pm $(DESTDIR)/$(SITE_CONFIG_FILE) 
337
338         chgrp $(RTGROUP) $(DESTDIR)/$(CONFIG_FILE)
339         chown $(BIN_OWNER) $(DESTDIR)/$(CONFIG_FILE)
340
341         chgrp $(RTGROUP) $(DESTDIR)/$(SITE_CONFIG_FILE)
342         chown $(BIN_OWNER) $(DESTDIR)/$(SITE_CONFIG_FILE)
343
344         @echo "Installed configuration. about to install rt in  $(RT_PATH)"
345
346 test: 
347         $(PERL) -Ilib lib/t/00smoke.t
348
349 regression-install: config-install
350         $(PERL) -pi -e 's/Set\(\$$DatabaseName.*\);/Set\(\$$DatabaseName, "rt3regression"\);/' $(DESTDIR)/$(CONFIG_FILE)
351
352 regression: regression-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db  testify-pods fixperms apachectl run-regression
353
354 run-regression:
355         prove -Ilib lib/t/setup_regression.t  lib/t/autogen/ lib/t/regression/
356
357
358 regression-noapache: regression-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db  testify-pods fixperms start-httpd  run-regression
359
360 regression-quiet:
361         $(PERL) sbin/regression_harness
362
363 regression-instruct:
364         @echo "About to wipe your database for a regression test. ABORT NOW with Control-C"
365
366
367 # {{{ database-installation
368
369 regression-reset-db:
370         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action drop --dba $(DB_DBA) --dba-password '' --force
371         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action init --dba $(DB_DBA) --dba-password ''
372
373 initdb :: initialize-database
374
375 initialize-database: 
376         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action init --dba $(DB_DBA) --prompt-for-dba-password
377
378 dropdb: 
379         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action drop --dba $(DB_DBA) --prompt-for-dba-password
380
381 insert-approval-data: 
382         $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/insert_approval_scrips
383 # }}}
384
385 # {{{ libs-install
386 libs-install: 
387         [ -d $(DESTDIR)/$(RT_LIB_PATH) ] || mkdir -p $(DESTDIR)/$(RT_LIB_PATH)
388         -cp -rp lib/* $(DESTDIR)/$(RT_LIB_PATH)
389 # }}}
390
391 # {{{ html-install
392 html-install:
393         [ -d $(DESTDIR)/$(MASON_HTML_PATH) ] || mkdir -p $(DESTDIR)/$(MASON_HTML_PATH)
394         -cp -rp ./html/* $(DESTDIR)/$(MASON_HTML_PATH)
395 # }}}
396
397 # {{{ doc-install
398 doc-install:
399         # RT 3.0.0 - RT 3.0.2 would accidentally create a file instead of a dir
400         -[ -f $(DESTDIR)/$(RT_DOC_PATH) ] && rm $(DESTDIR)/$(RT_DOC_PATH) 
401         [ -d $(DESTDIR)/$(RT_DOC_PATH) ] || mkdir -p $(DESTDIR)/$(RT_DOC_PATH)
402         -cp -rp ./README $(DESTDIR)/$(RT_DOC_PATH)
403 # }}}
404
405 # {{{ etc-install
406
407 etc-install:
408         mkdir -p $(DESTDIR)/$(RT_ETC_PATH)
409         -cp -rp \
410                 etc/acl.* \
411                 etc/initialdata \
412                 etc/schema.* \
413                 $(DESTDIR)/$(RT_ETC_PATH)
414 # }}}
415
416 # {{{ sbin-install
417
418 sbin-install:
419         mkdir -p $(DESTDIR)/$(RT_SBIN_PATH)
420         chmod +x \
421                 sbin/rt-dump-database \
422                 sbin/rt-setup-database \
423                 sbin/rt-test-dependencies
424         -cp -rp \
425                 sbin/rt-dump-database \
426                 sbin/rt-setup-database \
427                 sbin/rt-test-dependencies \
428                 $(DESTDIR)/$(RT_SBIN_PATH)
429
430 # }}}
431
432 # {{{ bin-install
433
434 bin-install:
435         mkdir -p $(DESTDIR)/$(RT_BIN_PATH)
436         chmod +x bin/rt-mailgate \
437                 bin/rt-crontool
438         -cp -rp \
439                 bin/rt-mailgate \
440                 bin/mason_handler.fcgi \
441                 bin/mason_handler.scgi \
442                 bin/standalone_httpd \
443                 bin/mason_handler.svc \
444                 bin/rt \
445                 bin/webmux.pl \
446                 bin/rt-crontool \
447                 $(DESTDIR)/$(RT_BIN_PATH)
448 # }}}
449
450 # {{{ local-install
451 local-install:
452         -cp -rp ./local/html/* $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
453         -cp -rp ./local/po/* $(DESTDIR)/$(LOCAL_LEXICON_PATH)
454         -cp -rp ./local/etc/* $(DESTDIR)/$(LOCAL_ETC_PATH)
455 # }}}
456
457 # {{{ Best Practical Build targets -- no user servicable parts inside
458
459
460 POD2TEST_EXE = sbin/extract_pod_tests
461
462 testify-pods:
463         [ -d lib/t/autogen ] || mkdir lib/t/autogen
464         find lib -name \*pm |grep -v .svn | grep -v \*.in |xargs -n 1 $(PERL) $(POD2TEST_EXE)
465         find bin -type f |grep -v .svn | grep -v \~ | grep -v "\.in" | xargs -n 1 $(PERL) $(POD2TEST_EXE)
466         find lib -name \*pm |grep -v .svn | grep -v \*.in |xargs -n 1 $(PERL) $(POD2TEST_EXE)
467         find bin -type f |grep -v .svn | grep -v \~ | grep -v "\.in" | xargs -n 1 $(PERL) $(POD2TEST_EXE)
468
469
470
471 regenerate-catalogs:
472         $(PERL) sbin/extract-message-catalog
473
474 license-tag:
475         $(PERL) sbin/license_tag
476
477 factory: initialize-database
478         cd lib; $(PERL) ../sbin/factory  $(DB_DATABASE) RT
479
480 reconfigure:
481         aclocal -I m4
482         autoconf
483         chmod 755 ./configure
484         ./configure
485
486 start-httpd:
487         $(PERL) bin/standalone_httpd &
488
489 apachectl:
490         $(APACHECTL) stop
491         sleep 10
492         $(APACHECTL) start
493         sleep 5
494 # }}}