rt.spec 18 KB

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