X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2FMakefile;h=e6a5ddee55c575d4d772e7ac3f48b622fdbd65b2;hb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;hp=644722109e59563e4d372eaeb9d7ba5e1743e3a4;hpb=673b9a458d9138523026963df6fa3b4683e09bae;p=freeside.git diff --git a/rt/Makefile b/rt/Makefile index 644722109..e6a5ddee5 100644 --- a/rt/Makefile +++ b/rt/Makefile @@ -1,29 +1,50 @@ -# BEGIN LICENSE BLOCK +# BEGIN BPS TAGGED BLOCK {{{ # -# Copyright (c) 1996-2002 Jesse Vincent +# COPYRIGHT: +# +# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +# # -# (Except where explictly superceded by other copyright notices) +# (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 +# 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., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 or visit their web page on the internet at +# http://www.gnu.org/copyleft/gpl.html. # -# Unless otherwise specified, all modifications, corrections or -# extensions to this work which alter its source code become the -# property of Best Practical Solutions, LLC when submitted for -# inclusion in the work. # +# CONTRIBUTION SUBMISSION POLICY: # -# END LICENSE BLOCK - - +# (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 @@ -38,7 +59,7 @@ SITE_CONFIG_FILE = $(CONFIG_FILE_PATH)/RT_SiteConfig.pm RT_VERSION_MAJOR = 3 -RT_VERSION_MINOR = 0 +RT_VERSION_MINOR = 6 RT_VERSION_PATCH = 4 RT_VERSION = $(RT_VERSION_MAJOR).$(RT_VERSION_MINOR).$(RT_VERSION_PATCH) @@ -46,7 +67,7 @@ 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 = rt +RTGROUP = freeside # User which should own rt binaries. @@ -58,8 +79,11 @@ LIBS_OWNER = root # Group that should own all of RT's libraries, generally root. LIBS_GROUP = bin -WEB_USER = www -WEB_GROUP = www +WEB_USER = freeside +WEB_GROUP = freeside + + +APACHECTL = /usr/sbin/apachectl # {{{ Files and directories @@ -79,10 +103,11 @@ RT_VAR_PATH = /opt/rt3/var RT_DOC_PATH = /opt/rt3/share/doc RT_LOCAL_PATH = /opt/rt3/local LOCAL_ETC_PATH = /opt/rt3/local/etc +LOCAL_LIB_PATH = /opt/rt3/local/lib LOCAL_LEXICON_PATH = /opt/rt3/local/po -MASON_HTML_PATH = /opt/rt3/share/html +MASON_HTML_PATH = /var/www/freeside/rt MASON_LOCAL_HTML_PATH = /opt/rt3/local/html -MASON_DATA_PATH = /opt/rt3/var/mason_data +MASON_DATA_PATH = /usr/local/etc/freeside/masondata MASON_SESSION_PATH = /opt/rt3/var/session_data RT_LOG_PATH = /opt/rt3/var/log @@ -97,12 +122,16 @@ RT_READABLE_DIR_MODE = 0755 # 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 admin CLI -RT_CLI_ADMIN_BIN = $(RT_BIN_PATH)/rtadmin +# 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 @@ -110,16 +139,17 @@ RT_CRON_BIN = $(RT_BIN_PATH)/rt-crontool # }}} -SETGID_BINARIES = $(DESTDIR)/$(RT_FASTCGI_HANDLER) \ - $(DESTDIR)/$(RT_WIN32_FASTCGI_HANDLER) BINARIES = $(DESTDIR)/$(RT_MODPERL_HANDLER) \ $(DESTDIR)/$(RT_MAILGATE_BIN) \ + $(DESTDIR)/$(RT_CLI_BIN) \ $(DESTDIR)/$(RT_CRON_BIN) \ - $(SETGID_BINARIES) + $(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 @@ -128,8 +158,9 @@ SYSTEM_BINARIES = $(DESTDIR)/$(RT_SBIN_PATH)/ # 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 = mysql +DB_TYPE = Pg # Set DBA to the name of a unix account with the proper permissions and # environment to run your commandline SQL sbin @@ -138,9 +169,10 @@ DB_TYPE = mysql # For mysql, you probably want 'root' # For Pg, you probably want 'postgres' -# For oracle, you want 'system' +# For Oracle, you want 'system' +# For Informix, you want 'informix' -DB_DBA = root +DB_DBA = freeside DB_HOST = localhost @@ -166,9 +198,9 @@ DB_RT_HOST = localhost # 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 = rt3 -DB_RT_USER = rt_user -DB_RT_PASS = rt_pass +DB_DATABASE = freeside +DB_RT_USER = freeside +DB_RT_PASS = # }}} @@ -189,8 +221,11 @@ instruct: @echo "" @echo "You must now configure RT by editing $(SITE_CONFIG_FILE)." @echo "" - @echo "(You will definitely need to set RT's database password before continuing." - @echo " Not doing so could be very dangerous)" + @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'" @@ -206,22 +241,27 @@ upgrade-instruct: @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 "For each file in that directory whose name is greater than" + @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 --action insert --datafile etc/upgrade/" + @echo " $(RT_SBIN_PATH)/rt-setup-database --dba $(DB_DBA) --prompt-for-dba-password --action schema --datadir etc/upgrade/" + @echo " $(RT_SBIN_PATH)/rt-setup-database --dba $(DB_DBA) --prompt-for-dba-password --action acl --datadir etc/upgrade/" + @echo " $(RT_SBIN_PATH)/rt-setup-database --dba $(DB_DBA) --prompt-for-dba-password --action insert --datadir etc/upgrade/" -upgrade: dirs upgrade-noclobber upgrade-instruct +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 --with-$(DB_TYPE) + $(PERL) ./sbin/rt-test-dependencies --verbose --with-$(DB_TYPE) + +depends: fixdeps fixdeps: - $(PERL) ./sbin/rt-test-dependencies --install --with-$(DB_TYPE) + $(PERL) ./sbin/rt-test-dependencies --verbose --install --with-$(DB_TYPE) #}}} @@ -241,18 +281,17 @@ fixperms: chmod 0500 $(DESTDIR)/$(RT_ETC_PATH)/* #TODO: the config file should probably be able to have its - # owner set seperately from the binaries. + # 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 and setgid rt + # Make the interfaces executable chown $(BIN_OWNER) $(BINARIES) chgrp $(RTGROUP) $(BINARIES) chmod 0755 $(BINARIES) - chmod g+s $(SETGID_BINARIES) # Make the web ui readable by all. chmod -R u+rwX,go-w,go+rX $(DESTDIR)/$(MASON_HTML_PATH) \ @@ -272,12 +311,6 @@ fixperms: $(DESTDIR)/$(MASON_SESSION_PATH) # }}} -fixperms-nosetgid: fixperms - @echo "You should never be running RT this way. it's unsafe" - chmod 0555 $(SETGID_BINARIES) - chmod 0555 $(DESTDIR)/$(CONFIG_FILE) - chmod 0555 $(DESTDIR)/$(SITE_CONFIG_FILE) - # {{{ dirs dirs: mkdir -p $(DESTDIR)/$(RT_LOG_PATH) @@ -289,6 +322,7 @@ dirs: 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) # }}} @@ -298,7 +332,7 @@ files-install: libs-install etc-install bin-install sbin-install html-install lo config-install: mkdir -p $(DESTDIR)/$(CONFIG_FILE_PATH) - cp etc/RT_Config.pm $(DESTDIR)/$(CONFIG_FILE) + -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) @@ -312,14 +346,16 @@ config-install: test: $(PERL) -Ilib lib/t/00smoke.t -regression-nosetgid-quiet: config-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db testify-pods fixperms-nosetgid apachectl - $(PERL) sbin/regression_harness +regression-install: config-install + $(PERL) -pi -e 's/Set\(\$$DatabaseName.*\);/Set\(\$$DatabaseName, "rt3regression"\);/' $(DESTDIR)/$(CONFIG_FILE) -regression-nosetgid: config-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db testify-pods fixperms-nosetgid apachectl - $(PERL) lib/t/02regression.t +regression: regression-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db testify-pods fixperms apachectl run-regression -regression: config-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db testify-pods apachectl - $(PERL) lib/t/02regression.t +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 @@ -331,9 +367,11 @@ regression-instruct: # {{{ database-installation regression-reset-db: - $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action drop --dba $(DB_DBA) --dba-password '' + $(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 @@ -346,13 +384,13 @@ insert-approval-data: # {{{ libs-install libs-install: - [ -d $(DESTDIR)/$(RT_LIB_PATH) ] || mkdir $(DESTDIR)/$(RT_LIB_PATH) + [ -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 $(DESTDIR)/$(MASON_HTML_PATH) + [ -d $(DESTDIR)/$(MASON_HTML_PATH) ] || mkdir -p $(DESTDIR)/$(MASON_HTML_PATH) -cp -rp ./html/* $(DESTDIR)/$(MASON_HTML_PATH) # }}} @@ -360,7 +398,7 @@ html-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 $(DESTDIR)/$(RT_DOC_PATH) + [ -d $(DESTDIR)/$(RT_DOC_PATH) ] || mkdir -p $(DESTDIR)/$(RT_DOC_PATH) -cp -rp ./README $(DESTDIR)/$(RT_DOC_PATH) # }}} @@ -379,9 +417,12 @@ etc-install: sbin-install: mkdir -p $(DESTDIR)/$(RT_SBIN_PATH) - chmod +x sbin/rt-setup-database \ + 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) @@ -397,7 +438,10 @@ bin-install: -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) @@ -417,8 +461,10 @@ POD2TEST_EXE = sbin/extract_pod_tests testify-pods: [ -d lib/t/autogen ] || mkdir lib/t/autogen - find lib -name \*pm |grep -v \*.in |xargs -n 1 $(PERL) $(POD2TEST_EXE) - find bin -type f |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) + 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) @@ -431,55 +477,18 @@ license-tag: factory: initialize-database cd lib; $(PERL) ../sbin/factory $(DB_DATABASE) RT -commit: - aegis -build ; aegis -diff ; aegis -test; aegis -develop_end - -integrate: - aegis -integrate_begin; aegis -build; aegis -diff; aegis -test ; aegis -integrate_pass - -predist: commit tag-and-tar - -tag-and-release-baseline: - aegis -cp -ind Makefile -output /tmp/Makefile.tagandrelease; \ - $(MAKE) -f /tmp/Makefile.tagandrelease tag-and-release-never-by-hand - - -# Running this target in a working directory is -# WRONG WRONG WRONG. -# it will tag the current baseline with the version of RT defined -# in the currently-being-worked-on makefile. which is wrong. -# you want tag-and-release-baseline - -tag-and-release-never-by-hand: - aegis --delta-name $(TAG) - rm -rf /tmp/$(TAG) - mkdir /tmp/$(TAG) - cd /tmp/$(TAG); \ - aegis -cp -ind -delta $(TAG) . ;\ - make reconfigure;\ - chmod 600 Makefile;\ - aegis --report --project rt.$(RT_VERSION_MAJOR) \ - --page_width 80 \ - --page_length 9999 \ - --change $(RT_VERSION_MINOR) --output Changelog Change_Log - - cd /tmp; tar czvf /home/ftp/pub/rt/devel/$(TAG).tar.gz $(TAG)/ - chmod 644 /home/ftp/pub/rt/devel/$(TAG).tar.gz - - reconfigure: aclocal -I m4 autoconf chmod 755 ./configure ./configure -rpm: - (cd ..; tar czvf /usr/src/redhat/SOURCES/rt.tar.gz rt) - rpm -ba etc/rt.spec - +start-httpd: + $(PERL) bin/standalone_httpd & apachectl: - apachectl stop - sleep 3 - apachectl start + $(APACHECTL) stop + sleep 10 + $(APACHECTL) start + sleep 5 # }}}