File: Makefile.in

package info (click to toggle)
request-tracker3.6 3.6.1-4+etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 9,028 kB
  • ctags: 1,371
  • sloc: perl: 27,270; sh: 671; makefile: 327
file content (492 lines) | stat: -rwxr-xr-x 15,098 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
# BEGIN BPS TAGGED BLOCK {{{
# 
# COPYRIGHT:
#  
# This software is Copyright (c) 1996-2006 Best Practical Solutions, LLC 
#                                          <jesse@bestpractical.com>
# 
# (Except where explicitly superseded by other copyright notices)
# 
# 
# LICENSE:
# 
# This work is made available to you under the terms of Version 2 of
# the GNU General Public License. A copy of that license should have
# been provided with this software, but in any event can be snarfed
# from www.gnu.org.
# 
# This work is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# 
# 
# CONTRIBUTION SUBMISSION POLICY:
# 
# (The following paragraph is not intended to limit the rights granted
# to you to modify and distribute this software under the terms of
# the GNU General Public License and is only of importance to you if
# you choose to contribute your changes and enhancements to the
# community by submitting them to Best Practical Solutions, LLC.)
# 
# By intentionally submitting any modifications, corrections or
# derivatives to this work, or any other work intended for use with
# Request Tracker, to Best Practical Solutions, LLC, you confirm that
# you are the copyright holder for those contributions and you grant
# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
# royalty-free, perpetual, license to use, copy, create derivative
# works based on those contributions, and sublicense and distribute
# those contributions and any derivatives thereof.
# 
# END BPS TAGGED BLOCK }}}
#
# DO NOT HAND-EDIT the file named 'Makefile'. This file is autogenerated.
# Have a look at "configure" and "Makefile.in" instead
#


PERL			= 	@PERL@

CONFIG_FILE_PATH	=	@CONFIG_FILE_PATH@
CONFIG_FILE		= 	$(CONFIG_FILE_PATH)/RT_Config.pm
SITE_CONFIG_FILE		= 	$(CONFIG_FILE_PATH)/RT_SiteConfig.pm


RT_VERSION_MAJOR	=	@RT_VERSION_MAJOR@
RT_VERSION_MINOR	=	@RT_VERSION_MINOR@
RT_VERSION_PATCH	=	@RT_VERSION_PATCH@

RT_VERSION =	$(RT_VERSION_MAJOR).$(RT_VERSION_MINOR).$(RT_VERSION_PATCH)
TAG 	   =	rt-$(RT_VERSION_MAJOR)-$(RT_VERSION_MINOR)-$(RT_VERSION_PATCH)


# This is the group that all of the installed files will be chgrp'ed to.
RTGROUP			=	@RTGROUP@


# User which should own rt binaries.
BIN_OWNER		=	@BIN_OWNER@

# User that should own all of RT's libraries, generally root.
LIBS_OWNER 		=	@LIBS_OWNER@

# Group that should own all of RT's libraries, generally root.
LIBS_GROUP		=	@LIBS_GROUP@

WEB_USER		=	@WEB_USER@
WEB_GROUP		=	@WEB_GROUP@


APACHECTL		=	@APACHECTL@

# {{{ Files and directories 

# DESTDIR allows you to specify that RT be installed somewhere other than
# where it will eventually reside

DESTDIR			=	


RT_PATH			=	@RT_PATH@
RT_ETC_PATH		=	@RT_ETC_PATH@
RT_BIN_PATH		=	@RT_BIN_PATH@
RT_SBIN_PATH		=	@RT_SBIN_PATH@
RT_LIB_PATH		=	@RT_LIB_PATH@
RT_MAN_PATH		=	@RT_MAN_PATH@
RT_VAR_PATH		=	@RT_VAR_PATH@
RT_DOC_PATH		=	@RT_DOC_PATH@
RT_LOCAL_PATH		=	@RT_LOCAL_PATH@
LOCAL_ETC_PATH		=	@LOCAL_ETC_PATH@
LOCAL_LIB_PATH		=	@LOCAL_LIB_PATH@
LOCAL_LEXICON_PATH	=	@LOCAL_LEXICON_PATH@
MASON_HTML_PATH		=	@MASON_HTML_PATH@
MASON_LOCAL_HTML_PATH	=	@MASON_LOCAL_HTML_PATH@
MASON_DATA_PATH		=	@MASON_DATA_PATH@
MASON_SESSION_PATH	=	@MASON_SESSION_PATH@
RT_LOG_PATH	    =       @RT_LOG_PATH@

# RT_READABLE_DIR_MODE is the mode of directories that are generally meant
# to be accessable
RT_READABLE_DIR_MODE	=	0755




# {{{ all these define the places that RT's binaries should get installed

# RT_MODPERL_HANDLER is the mason handler script for mod_perl
RT_MODPERL_HANDLER	=	$(RT_BIN_PATH)/webmux.pl
# RT_STANDALONE_SERVER is a stand-alone HTTP server
RT_STANDALONE_SERVER	=	$(RT_BIN_PATH)/standalone_httpd
# RT_SPEEDYCGI_HANDLER is the mason handler script for SpeedyCGI
RT_SPEEDYCGI_HANDLER	=	$(RT_BIN_PATH)/mason_handler.scgi
# RT_FASTCGI_HANDLER is the mason handler script for FastCGI
RT_FASTCGI_HANDLER	=	$(RT_BIN_PATH)/mason_handler.fcgi
# RT_WIN32_FASTCGI_HANDLER is the mason handler script for FastCGI
RT_WIN32_FASTCGI_HANDLER	=	$(RT_BIN_PATH)/mason_handler.svc
# RT's CLI
RT_CLI_BIN		=	$(RT_BIN_PATH)/rt
# RT's mail gateway
RT_MAILGATE_BIN		=	$(RT_BIN_PATH)/rt-mailgate
# RT's cron tool
RT_CRON_BIN		=	$(RT_BIN_PATH)/rt-crontool

# }}}


BINARIES		=	$(DESTDIR)/$(RT_MODPERL_HANDLER) \
				$(DESTDIR)/$(RT_MAILGATE_BIN) \
				$(DESTDIR)/$(RT_CLI_BIN) \
				$(DESTDIR)/$(RT_CRON_BIN) \
				$(DESTDIR)/$(RT_STANDALONE_SERVER) \
				$(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \
				$(DESTDIR)/$(RT_FASTCGI_HANDLER) \
				$(DESTDIR)/$(RT_WIN32_FASTCGI_HANDLER)
SYSTEM_BINARIES		=	$(DESTDIR)/$(RT_SBIN_PATH)/

# }}}

# {{{ Database setup

#
# DB_TYPE defines what sort of database RT trys to talk to
# "mysql" is known to work.
# "Pg" is known to work
# "Informix" is known to work

DB_TYPE			=	@DB_TYPE@

# Set DBA to the name of a unix account with the proper permissions and 
# environment to run your commandline SQL sbin

# Set DB_DBA to the name of a DB user with permission to create new databases 

# For mysql, you probably want 'root'
# For Pg, you probably want 'postgres' 
# For Oracle, you want 'system'
# For Informix, you want 'informix'

DB_DBA			=	@DB_DBA@

DB_HOST			=	@DB_HOST@

# If you're not running your database server on its default port, 
# specifiy the port the database server is running on below.
# It's generally safe to leave this blank 

DB_PORT			=	@DB_PORT@




#
# Set this to the canonical name of the interface RT will be talking to the 
# database on.  If you said that the RT_DB_HOST above was "localhost," this 
# should be too. This value will be used to grant rt access to the database.
# If you want to access the RT database from multiple hosts, you'll need
# to grant those database rights by hand.
#

DB_RT_HOST		=	@DB_RT_HOST@

# set this to the name you want to give to the RT database in 
# your database server. For Oracle, this should be the name of your sid

DB_DATABASE		=	@DB_DATABASE@
DB_RT_USER		=	@DB_RT_USER@
DB_RT_PASS		=	@DB_RT_PASS@

# }}}


####################################################################

all: default

default:
	@echo "Please read RT's readme before installing. Not doing so could"
	@echo "be dangerous."



instruct:
	@echo "Congratulations. RT has been installed. "
	@echo ""
	@echo ""
	@echo "You must now configure RT by editing $(SITE_CONFIG_FILE)."
	@echo ""
	@echo "(You will definitely need to set RT's database password in "
	@echo "$(SITE_CONFIG_FILE) before continuing. Not doing so could be "
	@echo "very dangerous.  Note that you do not have to manually add a "
	@echo "database user or set up a database for RT.  These actions will be "
	@echo "taken care of in the next step.)"
	@echo ""
	@echo "After that, you need to initialize RT's database by running" 
	@echo " 'make initialize-database'"

#	@echo " or by executing "       
#	@echo " '$(RT_SBIN_PATH)/rt-setup-database --action init \ "
#	@echo "     --dba $(DB_DBA) --prompt-for-dba-password'"



upgrade-instruct: 
	@echo "Congratulations. RT has been upgraded. You should now check-over"
	@echo "$(CONFIG_FILE) for any necessary site customization. Additionally,"
	@echo "you should update RT's system database objects by running "
	@echo "   ls etc/upgrade"
	@echo ""
	@echo "For each item in that directory whose name is greater than"
	@echo "your previously installed RT version, run:"
	@echo "	   $(RT_SBIN_PATH)/rt-setup-database --dba $(DB_DBA) --prompt-for-dba-password --action schema --datadir etc/upgrade/<version>"
	@echo "	   $(RT_SBIN_PATH)/rt-setup-database --dba $(DB_DBA) --prompt-for-dba-password --action acl --datadir etc/upgrade/<version>"
	@echo "	   $(RT_SBIN_PATH)/rt-setup-database --dba $(DB_DBA) --prompt-for-dba-password --action insert --datadir etc/upgrade/<version>"


upgrade: config-install dirs files-install fixperms upgrade-instruct

upgrade-noclobber: config-install libs-install html-install bin-install local-install doc-install fixperms


# {{{ dependencies
testdeps:
	$(PERL) ./sbin/rt-test-dependencies --verbose --with-$(DB_TYPE)

depends: fixdeps

fixdeps:
	$(PERL) ./sbin/rt-test-dependencies --verbose --install --with-$(DB_TYPE)

#}}}

# {{{ fixperms
fixperms:
	# Make the libraries readable
	chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_PATH)
	chown -R $(LIBS_OWNER) $(DESTDIR)/$(RT_LIB_PATH)
	chgrp -R $(LIBS_GROUP) $(DESTDIR)/$(RT_LIB_PATH)
	chmod -R  u+rwX,go-w,go+rX 	$(DESTDIR)/$(RT_LIB_PATH)


	chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_BIN_PATH)
	chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_BIN_PATH)	

	chmod 0755 $(DESTDIR)/$(RT_ETC_PATH)
	chmod 0500 $(DESTDIR)/$(RT_ETC_PATH)/*

	#TODO: the config file should probably be able to have its
	# owner set separately from the binaries.
	chown -R $(BIN_OWNER) $(DESTDIR)/$(RT_ETC_PATH)
	chgrp -R $(RTGROUP) $(DESTDIR)/$(RT_ETC_PATH)

	chmod 0550 $(DESTDIR)/$(CONFIG_FILE)
	chmod 0550 $(DESTDIR)/$(SITE_CONFIG_FILE)

	# Make the interfaces executable
	chown $(BIN_OWNER) $(BINARIES)
	chgrp $(RTGROUP) $(BINARIES)
	chmod 0755  $(BINARIES)

	# Make the web ui readable by all. 
	chmod -R  u+rwX,go-w,go+rX 	$(DESTDIR)/$(MASON_HTML_PATH) \
					$(DESTDIR)/$(MASON_LOCAL_HTML_PATH) \
					$(DESTDIR)/$(LOCAL_LEXICON_PATH)
	chown -R $(LIBS_OWNER) 	$(DESTDIR)/$(MASON_HTML_PATH) \
				$(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
	chgrp -R $(LIBS_GROUP) 	$(DESTDIR)/$(MASON_HTML_PATH) \
				$(DESTDIR)/$(MASON_LOCAL_HTML_PATH)

	# Make the web ui's data dir writable
	chmod 0770  	$(DESTDIR)/$(MASON_DATA_PATH) \
			$(DESTDIR)/$(MASON_SESSION_PATH)
	chown -R $(WEB_USER) 	$(DESTDIR)/$(MASON_DATA_PATH) \
				$(DESTDIR)/$(MASON_SESSION_PATH)
	chgrp -R $(WEB_GROUP) 	$(DESTDIR)/$(MASON_DATA_PATH) \
				$(DESTDIR)/$(MASON_SESSION_PATH)
# }}}

# {{{ dirs
dirs:
	mkdir -p $(DESTDIR)/$(RT_LOG_PATH)
	mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)
	mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)/cache
	mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)/etc
	mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)/obj
	mkdir -p $(DESTDIR)/$(MASON_SESSION_PATH)
	mkdir -p $(DESTDIR)/$(MASON_HTML_PATH)
	mkdir -p $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
	mkdir -p $(DESTDIR)/$(LOCAL_ETC_PATH)
	mkdir -p $(DESTDIR)/$(LOCAL_LIB_PATH)
	mkdir -p $(DESTDIR)/$(LOCAL_LEXICON_PATH)
# }}}

install: config-install dirs files-install fixperms instruct

files-install: libs-install etc-install bin-install sbin-install html-install local-install doc-install

config-install:
	mkdir -p $(DESTDIR)/$(CONFIG_FILE_PATH)	
	-cp etc/RT_Config.pm $(DESTDIR)/$(CONFIG_FILE)
	[ -f $(DESTDIR)/$(SITE_CONFIG_FILE) ] || cp etc/RT_SiteConfig.pm $(DESTDIR)/$(SITE_CONFIG_FILE) 

	chgrp $(RTGROUP) $(DESTDIR)/$(CONFIG_FILE)
	chown $(BIN_OWNER) $(DESTDIR)/$(CONFIG_FILE)

	chgrp $(RTGROUP) $(DESTDIR)/$(SITE_CONFIG_FILE)
	chown $(BIN_OWNER) $(DESTDIR)/$(SITE_CONFIG_FILE)

	@echo "Installed configuration. about to install rt in  $(RT_PATH)"

test: 
	$(PERL) -Ilib lib/t/00smoke.t

regression-install: config-install
	$(PERL) -pi -e 's/Set\(\$$DatabaseName.*\);/Set\(\$$DatabaseName, "rt3regression"\);/' $(DESTDIR)/$(CONFIG_FILE)

regression: regression-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db  testify-pods fixperms apachectl run-regression

run-regression:
	prove -Ilib lib/t/setup_regression.t  lib/t/autogen/ lib/t/regression/


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

regression-quiet:
	$(PERL) sbin/regression_harness

regression-instruct:
	@echo "About to wipe your database for a regression test. ABORT NOW with Control-C"


# {{{ database-installation

regression-reset-db:
	$(PERL)	$(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action drop --dba $(DB_DBA) --dba-password '' --force
	$(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action init --dba $(DB_DBA) --dba-password ''

initdb :: initialize-database

initialize-database: 
	$(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action init --dba $(DB_DBA) --prompt-for-dba-password

dropdb: 
	$(PERL)	$(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action drop --dba $(DB_DBA) --prompt-for-dba-password

insert-approval-data: 
	$(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/insert_approval_scrips
# }}}

# {{{ libs-install
libs-install: 
	[ -d $(DESTDIR)/$(RT_LIB_PATH) ] || mkdir -p $(DESTDIR)/$(RT_LIB_PATH)
	-cp -rp lib/* $(DESTDIR)/$(RT_LIB_PATH)
# }}}

# {{{ html-install
html-install:
	[ -d $(DESTDIR)/$(MASON_HTML_PATH) ] || mkdir -p $(DESTDIR)/$(MASON_HTML_PATH)
	-cp -rp ./html/* $(DESTDIR)/$(MASON_HTML_PATH)
# }}}

# {{{ doc-install
doc-install:
	# RT 3.0.0 - RT 3.0.2 would accidentally create a file instead of a dir
	-[ -f $(DESTDIR)/$(RT_DOC_PATH) ] && rm $(DESTDIR)/$(RT_DOC_PATH) 
	[ -d $(DESTDIR)/$(RT_DOC_PATH) ] || mkdir -p $(DESTDIR)/$(RT_DOC_PATH)
	-cp -rp ./README $(DESTDIR)/$(RT_DOC_PATH)
# }}}

# {{{ etc-install

etc-install:
	mkdir -p $(DESTDIR)/$(RT_ETC_PATH)
	-cp -rp \
		etc/acl.* \
		etc/initialdata \
		etc/schema.* \
		$(DESTDIR)/$(RT_ETC_PATH)
# }}}

# {{{ sbin-install

sbin-install:
	mkdir -p $(DESTDIR)/$(RT_SBIN_PATH)
	chmod +x \
		sbin/rt-dump-database \
		sbin/rt-setup-database \
		sbin/rt-test-dependencies
	-cp -rp \
		sbin/rt-dump-database \
		sbin/rt-setup-database \
		sbin/rt-test-dependencies \
		$(DESTDIR)/$(RT_SBIN_PATH)

# }}}

# {{{ bin-install

bin-install:
	mkdir -p $(DESTDIR)/$(RT_BIN_PATH)
	chmod +x bin/rt-mailgate \
		bin/rt-crontool
	-cp -rp \
		bin/rt-mailgate \
		bin/mason_handler.fcgi \
		bin/mason_handler.scgi \
		bin/standalone_httpd \
		bin/mason_handler.svc \
		bin/rt \
		bin/webmux.pl \
		bin/rt-crontool \
		$(DESTDIR)/$(RT_BIN_PATH)
# }}}

# {{{ local-install
local-install:
	-cp -rp ./local/html/* $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
	-cp -rp ./local/po/* $(DESTDIR)/$(LOCAL_LEXICON_PATH)
	-cp -rp ./local/etc/* $(DESTDIR)/$(LOCAL_ETC_PATH)
# }}}

# {{{ Best Practical Build targets -- no user servicable parts inside


POD2TEST_EXE = sbin/extract_pod_tests

testify-pods:
	[ -d lib/t/autogen ] || mkdir lib/t/autogen
	find lib -name \*pm |grep -v .svn | grep -v \*.in |xargs -n 1 $(PERL) $(POD2TEST_EXE)
	find bin -type f |grep -v .svn | grep -v \~ | grep -v "\.in" | xargs -n 1 $(PERL) $(POD2TEST_EXE)
	find lib -name \*pm |grep -v .svn | grep -v \*.in |xargs -n 1 $(PERL) $(POD2TEST_EXE)
	find bin -type f |grep -v .svn | grep -v \~ | grep -v "\.in" | xargs -n 1 $(PERL) $(POD2TEST_EXE)



regenerate-catalogs:
	$(PERL) sbin/extract-message-catalog

license-tag:
	$(PERL) sbin/license_tag

factory: initialize-database
	cd lib; $(PERL) ../sbin/factory  $(DB_DATABASE) RT

reconfigure:
	aclocal -I m4
	autoconf
	chmod 755 ./configure
	./configure

start-httpd:
	$(PERL) bin/standalone_httpd &

apachectl:
	$(APACHECTL) stop
	sleep 10
	$(APACHECTL) start
	sleep 5
# }}}