| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440 |
- ##
- ## rt.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package versions
- %define V_rt 3.6.7
- %define V_log_dispatch 2.21
- %define V_html_mason 1.39
- %define V_mldbm 2.01
- %define V_html_format 2.04
- %define V_html_scrubber 0.08
- %define V_module_version 1.02
- # package information
- Name: rt
- Summary: Request Tracker
- URL: http://bestpractical.com/rt/
- Vendor: Best Practical
- Packager: OpenPKG Foundation e.V.
- Distribution: OpenPKG Community
- Class: EVAL
- Group: Ticketing
- License: GPL
- Version: %{V_rt}
- Release: 20080617
- # package options
- %option with_db_sqlite no
- %option with_db_mysql yes
- %option with_db_pgsql no
- %option with_db_oracle no
- # fixing conflicting options
- %if "%{with_db_sqlite}" == "yes" || "%{with_db_pgsql}" == "yes" || "%{with_db_oracle}" == "yes"
- %undefine with_db_mysql
- %define with_db_mysql no
- %endif
- # list of sources
- Source0: http://download.bestpractical.com/pub/rt/release/rt-%{V_rt}.tar.gz
- Source1: http://www.cpan.org/modules/by-module/Log/Log-Dispatch-%{V_log_dispatch}.tar.gz
- Source2: http://www.cpan.org/modules/by-module/HTML/HTML-Mason-%{V_html_mason}.tar.gz
- Source3: http://www.cpan.org/modules/by-authors/id/C/CH/CHAMAS/MLDBM-%{V_mldbm}.tar.gz
- Source4: http://www.cpan.org/modules/by-authors/id/S/SB/SBURKE/HTML-Format-%{V_html_format}.tar.gz
- Source5: http://www.cpan.org/modules/by-authors/id/P/PO/PODMASTER/HTML-Scrubber-%{V_html_scrubber}.tar.gz
- Source6: http://www.cpan.org/modules/by-authors/id/S/SB/SBURKE/Module-Versions-Report-%{V_module_version}.tar.gz
- Source7: rc.rt
- Source8: rtsetup
- Source9: rtcleanup
- Source10: rtupgrade
- Source11: rtapachectl
- Source12: rtapache.conf
- Source13: config.layout
- Source14: rt-mailgate.sh
- Patch0: rt.patch
- # build information
- Prefix: %{l_prefix}
- BuildRoot: %{l_buildroot}
- BuildPreReq: OpenPKG, openpkg >= 20060823, perl, perl-openpkg >= 5.8.3-20051031
- PreReq: OpenPKG, openpkg >= 20060823, perl
- BuildPreReq: perl-sys, perl-util, perl-ds, perl-text, perl-apache, perl-module
- PreReq: perl-sys, perl-util, perl-ds, perl-text, perl-apache, perl-module
- BuildPreReq: perl-dbi, perl-dbix, perl-mail, perl-www, perl-locale, perl-devel, perl-cache
- PreReq: perl-dbi, perl-dbix, perl-mail, perl-www, perl-locale, perl-devel, perl-cache
- BuildPreReq: apache, apache-perl
- PreReq: apache, apache-perl
- %if "%{with_db_sqlite}" == "yes"
- PreReq: sqlite, perl-dbi::with_dbd_sqlite = yes
- %endif
- %if "%{with_db_mysql}" == "yes"
- PreReq: mysql, mysql::with_innobase = yes, perl-dbi::with_dbd_mysql = yes
- %endif
- %if "%{with_db_pgsql}" == "yes"
- PreReq: postgresql, perl-dbi::with_dbd_pgsql = yes
- %endif
- %if "%{with_db_oracle}" == "yes"
- PreReq: oracle, perl-dbi::with_dbd_oracle = yes
- %endif
- PreReq: MTA
- AutoReq: no
- AutoReqProv: no
- %description
- RT is an industrial-grade ticketing system. It lets a group of
- people intelligently and efficiently manage requests submitted by a
- community of users. RT is used by systems administrators, customer
- support staffs, NOCs, developers and even marketing departments at
- over a thousand sites around the world.
- %track
- prog rt = {
- version = %{V_rt}
- url = http://bestpractical.com/rt/download.html
- regex = rt-(__VER__)\.tar\.gz
- }
- prog rt:html-format = {
- version = %{V_html_format}
- url = http://www.cpan.org/modules/by-authors/id/S/SB/SBURKE/
- regex = HTML-Format-(__VER__)\.tar\.gz
- }
- prog rt:html-mason = {
- version = %{V_html_mason}00
- url = http://www.cpan.org/modules/by-module/HTML/
- regex = HTML-Mason-(__VER__)\.tar\.gz
- transform = "s/^(\\d+\\.\\d\\d)$/${1}00/; $_"
- }
- prog rt:log-dispatch = {
- version = %{V_log_dispatch}
- url = http://www.cpan.org/modules/by-module/Log/
- regex = Log-Dispatch-(__VER__)\.tar\.gz
- }
- prog rt:mldbm = {
- version = %{V_mldbm}
- url = http://www.cpan.org/modules/by-authors/id/C/CH/CHAMAS/
- regex = MLDBM-(__VER__)\.tar\.gz
- }
- prog rt:html-scrubber = {
- version = %{V_html_scrubber}
- url = http://www.cpan.org/modules/by-authors/id/P/PO/PODMASTER/
- regex = HTML-Scrubber-(__VER__)\.tar\.gz
- }
- prog rt:module-version = {
- version = %{V_module_version}
- url = http://www.cpan.org/modules/by-authors/id/S/SB/SBURKE/
- regex = Module-Versions-Report-(__VER__)\.tar\.gz
- }
- %prep
- # unpack distribution tarballs
- %setup -q -c
- %setup -q -T -D -a 1
- %setup -q -T -D -a 2
- %setup -q -T -D -a 3
- %setup -q -T -D -a 4
- %setup -q -T -D -a 5
- %setup -q -T -D -a 6
- # patch RT distribution
- cd rt-%{V_rt}
- %patch -p0
- %{l_shtool} install -c -m 0644 %{l_value -s -a} \
- %{SOURCE config.layout} .
- %{l_shtool} subst \
- -e 's;chown;true;g' \
- -e 's;chgrp;true;g' \
- -e 's;chmod;true;g' \
- -e 's;mkdir -p;%{l_shtool} mkdir -p;g' \
- Makefile.in
- %{l_shtool} subst \
- -e 's;Locale::Maketext 1\.04;Locale::Maketext 1.03;' \
- lib/RT/I18N.pm
- %{l_shtool} subst \
- -e 's;/usr/sbin/sendmail;%{l_prefix}/sbin/sendmail;g' \
- etc/RT_Config.pm.in
- %build
- # configure RT part
- cd rt-%{V_rt}
- PERL=%{l_prefix}/bin/perl
- ./configure \
- --enable-layout=OPKG \
- --with-db-host=localhost \
- --with-db-home=%{l_prefix} \
- %if "%{with_db_sqlite}" == "yes"
- --with-db-type=SQLite \
- --with-db-dba=%{l_rusr} \
- --with-db-database=%{l_prefix}/var/rt/run/rt.db \
- --with-db-user=rt \
- --with-db-pass=XXX \
- %endif
- %if "%{with_db_mysql}" == "yes"
- --with-db-type=mysql \
- --with-db-dba=root \
- --with-db-database=rt \
- --with-db-user=rt \
- --with-db-pass=XXX \
- %endif
- %if "%{with_db_pgsql}" == "yes"
- --with-db-type=Pg \
- --with-db-dba=postgresql \
- --with-db-database=rt \
- --with-db-user=rt \
- --with-db-pass=XXX \
- %endif
- %if "%{with_db_oracle}" == "yes"
- --with-db-type=Oracle \
- --with-db-dba=system \
- --with-db-database=rt \
- --with-db-user=rt \
- --with-db-pass=XXX \
- %endif
- --with-web-user=%{l_rusr} \
- --with-web-group=%{l_rgrp} \
- --with-customdir=%{l_prefix}/etc/rt/local \
- --with-customhtmldir=%{l_prefix}/etc/rt/local/html \
- --with-customlibdir=%{l_prefix}/etc/rt/local/lib \
- --with-customlexdir=%{l_prefix}/etc/rt/local/po
- %install
- rm -rf $RPM_BUILD_ROOT
- # perform common Perl prolog operations
- %{l_shtool} mkdir -f -p -m 755 ${RPM_BUILD_ROOT}%{l_prefix}/libexec/rt
- %{l_prefix}/bin/perl-openpkg prepare
- # install remaining prerequisite Perl modules which
- # are not part of the OpenPKG perl-xxx packages.
- %{l_prefix}/bin/perl-openpkg -d Log-Dispatch-%{V_log_dispatch} \
- -l %{l_prefix}/libexec/rt configure build install
- %{l_prefix}/bin/perl-openpkg -d HTML-Mason-%{V_html_mason} \
- -l %{l_prefix}/libexec/rt configure build install
- %{l_prefix}/bin/perl-openpkg -d MLDBM-%{V_mldbm} \
- -l %{l_prefix}/libexec/rt configure build install
- %{l_prefix}/bin/perl-openpkg -d HTML-Format-%{V_html_format} \
- -l %{l_prefix}/libexec/rt configure build install
- %{l_prefix}/bin/perl-openpkg -d HTML-Scrubber-%{V_html_scrubber} \
- -l %{l_prefix}/libexec/rt configure build install
- %{l_prefix}/bin/perl-openpkg -d Module-Versions-Report-%{V_module_version} \
- -l %{l_prefix}/libexec/rt configure build install
- %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
- # create installation file hierarchy
- %{l_shtool} mkdir -f -p -m 0755 \
- $RPM_BUILD_ROOT%{l_prefix}/sbin \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rt \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
- $RPM_BUILD_ROOT%{l_prefix}/cgi/rt \
- $RPM_BUILD_ROOT%{l_prefix}/share/rt \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/etc/upgrade \
- $RPM_BUILD_ROOT%{l_prefix}/var/rt/mason-data \
- $RPM_BUILD_ROOT%{l_prefix}/var/rt/mason-session \
- $RPM_BUILD_ROOT%{l_prefix}/var/rt/log \
- $RPM_BUILD_ROOT%{l_prefix}/var/rt/run
- # perform RT installation procedure
- ( cd rt-%{V_rt}
- %{l_make} %{l_mflags} \
- config-install dirs libs-install etc-install bin-install \
- sbin-install html-install doc-install \
- DESTDIR=$RPM_BUILD_ROOT
- cp -rp \
- etc/upgrade/* \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/etc/upgrade/
- %{l_shtool} install -c -m 0644 \
- -e '/Set($WebBaseURL/s;"[^"]*";"";' \
- etc/RT_Config.pm \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rt/RT_SiteConfig.pm
- ) || exit $?
- # post-adjust installation hierarchy
- %{l_shtool} mkln -f -s \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rt/RT_SiteConfig.pm \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/etc/RT_SiteConfig.pm
- mv \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/WebRT/html/NoAuth/css/print.css \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rt/print.css
- %{l_shtool} mkln -f -s \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rt/print.css \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/WebRT/html/NoAuth/css/print.css
- mv \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/local \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rt/local
- %{l_shtool} mkln -f -s \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rt/local \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/local
- mv \
- $RPM_BUILD_ROOT%{l_prefix}/bin/webmux.pl \
- $RPM_BUILD_ROOT%{l_prefix}/bin/mason_handler.fcgi \
- $RPM_BUILD_ROOT%{l_prefix}/cgi/rt/
- mv \
- $RPM_BUILD_ROOT%{l_prefix}/bin/rt-crontool \
- $RPM_BUILD_ROOT%{l_prefix}/bin/rt-mailgate \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools/
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE rt-mailgate.sh} \
- $RPM_BUILD_ROOT%{l_prefix}/bin/rt-mailgate
- # strip installation hierarchy
- rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/convert*
- rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/*.svc
- rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools/rt-test-dependencies
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/t
- rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/RT.pm.in
- rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/xgettext.pl
- rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/pod2test
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/rt
- # install own setup/cleanup/upgrade script
- %if "%{with_db_sqlite}" == "yes"
- rt_db_dba=%{l_rusr}
- %endif
- %if "%{with_db_mysql}" == "yes"
- rt_db_dba=root
- %endif
- %if "%{with_db_pgsql}" == "yes"
- rt_db_dba=postgresql
- %endif
- %if "%{with_db_oracle}" == "yes"
- rt_db_dba=system
- %endif
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- -e "s;@rt_db_dba@;$rt_db_dba;g" \
- %{SOURCE rtsetup} %{SOURCE rtcleanup} %{SOURCE rtupgrade} \
- $RPM_BUILD_ROOT%{l_prefix}/sbin/
- # install OpenPKG run-command script
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE rc.rt} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
- # install Apache "apachectl" wrapper
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- %{SOURCE rtapachectl} \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools/
- # install Apache configuration
- l_hostname=`%{l_shtool} echo -e %h`
- l_domainname=`%{l_shtool} echo -e %d | cut -c2-`
- %{l_shtool} install -c -m 755 %{l_value -s -a} \
- -e "s;@l_hostname@;$l_hostname;g" \
- -e "s;@l_domainname@;$l_domainname;g" \
- %{SOURCE rtapache.conf} \
- $RPM_BUILD_ROOT%{l_prefix}/etc/rt/
- # final post-adjustments to installation hierarchy
- find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt \
- -type f -name "*.html" -print | xargs chmod 644
- find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt \
- -type f -name "*.pm" -print | xargs chmod 644
- find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt \
- -type f -print | xargs chmod a+r
- find $RPM_BUILD_ROOT%{l_prefix}/libexec/rt \
- -type d -print | xargs chmod 755
- find ${RPM_BUILD_ROOT}${l_prefix} -name .packlist -print | xargs rm -f
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
- %{l_files_std} `cat perl-openpkg-files` \
- '%{l_prefix}/libexec/rt' \
- '%attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/libexec/rt/tools/rt-setup-database' \
- '%attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/libexec/rt/tools/rt-crontool' \
- '%attr(755,%{l_musr},%{l_mgrp}) %{l_prefix}/libexec/rt/tools/rt-mailgate' \
- '%config %attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/rt/RT_SiteConfig.pm' \
- '%config %attr(640,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/rt/rtapache.conf' \
- '%config %attr(644,%{l_musr},%{l_rgrp}) %{l_prefix}/etc/rt/print.css' \
- '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/mason-data' \
- '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/mason-data/*' \
- '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/mason-session' \
- '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/log' \
- '%attr(750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/rt/run'
- %files -f files
- %clean
- rm -rf $RPM_BUILD_ROOT
- %post
- if [ $1 -eq 1 ]; then
- # activate in MTA configuration
- aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file`
- aliases_update=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update`
- if [ ".$aliases_file" != . ]; then
- ( echo "rt: \"|$RPM_INSTALL_PREFIX/bin/rt-mailgate --action correspond --queue general --url http://127.0.0.1:8380/\""
- echo "rt-comment: \"|$RPM_INSTALL_PREFIX/bin/rt-mailgate --action comment --queue general --url http://127.0.0.1:8380/\""
- ) | %{l_rpmtool} config -a -i "$RPM_INSTALL_PREFIX:rt" $aliases_file
- fi
- if [ ".$aliases_update" != . ]; then
- eval $aliases_update
- fi
- # display final hint after initial installation
- ( echo "To complete installation of RT, please check the file"
- echo " $RPM_INSTALL_PREFIX/etc/rt/RT_SiteConfig.pm"
- echo "In particular, you have to assign a password to the RT"
- echo "database user. Then you have to start the MySQL RDBMS and"
- echo "create the initial RT database with:"
- echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc mysql start"
- echo " \$ $RPM_INSTALL_PREFIX/sbin/rtsetup"
- echo "After this post-installation, start RT by running"
- echo " \$ $RPM_INSTALL_PREFIX/bin/openpkg rc rt start"
- echo "and connect with a browser to:"
- echo " http://127.0.0.1:8380/"
- echo "Login as 'root' (with initial password 'password')"
- echo "to change the password to a custom one."
- ) | %{l_rpmtool} msg -b -t notice
- elif [ $1 -gt 1 ]; then
- # display final hint after upgrading
- ( echo "If you have an old RT database you can erase it with:"
- echo " \$ $RPM_INSTALL_PREFIX/sbin/rtcleanup"
- echo "Upgrading from an earlier RT 3.x database you can with:"
- echo " \$ $RPM_INSTALL_PREFIX/sbin/rtupgrade <old-rt-version>"
- ) | %{l_rpmtool} msg -b -t notice
- fi
- %preun
- if [ $1 -eq 0 ]; then
- # stop perhaps still running server
- $RPM_INSTALL_PREFIX/bin/openpkg rc rt stop
- # deactivate in MTA configuration
- aliases_file=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_file`
- aliases_update=`$RPM_INSTALL_PREFIX/bin/openpkg rc --query MTA_aliases_update`
- if [ ".$aliases_file" != . ]; then
- %{l_rpmtool} config -r -i "$RPM_INSTALL_PREFIX:rt" $aliases_file
- fi
- if [ ".$aliases_update" != . ]; then
- eval $aliases_update
- fi
- # remove generated files
- rm -f $RPM_INSTALL_PREFIX/var/rt/mason-session/*
- rm -rf $RPM_INSTALL_PREFIX/var/rt/mason-data/*/*
- rm -f $RPM_INSTALL_PREFIX/var/rt/log/*
- rm -f $RPM_INSTALL_PREFIX/var/rt/run/apache.pid
- rm -f $RPM_INSTALL_PREFIX/var/rt/run/ssl_scache
- fi
|