rt.spec 19 KB

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