rt.spec 18 KB

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