rt.spec 18 KB

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