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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Tue Mar 20 03:17:00 2012 UTC (7 years, 11 months ago) by radhermit
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Remove old.

(Portage version: 2.2.0_alpha92/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20