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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (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.4: +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.6.7.ebuild,v 1.4 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.09
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
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
67 !lighttpd? ( dev-perl/Apache-DBI )
68 lighttpd? ( dev-perl/FCGI )
69 fastcgi? ( dev-perl/FCGI )
70 mysql? ( >=dev-perl/DBD-mysql-2.1018 )
71 postgres? ( >=dev-perl/DBD-Pg-1.43 )
72 "
73
74 RDEPEND="${DEPEND}
75 virtual/mta
76 !lighttpd? ( ${APACHE2_DEPEND} )
77 lighttpd? ( >=www-servers/lighttpd-1.3.13 )
78 "
79
80 need_httpd_cgi
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 elog " - Userid: ${euid}"
118
119 enewuser rt ${euid} -1 /dev/null rt
120 return 0
121 }
122
123 pkg_setup() {
124 webapp_pkg_setup
125 ewarn
126 ewarn "If you are upgrading from an existing _RT2_ installation,"
127 ewarn "stop this ebuild (Ctrl-C now), download the upgrade tool,"
128 ewarn "http://bestpractical.com/pub/rt/devel/rt2-to-rt3.tar.gz"
129 ewarn "and follow the included instructions."
130 ewarn
131 epause 5
132 enewgroup rt
133 add_user_rt || die "Could not add user"
134 }
135
136 src_unpack() {
137 unpack ${A}
138 cd "${S}"
139
140 # add Gentoo-specific layout
141 cat "${FILESDIR}"/config.layout-gentoo >> config.layout
142 sed -e "s|PREFIX|${D}/${MY_HOSTROOTDIR}/${PF}|
143 s|HTMLDIR|${D}/${MY_HTDOCSDIR}|g" -i ./config.layout || die
144
145 # don't need to check dev dependencies
146 sed -e "s|\$args{'with-DEV'} =1;|#\$args{'with-DEV'} =1;|" -i sbin/rt-test-dependencies.in || die
147 }
148
149 src_compile() {
150 local web="apache"
151 use lighttpd && web="lighttpd"
152
153 local dbtype dba
154
155 if use mysql; then
156 dbtype="--with-db-type=mysql"
157 dba="--with-db-dba=root"
158 fi
159 if use postgres;then
160 dbtype="--with-db-type=Pg"
161 dba="--with-db-dba=postgres"
162 fi
163 if use postgres && use mysql; then
164 ewarn "Both mysql and postgres USE flags enabled, default is mysql."
165 ewarn "You can set the default value in RT_SiteConfig before DB init."
166 dbtype="--with-db-type=mysql"
167 dba="--with-db-dba=root"
168 fi
169
170 ./configure --enable-layout=Gentoo \
171 --with-bin-owner=rt \
172 --with-libs-owner=rt \
173 --with-libs-group=rt \
174 --with-rt-group=rt \
175 --with-web-user=${web} \
176 --with-web-group=${web} \
177 ${dbtype} ${dba}
178
179 # check for missing deps and ask to report if something is broken
180 local myconf="--verbose \
181 $(enable_extension_withonly mysql mysql) \
182 $(enable_extension_withonly postgresql postgres) \
183 $(enable_extension_withonly fastcgi fastcgi) \
184 $(enable_extension_withonly fastcgi lighttpd)" \
185
186 if ! use fastcgi && ! use lighttpd; then
187 myconf="${myconf} --with-modperl2"
188 fi
189
190 /usr/bin/perl ./sbin/rt-test-dependencies ${myconf} > "${T}"/t
191 if grep -q "MISSING" "${T}"/t; then
192 ewarn "Missing Perl dependency!"
193 ewarn
194 cat "${T}"/t | grep MISSING
195 ewarn
196 ewarn "Please run perl-cleaner. If the problem persists,"
197 ewarn "please file a bug in the Gentoo Bugzilla with the information above"
198 die "Missing dependencies."
199 fi
200 }
201
202 src_install() {
203 webapp_src_preinst
204 emake install || die
205
206 # make sure we don't clobber existing site configuration
207 rm -f "${D}"/${MY_HOSTROOTDIR}/${PF}/etc/RT_SiteConfig.pm
208
209 # fix paths
210 find "${D}" -type f -print0 | xargs -0 sed -i -e "s:${D}::g"
211
212 # copy upgrade files
213 insinto "${MY_HOSTROOTDIR}/${PF}"
214 doins -r etc/upgrade
215
216 if use lighttpd; then
217 newinitd "${FILESDIR}"/${PN}.init.d ${PN}
218 newconfd "${FILESDIR}"/${PN}.conf.d ${PN}
219 dosed "s/@@PF@@/${PF}/g" /etc/conf.d/${PN}
220 else
221 doins "${FILESDIR}"/{rt_apache2_fcgi.conf,rt_apache2.conf}
222 fi
223
224 webapp_serverowned "${MY_HOSTROOTDIR}"/${PF}/var
225
226 webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
227 webapp_hook_script "${FILESDIR}"/reconfig
228
229 webapp_src_install
230 }

  ViewVC Help
Powered by ViewVC 1.1.20