/[gentoo-x86]/www-apps/rt/rt-3.4.2-r1.ebuild
Gentoo

Contents of /www-apps/rt/rt-3.4.2-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Jun 21 02:12:38 2005 UTC (14 years, 11 months ago) by rl03
Branch: MAIN
Added proper FastCGI support for Apache1 and Apache2. Added lighttpd support.
(Portage version: 2.0.51.22-r1)

1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-apps/rt/rt-3.4.2.ebuild,v 1.1 2005/06/12 20:03:35 rl03 Exp $
4
5 inherit webapp eutils
6
7 IUSE="mysql postgres fastcgi apache2 lighttpd"
8
9 DESCRIPTION="RT is an enterprise-grade ticketing system"
10 HOMEPAGE="http://www.bestpractical.com/rt/"
11 SRC_URI="http://download.bestpractical.com/pub/${PN}/release/${P}.tar.gz
12 ftp://ftp.eu.uu.net/pub/unix/ticketing/${PN}/release/${P}.tar.gz
13 ftp://rhinst.ece.cmu.edu/${PN}/release/${P}.tar.gz"
14
15 KEYWORDS="~x86"
16
17 DEPEND="
18 >=dev-lang/perl-5.8.3
19 >=dev-perl/Params-Validate-0.02
20 dev-perl/Cache-Cache
21 >=dev-perl/Exception-Class-1.14
22 perl-core/CGI
23 >=dev-perl/HTML-Mason-1.28
24 dev-perl/MLDBM
25 dev-perl/FreezeThaw
26 >=dev-perl/Apache-Session-1.53
27 dev-perl/XML-RSS
28 >=dev-perl/HTTP-Server-Simple-0.07
29 >=dev-perl/HTTP-Server-Simple-Mason-0.05
30 dev-perl/HTML-Tree
31 dev-perl/HTML-Format
32 dev-perl/libwww-perl
33 >=dev-perl/DBI-1.37
34 dev-perl/Test-Inline
35 >=dev-perl/class-returnvalue-0.40
36 >=dev-perl/dbix-searchbuilder-1.27
37 dev-perl/text-template
38 dev-perl/HTML-Parser
39 >=dev-perl/HTML-Scrubber-0.08
40 >=dev-perl/log-dispatch-2.0
41 >=dev-perl/locale-maketext-lexicon-0.32
42 dev-perl/locale-maketext-fuzzy
43 >=dev-perl/MIME-tools-5.417
44 >=dev-perl/MailTools-1.60
45 dev-perl/text-wrapper
46 dev-perl/Time-modules
47 dev-perl/TermReadKey
48 >=dev-perl/Text-Quoted-1.3
49 >=dev-perl/Tree-Simple-1.04
50 dev-perl/Module-Versions-Report
51 dev-perl/Cache-Simple-TimedExpiry
52 dev-perl/XML-Simple
53 dev-perl/regexp-common
54 dev-perl/WWW-Mechanize
55 dev-perl/Test-WWW-Mechanize
56 dev-perl/Module-Refresh
57
58 dev-perl/Font-AFM
59 dev-perl/text-autoformat
60 dev-perl/text-reform
61 "
62
63 RDEPEND="
64 ${DEPEND}
65 virtual/mta
66 mysql? ( >=dev-db/mysql-4.0.13 >=dev-perl/DBD-mysql-2.1018 )
67 postgres? ( >=dev-db/postgresql-7.4.2-r1 >=dev-perl/DBD-Pg-1.41 )
68 !lighttpd? (
69 dev-perl/Apache-Test
70 >=dev-perl/Apache-DBI-0.92
71 apache2? ( >=net-www/apache-2 dev-perl/FCGI net-www/mod_fastcgi )
72 !apache2? ( =net-www/apache-1*
73 fastcgi? ( dev-perl/FCGI net-www/mod_fastcgi )
74 !fastcgi? ( =www-apache/libapreq-1* ) ) )
75 lighttpd? (
76 >=www-servers/lighttpd-1.3.13
77 dev-perl/FCGI )
78 "
79
80 LICENSE="GPL-2"
81
82 add_user_rt() {
83 # add new user
84 # suexec2 requires uid >= 1000; enewuser is of no help here
85 # From: Mike Frysinger <vapier@gentoo.org>
86 # Date: Fri, 17 Jun 2005 08:41:44 -0400
87 # i'd pick a 5 digit # if i were you
88
89 local euser="rt"
90
91 # first check if username rt exists
92 if [[ ${euser} == $(egetent passwd "${euser}" | cut -d: -f1) ]] ; then
93 # check uid
94 rt_uid=$(egetent passwd "${euser}" | cut -d: -f3)
95 if `expr ${rt_uid} '<' 1000 > /dev/null`; then
96 ewarn "uid of user rt is less than 1000. suexec2 will not work."
97 ewarn "If you want to use FastCGI, please delete the user 'rt'"
98 ewarn "from your system and re-emerge www-apps/rt"
99 epause
100 fi
101 return 0 # all is well
102 fi
103
104 # add user
105 # stolen from enewuser
106 local pwrange euid
107
108 pwrange=$(seq 10001 11001)
109 for euid in ${pwrange} ; do
110 [[ -z $(egetent passwd ${euid}) ]] && break
111 done
112 if [[ ${euid} == "11001" ]]; then
113 # she gets around, doesn't she?
114 die "No available uid's found"
115 fi
116
117 einfo " - Userid: ${euid}"
118
119 enewuser rt ${euid} /bin/false /dev/null rt > /dev/null
120 return 0
121 }
122
123 pkg_setup() {
124 webapp_pkg_setup
125
126 if useq mysql; then
127 ewarn "RT needs MySQL with innodb support"
128 fi
129 ewarn
130 ewarn "If you are upgrading from an existing _RT2_ installation,"
131 ewarn "stop this ebuild (Ctrl-C now), download the upgrade tool,"
132 ewarn "http://bestpractical.com/pub/rt/devel/rt2-to-rt3.tar.gz"
133 ewarn "and follow the included instructions."
134 ewarn
135 enewgroup rt >/dev/null
136 add_user_rt || die "Could not add user"
137
138 }
139
140 src_unpack() {
141 unpack ${A}
142 cd ${S}
143
144 # add Gentoo-specific layout
145 cat ${FILESDIR}/${PV}/config.layout-gentoo >> config.layout
146 sed -e "s|PREFIX|${D}/${MY_HOSTROOTDIR}/${P}|
147 s|HTMLDIR|${D}/${MY_HTDOCSDIR}|g" -i ./config.layout
148 }
149
150 src_compile() {
151
152 local web="apache"
153 if useq lighttpd; then
154 web="lighttpd"
155 fi
156
157 ./configure --enable-layout=Gentoo \
158 --with-bin-owner=rt \
159 --with-libs-owner=rt \
160 --with-libs-group=rt \
161 --with-rt-group=rt \
162 --with-web-user=${web} \
163 --with-web-group=${web}
164
165 # check for missing deps and ask to report if something is broken
166 if `make testdeps | grep "MISSING"`; then
167 ewarn "Missing Perl dependency!"
168 ewarn "Please file a bug in the Gentoo Bugzilla with the information above"
169 ewarn "and assign it to rl03@gentoo.org"
170 die "Missing dependencies."
171 fi
172 }
173
174 src_install() {
175 webapp_src_preinst
176
177 make install
178
179 # make sure we don't clobber existing site configuration
180 rm -f ${D}/${MY_HOSTROOTDIR}/${P}/etc/RT_SiteConfig.pm
181
182 # copy upgrade files
183 cp -R etc/upgrade ${D}/${MY_HOSTROOTDIR}/${P}
184
185 cd ${D}
186 grep -Rl "${D}" * | xargs dosed
187
188 if ! useq lighttpd; then
189 if ! useq apache2; then
190 webapp_server_configfile apache1 ${FILESDIR}/${PV}/rt_apache.conf
191 webapp_server_configfile apache1 ${FILESDIR}/${PV}/rt_apache1_fcgi.conf
192 else
193 webapp_server_configfile apache2 ${FILESDIR}/${PV}/rt_apache2_fcgi.conf
194 fi
195 else
196 newinitd ${FILESDIR}/${PV}/${PN}.init.d ${PN}
197 insinto /etc/conf.d
198 newins ${FILESDIR}/${PV}/${PN}.conf.d ${PN}
199 fi
200 webapp_postinst_txt en ${FILESDIR}/${PV}/postinstall-en.txt
201 webapp_hook_script ${FILESDIR}/${PV}/reconfig
202 webapp_src_install
203 }

  ViewVC Help
Powered by ViewVC 1.1.20