rt.spec 18 KB

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