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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (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.2: +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-r1.ebuild,v 1.2 2011/11/18 18:22:31 flameeyes 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? (
82 >=www-servers/lighttpd-1.3.13
83 sys-apps/openrc
84 )
85 "
86
87 need_httpd_cgi
88
89 add_user_rt() {
90 # add new user
91 # suexec2 requires uid >= 1000; enewuser is of no help here
92 # From: Mike Frysinger <vapier@gentoo.org>
93 # Date: Fri, 17 Jun 2005 08:41:44 -0400
94 # i'd pick a 5 digit # if i were you
95
96 local euser="rt"
97
98 # first check if username rt exists
99 if [[ ${euser} == $(egetent passwd "${euser}" | cut -d: -f1) ]] ; then
100 # check uid
101 rt_uid=$(egetent passwd "${euser}" | cut -d: -f3)
102 if $(expr ${rt_uid} '<' 1000 > /dev/null); then
103 ewarn "uid of user rt is less than 1000. suexec2 will not work."
104 ewarn "If you want to use FastCGI, please delete the user 'rt'"
105 ewarn "from your system and re-emerge www-apps/rt"
106 epause
107 fi
108 return 0 # all is well
109 fi
110
111 # add user
112 # stolen from enewuser
113 local pwrange euid
114
115 pwrange=$(seq 10001 11001)
116 for euid in ${pwrange} ; do
117 [[ -z $(egetent passwd ${euid}) ]] && break
118 done
119 if [[ ${euid} == "11001" ]]; then
120 # she gets around, doesn't she?
121 die "No available uid's found"
122 fi
123
124 elog " - Userid: ${euid}"
125
126 enewuser rt ${euid} -1 /dev/null rt
127 return 0
128 }
129
130 pkg_setup() {
131 webapp_pkg_setup
132 ewarn
133 ewarn "If you are upgrading from an existing _RT2_ installation,"
134 ewarn "stop this ebuild (Ctrl-C now), download the upgrade tool,"
135 ewarn "http://bestpractical.com/pub/rt/devel/rt2-to-rt3.tar.gz"
136 ewarn "and follow the included instructions."
137 ewarn
138 epause 5
139 enewgroup rt
140 add_user_rt || die "Could not add user"
141 }
142
143 src_unpack() {
144 unpack ${A}
145 cd "${S}"
146
147 # add Gentoo-specific layout
148 cat "${FILESDIR}"/config.layout-gentoo >> config.layout
149 sed -e "s|PREFIX|${D}/${MY_HOSTROOTDIR}/${PF}|
150 s|HTMLDIR|${D}/${MY_HTDOCSDIR}|g" -i ./config.layout || die
151
152 # don't need to check dev dependencies
153 sed -e "s|\$args{'with-DEV'} =1;|#\$args{'with-DEV'} =1;|" -i sbin/rt-test-dependencies.in || die
154 }
155
156 src_compile() {
157 local web myconf depsconf
158
159 if use mysql; then
160 myconf+=" --with-db-type=mysql --with-db-dba=root"
161 depsconf+=" --with-mysql"
162 fi
163 if use postgres;then
164 myconf+=" --with-db-type=Pg --with-db-dba=postgres"
165 depsconf+=" --with-postgresql"
166 fi
167 if use postgres && use mysql; then
168 ewarn "Both mysql and postgres USE flags enabled, default is mysql."
169 ewarn "You can set the default value in RT_SiteConfig before DB init."
170 myconf+=" --with-db-type=mysql --with-db-dba=root"
171 depsconf+=" --with-mysql"
172 fi
173
174 if use fastcgi ; then
175 myconf+=" --with-web-handler=fastcgi"
176 web="apache"
177 depsconf+=" --with-fastcgi"
178 elif use lighttpd ; then
179 myconf+=" --with-web-handler=fastcgi"
180 web="lighttpd"
181 depsconf+=" --with-fastcgi"
182 else
183 myconf+=" --with-web-handler=modperl2"
184 web="apache"
185 depsconf+=" --with-modperl2"
186 fi
187
188 ./configure --enable-layout=Gentoo \
189 --with-bin-owner=rt \
190 --with-libs-owner=rt \
191 --with-libs-group=rt \
192 --with-rt-group=rt \
193 --with-web-user=${web} \
194 --with-web-group=${web} \
195 ${myconf}
196
197 # check for missing deps and ask to report if something is broken
198 /usr/bin/perl ./sbin/rt-test-dependencies ${depsconf} > "${T}"/t
199 if grep -q "MISSING" "${T}"/t; then
200 ewarn "Missing Perl dependency!"
201 ewarn
202 cat "${T}"/t | grep MISSING
203 ewarn
204 ewarn "Please run perl-cleaner. If the problem persists,"
205 ewarn "please file a bug in the Gentoo Bugzilla with the information above"
206 die "Missing dependencies."
207 fi
208 }
209
210 src_install() {
211 webapp_src_preinst
212 emake -j1 install || die
213
214 # make sure we don't clobber existing site configuration
215 rm -f "${D}"/${MY_HOSTROOTDIR}/${PF}/etc/RT_SiteConfig.pm
216
217 # fix paths
218 find "${D}" -type f -print0 | xargs -0 sed -i -e "s:${D}::g"
219
220 # copy upgrade files
221 insinto "${MY_HOSTROOTDIR}/${PF}"
222 doins -r etc/upgrade
223
224 if use lighttpd; then
225 newinitd "${FILESDIR}"/${PN}.init.d.2 ${PN}
226 newconfd "${FILESDIR}"/${PN}.conf.d.2 ${PN}
227 dosed "s/@@PF@@/${PF}/g" /etc/conf.d/${PN}
228 else
229 doins "${FILESDIR}"/{rt_apache2_fcgi.conf,rt_apache2.conf}
230 fi
231
232 webapp_serverowned "${MY_HOSTROOTDIR}"/${PF}/var
233
234 webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
235 webapp_hook_script "${FILESDIR}"/reconfig
236
237 webapp_src_install
238 }

  ViewVC Help
Powered by ViewVC 1.1.20