pkgsrc/devel/rt-mysql/patches/patch-aa
abs 5b1cad1352 Update rt-mysql and rt-pgsql to rt-mysql-2.0.15 and rt-pgsql-2.0.15
Various changes from 2.0.13, most obvious of which appears to be that
RT no longer causes problems with the HTML::Mason in pkgsrc.
Also add a note as to how to get an Apache configuration which does not
ignore POSTs. Still some configuration issues, but we are now _nearly_
working without some small hacking, as opposed to completely broken.
2004-02-04 22:19:09 +00:00

391 lines
13 KiB
Text

$NetBSD: patch-aa,v 1.2 2004/02/04 22:19:10 abs Exp $
--- Makefile.orig Fri Oct 4 19:48:46 2002
+++ Makefile
@@ -2,7 +2,7 @@
# 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
+PERL = @PREFIX@/bin/perl
RT_VERSION_MAJOR = 2
RT_VERSION_MINOR = 0
@@ -15,7 +15,7 @@ TAG = rt-$(RT_VERSION_MAJOR)-$(RT_VE
BRANCH = HEAD
# This is the group that all of the installed files will be chgrp'ed to.
-RTGROUP = rt
+RTGROUP = @RT_GROUP@
# User which should own rt binaries.
@@ -40,7 +40,7 @@ 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 = @RT_PATH@
# The rest of these paths are all configurable, but you probably don't want to
# put them elsewhere
@@ -49,6 +49,7 @@ RT_LIB_PATH = $(RT_PATH)/lib
RT_ETC_PATH = $(RT_PATH)/etc
RT_CONFIG_PATH = $(RT_ETC_PATH)
RT_BIN_PATH = $(RT_PATH)/bin
+WRAPPED_RT_BIN_PATH = $(RT_BIN_PATH)/real
RT_MAN_PATH = $(RT_PATH)/man
MASON_HTML_PATH = $(RT_PATH)/WebRT/html
@@ -60,10 +61,10 @@ MASON_LOCAL_HTML_PATH = $(RT_PATH)/local
# 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
+MASON_DATA_PATH = @RT_DATA_PATH@
+MASON_SESSION_PATH = @RT_SESSION_PATH@
-RT_LOG_PATH = /tmp
+RT_LOG_PATH = @RT_LOG_PATH@
# RT_READABLE_DIR_MODE is the mode of directories that are generally meant
# to be accessable
@@ -79,17 +80,22 @@ RT_MODPERL_HANDLER = $(RT_BIN_PATH)/webm
# 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_FASTCGI_HANDLER = $(WRAPPED_RT_BIN_PATH)/mason_handler.fcgi
+RT_FASTCGI_HANDLER_WRAPPER= $(RT_BIN_PATH)/mason_handler.fcgi
# 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
+RT_SPEEDYCGI_HANDLER = $(WRAPPED_RT_BIN_PATH)/mason_handler.scgi
+RT_SPEEDYCGI_HANDLER_WRAPPER= $(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
+RT_CLI_BIN = $(WRAPPED_RT_BIN_PATH)/rt
+RT_CLI_ADMIN_BIN = $(WRAPPED_RT_BIN_PATH)/rtadmin
+RT_MAILGATE_BIN = $(WRAPPED_RT_BIN_PATH)/rt-mailgate
+RT_CLI_BIN_WRAPPER = $(RT_BIN_PATH)/rt
+RT_CLI_ADMIN_BIN_WRAPPER= $(RT_BIN_PATH)/rtadmin
+RT_MAILGATE_BIN_WRAPPER = $(RT_BIN_PATH)/rt-mailgate
# }}}
@@ -101,13 +107,13 @@ RT_MAILGATE_BIN = $(RT_BIN_PATH)/rt-mai
# "Pg" is known to work
# "Oracle" is in the early stages of working.
-DB_TYPE = mysql
+DB_TYPE = @RT_DB_TYPE@
# 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
+DB_HOME = @PREFIX@
# Set DBA to the name of a unix account with the proper permissions and
# environment to run your commandline SQL tools
@@ -120,21 +126,21 @@ DB_HOME = /usr
# For Pg, you probably want 'postgres'
# For oracle, you want 'system'
-DB_DBA = root
-DB_DBA_PASSWORD =
+DB_DBA = @RT_DB_DBA@
+DB_DBA_PASSWORD = @RT_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
+DB_HOST = @RT_DB_HOST@
# If you're not running your database server on its default port,
# specifiy the port the database server is running on below.
# It's generally safe to leave this blank
-DB_PORT =
+DB_PORT = @RT_DB_PORT@
#
# Set this to the canonical name of the interface RT will be talking to the
@@ -144,21 +150,21 @@ DB_PORT =
# to grant those database rights by hand.
#
-DB_RT_HOST = localhost
+DB_RT_HOST = @RT_DB_HOST@
# set this to the name you want to give to the RT database in
# your database server. For Oracle, this should be the name of your sid
-DB_DATABASE = rt2
+DB_DATABASE = @RT_DB_DATABASE@
# Set this to the name of the rt database user
-DB_RT_USER = rt_user
+DB_RT_USER = @RT_DB_USER@
# Set this to the password used by the rt database user
# *** Change This Before Installation***
-DB_RT_PASS = rt_pass
+DB_RT_PASS = @RT_DB_PASS@
# }}}
@@ -167,8 +173,8 @@ DB_RT_PASS = rt_pass
# The user your webserver runs as. needed so that webrt can cache mason
# objectcode
-WEB_USER = www
-WEB_GROUP = rt
+WEB_USER = @RT_WEB_USER@
+WEB_GROUP = @RT_WEB_GROUP@
# }}}
@@ -181,7 +187,7 @@ default:
@echo "Please read RT's readme before installing. Not doing so could"
@echo "be dangerous."
-install: dirs initialize.$(DB_TYPE) upgrade insert instruct
+install: dirs initialize.$(DB_TYPE) upgrade insert-install
instruct:
@echo "Congratulations. RT has been installed. "
@@ -201,7 +207,7 @@ upgrade-instruct:
@echo " $(RT_ETC_PATH)/insertdata <version>"
@echo "where <version> is the version of RT you're upgrading from."
-upgrade-noclobber: insert-install libs-install html-install bin-install nondestruct
+upgrade-noclobber: insert-install libs-install perl-install html-install bin-install nondestruct
nondestruct: fixperms
@@ -213,8 +219,8 @@ fixdeps:
-all:
- @echo "Read the readme."
+all: perl-build
+ @(cd src ; make wrapper)
fixperms:
# Make the libraries readable
@@ -229,40 +235,54 @@ fixperms:
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 0750 $(DESTDIR)/$(RT_ETC_PATH)
#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)
+ chmod 0550 $(DESTDIR)/$(RT_CONFIG).default
# 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)
+ $(DESTDIR)/$(RT_CLI_ADMIN_BIN) \
+ $(DESTDIR)/$(RT_MAILGATE_BIN_WRAPPER) \
+ $(DESTDIR)/$(RT_FASTCGI_HANDLER_WRAPPER) \
+ $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER_WRAPPER) \
+ $(DESTDIR)/$(RT_CLI_BIN_WRAPPER) \
+ $(DESTDIR)/$(RT_CLI_ADMIN_BIN_WRAPPER)
chgrp $(RTGROUP) $(DESTDIR)/$(RT_MAILGATE_BIN) \
$(DESTDIR)/$(RT_FASTCGI_HANDLER) \
$(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \
$(DESTDIR)/$(RT_CLI_BIN) \
- $(DESTDIR)/$(RT_CLI_ADMIN_BIN)
+ $(DESTDIR)/$(RT_CLI_ADMIN_BIN) \
+ $(DESTDIR)/$(RT_MAILGATE_BIN_WRAPPER) \
+ $(DESTDIR)/$(RT_FASTCGI_HANDLER_WRAPPER) \
+ $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER_WRAPPER) \
+ $(DESTDIR)/$(RT_CLI_BIN_WRAPPER) \
+ $(DESTDIR)/$(RT_CLI_ADMIN_BIN_WRAPPER)
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)
+ $(DESTDIR)/$(RT_CLI_ADMIN_BIN) \
+ $(DESTDIR)/$(RT_MAILGATE_BIN_WRAPPER) \
+ $(DESTDIR)/$(RT_FASTCGI_HANDLER_WRAPPER) \
+ $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER_WRAPPER) \
+ $(DESTDIR)/$(RT_CLI_BIN_WRAPPER) \
+ $(DESTDIR)/$(RT_CLI_ADMIN_BIN_WRAPPER)
+
+ chmod u+s $(DESTDIR)/$(RT_MAILGATE_BIN_WRAPPER) \
+ $(DESTDIR)/$(RT_FASTCGI_HANDLER_WRAPPER) \
+ $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER_WRAPPER) \
+ $(DESTDIR)/$(RT_CLI_BIN_WRAPPER) \
+ $(DESTDIR)/$(RT_CLI_ADMIN_BIN_WRAPPER)
# Make the web ui readable by all.
chmod -R u+rwX,go-w,go+rX $(DESTDIR)/$(MASON_HTML_PATH) \
@@ -272,6 +292,7 @@ fixperms:
chgrp -R $(LIBS_GROUP) $(DESTDIR)/$(MASON_HTML_PATH) \
$(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
+XXX-fixperms: # post pkg install
# Make the web ui's data dir writable
chmod 0770 $(DESTDIR)/$(MASON_DATA_PATH) \
$(DESTDIR)/$(MASON_SESSION_PATH)
@@ -281,25 +302,33 @@ fixperms:
$(DESTDIR)/$(MASON_SESSION_PATH)
dirs:
mkdir -p $(DESTDIR)/$(RT_BIN_PATH)
+ mkdir -p $(DESTDIR)/$(WRAPPED_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)
+ mkdir -p $(DESTDIR)/$(RT_LOG_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)
+
+perl-build:
( cd ./lib; \
- $(PERL) Makefile.PL INSTALLSITELIB=$(RT_LIB_PATH) \
+ $(PERL) -p -i -e " s'!!RT_VERSION!!'$(RT_VERSION)'g;" RT.pm && \
+ $(PERL) Makefile.PL INSTALLSITELIB=$(DESTDIR)/$(RT_LIB_PATH) \
INSTALLMAN1DIR=$(RT_MAN_PATH)/man1 \
INSTALLMAN3DIR=$(RT_MAN_PATH)/man3 \
&& make \
&& make test \
- && $(PERL) -p -i -e " s'!!RT_VERSION!!'$(RT_VERSION)'g;" blib/lib/RT.pm ;\
+ )
+
+perl-install:
+ ( cd ./lib; \
make install \
INSTALLSITEMAN1DIR=$(RT_MAN_PATH)/man1 \
INSTALLSITEMAN3DIR=$(RT_MAN_PATH)/man3 \
@@ -322,13 +351,16 @@ initialize.mysql: createdb acls initdb.r
initialize.Oracle: acls initdb.rtuser
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)
+ cp etc/acl.* '$(DESTDIR)/$(RT_ETC_PATH)'
+ cp etc/schema.* '$(DESTDIR)/$(RT_ETC_PATH)'
+ $(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)
+
+XXX-acls: # post pkg install
bin/initacls.$(DB_TYPE) '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DBA_PASSWORD)' '$(DB_DATABASE)' '$(DESTDIR)/$(RT_ETC_PATH)/acl.$(DB_TYPE)'
@@ -338,21 +370,35 @@ dropdb:
createdb:
+
+XXX-createdb: # post pkg installl
$(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DATABASE)' create
initdb.dba:
+
+XXX-initdb.dba: # post pkg install
$(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DATABASE)' insert
initdb.rtuser:
+
+XXX-initdb.rtuser: # post pkg install
$(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_RT_USER)' '$(DB_DATABASE)' insert
insert-install:
- cp -rp ./tools/insertdata \
+ cp -rp ./tools/insertdata ./tools/initdb \
$(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
+ cp -rp ./bin/initacls.* \
+ $(DESTDIR)/$(RT_ETC_PATH)
+ cp -rp ./rtconfig \
+ $(DESTDIR)/$(RT_ETC_PATH)
+ cp -rp ./README \
+ $(DESTDIR)/$(RT_ETC_PATH)/README.rt
+ cp -rp ./README.pkg \
+ $(DESTDIR)/$(RT_ETC_PATH)
bin-install:
cp -p ./bin/webmux.pl $(DESTDIR)/$(RT_MODPERL_HANDLER)
@@ -361,6 +407,11 @@ bin-install:
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)
+ cp -p ./src/wrapper $(DESTDIR)/$(RT_CLI_BIN_WRAPPER)
+ ln -f $(DESTDIR)/$(RT_CLI_BIN_WRAPPER) $(DESTDIR)/$(RT_MAILGATE_BIN_WRAPPER)
+ ln -f $(DESTDIR)/$(RT_CLI_BIN_WRAPPER) $(DESTDIR)/$(RT_CLI_ADMIN_BIN_WRAPPER)
+ ln -f $(DESTDIR)/$(RT_CLI_BIN_WRAPPER) $(DESTDIR)/$(RT_FASTCGI_HANDLER_WRAPPER)
+ ln -f $(DESTDIR)/$(RT_CLI_BIN_WRAPPER) $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER_WRAPPER)
$(PERL) -p -i -e "s'!!RT_PATH!!'"$(RT_PATH)"'g;\
s'!!PERL!!'"$(PERL)"'g;\
@@ -379,7 +430,7 @@ 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)
+ cp -rp ./etc/config.pm $(DESTDIR)/$(RT_CONFIG).default
$(PERL) -p -i -e "\
s'!!DB_TYPE!!'"$(DB_TYPE)"'g;\
s'!!DB_HOST!!'"$(DB_HOST)"'g;\
@@ -393,7 +444,7 @@ config-replace:
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)
+ " $(DESTDIR)/$(RT_CONFIG).default
commit: