tyop
[freeside.git] / rt / Makefile
index 0895874..fe01b71 100644 (file)
@@ -1,46 +1,18 @@
-# BEGIN LICENSE BLOCK
-# 
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-# 
-# (Except where explictly superceded by other copyright notices)
-# 
-# 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.
-# 
-# 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.
-# 
-# 
-# END LICENSE BLOCK
-#
-# DO NOT HAND-EDIT the file named 'Makefile'. This file is autogenerated.
-# Have a look at "configure" and "Makefile.in" instead
-#
-
+# $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 <jesse@bestpractical.com>
+# It is distributed under the terms of the GNU General Public License, version 2
 
 PERL                   =       /usr/bin/perl
 
-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_MAJOR       =       3
+RT_VERSION_MAJOR       =       2
 RT_VERSION_MINOR       =       0
-RT_VERSION_PATCH       =       9
+RT_VERSION_PATCH       =       14
+
 
 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
@@ -55,8 +27,7 @@ LIBS_OWNER            =       root
 # Group that should own all of RT's libraries, generally root.
 LIBS_GROUP             =       bin
 
-WEB_USER               =       www
-WEB_GROUP              =       www
+
 
 # {{{ Files and directories 
 
@@ -66,22 +37,33 @@ WEB_GROUP           =       www
 DESTDIR                        =       
 
 
-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/share/doc
-RT_LOCAL_PATH          =       /opt/rt3/local
-LOCAL_ETC_PATH         =       /opt/rt3/local/etc
-LOCAL_LEXICON_PATH     =       /opt/rt3/local/po
-MASON_HTML_PATH                =       /opt/rt3/share/html
-MASON_LOCAL_HTML_PATH  =       /opt/rt3/local/html
-MASON_DATA_PATH                =       /opt/rt3/var/mason_data
-MASON_SESSION_PATH     =       /opt/rt3/var/session_data
-RT_LOG_PATH        =       /opt/rt3/var/log
+# 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
+
+# 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 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_READABLE_DIR_MODE is the mode of directories that are generally meant
 # to be accessable
@@ -89,34 +71,25 @@ RT_READABLE_DIR_MODE        =       0755
 
 
 
-
-# {{{ all these define the places that RT's binaries should get installed
+# The location of your rt configuration file
+RT_CONFIG              =       $(RT_CONFIG_PATH)/config.pm
 
 # 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
-# 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
-
-# }}}
 
-SETGID_BINARIES                =       $(DESTDIR)/$(RT_FASTCGI_HANDLER) \
-                               $(DESTDIR)/$(RT_WIN32_FASTCGI_HANDLER)
+# 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
 
-BINARIES               =       $(DESTDIR)/$(RT_MODPERL_HANDLER) \
-                               $(DESTDIR)/$(RT_MAILGATE_BIN) \
-                               $(DESTDIR)/$(RT_CLI_BIN) \
-                               $(DESTDIR)/$(RT_CRON_BIN) \
-                               $(SETGID_BINARIES)
-SYSTEM_BINARIES                =       $(DESTDIR)/$(RT_SBIN_PATH)/
+# 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
 
 # }}}
 
@@ -126,21 +99,34 @@ 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
+# "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"
+
+DB_HOME                        = /usr
+
 # Set DBA to the name of a unix account with the proper permissions and 
-# environment to run your commandline SQL sbin
+# environment to run your commandline SQL tools
 
 # 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 Informix, you want 'informix'
+# 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_HOST                        =       localhost
 
@@ -150,9 +136,6 @@ 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 
@@ -166,72 +149,81 @@ 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_DATABASE            =       rt2
+
+# Set this to the name of the rt database user
+
 DB_RT_USER             =       rt_user
+
+# Set this to the password used by the rt database user
+# *** Change This Before Installation***
+
 DB_RT_PASS             =       rt_pass
 
 # }}}
 
+# {{{ Web configuration 
 
-####################################################################
+# The user your webserver runs as. needed so that webrt can cache mason
+# objectcode
 
-all: default
+WEB_USER               =       www
+WEB_GROUP              =       rt
+
+# }}}
+
+
+####################################################################
+# 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."
 
-
+install: dirs initialize.$(DB_TYPE) upgrade insert instruct
 
 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 before continuing."
-       @echo " Not doing so could be very dangerous)"
-       @echo ""
-       @echo "After that, you need to initialize RT's database by running" 
-       @echo " 'make initialize-database'"
+       @echo "You must now configure it by editing $(RT_CONFIG)."
+       @echo "From here on in, you should refer to the users guide."
 
-#      @echo " or by executing "       
-#      @echo " '$(RT_SBIN_PATH)/rt-setup-database --action init \ "
-#      @echo "     --dba $(DB_DBA) --prompt-for-dba-password'"
 
+insert: insert-install
+       $(PERL) -I$(DESTDIR)/$(RT_ETC_PATH) -I$(DESTDIR)/$(RT_LIB_PATH) $(DESTDIR)/$(RT_ETC_PATH)/insertdata
 
+upgrade: dirs config-replace upgrade-noclobber  upgrade-instruct
 
 upgrade-instruct: 
        @echo "Congratulations. RT has been upgraded. You should now check-over"
-       @echo "$(CONFIG_FILE) for any necessary site customization. Additionally,"
+       @echo "$(RT_CONFIG) 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 "your previously installed RT version, run:"
-       @echo "    $(RT_SBIN_PATH)/rt-setup-database --action insert --datafile etc/upgrade/<version>"
-
+       @echo "    $(RT_ETC_PATH)/insertdata <version>"
+       @echo "where <version> is the version of RT you're upgrading from."
 
-upgrade: config-install dirs files-install fixperms upgrade-instruct
+upgrade-noclobber: insert-install libs-install html-install bin-install nondestruct
 
-upgrade-noclobber: config-install libs-install html-install bin-install local-install doc-install fixperms
+nondestruct: fixperms
 
-
-# {{{ dependencies
 testdeps:
-       $(PERL) ./sbin/rt-test-dependencies --with-$(DB_TYPE)
+       $(PERL) ./tools/testdeps -warn $(DB_TYPE)
 
 fixdeps:
-       $(PERL) ./sbin/rt-test-dependencies --install --with-$(DB_TYPE)
+       $(PERL) ./tools/testdeps -fix $(DB_TYPE)
+
+
 
-#}}}
+all:
+       @echo "Read the readme."
 
-# {{{ fixperms
 fixperms:
        # Make the libraries readable
-       chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_PATH)
+       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)
-       chmod -R  u+rwX,go-w,go+rX      $(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_BIN_PATH)
@@ -245,19 +237,36 @@ fixperms:
        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)
+       chmod 0550 $(DESTDIR)/$(RT_CONFIG)
 
        # Make the interfaces executable and setgid rt
-       chown $(BIN_OWNER) $(BINARIES)
-       chgrp $(RTGROUP) $(BINARIES)
-       chmod 0755  $(BINARIES)
-       chmod g+s $(SETGID_BINARIES)
+       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)
 
        # 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)
+                                       $(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) \
@@ -270,221 +279,140 @@ fixperms:
                                $(DESTDIR)/$(MASON_SESSION_PATH)
        chgrp -R $(WEB_GROUP)   $(DESTDIR)/$(MASON_DATA_PATH) \
                                $(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)
+       mkdir -p $(DESTDIR)/$(RT_BIN_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)/$(RT_ETC_PATH)
+       mkdir -p $(DESTDIR)/$(RT_LIB_PATH)
        mkdir -p $(DESTDIR)/$(MASON_HTML_PATH)
        mkdir -p $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
-       mkdir -p $(DESTDIR)/$(LOCAL_ETC_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-nosetgid-quiet: regression-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-nosetgid: regression-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
-       $(PERL) lib/t/02regression.t
-
-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 ''
-       $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action init --dba $(DB_DBA) --dba-password ''
-
-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 $(DESTDIR)/$(RT_LIB_PATH)
-       -cp -rp lib/* $(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
 html-install:
-       [ -d $(DESTDIR)/$(MASON_HTML_PATH) ] || mkdir $(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 $(DESTDIR)/$(RT_DOC_PATH)
-       -cp -rp ./README $(DESTDIR)/$(RT_DOC_PATH)
-# }}}
+       cp -rp ./webrt/* $(DESTDIR)/$(MASON_HTML_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-setup-database \
-               sbin/rt-test-dependencies
-       -cp -rp \
-               sbin/rt-setup-database \
-               sbin/rt-test-dependencies \
-               $(DESTDIR)/$(RT_SBIN_PATH)
-
-# }}}
 
-# {{{ bin-install
+genschema:
+       $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DATABASE)' generate
 
-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/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)
-# }}}
+initialize.Pg: createdb initdb.dba acls 
 
-# {{{ Best Practical Build targets -- no user servicable parts inside
+initialize.mysql: createdb acls initdb.rtuser
 
+initialize.Oracle: acls initdb.rtuser
 
-POD2TEST_EXE = sbin/extract_pod_tests
+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)' 
 
-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)
 
 
+dropdb: 
+       $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DATABASE)' drop
 
-regenerate-catalogs:
-       $(PERL) sbin/extract-message-catalog
 
-license-tag:
-       $(PERL) sbin/license_tag
+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
 
-factory: initialize-database
-       cd lib; $(PERL) ../sbin/factory  $(DB_DATABASE) RT
+initdb.rtuser:
+       $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_RT_USER)' '$(DB_DATABASE)' insert
 
-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
+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
 
-tag-and-release-baseline:
-       aegis -cp -ind Makefile -output /tmp/Makefile.tagandrelease; \
-       $(MAKE) -f /tmp/Makefile.tagandrelease tag-and-release-never-by-hand
+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)
 
 
-# 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
+commit:
+       cvs commit
 
-tag-and-release-never-by-hand:
-       aegis --delta-name $(TAG)
+predist: commit
+       cvs tag -r $(BRANCH) -F $(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
-
+       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
 
-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
-
-
-apachectl:
-       apachectl stop
-       sleep 3
-       apachectl start
-# }}}