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

Contents of /www-apps/rt/rt-3.6.6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Jul 1 16:48:46 2008 UTC (11 years, 9 months ago) by wrobel
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Removed vulnerable rt-3.6.3, rt-3.6.6, added rt-3.6.7 (sec issue #230007).
(Portage version: 2.1.4.4)

1 # Copyright 1999-2008 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.6.6.ebuild,v 1.2 2008/04/03 09:57:12 hollow Exp $
4
5 inherit webapp eutils depend.apache confutils
6
7 DESCRIPTION="RT is an enterprise-grade ticketing system"
8 HOMEPAGE="http://www.bestpractical.com/rt/"
9 SRC_URI="http://download.bestpractical.com/pub/${PN}/release/${P}.tar.gz"
10
11 KEYWORDS="~amd64 ~ppc ~x86"
12 LICENSE="GPL-2"
13 IUSE="mysql postgres fastcgi lighttpd"
14
15 DEPEND="
16 >=dev-lang/perl-5.8.3
17
18 >=dev-perl/Apache-Session-1.53
19 dev-perl/Cache-Simple-TimedExpiry
20 dev-perl/Calendar-Simple
21 >=dev-perl/class-returnvalue-0.40
22 >=dev-perl/CSS-Squish-0.06
23 >=dev-perl/DBI-1.37
24 >=dev-perl/dbix-searchbuilder-1.50
25 dev-perl/GD
26 dev-perl/GDGraph
27 dev-perl/GDTextUtil
28 dev-perl/HTML-Format
29 >dev-perl/HTML-Mason-1.31
30 dev-perl/HTML-Parser
31 >=dev-perl/HTML-Scrubber-0.08
32 dev-perl/HTML-Tree
33 >=dev-perl/HTTP-Server-Simple-0.07
34 >=dev-perl/HTTP-Server-Simple-Mason-0.09
35 dev-perl/libwww-perl
36 dev-perl/locale-maketext-fuzzy
37 >=dev-perl/locale-maketext-lexicon-0.32
38 >=dev-perl/log-dispatch-2.0
39 >=dev-perl/MailTools-1.60
40 >=dev-perl/MIME-tools-5.417
41 dev-perl/Module-Versions-Report
42 dev-perl/regexp-common
43 dev-perl/TermReadKey
44 dev-perl/text-autoformat
45 >=dev-perl/Text-Quoted-2.02
46 dev-perl/text-template
47 >=dev-perl/Text-WikiFormat-0.76
48 dev-perl/text-wrapper
49 dev-perl/TimeDate
50 dev-perl/Time-modules
51 >=dev-perl/Tree-Simple-1.04
52 dev-perl/UNIVERSAL-require
53 >=dev-perl/XML-RSS-1.05
54 >=virtual/perl-CGI-2.92
55 virtual/perl-digest-base
56 >=virtual/perl-Digest-MD5-2.27
57 >=virtual/perl-File-Spec-0.8
58 virtual/perl-File-Temp
59 >=virtual/perl-Getopt-Long-2.24
60 virtual/perl-libnet
61 >=virtual/perl-locale-maketext-1.06
62 virtual/perl-Scalar-List-Utils
63 >=virtual/perl-Storable-2.08
64 virtual/perl-Time-HiRes
65
66 !lighttpd? ( dev-perl/Apache-DBI )
67 lighttpd? ( dev-perl/FCGI )
68 fastcgi? ( dev-perl/FCGI )
69 mysql? ( >=dev-perl/DBD-mysql-2.1018 )
70 postgres? ( >=dev-perl/DBD-Pg-1.43 )
71 "
72
73 RDEPEND="${DEPEND}
74 virtual/mta
75 !lighttpd? ( ${APACHE2_DEPEND} )
76 lighttpd? ( >=www-servers/lighttpd-1.3.13 )
77 "
78
79 need_httpd_cgi
80
81 add_user_rt() {
82 # add new user
83 # suexec2 requires uid >= 1000; enewuser is of no help here
84 # From: Mike Frysinger <vapier@gentoo.org>
85 # Date: Fri, 17 Jun 2005 08:41:44 -0400
86 # i'd pick a 5 digit # if i were you
87
88 local euser="rt"
89
90 # first check if username rt exists
91 if [[ ${euser} == $(egetent passwd "${euser}" | cut -d: -f1) ]] ; then
92 # check uid
93 rt_uid=$(egetent passwd "${euser}" | cut -d: -f3)
94 if $(expr ${rt_uid} '<' 1000 > /dev/null); then
95 ewarn "uid of user rt is less than 1000. suexec2 will not work."
96 ewarn "If you want to use FastCGI, please delete the user 'rt'"
97 ewarn "from your system and re-emerge www-apps/rt"
98 epause
99 fi
100 return 0 # all is well
101 fi
102
103 # add user
104 # stolen from enewuser
105 local pwrange euid
106
107 pwrange=$(seq 10001 11001)
108 for euid in ${pwrange} ; do
109 [[ -z $(egetent passwd ${euid}) ]] && break
110 done
111 if [[ ${euid} == "11001" ]]; then
112 # she gets around, doesn't she?
113 die "No available uid's found"
114 fi
115
116 elog " - Userid: ${euid}"
117
118 enewuser rt ${euid} -1 /dev/null rt > /dev/null
119 return 0
120 }
121
122 pkg_setup() {
123 webapp_pkg_setup
124 ewarn
125 ewarn "If you are upgrading from an existing _RT2_ installation,"
126 ewarn "stop this ebuild (Ctrl-C now), download the upgrade tool,"
127 ewarn "http://bestpractical.com/pub/rt/devel/rt2-to-rt3.tar.gz"
128 ewarn "and follow the included instructions."
129 ewarn
130 epause 5
131 enewgroup rt >/dev/null
132 add_user_rt || die "Could not add user"
133 }
134
135 src_unpack() {
136 unpack ${A}
137 cd "${S}"
138
139 # add Gentoo-specific layout
140 cat "${FILESDIR}"/config.layout-gentoo >> config.layout
141 sed -e "s|PREFIX|${D}/${MY_HOSTROOTDIR}/${PF}|
142 s|HTMLDIR|${D}/${MY_HTDOCSDIR}|g" -i ./config.layout || die
143
144 # don't need to check dev dependencies
145 sed -e "s|\$args{'with-DEV'} =1;|#\$args{'with-DEV'} =1;|" -i sbin/rt-test-dependencies.in || die
146 }
147
148 src_compile() {
149 local web="apache"
150 use lighttpd && web="lighttpd"
151
152 local dbtype dba
153
154 if use mysql; then
155 dbtype="--with-db-type=mysql"
156 dba="--with-db-dba=root"
157 fi
158 if use postgres;then
159 dbtype="--with-db-type=Pg"
160 dba="--with-db-dba=postgres"
161 fi
162 if use postgres && use mysql; then
163 ewarn "Both mysql and postgres USE flags enabled, default is mysql."
164 ewarn "You can set the default value in RT_SiteConfig before DB init."
165 dbtype="--with-db-type=mysql"
166 dba="--with-db-dba=root"
167 fi
168
169 ./configure --enable-layout=Gentoo \
170 --with-bin-owner=rt \
171 --with-libs-owner=rt \
172 --with-libs-group=rt \
173 --with-rt-group=rt \
174 --with-web-user=${web} \
175 --with-web-group=${web} \
176 ${dbtype} ${dba}
177
178 # check for missing deps and ask to report if something is broken
179 local myconf="--verbose \
180 $(enable_extension_withonly mysql mysql) \
181 $(enable_extension_withonly postgresql postgres) \
182 $(enable_extension_withonly fastcgi fastcgi) \
183 $(enable_extension_withonly fastcgi lighttpd)" \
184
185 if ! useq fastcgi && ! useq lighttpd; then
186 myconf="${myconf} --with-modperl2"
187 fi
188
189 /usr/bin/perl ./sbin/rt-test-dependencies ${myconf} > "${T}"/t
190 if grep -q "MISSING" "${T}"/t; then
191 ewarn "Missing Perl dependency!"
192 ewarn
193 cat "${T}"/t | grep MISSING
194 ewarn
195 ewarn "Please run perl-cleaner. If the problem persists,"
196 ewarn "please file a bug in the Gentoo Bugzilla with the information above"
197 die "Missing dependencies."
198 fi
199 }
200
201 src_install() {
202 webapp_src_preinst
203 emake install || die
204
205 # make sure we don't clobber existing site configuration
206 rm -f "${D}"/${MY_HOSTROOTDIR}/${PF}/etc/RT_SiteConfig.pm
207
208 # fix paths
209 find "${D}" -type f -print0 | xargs -0 sed -i -e "s:${D}::g"
210
211 # copy upgrade files
212 insinto "${MY_HOSTROOTDIR}/${PF}"
213 doins -r etc/upgrade
214
215 if use lighttpd; then
216 newinitd "${FILESDIR}"/${PN}.init.d ${PN}
217 newconfd "${FILESDIR}"/${PN}.conf.d ${PN}
218 dosed "s/@@PF@@/${PF}/g" /etc/conf.d/${PN}
219 else
220 doins "${FILESDIR}"/{rt_apache2_fcgi.conf,rt_apache2.conf}
221 fi
222
223 webapp_serverowned "${MY_HOSTROOTDIR}"/${PF}/var
224
225 webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
226 webapp_hook_script "${FILESDIR}"/reconfig
227
228 webapp_src_install
229 }

  ViewVC Help
Powered by ViewVC 1.1.20