X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2FMakefile;h=1ad55304f1a33a5714e2137450651162daace52d;hp=fe01b71c163f1fa4405759cf186f8358c0d93457;hb=ed1f84b4e8f626245995ecda5afcf83092c153b2;hpb=3ef62a0570055da710328937e7f65dbb2c027c62 diff --git a/rt/Makefile b/rt/Makefile index fe01b71c1..1ad55304f 100644 --- a/rt/Makefile +++ b/rt/Makefile @@ -1,21 +1,77 @@ -# $Header: /home/cvs/cvsroot/freeside/rt/Makefile,v 1.1 2002-08-12 06:17:06 ivan Exp $ -# RT is Copyright 1996-2002 Jesse Vincent -# It is distributed under the terms of the GNU General Public License, version 2 +# BEGIN BPS TAGGED BLOCK {{{ +# +# COPYRIGHT: +# +# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC +# +# +# (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., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 or visit their web page on the internet at +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +# +# +# 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 = /usr/bin/perl -RT_VERSION_MAJOR = 2 -RT_VERSION_MINOR = 0 -RT_VERSION_PATCH = 14 +PERL = /usr/bin/perl +INSTALL = /usr/bin/install -c +CC = @CC@ + +RT_LAYOUT = Freeside + +CONFIG_FILE_PATH = /opt/rt3/etc +CONFIG_FILE = $(CONFIG_FILE_PATH)/RT_Config.pm +SITE_CONFIG_FILE = $(CONFIG_FILE_PATH)/RT_SiteConfig.pm -RT_VERSION = $(RT_VERSION_MAJOR).$(RT_VERSION_MINOR).$(RT_VERSION_PATCH) -TAG = rt-$(RT_VERSION_MAJOR)-$(RT_VERSION_MINOR)-$(RT_VERSION_PATCH) +RT_VERSION_MAJOR = 4 +RT_VERSION_MINOR = 0 +RT_VERSION_PATCH = 22 + +RT_VERSION = $(RT_VERSION_MAJOR).$(RT_VERSION_MINOR).$(RT_VERSION_PATCH) +TAG = rt-$(RT_VERSION_MAJOR)-$(RT_VERSION_MINOR)-$(RT_VERSION_PATCH) -BRANCH = HEAD # 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. @@ -27,106 +83,115 @@ LIBS_OWNER = root # Group that should own all of RT's libraries, generally root. LIBS_GROUP = bin +WEB_USER = freeside +WEB_GROUP = freeside + +APACHECTL = /usr/sbin/apachectl -# {{{ Files and directories # DESTDIR allows you to specify that RT be installed somewhere other than -# where it will eventually reside +# where it will eventually reside. DESTDIR _must_ have a trailing slash +# if it's defined. DESTDIR = -# RT_PATH is the name of the directory you want make to install RT in -# RT must be installed in its own directory (don't set this to /usr/local) -RT_PATH = /opt/rt2 +RT_PATH = /opt/rt3 +RT_ETC_PATH = /opt/rt3/etc +RT_BIN_PATH = /opt/rt3/bin +RT_SBIN_PATH = /opt/rt3/sbin +RT_LIB_PATH = /opt/rt3/lib +RT_MAN_PATH = /opt/rt3/man +RT_VAR_PATH = /opt/rt3/var +RT_DOC_PATH = /opt/rt3/docs +RT_FONT_PATH = /opt/rt3/share/fonts +RT_LEXICON_PATH = /opt/rt3/share/po +RT_LOCAL_PATH = /opt/rt3/local +LOCAL_PLUGIN_PATH = /opt/rt3/local/plugins +LOCAL_ETC_PATH = /opt/rt3/local/etc +LOCAL_LIB_PATH = /opt/rt3/local/lib +LOCAL_LEXICON_PATH = /opt/rt3/local/po +MASON_HTML_PATH = /var/www/freeside/rt +MASON_LOCAL_HTML_PATH = /opt/rt3/local/html +MASON_DATA_PATH = /usr/local/etc/freeside/masondata +MASON_SESSION_PATH = /opt/rt3/var/session_data +RT_LOG_PATH = /opt/rt3/var/log -# The rest of these paths are all configurable, but you probably don't want to -# put them elsewhere - -RT_LIB_PATH = $(RT_PATH)/lib -RT_ETC_PATH = $(RT_PATH)/etc -RT_CONFIG_PATH = $(RT_ETC_PATH) -RT_BIN_PATH = $(RT_PATH)/bin -RT_MAN_PATH = $(RT_PATH)/man -MASON_HTML_PATH = $(RT_PATH)/WebRT/html +# RT_READABLE_DIR_MODE is the mode of directories that are generally meant +# to be accessable +RT_READABLE_DIR_MODE = 0755 -# RT allows sites to overlay the default web ui with -# local customizations Those files can be placed in MASON_LOCAL_HTML_PATH -MASON_LOCAL_HTML_PATH = $(RT_PATH)/local/WebRT/html -# RT needs to be able to write to MASON_DATA_PATH and MASON_SESSION_PATH -# RT will create and chown these directories. Don't just set them to /tmp -MASON_DATA_PATH = $(RT_PATH)/WebRT/data -MASON_SESSION_PATH = $(RT_PATH)/WebRT/sessiondata -RT_LOG_PATH = /tmp +# RT's CLI +RT_CLI_BIN = rt +# RT's mail gateway +RT_MAILGATE_BIN = rt-mailgate +# RT's cron tool +RT_CRON_BIN = rt-crontool -# RT_READABLE_DIR_MODE is the mode of directories that are generally meant -# to be accessable -RT_READABLE_DIR_MODE = 0755 +BINARIES = $(RT_MAILGATE_BIN) \ + $(RT_CLI_BIN) \ + $(RT_CRON_BIN) -# The location of your rt configuration file -RT_CONFIG = $(RT_CONFIG_PATH)/config.pm +SYSTEM_BINARIES = rt-attributes-viewer \ + rt-clean-sessions \ + rt-dump-metadata \ + rt-email-dashboards \ + rt-email-digest \ + rt-email-group-admin \ + rt-fulltext-indexer \ + rt-preferences-viewer \ + rt-server \ + rt-session-viewer \ + rt-server.fcgi \ + rt-session-viewer \ + rt-setup-database \ + rt-setup-fulltext-index \ + rt-shredder \ + rt-test-dependencies \ + rt-validator \ + rt-validate-aliases \ + standalone_httpd -# RT_MODPERL_HANDLER is the mason handler script for mod_perl -RT_MODPERL_HANDLER = $(RT_BIN_PATH)/webmux.pl -# RT_FASTCGI_HANDLER is the mason handler script for FastCGI -# THIS HANDLER IS NOT CURRENTLY SUPPORTED -RT_FASTCGI_HANDLER = $(RT_BIN_PATH)/mason_handler.fcgi +ETC_FILES = acl.Pg \ + acl.Oracle \ + acl.mysql \ + schema.Pg \ + schema.Oracle \ + schema.mysql \ + schema.SQLite \ + initialdata -# RT_SPEEDYCGI_HANDLER is the mason handler script for SpeedyCGI -# THIS HANDLER IS NOT CURRENTLY SUPPORTED -RT_SPEEDYCGI_HANDLER = $(RT_BIN_PATH)/mason_handler.scgi -# The following are the names of the various binaries which make up RT -RT_CLI_BIN = $(RT_BIN_PATH)/rt -RT_CLI_ADMIN_BIN = $(RT_BIN_PATH)/rtadmin -RT_MAILGATE_BIN = $(RT_BIN_PATH)/rt-mailgate +WEB_HANDLER = modperl2 -# }}} -# {{{ Database setup # # DB_TYPE defines what sort of database RT trys to talk to -# "mysql" is known to work. -# "Pg" is known to work -# "Oracle" is in the early stages of working. - -DB_TYPE = mysql - -# DB_HOME is where the Database's commandline tools live. $DB_HOME/bin -# should contain the binaries themselves, e.g. if "which mysql" gives -# "/usr/local/mysql/bin/mysql", $DB_HOME should be "/usr/local/mysql" +# "mysql", "Oracle", "Pg", and "SQLite" are known to work. -DB_HOME = /usr +DB_TYPE = Pg # Set DBA to the name of a unix account with the proper permissions and -# environment to run your commandline SQL tools +# environment to run your commandline SQL sbin # Set DB_DBA to the name of a DB user with permission to create new databases -# Set DB_DBA_PASSWORD to that user's password (if you don't, you'll be prompted -# later) # For mysql, you probably want 'root' # For Pg, you probably want 'postgres' -# For oracle, you want 'system' +# For Oracle, you want 'system' -DB_DBA = root -DB_DBA_PASSWORD = - -# -# Set this to the Fully Qualified Domain Name of your database server. -# If the database is local, rather than on a remote host, using "localhost" -# will greatly enhance performance. +DB_DBA = freeside DB_HOST = localhost @@ -136,6 +201,9 @@ DB_HOST = localhost 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 @@ -149,270 +217,356 @@ 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 = rt2 - -# Set this to the name of the rt database user - -DB_RT_USER = rt_user +DB_DATABASE = freeside +DB_RT_USER = freeside +DB_RT_PASS = -# Set this to the password used by the rt database user -# *** Change This Before Installation*** -DB_RT_PASS = rt_pass -# }}} +TEST_FILES = t/*.t t/*/*.t +TEST_VERBOSE = 0 -# {{{ Web configuration - -# The user your webserver runs as. needed so that webrt can cache mason -# objectcode - -WEB_USER = www -WEB_GROUP = rt - -# }}} +RT_TEST_PARALLEL_NUM ?= 5 #################################################################### -# No user servicable parts below this line. Frob at your own risk # -#################################################################### -default: - @echo "Please read RT's readme before installing. Not doing so could" - @echo "be dangerous." +all: default -install: dirs initialize.$(DB_TYPE) upgrade insert instruct +default: + @echo "Please read RT's README before beginning your installation." -instruct: - @echo "Congratulations. RT has been installed. " - @echo "You must now configure it by editing $(RT_CONFIG)." - @echo "From here on in, you should refer to the users guide." -insert: insert-install - $(PERL) -I$(DESTDIR)/$(RT_ETC_PATH) -I$(DESTDIR)/$(RT_LIB_PATH) $(DESTDIR)/$(RT_ETC_PATH)/insertdata +instruct: + @echo "Congratulations. RT is now 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'" -upgrade: dirs config-replace upgrade-noclobber upgrade-instruct upgrade-instruct: - @echo "Congratulations. RT has been upgraded. You should now check-over" - @echo "$(RT_CONFIG) for any necessary site customization. Additionally," + @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 " $(RT_ETC_PATH)/insertdata " - @echo "where is the version of RT you're upgrading from." + @echo " make upgrade-database" -upgrade-noclobber: insert-install libs-install html-install bin-install nondestruct -nondestruct: fixperms +upgrade: testdeps config-install dirs files-install fixperms upgrade-instruct +my_with_web_handlers= $(shell $(PERL) -e 'print join " ", map "--with-$$_", grep defined && length, split /,/, "$(WEB_HANDLER)"') testdeps: - $(PERL) ./tools/testdeps -warn $(DB_TYPE) - -fixdeps: - $(PERL) ./tools/testdeps -fix $(DB_TYPE) + $(PERL) ./sbin/rt-test-dependencies --verbose --with-$(DB_TYPE) $(my_with_web_handlers) +depends: fixdeps +fixdeps: + $(PERL) ./sbin/rt-test-dependencies --verbose --install --with-$(DB_TYPE) $(my_with_web_handlers) -all: - @echo "Read the readme." +#}}} fixperms: # Make the libraries readable - chmod -R $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_PATH) - chown -R $(LIBS_OWNER) $(DESTDIR)/$(RT_LIB_PATH) - chgrp -R $(LIBS_GROUP) $(DESTDIR)/$(RT_LIB_PATH) - - chown -R $(BIN_OWNER) $(DESTDIR)/$(RT_BIN_PATH) - chgrp -R $(RTGROUP) $(DESTDIR)/$(RT_BIN_PATH) + 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 $(RT_READABLE_DIR_MODE) $(DESTDIR)$(RT_BIN_PATH) - chmod 0755 $(DESTDIR)/$(RT_ETC_PATH) - chmod 0500 $(DESTDIR)/$(RT_ETC_PATH)/* + chmod 0755 $(DESTDIR)$(RT_ETC_PATH) + cd $(DESTDIR)$(RT_ETC_PATH) && chmod 0400 $(ETC_FILES) || true #TODO: the config file should probably be able to have its - # owner set seperately from the binaries. - chown -R $(BIN_OWNER) $(DESTDIR)/$(RT_ETC_PATH) - chgrp -R $(RTGROUP) $(DESTDIR)/$(RT_ETC_PATH) - - chmod 0550 $(DESTDIR)/$(RT_CONFIG) - - # Make the interfaces executable and setgid rt - chown $(BIN_OWNER) $(DESTDIR)/$(RT_MAILGATE_BIN) \ - $(DESTDIR)/$(RT_FASTCGI_HANDLER) \ - $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \ - $(DESTDIR)/$(RT_CLI_BIN) \ - $(DESTDIR)/$(RT_CLI_ADMIN_BIN) - - chgrp $(RTGROUP) $(DESTDIR)/$(RT_MAILGATE_BIN) \ - $(DESTDIR)/$(RT_FASTCGI_HANDLER) \ - $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \ - $(DESTDIR)/$(RT_CLI_BIN) \ - $(DESTDIR)/$(RT_CLI_ADMIN_BIN) - - chmod 0755 $(DESTDIR)/$(RT_MAILGATE_BIN) \ - $(DESTDIR)/$(RT_FASTCGI_HANDLER) \ - $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \ - $(DESTDIR)/$(RT_CLI_BIN) \ - $(DESTDIR)/$(RT_CLI_ADMIN_BIN) - - chmod g+s $(DESTDIR)/$(RT_MAILGATE_BIN) \ - $(DESTDIR)/$(RT_FASTCGI_HANDLER) \ - $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \ - $(DESTDIR)/$(RT_CLI_BIN) \ - $(DESTDIR)/$(RT_CLI_ADMIN_BIN) + # owner set separately from the binaries. + chown -R $(BIN_OWNER) $(DESTDIR)$(RT_ETC_PATH) + chgrp -R $(RTGROUP) $(DESTDIR)$(RT_ETC_PATH) + + chmod 0440 $(DESTDIR)$(CONFIG_FILE) + chmod 0640 $(DESTDIR)$(SITE_CONFIG_FILE) + # Make this externally readable + chmod 0440 $(DESTDIR)$(RT_ETC_PATH)/initialdata + + # Make the system binaries + cd $(DESTDIR)$(RT_BIN_PATH) && ( chmod 0755 $(BINARIES) ; chown $(BIN_OWNER) $(BINARIES); chgrp $(RTGROUP) $(BINARIES)) + + # Make the system binaries executable also + cd $(DESTDIR)$(RT_SBIN_PATH) && ( chmod 0755 $(SYSTEM_BINARIES) ; chown $(BIN_OWNER) $(SYSTEM_BINARIES); chgrp $(RTGROUP) $(SYSTEM_BINARIES)) + + # Make upgrade scripts executable if they are in the source. + # + # Note that we use the deprecated (by GNU/POSIX find) -perm +0NNN syntax + # instead of -perm /0NNN since BSD find doesn't support the latter. + ( cd etc/upgrade && find . -type f -not -name '*.in' -perm +0111 -print ) | while read file ; do \ + chmod a+x "$(DESTDIR)$(RT_ETC_PATH)/upgrade/$$file" ; \ + done # Make the web ui readable by all. - chmod -R u+rwX,go-w,go+rX $(DESTDIR)/$(MASON_HTML_PATH) \ - $(DESTDIR)/$(MASON_LOCAL_HTML_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) + chmod -R u+rwX,go-w,go+rX $(DESTDIR)$(MASON_HTML_PATH) \ + $(DESTDIR)$(MASON_LOCAL_HTML_PATH) \ + $(DESTDIR)$(RT_LEXICON_PATH) \ + $(DESTDIR)$(LOCAL_LEXICON_PATH) + chown -R $(LIBS_OWNER) $(DESTDIR)$(MASON_HTML_PATH) \ + $(DESTDIR)$(MASON_LOCAL_HTML_PATH) \ + $(DESTDIR)$(RT_LEXICON_PATH) \ + $(DESTDIR)$(LOCAL_LEXICON_PATH) + chgrp -R $(LIBS_GROUP) $(DESTDIR)$(MASON_HTML_PATH) \ + $(DESTDIR)$(MASON_LOCAL_HTML_PATH) \ + $(DESTDIR)$(RT_LEXICON_PATH) \ + $(DESTDIR)$(LOCAL_LEXICON_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: - mkdir -p $(DESTDIR)/$(RT_BIN_PATH) - mkdir -p $(DESTDIR)/$(MASON_DATA_PATH) - mkdir -p $(DESTDIR)/$(MASON_SESSION_PATH) - mkdir -p $(DESTDIR)/$(RT_ETC_PATH) - mkdir -p $(DESTDIR)/$(RT_LIB_PATH) - mkdir -p $(DESTDIR)/$(MASON_HTML_PATH) - mkdir -p $(DESTDIR)/$(MASON_LOCAL_HTML_PATH) + 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) -libs-install: - [ -d $(DESTDIR)/$(RT_LIB_PATH) ] || mkdir $(DESTDIR)/$(RT_LIB_PATH) - chown -R $(LIBS_OWNER) $(DESTDIR)/$(RT_LIB_PATH) - chgrp -R $(LIBS_GROUP) $(DESTDIR)/$(RT_LIB_PATH) - chmod -R $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_LIB_PATH) - ( cd ./lib; \ - $(PERL) Makefile.PL INSTALLSITELIB=$(DESTDIR)/$(RT_LIB_PATH) \ - INSTALLMAN1DIR=$(DESTDIR)/$(RT_MAN_PATH)/man1 \ - INSTALLMAN3DIR=$(DESTDIR)/$(RT_MAN_PATH)/man3 \ - && make \ - && make test \ - && $(PERL) -p -i -e " s'!!RT_VERSION!!'$(RT_VERSION)'g;" blib/lib/RT.pm ;\ - make install \ - INSTALLSITEMAN1DIR=$(DESTDIR)/$(RT_MAN_PATH)/man1 \ - INSTALLSITEMAN3DIR=$(DESTDIR)/$(RT_MAN_PATH)/man3 \ - ) - -html-install: - cp -rp ./webrt/* $(DESTDIR)/$(MASON_HTML_PATH) +dirs: + $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_LOG_PATH) + $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_FONT_PATH) + $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_LEXICON_PATH) + $(INSTALL) -m 0770 -d $(DESTDIR)$(MASON_DATA_PATH) + $(INSTALL) -m 0770 -d $(DESTDIR)$(MASON_DATA_PATH)/cache + $(INSTALL) -m 0770 -d $(DESTDIR)$(MASON_DATA_PATH)/etc + $(INSTALL) -m 0770 -d $(DESTDIR)$(MASON_DATA_PATH)/obj + $(INSTALL) -m 0770 -d $(DESTDIR)$(MASON_SESSION_PATH) + $(INSTALL) -m 0755 -d $(DESTDIR)$(MASON_HTML_PATH) + $(INSTALL) -m 0755 -d $(DESTDIR)$(MASON_LOCAL_HTML_PATH) + $(INSTALL) -m 0755 -d $(DESTDIR)$(LOCAL_ETC_PATH) + $(INSTALL) -m 0755 -d $(DESTDIR)$(LOCAL_LIB_PATH) + $(INSTALL) -m 0755 -d $(DESTDIR)$(LOCAL_PLUGIN_PATH) + $(INSTALL) -m 0755 -d $(DESTDIR)$(LOCAL_LEXICON_PATH) +install: testdeps config-install dirs files-install fixperms instruct +files-install: libs-install etc-install config-install bin-install sbin-install html-install doc-install font-install po-install -genschema: - $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DATABASE)' generate +config-install: + $(INSTALL) -m 0755 -o $(BIN_OWNER) -g $(RTGROUP) -d $(DESTDIR)$(CONFIG_FILE_PATH) + -$(INSTALL) -m 0440 -o $(BIN_OWNER) -g $(RTGROUP) etc/RT_Config.pm $(DESTDIR)$(CONFIG_FILE) + [ -f $(DESTDIR)$(SITE_CONFIG_FILE) ] || $(INSTALL) -m 0640 -o $(BIN_OWNER) -g $(RTGROUP) etc/RT_SiteConfig.pm $(DESTDIR)$(SITE_CONFIG_FILE) + @echo "Installed configuration. About to install RT in $(RT_PATH)" +test: + $(PERL) "-MExtUtils::Command::MM" -e "test_harness($(TEST_VERBOSE), 'lib')" $(TEST_FILES) -initialize.Pg: createdb initdb.dba acls +parallel-test: test-parallel -initialize.mysql: createdb acls initdb.rtuser +test-parallel: + 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 )' -initialize.Oracle: acls initdb.rtuser +regression-reset-db: force-dropdb + $(PERL) -I$(LOCAL_LIB_PATH) -I$(RT_LIB_PATH) sbin/rt-setup-database --action init --dba-password '' -acls: - cp etc/acl.$(DB_TYPE) '$(DESTDIR)/$(RT_ETC_PATH)/acl.$(DB_TYPE)' - $(PERL) -p -i -e " s'!!DB_TYPE!!'"$(DB_TYPE)"'g;\ - s'!!DB_HOST!!'"$(DB_HOST)"'g;\ - s'!!DB_RT_PASS!!'"$(DB_RT_PASS)"'g;\ - s'!!DB_RT_HOST!!'"$(DB_RT_HOST)"'g;\ - s'!!DB_RT_USER!!'"$(DB_RT_USER)"'g;\ - s'!!DB_DATABASE!!'"$(DB_DATABASE)"'g;" $(DESTDIR)/$(RT_ETC_PATH)/acl.$(DB_TYPE) - bin/initacls.$(DB_TYPE) '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DBA_PASSWORD)' '$(DB_DATABASE)' '$(DESTDIR)/$(RT_ETC_PATH)/acl.$(DB_TYPE)' +initdb :: initialize-database +initialize-database: + $(PERL) -I$(LOCAL_LIB_PATH) -I$(RT_LIB_PATH) sbin/rt-setup-database --action init --prompt-for-dba-password +upgrade-database: + $(PERL) -I$(LOCAL_LIB_PATH) -I$(RT_LIB_PATH) sbin/rt-setup-database --action upgrade --prompt-for-dba-password dropdb: - $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DATABASE)' drop + $(PERL) -I$(LOCAL_LIB_PATH) -I$(RT_LIB_PATH) sbin/rt-setup-database --action drop --prompt-for-dba-password +force-dropdb: + $(PERL) -I$(LOCAL_LIB_PATH) -I$(RT_LIB_PATH) sbin/rt-setup-database --action drop --dba-password '' --force -createdb: - $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DATABASE)' create -initdb.dba: - $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DATABASE)' insert +critic: + perlcritic --quiet sbin bin lib -initdb.rtuser: - $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_RT_USER)' '$(DB_DATABASE)' insert +libs-install: + [ -d $(DESTDIR)$(RT_LIB_PATH) ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_LIB_PATH) + -( cd lib && find . -type d -print ) | while read dir ; do \ + $(INSTALL) -m 0755 -d "$(DESTDIR)$(RT_LIB_PATH)/$$dir" ; \ + done + -( cd lib && find . -type f -print ) | while read file ; do \ + $(INSTALL) -m 0644 "lib/$$file" "$(DESTDIR)$(RT_LIB_PATH)/$$file" ; \ + done +html-install: + [ -d $(DESTDIR)$(MASON_HTML_PATH) ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(MASON_HTML_PATH) + -( cd share/html && find . -type d -print ) | while read dir ; do \ + $(INSTALL) -m 0755 -d "$(DESTDIR)$(MASON_HTML_PATH)/$$dir" ; \ + done + -( cd share/html && find . -type f -print ) | while read file ; do \ + $(INSTALL) -m 0644 "share/html/$$file" "$(DESTDIR)$(MASON_HTML_PATH)/$$file" ; \ + done + +font-install: + [ -d $(DESTDIR)$(RT_FONT_PATH) ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_FONT_PATH) + -( cd share/fonts && find . -type f -print ) | while read file ; do \ + $(INSTALL) -m 0644 "share/fonts/$$file" "$(DESTDIR)$(RT_FONT_PATH)/$$file" ; \ + done + + +po-install: + [ -d $(DESTDIR)$(RT_LEXICON_PATH) ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_LEXICON_PATH) + -( cd share/po && find . -type f -print ) | while read file ; do \ + $(INSTALL) -m 0644 "share/po/$$file" "$(DESTDIR)$(RT_LEXICON_PATH)/$$file" ; \ + done + + + +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) ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_DOC_PATH) + -( cd docs && find . -type d -print ) | while read dir ; do \ + $(INSTALL) -m 0755 -d "$(DESTDIR)$(RT_DOC_PATH)/$$dir" ; \ + done + -( cd docs && find . -type f -print ) | while read file ; do \ + $(INSTALL) -m 0644 "docs/$$file" "$(DESTDIR)$(RT_DOC_PATH)/$$file" ; \ + done + -$(INSTALL) -m 0644 ./README $(DESTDIR)$(RT_DOC_PATH)/ + + +etc-install: + [ -d $(DESTDIR)$(RT_ETC_PATH) ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_ETC_PATH) + for file in $(ETC_FILES) ; do \ + $(INSTALL) -m 0644 "etc/$$file" "$(DESTDIR)$(RT_ETC_PATH)/" ; \ + done + [ -d $(DESTDIR)$(RT_ETC_PATH)/upgrade ] || $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_ETC_PATH)/upgrade + -( cd etc/upgrade && find . -type d -print ) | while read dir ; do \ + $(INSTALL) -m 0755 -d "$(DESTDIR)$(RT_ETC_PATH)/upgrade/$$dir" ; \ + done + -( cd etc/upgrade && find . -type f -not -name '*.in' -print ) | while read file ; do \ + $(INSTALL) -m 0644 "etc/upgrade/$$file" "$(DESTDIR)$(RT_ETC_PATH)/upgrade/$$file" ; \ + done + + +sbin-install: + $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_SBIN_PATH) + for file in $(SYSTEM_BINARIES) ; do \ + $(INSTALL) -o $(BIN_OWNER) -g $(RTGROUP) -m 0755 "sbin/$$file" "$(DESTDIR)$(RT_SBIN_PATH)/" ; \ + done -insert-install: - cp -rp ./tools/insertdata \ - $(DESTDIR)/$(RT_ETC_PATH) - $(PERL) -p -i -e " s'!!RT_ETC_PATH!!'$(RT_ETC_PATH)'g;\ - s'!!RT_LIB_PATH!!'$(RT_LIB_PATH)'g;"\ - $(DESTDIR)/$(RT_ETC_PATH)/insertdata bin-install: - cp -p ./bin/webmux.pl $(DESTDIR)/$(RT_MODPERL_HANDLER) - cp -p ./bin/rt-mailgate $(DESTDIR)/$(RT_MAILGATE_BIN) - cp -p ./bin/rtadmin $(DESTDIR)/$(RT_CLI_ADMIN_BIN) - cp -p ./bin/rt $(DESTDIR)/$(RT_CLI_BIN) - cp -p ./bin/mason_handler.fcgi $(DESTDIR)/$(RT_FASTCGI_HANDLER) - cp -p ./bin/mason_handler.scgi $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) - - $(PERL) -p -i -e "s'!!RT_PATH!!'"$(RT_PATH)"'g;\ - s'!!PERL!!'"$(PERL)"'g;\ - s'!!RT_VERSION!!'"$(RT_VERSION)"'g;\ - s'!!RT_ETC_PATH!!'"$(RT_CONFIG_PATH)"'g;\ - s'!!RT_LIB_PATH!!'"$(RT_LIB_PATH)"'g;"\ - $(DESTDIR)/$(RT_MODPERL_HANDLER) \ - $(DESTDIR)/$(RT_FASTCGI_HANDLER) \ - $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \ - $(DESTDIR)/$(RT_CLI_BIN) \ - $(DESTDIR)/$(RT_CLI_ADMIN_BIN) \ - $(DESTDIR)/$(RT_MAILGATE_BIN) - - -config-replace: - -[ -f $(DESTDIR)/$(RT_CONFIG) ] && \ - mv $(DESTDIR)/$(RT_CONFIG) $(DESTDIR)/$(RT_CONFIG).old && \ - chmod 000 $(DESTDIR)/$(RT_CONFIG).old - cp -rp ./etc/config.pm $(DESTDIR)/$(RT_CONFIG) - $(PERL) -p -i -e "\ - s'!!DB_TYPE!!'"$(DB_TYPE)"'g;\ - s'!!DB_HOST!!'"$(DB_HOST)"'g;\ - s'!!DB_PORT!!'"$(DB_PORT)"'g;\ - s'!!DB_RT_PASS!!'"$(DB_RT_PASS)"'g;\ - s'!!DB_RT_USER!!'"$(DB_RT_USER)"'g;\ - s'!!DB_DATABASE!!'"$(DB_DATABASE)"'g;\ - s'!!MASON_HTML_PATH!!'"$(MASON_HTML_PATH)"'g;\ - s'!!MASON_LOCAL_HTML_PATH!!'"$(MASON_LOCAL_HTML_PATH)"'g;\ - s'!!MASON_SESSION_PATH!!'"$(MASON_SESSION_PATH)"'g;\ - s'!!MASON_DATA_PATH!!'"$(MASON_DATA_PATH)"'g;\ - s'!!RT_LOG_PATH!!'"$(RT_LOG_PATH)"'g;\ - s'!!RT_VERSION!!'"$(RT_VERSION)"'g;\ - " $(DESTDIR)/$(RT_CONFIG) - - -commit: - cvs commit - -predist: commit - cvs tag -r $(BRANCH) -F $(TAG) - rm -rf /tmp/$(TAG) - cvs co -d /tmp/$(TAG) -r $(TAG) rt - cd /tmp/$(TAG); chmod 600 Makefile; /usr/local/bin/cvs2cl.pl \ - --no-wrap --separate-header \ - --window 120 - cd /tmp; tar czvf /home/ftp/pub/rt/devel/$(TAG).tar.gz $(TAG)/ - chmod 644 /home/ftp/pub/rt/devel/$(TAG).tar.gz - -dist: commit predist - rm -rf /home/ftp/pub/rt/devel/rt.tar.gz - ln -s ./$(TAG).tar.gz /home/ftp/pub/rt/devel/rt.tar.gz - - -rpm: - (cd ..; tar czvf /usr/src/redhat/SOURCES/rt.tar.gz rt) - rpm -ba etc/rt.spec + $(INSTALL) -m 0755 -d $(DESTDIR)$(RT_BIN_PATH) + for file in $(BINARIES) ; do \ + $(INSTALL) -o $(BIN_OWNER) -g $(RTGROUP) -m 0755 "bin/$$file" "$(DESTDIR)$(RT_BIN_PATH)/" ; \ + done + + + +regenerate-catalogs: + $(PERL) devel/tools/extract-message-catalog + +license-tag: + $(PERL) devel/tools/license_tag + +factory: initialize-database + cd lib; $(PERL) ../devel/tools/factory $(DB_DATABASE) RT + +start-httpd: + $(PERL) sbin/standalone_httpd & + +start-server: + $(PERL) sbin/rt-server & + +apachectl: + $(APACHECTL) stop + sleep 10 + $(APACHECTL) start + sleep 5 + +SNAPSHOT=$(shell git describe --tags) +THIRD_PARTY=devel/third-party/ +snapshot: build-snapshot build-third-party clearsign-snapshot clearsign-third-party snapshot-shasums + +build-snapshot: + git archive --prefix "$(SNAPSHOT)/" HEAD | tar -xf - + ( cd $(SNAPSHOT) && \ + echo "$(SNAPSHOT)" > .tag && \ + autoconf && \ + INSTALL=./install-sh PERL=/usr/bin/perl ./configure \ + --with-db-type=SQLite \ + --enable-layout=relative \ + --with-web-handler=standalone && \ + rm -rf autom4te.cache \ + config.status config.log config.pld \ + ) + tar -czf "$(SNAPSHOT).tar.gz" "$(SNAPSHOT)/" + rm -fr "$(SNAPSHOT)/" + +clearsign-snapshot: + gpg --no-armor --detach-sign "$(SNAPSHOT).tar.gz" + +build-third-party: + git archive --prefix "$(SNAPSHOT)/$(THIRD_PARTY)" HEAD:$(THIRD_PARTY) \ + | gzip > "$(SNAPSHOT)-third-party-source.tar.gz" + rm -rf "$(SNAPSHOT)/$(THIRD_PARTY)" + +clearsign-third-party: + gpg --no-armor --detach-sign "$(SNAPSHOT)-third-party-source.tar.gz" + +snapshot-shasums: + sha1sum $(SNAPSHOT)*.tar.gz* + +vessel-import: build-snapshot + [ -d $(VESSEL) ] || (echo "VESSEL isn't a path to your shipwright vessel" && exit -1) + cp $(VESSEL)/scripts/RT/build.pl /tmp/build.pl + ./sbin/rt-test-dependencies --with-standalone --with-fastcgi --with-sqlite --list > /tmp/rt.yml + shipwright import file:$(SNAPSHOT).tar.gz \ + --require-yml /tmp/rt.yml \ + --build-script /tmp/build.pl \ + --name RT \ + --repository fs:$(VESSEL) \ + --log-level=info \ + --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 + mv $(VESSEL)/scripts/RT/build $(VESSEL)/scripts/RT/build.pl + +JSMIN_URL = http://download.bestpractical.com/mirror/jsmin-2011-01-22.c +JSMIN_SHA = 8a6b3b980a52c028eb73aee4a82ebe060c1ee854 + +jsmin: jsmin-checkcc jsmin-fetch jsmin-verify jsmin-confirm jsmin-build jsmin-install + @echo "" + @echo "To configure RT to use jsmin, add the following line to $(DESTDIR)$(RT_ETC_PATH)/RT_SiteConfig.pm:" + @echo "" + @echo " Set(\$$JSMinPath, '$(DESTDIR)$(RT_BIN_PATH)/jsmin');" + @echo "" + +jsmin-checkcc: + @[ -n "$(CC)" ] || (echo "You don't appear to have a C compiler, please set CC and re-run configure" && exit 1) + +jsmin-confirm: + @echo "jsmin is distributed under a slightly unusual license and can't be shipped" + @echo "with RT. Before configuring RT to use jsmin, please read jsmin's license" + @echo "below:" + @echo "" + @$(PERL) -pe 'print && exit if /^\*\// or /^#include/' jsmin.c + @echo "" + @echo "Press Enter to accept the license, or Ctrl-C to stop now." + @$(PERL) -e '' + +jsmin-fetch: + @echo "" + @echo "Downloading jsmin.c from $(JSMIN_URL)" + @echo "" + @$(PERL) -MLWP::Simple -e 'exit not is_success(getstore("$(JSMIN_URL)", "jsmin.c"))' \ + || (echo "Failed to download $(JSMIN_URL)" && exit 1) + +jsmin-verify: + @$(PERL) -MDigest::SHA -e \ + 'exit not Digest::SHA->new(1)->addfile("jsmin.c")->hexdigest eq "$(JSMIN_SHA)"' \ + || (echo "Verification of jsmin.c failed! Possible man in the middle?" && exit 1) + +jsmin-build: + $(CC) -o jsmin jsmin.c + +jsmin-install: + $(INSTALL) -o $(BIN_OWNER) -g $(RTGROUP) -m 0755 "jsmin" "$(DESTDIR)$(RT_BIN_PATH)/"