commit 9e46a6d572ab5fe802cf8e521811476122c4aa06 Author: Ralf Corsépius <corsepiu@xxxxxxxxxxxxxxxxx> Date: Thu Feb 2 06:29:54 2012 +0100 Fix shebangs. - Make testsuite files executable (enables rpm's perl module dep tracking). - Build *-tests, iff devel_mode was given. - Misc. specfile massaging. rt3.spec | 71 +++++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 43 insertions(+), 28 deletions(-) --- diff --git a/rt3.spec b/rt3.spec index f4eb88f..03a3ad3 100644 --- a/rt3.spec +++ b/rt3.spec @@ -41,7 +41,7 @@ Name: rt3 Version: 3.8.11 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Request tracker 3 Group: Applications/Internet @@ -54,6 +54,7 @@ Source4: README.fedora.in Source5: rt3.logrotate.in Patch0: rt-%{version}-config.diff +Patch1: rt-%{version}-shebang.diff Patch2: rt-%{version}-Makefile.diff Patch3: rt-%{version}-test-dependencies.diff @@ -160,10 +161,10 @@ BuildRequires: perl(XML::RSS) >= 1.05 BuildRequires: /usr/bin/pod2man BuildRequires: /usr/sbin/apachectl -# the original sources carry bundled versions of these +# the original sources carry bundled versions of these ... Requires: /usr/share/fonts/google-droid/DroidSansFallback.ttf Requires: /usr/share/fonts/google-droid/DroidSans.ttf - +# ... we use symlinks to the system-wide versions ... BuildRequires: /usr/share/fonts/google-droid/DroidSansFallback.ttf BuildRequires: /usr/share/fonts/google-droid/DroidSans.ttf @@ -222,6 +223,7 @@ RT is an enterprise-grade ticketing system which enables a group of people to intelligently and efficiently manage tasks, issues, and requests submitted by a community of users. + %package mailgate Summary: rt3's mailgate utility. Group: Applications/Internet @@ -233,29 +235,29 @@ Requires: perl(HTML::FormatText) %description mailgate %{summary} + +%if %{with devel_mode} %package tests Summary: Test suite for package rt3 Group: Development/Debug Requires: %{name} = %{version}-%{release} Requires: /usr/bin/prove Requires(postun): %{__rm} -Requires: perl(DBD::SQLite) -Requires: perl(HTML::Mason::Compiler) -Requires: perl(HTML::Mason::Compiler::ToObject) -Requires: perl(GnuPG::Interface) -Requires: perl(PerlIO::eol) -Requires: perl(RT::Test) -Requires: perl(String::ShellQuote) -Requires: perl(Test::HTTP::Server::Simple::StashWarnings) -Requires: perl(Test::Deep) -Requires: perl(Test::Expect) -Requires: perl(Test::MockTime) -Requires: perl(Test::Warn) +Requires: perl(DBD::SQLite) +Requires: perl(GnuPG::Interface) +Requires: perl(PerlIO::eol) +Requires: perl(strict) +Requires: perl(Test::HTTP::Server::Simple::StashWarnings) %description tests %{summary} -%if %{with devel_mode} +%postun tests +if [ $1 -eq 0 ]; then + %{__rm} -rf %{perl_testdir}/%{name} +fi + + %package -n perl-RT-Test Summary: rt3's test utility module Group: Applications/Internet @@ -265,7 +267,8 @@ Requires: perl(Log::Dispatch::Perl) %description -n perl-RT-Test %{summary} -%endif + +%endif # devel_mode %prep %setup -q -n rt-%{version} @@ -286,6 +289,7 @@ rm -rf autom4te.cache config.log config.status find bin sbin etc -name '*.in' | while read a; do d=$(echo "$a" | sed 's,\.in$,,'); rm "$d"; done %patch0 -p1 +%patch1 -p1 %patch2 -p1 %patch3 -p1 @@ -322,6 +326,15 @@ sed -i \ -e 's,-o $(BIN_OWNER) -g $(RTGROUP),,g' \ Makefile.in +# Fix up broken shebangs +sed -i \ + -e "s,^#!/usr/bin/env perl,#!%{__perl}," \ + -e "s,^#!/opt/perl/bin/perl,#!%{__perl}," \ +t/*/*.t sbin/rt-message-catalog t/shredder/utils.pl + +# Make scripts executable +find t \( -name '*.t' -o -name '*.pl' \) -exec chmod +x {} \; + %build %configure \ --with-apachectl=/usr/sbin/apachectl \ @@ -368,8 +381,8 @@ sed -e 's,@RT3_WWWDIR@,%{RT3_WWWDIR},g' \ %{SOURCE3} > ${RPM_BUILD_ROOT}%{_sysconfdir}/httpd/conf.d/rt3.conf mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1 -install -m 0644 bin/rt-mailgate.1 bin/mason_handler.fcgi.1 \ - ${RPM_BUILD_ROOT}%{_mandir}/man1 +install -m 0644 bin/rt-mailgate.1 ${RPM_BUILD_ROOT}%{_mandir}/man1 +install -m 0644 bin/mason_handler.fcgi.1 ${RPM_BUILD_ROOT}%{_mandir}/man1 if [ "%{_bindir}" != "%{RT3_BINDIR}" ]; then mkdir -p ${RPM_BUILD_ROOT}%{_bindir} @@ -406,7 +419,7 @@ cp %{SOURCE1} ${RPM_BUILD_ROOT}%{perl_testdir}/%{name} # pod.t can't be run outside of the source-tree rm -rf ${RPM_BUILD_ROOT}%{perl_testdir}/%{name}/t/pod.t -# Some of tests want t/../share/html +# Some of the tests want t/../share/html install -d -m755 ${RPM_BUILD_ROOT}%{perl_testdir}/%{name}/share ln -s %{RT3_WWWDIR} ${RPM_BUILD_ROOT}%{perl_testdir}/%{name}/share/html @@ -415,9 +428,9 @@ find ${RPM_BUILD_ROOT}%{RT3_WWWDIR} \ -type f -exec chmod a-x {} \; %check -# The tests don't work: -# - Require to be run as root -# - Require an operational rt3 system +# The tests don't work in buildroots, they +# - require to be run as root +# - require an operational rt3 system %{?with_runtests:make test} %postun @@ -425,10 +438,6 @@ if [ $1 -eq 0 ]; then %{__rm} -rf %{RT3_CACHEDIR} fi -%postun tests -if [ $1 -eq 0 ]; then - %{__rm} -rf %{perl_testdir}/%{name} -fi %files %defattr(-,root,root,-) @@ -474,11 +483,11 @@ fi %{_sbindir}/rt-mailgate %{_mandir}/man1/rt-mailgate* +%if %{with devel_mode} %files tests %defattr(-,root,root,-) %{perl_testdir}/%{name} -%if %{with devel_mode} %files -n perl-RT-Test %defattr(-,root,root,-) %dir %{RT3_LIBDIR}/RT @@ -486,6 +495,12 @@ fi %endif %changelog +* Tue Feb 02 2012 Ralf Corsépius <corsepiu@xxxxxxxxxxxxxxxxx> - 3.8.11-7 +- Fix shebangs. +- Make testsuite files executable (enables rpm's perl module dep tracking). +- Build *-tests, iff devel_mode was given. +- Misc. specfile massaging. + * Tue Jan 31 2012 Ralf Corsépius <corsepiu@xxxxxxxxxxxxxxxxx> - 3.8.11-6 - Misc. specfile improvements. -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl perl-devel mailing list perl-devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/perl-devel