two-sided printing of invoice batches, #29927
[freeside.git] / rt / Makefile.in
1 # BEGIN BPS TAGGED BLOCK {{{
2 #
3 # COPYRIGHT:
4 #
5 # This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
6 #                                          <sales@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/licenses/old-licenses/gpl-2.0.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 INSTALL                 =       @INSTALL@
56 CC                              =       @CC@
57
58 RT_LAYOUT               =       @rt_layout_name@
59
60 CONFIG_FILE_PATH        =       @CONFIG_FILE_PATH_R@
61 CONFIG_FILE             =       $(CONFIG_FILE_PATH)/RT_Config.pm
62 SITE_CONFIG_FILE        =       $(CONFIG_FILE_PATH)/RT_SiteConfig.pm
63
64
65 RT_VERSION_MAJOR        =       @RT_VERSION_MAJOR@
66 RT_VERSION_MINOR        =       @RT_VERSION_MINOR@
67 RT_VERSION_PATCH        =       @RT_VERSION_PATCH@
68
69 RT_VERSION              =       $(RT_VERSION_MAJOR).$(RT_VERSION_MINOR).$(RT_VERSION_PATCH)
70 TAG                     =       rt-$(RT_VERSION_MAJOR)-$(RT_VERSION_MINOR)-$(RT_VERSION_PATCH)
71
72
73 # This is the group that all of the installed files will be chgrp'ed to.
74 RTGROUP                 =       @RTGROUP@
75
76
77 # User which should own rt binaries.
78 BIN_OWNER               =       @BIN_OWNER@
79
80 # User that should own all of RT's libraries, generally root.
81 LIBS_OWNER              =       @LIBS_OWNER@
82
83 # Group that should own all of RT's libraries, generally root.
84 LIBS_GROUP              =       @LIBS_GROUP@
85
86 WEB_USER                =       @WEB_USER@
87 WEB_GROUP               =       @WEB_GROUP@
88
89
90 APACHECTL               =       @APACHECTL@
91
92
93 # DESTDIR allows you to specify that RT be installed somewhere other than
94 # where it will eventually reside. DESTDIR _must_ have a trailing slash
95 # if it's defined.
96
97 DESTDIR                 =       
98
99
100
101 RT_PATH                 =       @RT_PATH_R@
102 RT_ETC_PATH             =       @RT_ETC_PATH_R@
103 RT_BIN_PATH             =       @RT_BIN_PATH_R@
104 RT_SBIN_PATH            =       @RT_SBIN_PATH_R@
105 RT_LIB_PATH             =       @RT_LIB_PATH_R@
106 RT_MAN_PATH             =       @RT_MAN_PATH_R@
107 RT_VAR_PATH             =       @RT_VAR_PATH_R@
108 RT_DOC_PATH             =       @RT_DOC_PATH_R@
109 RT_FONT_PATH            =       @RT_FONT_PATH_R@
110 RT_LEXICON_PATH         =       @RT_LEXICON_PATH_R@
111 RT_LOCAL_PATH           =       @RT_LOCAL_PATH_R@
112 LOCAL_PLUGIN_PATH       =       @RT_LOCAL_PATH_R@/plugins
113 LOCAL_ETC_PATH          =       @LOCAL_ETC_PATH_R@
114 LOCAL_LIB_PATH          =       @LOCAL_LIB_PATH_R@
115 LOCAL_LEXICON_PATH      =       @LOCAL_LEXICON_PATH_R@
116 MASON_HTML_PATH         =       @MASON_HTML_PATH_R@
117 MASON_LOCAL_HTML_PATH   =       @MASON_LOCAL_HTML_PATH_R@
118 MASON_DATA_PATH         =       @MASON_DATA_PATH_R@
119 MASON_SESSION_PATH      =       @MASON_SESSION_PATH_R@
120 RT_LOG_PATH             =       @RT_LOG_PATH_R@
121
122 # RT_READABLE_DIR_MODE is the mode of directories that are generally meant
123 # to be accessable
124 RT_READABLE_DIR_MODE    =       0755
125
126
127
128
129
130 # RT's CLI
131 RT_CLI_BIN              =       rt
132 # RT's mail gateway
133 RT_MAILGATE_BIN         =       rt-mailgate
134 # RT's cron tool
135 RT_CRON_BIN             =       rt-crontool
136
137
138
139 BINARIES                =       $(RT_MAILGATE_BIN) \
140                                 $(RT_CLI_BIN) \
141                                 $(RT_CRON_BIN)
142
143 SYSTEM_BINARIES         =       rt-attributes-viewer \
144                                 rt-clean-sessions \
145                                 rt-dump-metadata \
146                                 rt-email-dashboards \
147                                 rt-email-digest \
148                                 rt-email-group-admin \
149                                 rt-fulltext-indexer \
150                                 rt-preferences-viewer \
151                                 rt-server \
152                                 rt-session-viewer \
153                                 rt-server.fcgi \
154                                 rt-session-viewer \
155                                 rt-setup-database \
156                                 rt-setup-fulltext-index \
157                                 rt-shredder \
158                                 rt-test-dependencies \
159                                 rt-validator \
160                                 rt-validate-aliases \
161                                 standalone_httpd
162
163
164 ETC_FILES               =       acl.Pg \
165                                 acl.Oracle \
166                                 acl.mysql \
167                                 schema.Pg \
168                                 schema.Oracle \
169                                 schema.mysql \
170                                 schema.SQLite \
171                                 initialdata
172
173
174
175 WEB_HANDLER             =       @WEB_HANDLER@
176
177
178
179 #
180 # DB_TYPE defines what sort of database RT trys to talk to
181 # "mysql", "Oracle", "Pg", and "SQLite" are known to work.
182
183 DB_TYPE                 =       @DB_TYPE@
184
185 # Set DBA to the name of a unix account with the proper permissions and 
186 # environment to run your commandline SQL sbin
187
188 # Set DB_DBA to the name of a DB user with permission to create new databases 
189
190 # For mysql, you probably want 'root'
191 # For Pg, you probably want 'postgres' 
192 # For Oracle, you want 'system'
193
194 DB_DBA                  =       @DB_DBA@
195
196 DB_HOST                 =       @DB_HOST@
197
198 # If you're not running your database server on its default port, 
199 # specifiy the port the database server is running on below.
200 # It's generally safe to leave this blank 
201
202 DB_PORT                 =       @DB_PORT@
203
204
205
206
207 #
208 # Set this to the canonical name of the interface RT will be talking to the 
209 # database on.  If you said that the RT_DB_HOST above was "localhost," this 
210 # should be too. This value will be used to grant rt access to the database.
211 # If you want to access the RT database from multiple hosts, you'll need
212 # to grant those database rights by hand.
213 #
214
215 DB_RT_HOST              =       @DB_RT_HOST@
216
217 # set this to the name you want to give to the RT database in 
218 # your database server. For Oracle, this should be the name of your sid
219
220 DB_DATABASE             =       @DB_DATABASE@
221 DB_RT_USER              =       @DB_RT_USER@
222 DB_RT_PASS              =       @DB_RT_PASS@
223
224
225
226 TEST_FILES = t/*.t t/*/*.t
227 TEST_VERBOSE = 0
228
229 RT_TEST_PARALLEL_NUM ?= 5
230
231
232 ####################################################################
233
234 all: default
235
236 default:
237         @echo "Please read RT's README before beginning your installation."
238
239
240
241 instruct:
242         @echo "Congratulations. RT is now installed."
243         @echo ""
244         @echo ""
245         @echo "You must now configure RT by editing $(SITE_CONFIG_FILE)."
246         @echo ""
247         @echo "(You will definitely need to set RT's database password in "
248         @echo "$(SITE_CONFIG_FILE) before continuing. Not doing so could be "
249         @echo "very dangerous.  Note that you do not have to manually add a "
250         @echo "database user or set up a database for RT.  These actions will be "
251         @echo "taken care of in the next step.)"
252         @echo ""
253         @echo "After that, you need to initialize RT's database by running" 
254         @echo " 'make initialize-database'"
255
256
257 upgrade-instruct: 
258         @echo "Congratulations. RT has been upgraded. You should now check over"
259         @echo "$(CONFIG_FILE) for any necessary site customization. Additionally,"
260         @echo "you should update RT's system database objects by running "
261         @echo "    make upgrade-database"
262
263
264 upgrade: testdeps config-install dirs files-install fixperms upgrade-instruct
265
266 my_with_web_handlers= $(shell $(PERL) -e 'print join " ", map "--with-$$_", grep defined && length, split /,/, "$(WEB_HANDLER)"')
267 testdeps:
268         $(PERL) ./sbin/rt-test-dependencies --verbose --with-$(DB_TYPE) $(my_with_web_handlers)
269
270 depends: fixdeps
271
272 fixdeps:
273         $(PERL) ./sbin/rt-test-dependencies --verbose --install --with-$(DB_TYPE) $(my_with_web_handlers)
274
275 #}}}
276
277 fixperms:
278         # Make the libraries readable
279         chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)$(RT_PATH)
280         chown -R $(LIBS_OWNER) $(DESTDIR)$(RT_LIB_PATH)
281         chgrp -R $(LIBS_GROUP) $(DESTDIR)$(RT_LIB_PATH)
282         chmod -R  u+rwX,go-w,go+rX $(DESTDIR)$(RT_LIB_PATH)
283
284
285         chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)$(RT_BIN_PATH)
286
287         chmod 0755 $(DESTDIR)$(RT_ETC_PATH)
288         cd $(DESTDIR)$(RT_ETC_PATH) && chmod 0400 $(ETC_FILES) || true
289
290         #TODO: the config file should probably be able to have its
291         # owner set separately from the binaries.
292         chown -R $(BIN_OWNER) $(DESTDIR)$(RT_ETC_PATH)
293         chgrp -R $(RTGROUP) $(DESTDIR)$(RT_ETC_PATH)
294
295         chmod 0440 $(DESTDIR)$(CONFIG_FILE)
296         chmod 0640 $(DESTDIR)$(SITE_CONFIG_FILE)
297         # Make this externally readable
298         chmod 0440 $(DESTDIR)$(RT_ETC_PATH)/initialdata
299
300         # Make the system binaries
301         cd $(DESTDIR)$(RT_BIN_PATH) && ( chmod 0755 $(BINARIES) ; chown $(BIN_OWNER) $(BINARIES);  chgrp $(RTGROUP) $(BINARIES))
302
303         # Make the system binaries executable also
304         cd $(DESTDIR)$(RT_SBIN_PATH) && ( chmod 0755 $(SYSTEM_BINARIES) ; chown $(BIN_OWNER) $(SYSTEM_BINARIES);  chgrp $(RTGROUP) $(SYSTEM_BINARIES))
305
306         # Make upgrade scripts executable if they are in the source.
307         #
308         # Note that we use the deprecated (by GNU/POSIX find) -perm +0NNN syntax
309         # instead of -perm /0NNN since BSD find doesn't support the latter.
310         ( cd etc/upgrade && find . -type f -not -name '*.in' -perm +0111 -print ) | while read file ; do \
311                 chmod a+x "$(DESTDIR)$(RT_ETC_PATH)/upgrade/$$file" ; \
312         done
313
314         # Make the web ui readable by all. 
315         chmod -R  u+rwX,go-w,go+rX      $(DESTDIR)$(MASON_HTML_PATH) \
316                                         $(DESTDIR)$(MASON_LOCAL_HTML_PATH) \
317                                         $(DESTDIR)$(RT_LEXICON_PATH) \
318                                         $(DESTDIR)$(LOCAL_LEXICON_PATH)
319         chown -R $(LIBS_OWNER)  $(DESTDIR)$(MASON_HTML_PATH) \
320                                 $(DESTDIR)$(MASON_LOCAL_HTML_PATH) \
321                                 $(DESTDIR)$(RT_LEXICON_PATH) \
322                                 $(DESTDIR)$(LOCAL_LEXICON_PATH)
323         chgrp -R $(LIBS_GROUP)  $(DESTDIR)$(MASON_HTML_PATH) \
324                                 $(DESTDIR)$(MASON_LOCAL_HTML_PATH) \
325                                 $(DESTDIR)$(RT_LEXICON_PATH) \
326                                 $(DESTDIR)$(LOCAL_LEXICON_PATH)
327
328         # Make the web ui's data dir writable
329         chmod 0770      $(DESTDIR)$(MASON_DATA_PATH) \
330                         $(DESTDIR)$(MASON_SESSION_PATH)
331         chown -R $(WEB_USER)    $(DESTDIR)$(MASON_DATA_PATH) \
332                                 $(DESTDIR)$(MASON_SESSION_PATH)
333         chgrp -R $(WEB_GROUP)   $(DESTDIR)$(MASON_DATA_PATH) \
334                                 $(DESTDIR)$(MASON_SESSION_PATH)
335
336 dirs:
337         $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_LOG_PATH)
338         $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_FONT_PATH)
339         $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_LEXICON_PATH)
340         $(INSTALL) -m 0770 -d $(DESTDIR)$(MASON_DATA_PATH)
341         $(INSTALL) -m 0770 -d $(DESTDIR)$(MASON_DATA_PATH)/cache
342         $(INSTALL) -m 0770 -d $(DESTDIR)$(MASON_DATA_PATH)/etc
343         $(INSTALL) -m 0770 -d $(DESTDIR)$(MASON_DATA_PATH)/obj
344         $(INSTALL) -m 0770 -d $(DESTDIR)$(MASON_SESSION_PATH)
345         $(INSTALL) -m 0755 -d $(DESTDIR)$(MASON_HTML_PATH)
346         $(INSTALL) -m 0755 -d $(DESTDIR)$(MASON_LOCAL_HTML_PATH)
347         $(INSTALL) -m 0755 -d $(DESTDIR)$(LOCAL_ETC_PATH)
348         $(INSTALL) -m 0755 -d $(DESTDIR)$(LOCAL_LIB_PATH)
349         $(INSTALL) -m 0755 -d $(DESTDIR)$(LOCAL_PLUGIN_PATH)
350         $(INSTALL) -m 0755 -d $(DESTDIR)$(LOCAL_LEXICON_PATH)
351
352 install: testdeps config-install dirs files-install fixperms instruct
353
354 files-install: libs-install etc-install config-install bin-install sbin-install html-install doc-install font-install po-install
355
356 config-install:
357 @COMMENT_INPLACE_LAYOUT@        $(INSTALL) -m 0755 -o $(BIN_OWNER) -g $(RTGROUP) -d $(DESTDIR)$(CONFIG_FILE_PATH)
358 @COMMENT_INPLACE_LAYOUT@        -$(INSTALL) -m 0440 -o $(BIN_OWNER) -g $(RTGROUP)  etc/RT_Config.pm $(DESTDIR)$(CONFIG_FILE)
359 @COMMENT_INPLACE_LAYOUT@        [ -f $(DESTDIR)$(SITE_CONFIG_FILE) ] || $(INSTALL) -m 0640 -o $(BIN_OWNER) -g $(RTGROUP) etc/RT_SiteConfig.pm $(DESTDIR)$(SITE_CONFIG_FILE) 
360 @COMMENT_INPLACE_LAYOUT@        @echo "Installed configuration. About to install RT in  $(RT_PATH)"
361
362 test: 
363         $(PERL) "-MExtUtils::Command::MM" -e "test_harness($(TEST_VERBOSE), 'lib')" $(TEST_FILES)
364
365 parallel-test: test-parallel
366
367 test-parallel: 
368         RT_TEST_PARALLEL=1 $(PERL) "-MApp::Prove" -e 'my $$p = App::Prove->new(); $$p->process_args("-wlrj$(RT_TEST_PARALLEL_NUM)","--state=slow,save", "t"); exit( $$p->run() ? 0 : 1 )'
369
370 regression-reset-db: force-dropdb
371         $(PERL) -I$(LOCAL_LIB_PATH) -I$(RT_LIB_PATH) sbin/rt-setup-database --action init --dba-password ''
372
373 initdb :: initialize-database
374
375 initialize-database: 
376         $(PERL) -I$(LOCAL_LIB_PATH) -I$(RT_LIB_PATH) sbin/rt-setup-database --action init --prompt-for-dba-password
377
378 upgrade-database:
379         $(PERL) -I$(LOCAL_LIB_PATH) -I$(RT_LIB_PATH) sbin/rt-setup-database --action upgrade --prompt-for-dba-password
380
381 dropdb: 
382         $(PERL) -I$(LOCAL_LIB_PATH) -I$(RT_LIB_PATH) sbin/rt-setup-database --action drop --prompt-for-dba-password
383
384 force-dropdb: 
385         $(PERL) -I$(LOCAL_LIB_PATH) -I$(RT_LIB_PATH) sbin/rt-setup-database --action drop --dba-password '' --force
386
387 critic:
388         perlcritic --quiet sbin bin lib
389
390 libs-install: 
391 @COMMENT_INPLACE_LAYOUT@        [ -d $(DESTDIR)$(RT_LIB_PATH) ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_LIB_PATH)
392 @COMMENT_INPLACE_LAYOUT@        -( cd lib && find . -type d -print ) | while read dir ; do \
393 @COMMENT_INPLACE_LAYOUT@            $(INSTALL) -m 0755 -d "$(DESTDIR)$(RT_LIB_PATH)/$$dir" ; \
394 @COMMENT_INPLACE_LAYOUT@        done
395 @COMMENT_INPLACE_LAYOUT@        -( cd lib && find . -type f -print ) | while read file ; do \
396 @COMMENT_INPLACE_LAYOUT@             $(INSTALL) -m 0644 "lib/$$file" "$(DESTDIR)$(RT_LIB_PATH)/$$file" ; \
397 @COMMENT_INPLACE_LAYOUT@        done
398
399 html-install:
400 @COMMENT_INPLACE_LAYOUT@        [ -d $(DESTDIR)$(MASON_HTML_PATH) ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(MASON_HTML_PATH)
401 @COMMENT_INPLACE_LAYOUT@        -( cd share/html && find . -type d -print ) | while read dir ; do \
402 @COMMENT_INPLACE_LAYOUT@            $(INSTALL) -m 0755 -d "$(DESTDIR)$(MASON_HTML_PATH)/$$dir" ; \
403 @COMMENT_INPLACE_LAYOUT@        done
404 @COMMENT_INPLACE_LAYOUT@        -( cd share/html && find . -type f -print ) | while read file ; do \
405 @COMMENT_INPLACE_LAYOUT@            $(INSTALL) -m 0644 "share/html/$$file" "$(DESTDIR)$(MASON_HTML_PATH)/$$file" ; \
406 @COMMENT_INPLACE_LAYOUT@        done
407
408 font-install:
409 @COMMENT_INPLACE_LAYOUT@        [ -d $(DESTDIR)$(RT_FONT_PATH) ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_FONT_PATH)
410 @COMMENT_INPLACE_LAYOUT@        -( cd share/fonts && find . -type f -print ) | while read file ; do \
411 @COMMENT_INPLACE_LAYOUT@            $(INSTALL) -m 0644 "share/fonts/$$file" "$(DESTDIR)$(RT_FONT_PATH)/$$file" ; \
412 @COMMENT_INPLACE_LAYOUT@        done
413
414
415 po-install:
416 @COMMENT_INPLACE_LAYOUT@        [ -d $(DESTDIR)$(RT_LEXICON_PATH) ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_LEXICON_PATH)
417 @COMMENT_INPLACE_LAYOUT@        -( cd share/po && find . -type f -print ) | while read file ; do \
418 @COMMENT_INPLACE_LAYOUT@            $(INSTALL) -m 0644 "share/po/$$file" "$(DESTDIR)$(RT_LEXICON_PATH)/$$file" ; \
419 @COMMENT_INPLACE_LAYOUT@        done
420
421
422
423 doc-install:
424 @COMMENT_INPLACE_LAYOUT@        # RT 3.0.0 - RT 3.0.2 would accidentally create a file instead of a dir
425 @COMMENT_INPLACE_LAYOUT@        -[ -f $(DESTDIR)$(RT_DOC_PATH) ] && rm $(DESTDIR)$(RT_DOC_PATH) 
426 @COMMENT_INPLACE_LAYOUT@        [ -d $(DESTDIR)$(RT_DOC_PATH) ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_DOC_PATH)
427 @COMMENT_INPLACE_LAYOUT@        -( cd docs && find . -type d -print ) | while read dir ; do \
428 @COMMENT_INPLACE_LAYOUT@            $(INSTALL) -m 0755 -d "$(DESTDIR)$(RT_DOC_PATH)/$$dir" ; \
429 @COMMENT_INPLACE_LAYOUT@        done
430 @COMMENT_INPLACE_LAYOUT@        -( cd docs && find . -type f -print ) | while read file ; do \
431 @COMMENT_INPLACE_LAYOUT@            $(INSTALL) -m 0644 "docs/$$file" "$(DESTDIR)$(RT_DOC_PATH)/$$file" ; \
432 @COMMENT_INPLACE_LAYOUT@        done
433 @COMMENT_INPLACE_LAYOUT@        -$(INSTALL) -m 0644 ./README $(DESTDIR)$(RT_DOC_PATH)/
434
435
436 etc-install:
437 @COMMENT_INPLACE_LAYOUT@        [ -d $(DESTDIR)$(RT_ETC_PATH) ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_ETC_PATH)
438 @COMMENT_INPLACE_LAYOUT@        for file in $(ETC_FILES) ; do \
439 @COMMENT_INPLACE_LAYOUT@            $(INSTALL) -m 0644 "etc/$$file" "$(DESTDIR)$(RT_ETC_PATH)/" ; \
440 @COMMENT_INPLACE_LAYOUT@        done
441 @COMMENT_INPLACE_LAYOUT@        [ -d $(DESTDIR)$(RT_ETC_PATH)/upgrade ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_ETC_PATH)/upgrade
442 @COMMENT_INPLACE_LAYOUT@        -( cd etc/upgrade && find . -type d -print ) | while read dir ; do \
443 @COMMENT_INPLACE_LAYOUT@            $(INSTALL) -m 0755 -d "$(DESTDIR)$(RT_ETC_PATH)/upgrade/$$dir" ; \
444 @COMMENT_INPLACE_LAYOUT@        done
445 @COMMENT_INPLACE_LAYOUT@        -( cd etc/upgrade && find . -type f -not -name '*.in' -print ) | while read file ; do \
446 @COMMENT_INPLACE_LAYOUT@            $(INSTALL) -m 0644 "etc/upgrade/$$file" "$(DESTDIR)$(RT_ETC_PATH)/upgrade/$$file" ; \
447 @COMMENT_INPLACE_LAYOUT@        done
448
449
450 sbin-install:
451 @COMMENT_INPLACE_LAYOUT@        $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_SBIN_PATH)
452 @COMMENT_INPLACE_LAYOUT@        for file in $(SYSTEM_BINARIES) ; do \
453 @COMMENT_INPLACE_LAYOUT@            $(INSTALL) -o $(BIN_OWNER) -g $(RTGROUP) -m 0755 "sbin/$$file" "$(DESTDIR)$(RT_SBIN_PATH)/" ; \
454 @COMMENT_INPLACE_LAYOUT@        done
455
456
457
458 bin-install:
459 @COMMENT_INPLACE_LAYOUT@        $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_BIN_PATH)
460 @COMMENT_INPLACE_LAYOUT@        for file in $(BINARIES) ; do \
461 @COMMENT_INPLACE_LAYOUT@            $(INSTALL) -o $(BIN_OWNER) -g $(RTGROUP) -m 0755 "bin/$$file" "$(DESTDIR)$(RT_BIN_PATH)/" ; \
462 @COMMENT_INPLACE_LAYOUT@        done
463
464
465
466 regenerate-catalogs:
467         $(PERL) devel/tools/extract-message-catalog
468
469 license-tag:
470         $(PERL) devel/tools/license_tag
471
472 factory: initialize-database
473         cd lib; $(PERL) ../devel/tools/factory  $(DB_DATABASE) RT
474
475 start-httpd:
476         $(PERL) sbin/standalone_httpd &
477
478 start-server:
479         $(PERL) sbin/rt-server &
480
481 apachectl:
482         $(APACHECTL) stop
483         sleep 10
484         $(APACHECTL) start
485         sleep 5
486
487 SNAPSHOT=$(shell git describe --tags)
488 THIRD_PARTY=devel/third-party/
489 snapshot: build-snapshot build-third-party clearsign-snapshot clearsign-third-party snapshot-shasums
490
491 build-snapshot:
492         git archive --prefix "$(SNAPSHOT)/"  HEAD | tar -xf -
493         ( cd $(SNAPSHOT)                                         && \
494                 echo "$(SNAPSHOT)" > .tag                        && \
495                 autoconf                                         && \
496                 INSTALL=./install-sh PERL=/usr/bin/perl ./configure \
497                     --with-db-type=SQLite                           \
498                     --enable-layout=relative                        \
499                     --with-web-handler=standalone                && \
500                 rm -rf autom4te.cache                               \
501                        config.status config.log config.pld          \
502         )
503         tar -czf "$(SNAPSHOT).tar.gz" "$(SNAPSHOT)/"
504         rm -fr "$(SNAPSHOT)/"
505
506 clearsign-snapshot:
507         gpg --no-armor --detach-sign "$(SNAPSHOT).tar.gz"
508
509 build-third-party:
510         git archive --prefix "$(SNAPSHOT)/$(THIRD_PARTY)" HEAD:$(THIRD_PARTY) \
511                 | gzip > "$(SNAPSHOT)-third-party-source.tar.gz"
512         rm -rf "$(SNAPSHOT)/$(THIRD_PARTY)"
513
514 clearsign-third-party:
515         gpg --no-armor --detach-sign "$(SNAPSHOT)-third-party-source.tar.gz"
516
517 snapshot-shasums:
518         sha1sum $(SNAPSHOT)*.tar.gz*
519
520 vessel-import: build-snapshot
521         [ -d $(VESSEL) ] || (echo "VESSEL isn't a path to your shipwright vessel" && exit -1)
522         cp $(VESSEL)/scripts/RT/build.pl /tmp/build.pl
523         ./sbin/rt-test-dependencies --with-standalone --with-fastcgi --with-sqlite --list > /tmp/rt.yml
524         shipwright import file:$(SNAPSHOT).tar.gz \
525     --require-yml /tmp/rt.yml \
526     --build-script /tmp/build.pl \
527     --name RT \
528         --repository fs:$(VESSEL) \
529      --log-level=info \
530      --skip cpan-capitalization,cpan-mod_perl,cpan-Encode,cpan-PPI,cpan-Test-Exception-LessClever,cpan-Test-Manifest,cpan-Test-Object,cpan-Test-Pod,cpan-Test-Requires,cpan-Test-SubCalls,cpan-Test-cpan-Tester,cpan-Test-Warn --skip-all-recommends
531         mv $(VESSEL)/scripts/RT/build  $(VESSEL)/scripts/RT/build.pl
532
533 JSMIN_URL = http://download.bestpractical.com/mirror/jsmin-2011-01-22.c
534 JSMIN_SHA = 8a6b3b980a52c028eb73aee4a82ebe060c1ee854
535
536 jsmin: jsmin-checkcc jsmin-fetch jsmin-verify jsmin-confirm jsmin-build jsmin-install
537         @echo ""
538         @echo "To configure RT to use jsmin, add the following line to $(DESTDIR)$(RT_ETC_PATH)/RT_SiteConfig.pm:"
539         @echo ""
540         @echo "    Set(\$$JSMinPath, '$(DESTDIR)$(RT_BIN_PATH)/jsmin');"
541         @echo ""
542
543 jsmin-checkcc:
544         @[ -n "$(CC)" ] || (echo "You don't appear to have a C compiler, please set CC and re-run configure" && exit 1)
545
546 jsmin-confirm:
547         @echo "jsmin is distributed under a slightly unusual license and can't be shipped"
548         @echo "with RT.  Before configuring RT to use jsmin, please read jsmin's license"
549         @echo "below:"
550         @echo ""
551         @$(PERL) -pe 'print && exit if /^\*\// or /^#include/' jsmin.c
552         @echo ""
553         @echo "Press Enter to accept the license, or Ctrl-C to stop now."
554         @$(PERL) -e '<STDIN>'
555
556 jsmin-fetch:
557         @echo ""
558         @echo "Downloading jsmin.c from $(JSMIN_URL)"
559         @echo ""
560         @$(PERL) -MLWP::Simple -e 'exit not is_success(getstore("$(JSMIN_URL)", "jsmin.c"))' \
561                 || (echo "Failed to download $(JSMIN_URL)" && exit 1)
562
563 jsmin-verify:
564         @$(PERL) -MDigest::SHA -e \
565                 'exit not Digest::SHA->new(1)->addfile("jsmin.c")->hexdigest eq "$(JSMIN_SHA)"' \
566                 || (echo "Verification of jsmin.c failed! Possible man in the middle?" && exit 1)
567
568 jsmin-build:
569         $(CC) -o jsmin jsmin.c
570
571 jsmin-install:
572         $(INSTALL) -o $(BIN_OWNER) -g $(RTGROUP) -m 0755 "jsmin" "$(DESTDIR)$(RT_BIN_PATH)/"