rt.spec 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. ##
  2. ## rt.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # FIXME: rse: Error: MM: mm:core: failed to open semaphore file (Permission denied): OS: No such file or directory
  26. # package versions
  27. %define V_rt 3.0.10
  28. %define V_log_dispatch 2.04
  29. %define V_html_mason 1.26
  30. %define V_mldbm 2.01
  31. %define V_html_format 2.03
  32. %define V_locale_maketext_lexicon 0.36
  33. %define V_locale_maketext_fuzzy 0.02
  34. %define V_regexp_common 2.113
  35. %define V_cache_cache 1.02
  36. # package information
  37. Name: rt
  38. Summary: Request Tracker
  39. URL: http://bestpractical.com/rt/
  40. Vendor: Best Practical
  41. Packager: The OpenPKG Project
  42. Distribution: OpenPKG
  43. Class: EVAL
  44. Group: Database
  45. License: GPL
  46. Version: %{V_rt}
  47. Release: 20040413
  48. # package options
  49. %option with_color_primary 336699
  50. %option with_color_secondary dddddd
  51. %option with_db_mysql yes
  52. %option with_db_pgsql no
  53. %option with_db_oracle no
  54. # fixing conflicting options
  55. %if "%{with_db_oracle}" == "yes"
  56. %undefine with_db_pgsql
  57. %define with_db_pgsql no
  58. %endif
  59. %if "%{with_db_oracle}" == "yes" || "%{with_db_pgsql}" == "yes"
  60. %undefine with_db_mysql
  61. %define with_db_mysql no
  62. %endif
  63. # list of sources
  64. Source0: http://www.cpan.org/modules/by-module/Log/Log-Dispatch-%{V_log_dispatch}.tar.gz
  65. Source1: http://www.cpan.org/modules/by-module/HTML/HTML-Mason-%{V_html_mason}.tar.gz
  66. Source2: http://www.cpan.org/modules/by-authors/id/C/CH/CHAMAS/MLDBM-%{V_mldbm}.tar.gz
  67. Source3: http://www.cpan.org/modules/by-authors/id/S/SB/SBURKE/HTML-Format-%{V_html_format}.tar.gz
  68. Source4: http://www.cpan.org/modules/by-authors/id/A/AU/AUTRIJUS/Locale-Maketext-Lexicon-%{V_locale_maketext_lexicon}.tar.gz
  69. Source5: http://www.cpan.org/modules/by-authors/id/A/AU/AUTRIJUS/Locale-Maketext-Fuzzy-%{V_locale_maketext_fuzzy}.tar.gz
  70. Source6: http://www.cpan.org/modules/by-authors/id/A/AB/ABIGAIL/Regexp-Common-%{V_regexp_common}.tar.gz
  71. Source7: http://www.cpan.org/modules/by-authors/id/D/DC/DCLINTON/Cache-Cache-%{V_cache_cache}.tar.gz
  72. Source8: http://bestpractical.com/pub/rt/release/rt-%{V_rt}.tar.gz
  73. Source9: rc.rt
  74. Source10: rtsetup
  75. Source11: rtcleanup
  76. Source12: rtupgrade
  77. Source13: rtapachectl
  78. Source14: rtapache.conf
  79. Source15: config.layout
  80. Source16: rt-mailgate.sh
  81. Patch0: rt.patch
  82. # build information
  83. Prefix: %{l_prefix}
  84. BuildRoot: %{l_buildroot}
  85. BuildPreReq: OpenPKG, openpkg >= 20040130, perl, perl-openpkg >= 5.8.3-20040126
  86. BuildPreReq: perl-sys, perl-util, perl-ds, perl-text, perl-apache
  87. BuildPreReq: perl-dbi, perl-dbix, perl-mail, perl-www
  88. BuildPreReq: apache, apache::with_mod_perl = yes
  89. PreReq: OpenPKG, openpkg >= 20040130, perl
  90. PreReq: perl-sys, perl-util, perl-ds, perl-text, perl-apache
  91. PreReq: perl-dbi, perl-dbix, perl-mail, perl-www
  92. PreReq: apache, apache::with_mod_perl = yes
  93. %if "%{with_db_mysql}" == "yes"
  94. PreReq: mysql, perl-dbi::with_dbd_mysql = yes
  95. %endif
  96. %if "%{with_db_pgsql}" == "yes"
  97. PreReq: postgresql, perl-dbi::with_dbd_pgsql = yes
  98. %endif
  99. %if "%{with_db_oracle}" == "yes"
  100. PreReq: oracle, perl-dbi::with_dbd_oracle = yes
  101. %endif
  102. PreReq: MTA
  103. AutoReq: no
  104. AutoReqProv: no
  105. %description
  106. RT is an industrial-grade ticketing system. It lets a group of
  107. people intelligently and efficiently manage requests submitted by a
  108. community of users. RT is used by systems administrators, customer
  109. support staffs, NOCs, developers and even marketing departments at
  110. over a thousand sites around the world.
  111. %track
  112. prog rt = {
  113. version = %{V_rt}
  114. url = http://bestpractical.com/rt/download.html
  115. regex = rt-(__VER__)\.tar\.gz
  116. }
  117. prog rt:cache-cache = {
  118. version = %{V_cache_cache}
  119. url = http://www.cpan.org/modules/by-authors/id/D/DC/DCLINTON/
  120. regex = Cache-Cache-(__VER__).tar.gz
  121. }
  122. prog rt:html-format = {
  123. version = %{V_html_format}
  124. url = http://www.cpan.org/modules/by-authors/id/S/SB/SBURKE/
  125. regex = HTML-Format-(__VER__).tar.gz
  126. }
  127. prog rt:html-mason = {
  128. version = %{V_html_mason}00
  129. url = http://www.cpan.org/modules/by-module/HTML/
  130. regex = HTML-Mason-(__VER__)\.tar\.gz
  131. transform = "s/^(\\d+\\.\\d\\d)$/${1}00/; $_"
  132. }
  133. prog rt:locale-maketext-fuzzy = {
  134. version = %{V_locale_maketext_fuzzy}
  135. url = http://www.cpan.org/modules/by-authors/id/A/AU/AUTRIJUS/
  136. regex = Locale-Maketext-Fuzzy-(__VER__).tar.gz
  137. }
  138. prog rt:locale-maketext-lexicon = {
  139. version = %{V_locale_maketext_lexicon}
  140. url = http://www.cpan.org/modules/by-authors/id/A/AU/AUTRIJUS/
  141. regex = Locale-Maketext-Lexicon-(__VER__).tar.gz
  142. }
  143. prog rt:log-dispatch = {
  144. disabled
  145. comment = "rse: 2.05 and higher have too nasty dependencies like YAML, Module::Build, etc"
  146. version = %{V_log_dispatch}
  147. url = http://www.cpan.org/modules/by-module/Log/
  148. regex = Log-Dispatch-(__VER__)\.tar\.gz
  149. }
  150. prog rt:mldbm = {
  151. version = %{V_mldbm}
  152. url = http://www.cpan.org/modules/by-authors/id/C/CH/CHAMAS/
  153. regex = MLDBM-(__VER__).tar.gz
  154. }
  155. prog rt:regexp-common = {
  156. version = %{V_regexp_common}
  157. url = http://www.cpan.org/modules/by-authors/id/A/AB/ABIGAIL/
  158. regex = Regexp-Common-(__VER__).tar.gz
  159. }
  160. %prep
  161. # unpack distribution tarballs
  162. %setup -q -c
  163. %setup -q -T -D -a 1
  164. %setup -q -T -D -a 2
  165. %setup -q -T -D -a 3
  166. %setup -q -T -D -a 4
  167. %setup -q -T -D -a 5
  168. %setup -q -T -D -a 6
  169. %setup -q -T -D -a 7
  170. %setup -q -T -D -a 8
  171. # patch RT distribution
  172. cd rt-%{V_rt}
  173. %patch -p0
  174. %{l_shtool} install -c -m 0644 %{l_value -s -a} \
  175. %{SOURCE config.layout} .
  176. %{l_shtool} subst \
  177. -e 's;chown;true;g' \
  178. -e 's;chgrp;true;g' \
  179. -e 's;chmod;true;g' \
  180. -e 's;mkdir -p;%{l_shtool} mkdir -p;g' \
  181. Makefile.in
  182. %{l_shtool} subst \
  183. -e 's;Locale::Maketext 1\.04;Locale::Maketext 1.03;' \
  184. lib/RT/I18N.pm
  185. %{l_shtool} subst \
  186. -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;g' \
  187. etc/RT_Config.pm.in
  188. %build
  189. # configure RT part
  190. cd rt-%{V_rt}
  191. PERL=%{l_prefix}/bin/perl
  192. ./configure \
  193. --enable-layout=OPKG \
  194. --with-db-type=mysql \
  195. --with-db-host=localhost \
  196. --with-db-home=%{l_prefix} \
  197. %if "%{with_db_mysql}" == "yes"
  198. --with-db-dba=root \
  199. --with-db-database=rt \
  200. --with-db-user=rt \
  201. --with-db-pass=XXX \
  202. %endif
  203. %if "%{with_db_pgsql}" == "yes"
  204. --with-db-dba=postgresql \
  205. --with-db-database=rt \
  206. --with-db-user=rt \
  207. --with-db-pass=XXX \
  208. %endif
  209. %if "%{with_db_oracle}" == "yes"
  210. --with-db-dba=system \
  211. --with-db-database=rt \
  212. --with-db-user=rt \
  213. --with-db-pass=XXX \
  214. %endif
  215. --with-web-user=%{l_nusr} \
  216. --with-web-group=%{l_ngrp} \
  217. --with-customdir=%{l_prefix}/etc/rt/local \
  218. --with-customhtmldir=%{l_prefix}/etc/rt/local/html \
  219. --with-customlibdir=%{l_prefix}/etc/rt/local/lib \
  220. --with-customlexdir=%{l_prefix}/etc/rt/local/po
  221. %install
  222. rm -rf $RPM_BUILD_ROOT
  223. # perform common Perl prolog operations
  224. %{l_shtool} mkdir -f -p -m 755 ${RPM_BUILD_ROOT}%{l_prefix}/libexec/rt
  225. %{l_prefix}/bin/perl-openpkg prepare
  226. # install remaining prerequisite Perl modules which
  227. # are not part of the OpenPKG perl-xxx packages.
  228. %{l_prefix}/bin/perl-openpkg -d Regexp-Common-%{V_regexp_common} -l %{l_prefix}/libexec/rt configure build install
  229. %{l_prefix}/bin/perl-openpkg -d Log-Dispatch-%{V_log_dispatch} -l %{l_prefix}/libexec/rt configure build install
  230. %{l_prefix}/bin/perl-openpkg -d Cache-Cache-%{V_cache_cache} -l %{l_prefix}/libexec/rt configure build install
  231. %{l_prefix}/bin/perl-openpkg -d HTML-Mason-%{V_html_mason} -l %{l_prefix}/libexec/rt configure build install
  232. %{l_prefix}/bin/perl-openpkg -d MLDBM-%{V_mldbm} -l %{l_prefix}/libexec/rt configure build install
  233. %{l_prefix}/bin/perl-openpkg -d HTML-Format-%{V_html_format} -l %{l_prefix}/libexec/rt configure build install
  234. %{l_prefix}/bin/perl-openpkg -d Locale-Maketext-Lexicon-%{V_locale_maketext_lexicon} -l %{l_prefix}/libexec/rt configure build install
  235. %{l_prefix}/bin/perl-openpkg -d Locale-Maketext-Fuzzy-%{V_locale_maketext_fuzzy} -l %{l_prefix}/libexec/rt configure build install
  236. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  237. # create installation file hierarchy
  238. %{l_shtool} mkdir -f -p -m 0755 \
  239. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  240. $RPM_BUILD_ROOT%{l_prefix}/etc/rt \
  241. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  242. $RPM_BUILD_ROOT%{l_prefix}/cgi/rt \
  243. $RPM_BUILD_ROOT%{l_prefix}/share/rt \
  244. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools \
  245. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/etc/upgrade \
  246. $RPM_BUILD_ROOT%{l_prefix}/var/rt/mason-data \
  247. $RPM_BUILD_ROOT%{l_prefix}/var/rt/mason-session \
  248. $RPM_BUILD_ROOT%{l_prefix}/var/rt/log \
  249. $RPM_BUILD_ROOT%{l_prefix}/var/rt/run
  250. # perform RT installation procedure
  251. ( cd rt-%{V_rt}
  252. %{l_make} %{l_mflags} \
  253. config-install dirs libs-install etc-install bin-install \
  254. sbin-install html-install doc-install \
  255. DESTDIR=$RPM_BUILD_ROOT
  256. %{l_shtool} install -c -m 0644 \
  257. etc/upgrade/* \
  258. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/etc/upgrade/
  259. %{l_shtool} install -c -m 0644 \
  260. -e '/Set($WebBaseURL/s;"[^"]*";"";' \
  261. etc/RT_Config.pm \
  262. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/RT_SiteConfig.pm
  263. ) || exit $?
  264. # post-adjust installation hierarchy
  265. %{l_shtool} mkln -f -s \
  266. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/RT_SiteConfig.pm \
  267. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/etc/RT_SiteConfig.pm
  268. mv \
  269. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/WebRT/html/NoAuth/webrt.css \
  270. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/webrt.css
  271. %{l_shtool} mkln -f -s \
  272. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/webrt.css \
  273. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/WebRT/html/NoAuth/webrt.css
  274. mv \
  275. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/local \
  276. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/local
  277. %{l_shtool} mkln -f -s \
  278. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/local \
  279. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/local
  280. mv \
  281. $RPM_BUILD_ROOT%{l_prefix}/bin/webmux.pl \
  282. $RPM_BUILD_ROOT%{l_prefix}/bin/mason_handler.fcgi \
  283. $RPM_BUILD_ROOT%{l_prefix}/cgi/rt/
  284. mv \
  285. $RPM_BUILD_ROOT%{l_prefix}/bin/rt-crontool \
  286. $RPM_BUILD_ROOT%{l_prefix}/bin/rt-mailgate \
  287. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools/
  288. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  289. %{SOURCE rt-mailgate.sh} \
  290. $RPM_BUILD_ROOT%{l_prefix}/bin/rt-mailgate
  291. # strip installation hierarchy
  292. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/*.svc
  293. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools/rt-test-dependencies
  294. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/t
  295. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/RT.pm.in
  296. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/xgettext.pl
  297. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/pod2test
  298. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  299. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/rt
  300. # install own setup/cleanup/upgrade script
  301. %if "%{with_db_mysql}" == "yes"
  302. rt_db_dba=root
  303. %endif
  304. %if "%{with_db_pgsql}" == "yes"
  305. rt_db_dba=postgresql
  306. %endif
  307. %if "%{with_db_oracle}" == "yes"
  308. rt_db_dba=system
  309. %endif
  310. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  311. -e "s;@rt_db_dba@;$rt_db_dba;g" \
  312. %{SOURCE rtsetup} %{SOURCE rtcleanup} %{SOURCE rtupgrade} \
  313. $RPM_BUILD_ROOT%{l_prefix}/sbin/
  314. # install OpenPKG run-command script
  315. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  316. %{SOURCE rc.rt} \
  317. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  318. # install Apache "apachectl" wrapper
  319. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  320. %{SOURCE rtapachectl} \
  321. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools/
  322. # install Apache configuration
  323. l_hostname=`%{l_shtool} echo -e %h`
  324. l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
  325. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  326. -e "s;@l_hostname@;$l_hostname;g" \
  327. -e "s;@l_domainname@;$l_domainname;g" \
  328. %{SOURCE rtapache.conf} \
  329. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/
  330. # final post-adjustments to installation hierarchy
  331. %{l_shtool} subst \
  332. -e 's;#336699;#%{with_color_primary};g' \
  333. -e 's;#dddddd;#%{with_color_secondary};g' \
  334. `find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/WebRT \
  335. -type f -print | grep -v gif | grep -v jpg | grep -v .orig`
  336. find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt \
  337. -type f -name "*.html" -print | xargs chmod 644
  338. find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt \
  339. -type f -name "*.pm" -print | xargs chmod 644
  340. find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt \
  341. -type f -print | xargs chmod a+r
  342. find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt \
  343. -type d -print | xargs chmod 755
  344. find ${RPM_BUILD_ROOT}${l_prefix} -name .packlist -print | xargs rm -f
  345. # determine installation files
  346. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  347. %{l_files_std} `cat perl-openpkg-files` \
  348. '%{l_prefix}/libexec/rt' \
  349. '%attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/libexec/rt/tools/rt-setup-database' \
  350. '%attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/libexec/rt/tools/rt-crontool' \
  351. '%attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/libexec/rt/tools/rt-mailgate' \
  352. '%config %attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/rt/RT_SiteConfig.pm' \
  353. '%config %attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/rt/rtapache.conf' \
  354. '%config %attr(644,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/rt/webrt.css' \
  355. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/mason-data' \
  356. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/mason-data/*' \
  357. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/mason-session' \
  358. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/log' \
  359. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/run'
  360. %files -f files
  361. %clean
  362. rm -rf $RPM_BUILD_ROOT
  363. %post
  364. if [ $1 -eq 1 ]; then
  365. # activate in MTA configuration
  366. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_file`
  367. aliases_update=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_update`
  368. if [ ".$aliases_file" != . ]; then
  369. ( echo "rt: \"|$RPM_INSTALL_PREFIX/bin/rt-mailgate --action correspond --queue general --url http://127.0.0.1:8380/\""
  370. echo "rt-comment: \"|$RPM_INSTALL_PREFIX/bin/rt-mailgate --action comment --queue general --url http://127.0.0.1:8380/\""
  371. ) | %{l_rpmtool} config -a -i "$RPM_INSTALL_PREFIX:rt" $aliases_file
  372. fi
  373. if [ ".$aliases_update" != . ]; then
  374. eval $aliases_update
  375. fi
  376. # display final hint after initial installation
  377. ( echo "To complete installation of the RT package please check the"
  378. echo "file $RPM_INSTALL_PREFIX/etc/rt/RT_SiteConfig.pm. In particular,"
  379. echo "you have to assign a password to the RT database user."
  380. echo "Then you have to create the RT database in the RDBMS with:"
  381. echo "\$ $RPM_INSTALL_PREFIX/sbin/rtsetup"
  382. ) | %{l_rpmtool} msg -b -t notice
  383. elif [ $1 -gt 1 ]; then
  384. # display final hint after upgrading
  385. ( echo "If you have an old RT database you can erase it with:"
  386. echo "\$ $RPM_INSTALL_PREFIX/sbin/rtcleanup"
  387. echo "Upgrading from an earlier RT 3.x database you can with:"
  388. echo "\$ $RPM_INSTALL_PREFIX/sbin/rtupgrade <old-rt-version>"
  389. ) | %{l_rpmtool} msg -b -t notice
  390. fi
  391. %preun
  392. if [ $1 -eq 0 ]; then
  393. # stop perhaps still running server
  394. $RPM_INSTALL_PREFIX/etc/rc rt stop
  395. # deactivate in MTA configuration
  396. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_file`
  397. aliases_update=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_update`
  398. if [ ".$aliases_file" != . ]; then
  399. %{l_rpmtool} config -r -i "$RPM_INSTALL_PREFIX:rt" $aliases_file
  400. fi
  401. if [ ".$aliases_update" != . ]; then
  402. eval $aliases_update
  403. fi
  404. # remove generated files
  405. rm -f $RPM_INSTALL_PREFIX/var/rt/mason-session/*
  406. rm -rf $RPM_INSTALL_PREFIX/var/rt/mason-data/*/*
  407. rm -f $RPM_INSTALL_PREFIX/var/rt/log/*
  408. rm -f $RPM_INSTALL_PREFIX/var/rt/run/apache.pid
  409. rm -f $RPM_INSTALL_PREFIX/var/rt/run/ssl_scache
  410. fi