rt.spec 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. ##
  2. ## rt.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2005 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.3
  27. %define V_log_dispatch 2.04
  28. %define V_html_mason 1.28
  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: 20050811
  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-20040126
  83. PreReq: OpenPKG, openpkg >= 20040130, perl
  84. BuildPreReq: perl-sys, perl-util, perl-ds, perl-text, perl-apache
  85. PreReq: perl-sys, perl-util, perl-ds, perl-text, perl-apache
  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. disabled
  127. comment = "rse: 2.05 and higher have too nasty dependencies like YAML, Module::Build, etc"
  128. version = %{V_log_dispatch}
  129. url = http://www.cpan.org/modules/by-module/Log/
  130. regex = Log-Dispatch-(__VER__)\.tar\.gz
  131. }
  132. prog rt:mldbm = {
  133. version = %{V_mldbm}
  134. url = http://www.cpan.org/modules/by-authors/id/C/CH/CHAMAS/
  135. regex = MLDBM-(__VER__)\.tar\.gz
  136. }
  137. prog rt:html-scrubber = {
  138. version = %{V_html_scrubber}
  139. url = http://www.cpan.org/modules/by-authors/id/P/PO/PODMASTER/
  140. regex = HTML-Scrubber-(__VER__)\.tar\.gz
  141. }
  142. prog rt:module-version = {
  143. version = %{V_module_version}
  144. url = http://www.cpan.org/modules/by-authors/id/S/SB/SBURKE/
  145. regex = Module-Versions-Report-(__VER__)\.tar\.gz
  146. }
  147. prog rt:cache-simple-timedexpiry = {
  148. version = %{V_cache_simple_timedexpiry}
  149. url = http://www.cpan.org/modules/by-module/Cache/
  150. regex = Cache-Simple-TimedExpiry-(__VER__)\.tar\.gz
  151. }
  152. %prep
  153. # unpack distribution tarballs
  154. %setup -q -c
  155. %setup -q -T -D -a 1
  156. %setup -q -T -D -a 2
  157. %setup -q -T -D -a 3
  158. %setup -q -T -D -a 4
  159. %setup -q -T -D -a 5
  160. %setup -q -T -D -a 6
  161. %setup -q -T -D -a 7
  162. # patch RT distribution
  163. cd rt-%{V_rt}
  164. %patch -p0
  165. %{l_shtool} install -c -m 0644 %{l_value -s -a} \
  166. %{SOURCE config.layout} .
  167. %{l_shtool} subst \
  168. -e 's;chown;true;g' \
  169. -e 's;chgrp;true;g' \
  170. -e 's;chmod;true;g' \
  171. -e 's;mkdir -p;%{l_shtool} mkdir -p;g' \
  172. Makefile.in
  173. %{l_shtool} subst \
  174. -e 's;Locale::Maketext 1\.04;Locale::Maketext 1.03;' \
  175. lib/RT/I18N.pm
  176. %{l_shtool} subst \
  177. -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;g' \
  178. etc/RT_Config.pm.in
  179. %build
  180. # configure RT part
  181. cd rt-%{V_rt}
  182. PERL=%{l_prefix}/bin/perl
  183. ./configure \
  184. --enable-layout=OPKG \
  185. --with-db-type=mysql \
  186. --with-db-host=localhost \
  187. --with-db-home=%{l_prefix} \
  188. %if "%{with_db_mysql}" == "yes"
  189. --with-db-dba=root \
  190. --with-db-database=rt \
  191. --with-db-user=rt \
  192. --with-db-pass=XXX \
  193. %endif
  194. %if "%{with_db_pgsql}" == "yes"
  195. --with-db-dba=postgresql \
  196. --with-db-database=rt \
  197. --with-db-user=rt \
  198. --with-db-pass=XXX \
  199. %endif
  200. %if "%{with_db_oracle}" == "yes"
  201. --with-db-dba=system \
  202. --with-db-database=rt \
  203. --with-db-user=rt \
  204. --with-db-pass=XXX \
  205. %endif
  206. --with-web-user=%{l_nusr} \
  207. --with-web-group=%{l_ngrp} \
  208. --with-customdir=%{l_prefix}/etc/rt/local \
  209. --with-customhtmldir=%{l_prefix}/etc/rt/local/html \
  210. --with-customlibdir=%{l_prefix}/etc/rt/local/lib \
  211. --with-customlexdir=%{l_prefix}/etc/rt/local/po
  212. %install
  213. rm -rf $RPM_BUILD_ROOT
  214. # perform common Perl prolog operations
  215. %{l_shtool} mkdir -f -p -m 755 ${RPM_BUILD_ROOT}%{l_prefix}/libexec/rt
  216. %{l_prefix}/bin/perl-openpkg prepare
  217. # install remaining prerequisite Perl modules which
  218. # are not part of the OpenPKG perl-xxx packages.
  219. %{l_prefix}/bin/perl-openpkg -d Log-Dispatch-%{V_log_dispatch} \
  220. -l %{l_prefix}/libexec/rt configure build install
  221. %{l_prefix}/bin/perl-openpkg -d HTML-Mason-%{V_html_mason} \
  222. -l %{l_prefix}/libexec/rt configure build install
  223. %{l_prefix}/bin/perl-openpkg -d MLDBM-%{V_mldbm} \
  224. -l %{l_prefix}/libexec/rt configure build install
  225. %{l_prefix}/bin/perl-openpkg -d HTML-Format-%{V_html_format} \
  226. -l %{l_prefix}/libexec/rt configure build install
  227. %{l_prefix}/bin/perl-openpkg -d HTML-Scrubber-%{V_html_scrubber} \
  228. -l %{l_prefix}/libexec/rt configure build install
  229. %{l_prefix}/bin/perl-openpkg -d Module-Versions-Report-%{V_module_version} \
  230. -l %{l_prefix}/libexec/rt configure build install
  231. %{l_prefix}/bin/perl-openpkg -d Cache-Simple-TimedExpiry-%{V_cache_simple_timedexpiry} \
  232. -l %{l_prefix}/libexec/rt configure build install
  233. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  234. # create installation file hierarchy
  235. %{l_shtool} mkdir -f -p -m 0755 \
  236. $RPM_BUILD_ROOT%{l_prefix}/sbin \
  237. $RPM_BUILD_ROOT%{l_prefix}/etc/rt \
  238. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  239. $RPM_BUILD_ROOT%{l_prefix}/cgi/rt \
  240. $RPM_BUILD_ROOT%{l_prefix}/share/rt \
  241. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools \
  242. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/etc/upgrade \
  243. $RPM_BUILD_ROOT%{l_prefix}/var/rt/mason-data \
  244. $RPM_BUILD_ROOT%{l_prefix}/var/rt/mason-session \
  245. $RPM_BUILD_ROOT%{l_prefix}/var/rt/log \
  246. $RPM_BUILD_ROOT%{l_prefix}/var/rt/run
  247. # perform RT installation procedure
  248. ( cd rt-%{V_rt}
  249. %{l_make} %{l_mflags} \
  250. config-install dirs libs-install etc-install bin-install \
  251. sbin-install html-install doc-install \
  252. DESTDIR=$RPM_BUILD_ROOT
  253. %{l_shtool} install -c -m 0644 \
  254. etc/upgrade/* \
  255. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/etc/upgrade/
  256. %{l_shtool} install -c -m 0644 \
  257. -e '/Set($WebBaseURL/s;"[^"]*";"";' \
  258. etc/RT_Config.pm \
  259. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/RT_SiteConfig.pm
  260. ) || exit $?
  261. # post-adjust installation hierarchy
  262. %{l_shtool} mkln -f -s \
  263. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/RT_SiteConfig.pm \
  264. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/etc/RT_SiteConfig.pm
  265. mv \
  266. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/WebRT/html/NoAuth/webrt.css \
  267. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/webrt.css
  268. %{l_shtool} mkln -f -s \
  269. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/webrt.css \
  270. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/WebRT/html/NoAuth/webrt.css
  271. mv \
  272. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/local \
  273. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/local
  274. %{l_shtool} mkln -f -s \
  275. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/local \
  276. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/local
  277. mv \
  278. $RPM_BUILD_ROOT%{l_prefix}/bin/webmux.pl \
  279. $RPM_BUILD_ROOT%{l_prefix}/bin/mason_handler.fcgi \
  280. $RPM_BUILD_ROOT%{l_prefix}/cgi/rt/
  281. mv \
  282. $RPM_BUILD_ROOT%{l_prefix}/bin/rt-crontool \
  283. $RPM_BUILD_ROOT%{l_prefix}/bin/rt-mailgate \
  284. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools/
  285. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  286. %{SOURCE rt-mailgate.sh} \
  287. $RPM_BUILD_ROOT%{l_prefix}/bin/rt-mailgate
  288. # strip installation hierarchy
  289. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/*.svc
  290. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools/rt-test-dependencies
  291. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/t
  292. rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/RT.pm.in
  293. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/xgettext.pl
  294. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/pod2test
  295. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
  296. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/rt
  297. # install own setup/cleanup/upgrade script
  298. %if "%{with_db_mysql}" == "yes"
  299. rt_db_dba=root
  300. %endif
  301. %if "%{with_db_pgsql}" == "yes"
  302. rt_db_dba=postgresql
  303. %endif
  304. %if "%{with_db_oracle}" == "yes"
  305. rt_db_dba=system
  306. %endif
  307. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  308. -e "s;@rt_db_dba@;$rt_db_dba;g" \
  309. %{SOURCE rtsetup} %{SOURCE rtcleanup} %{SOURCE rtupgrade} \
  310. $RPM_BUILD_ROOT%{l_prefix}/sbin/
  311. # install OpenPKG run-command script
  312. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  313. %{SOURCE rc.rt} \
  314. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  315. # install Apache "apachectl" wrapper
  316. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  317. %{SOURCE rtapachectl} \
  318. $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools/
  319. # install Apache configuration
  320. l_hostname=`%{l_shtool} echo -e %h`
  321. l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
  322. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  323. -e "s;@l_hostname@;$l_hostname;g" \
  324. -e "s;@l_domainname@;$l_domainname;g" \
  325. %{SOURCE rtapache.conf} \
  326. $RPM_BUILD_ROOT%{l_prefix}/etc/rt/
  327. # final post-adjustments to installation hierarchy
  328. %{l_shtool} subst \
  329. -e 's;#336699;#%{with_color_primary};g' \
  330. -e 's;#dddddd;#%{with_color_secondary};g' \
  331. `find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/WebRT \
  332. -type f -print | grep -v gif | grep -v jpg | grep -v .orig`
  333. find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt \
  334. -type f -name "*.html" -print | xargs chmod 644
  335. find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt \
  336. -type f -name "*.pm" -print | xargs chmod 644
  337. find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt \
  338. -type f -print | xargs chmod a+r
  339. find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt \
  340. -type d -print | xargs chmod 755
  341. find ${RPM_BUILD_ROOT}${l_prefix} -name .packlist -print | xargs rm -f
  342. # determine installation files
  343. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  344. %{l_files_std} `cat perl-openpkg-files` \
  345. '%{l_prefix}/libexec/rt' \
  346. '%attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/libexec/rt/tools/rt-setup-database' \
  347. '%attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/libexec/rt/tools/rt-crontool' \
  348. '%attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/libexec/rt/tools/rt-mailgate' \
  349. '%config %attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/rt/RT_SiteConfig.pm' \
  350. '%config %attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/rt/rtapache.conf' \
  351. '%config %attr(644,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/rt/webrt.css' \
  352. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/mason-data' \
  353. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/mason-data/*' \
  354. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/mason-session' \
  355. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/log' \
  356. '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/run'
  357. %files -f files
  358. %clean
  359. rm -rf $RPM_BUILD_ROOT
  360. %post
  361. if [ $1 -eq 1 ]; then
  362. # activate in MTA configuration
  363. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_file`
  364. aliases_update=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_update`
  365. if [ ".$aliases_file" != . ]; then
  366. ( echo "rt: \"|$RPM_INSTALL_PREFIX/bin/rt-mailgate --action correspond --queue general --url http://127.0.0.1:8380/\""
  367. echo "rt-comment: \"|$RPM_INSTALL_PREFIX/bin/rt-mailgate --action comment --queue general --url http://127.0.0.1:8380/\""
  368. ) | %{l_rpmtool} config -a -i "$RPM_INSTALL_PREFIX:rt" $aliases_file
  369. fi
  370. if [ ".$aliases_update" != . ]; then
  371. eval $aliases_update
  372. fi
  373. # display final hint after initial installation
  374. ( echo "To complete installation of RT, please check the file"
  375. echo " $RPM_INSTALL_PREFIX/etc/rt/RT_SiteConfig.pm"
  376. echo "In particular, you have to assign a password to the RT"
  377. echo "database user. Then you have to start the MySQL RDBMS and"
  378. echo "create the initial RT database with:"
  379. echo " \$ $RPM_INSTALL_PREFIX/etc/rc mysql start"
  380. echo " \$ $RPM_INSTALL_PREFIX/sbin/rtsetup"
  381. echo "After this post-installation, start RT by running"
  382. echo " \$ $RPM_INSTALL_PREFIX/etc/rc rt start"
  383. echo "and connect with a browser to:"
  384. echo " http://127.0.0.1:8380/"
  385. echo "Login as 'root' (with initial password 'password')"
  386. echo "to change the password to a custom one."
  387. ) | %{l_rpmtool} msg -b -t notice
  388. elif [ $1 -gt 1 ]; then
  389. # display final hint after upgrading
  390. ( echo "If you have an old RT database you can erase it with:"
  391. echo " \$ $RPM_INSTALL_PREFIX/sbin/rtcleanup"
  392. echo "Upgrading from an earlier RT 3.x database you can with:"
  393. echo " \$ $RPM_INSTALL_PREFIX/sbin/rtupgrade <old-rt-version>"
  394. ) | %{l_rpmtool} msg -b -t notice
  395. fi
  396. %preun
  397. if [ $1 -eq 0 ]; then
  398. # stop perhaps still running server
  399. $RPM_INSTALL_PREFIX/etc/rc rt stop
  400. # deactivate in MTA configuration
  401. aliases_file=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_file`
  402. aliases_update=`$RPM_INSTALL_PREFIX/etc/rc --query MTA_aliases_update`
  403. if [ ".$aliases_file" != . ]; then
  404. %{l_rpmtool} config -r -i "$RPM_INSTALL_PREFIX:rt" $aliases_file
  405. fi
  406. if [ ".$aliases_update" != . ]; then
  407. eval $aliases_update
  408. fi
  409. # remove generated files
  410. rm -f $RPM_INSTALL_PREFIX/var/rt/mason-session/*
  411. rm -rf $RPM_INSTALL_PREFIX/var/rt/mason-data/*/*
  412. rm -f $RPM_INSTALL_PREFIX/var/rt/log/*
  413. rm -f $RPM_INSTALL_PREFIX/var/rt/run/apache.pid
  414. rm -f $RPM_INSTALL_PREFIX/var/rt/run/ssl_scache
  415. fi