From 038e81a9cc594c21d9c752e843971d56e6b25f27 Mon Sep 17 00:00:00 2001 From: Richard Siddall Date: Sat, 5 Jul 2014 00:09:22 -0400 Subject: [PATCH] Since the site Perl folders are in very different locations on CentOS 6 compared to CentOS 5, switch to building lists of files instead of hard-coding their locations in the %files section. --- packaging/rpm/qpsmtpd.spec.in | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/packaging/rpm/qpsmtpd.spec.in b/packaging/rpm/qpsmtpd.spec.in index 954a448..1021966 100644 --- a/packaging/rpm/qpsmtpd.spec.in +++ b/packaging/rpm/qpsmtpd.spec.in @@ -126,6 +126,28 @@ if [ "$(cat %{name}-%{version}-%{release}-filelist)X" = "X" ] ; then exit -1 fi +find ${RPM_BUILD_ROOT}%{_prefix} -type f -print | \ + sed "s@^$RPM_BUILD_ROOT@@g" | \ + grep -v packaging | \ + grep -v README.selinux | \ + grep -v /Apache | cat - %{name}-%{version}-%{release}-filelist | sort | uniq -u > %{name}-%{version}-%{release}-async-filelist +if [ "$(cat %{name}-%{version}-%{release}-async-filelist)X" = "X" ] ; then + echo "ERROR: EMPTY FILE LIST" + exit -1 +fi + +find ${RPM_BUILD_ROOT}%{_prefix} -type f -print | \ + sed "s@^$RPM_BUILD_ROOT@@g" | \ + grep -v [Aa]sync | \ + grep -v packaging | \ + grep -v /Danga | \ + grep -v Qpsmtpd/ConfigServer.pm | \ + grep -v Qpsmtpd/PollServer.pm | cat - %{name}-%{version}-%{release}-filelist | sort | uniq -u > %{name}-%{version}-%{release}-apache-filelist +if [ "$(cat %{name}-%{version}-%{release}-apache-filelist)X" = "X" ] ; then + echo "ERROR: EMPTY FILE LIST" + exit -1 +fi + %files -f %{name}-%{version}-%{release}-filelist %defattr(-,root,root) %doc CREDITS Changes LICENSE README README.plugins STATUS @@ -135,22 +157,13 @@ fi %attr(2750,qpsmtpd,clamav) %dir %{_localstatedir}/spool/qpsmtpd %attr(0750,smtpd,smtpd) %dir %{_localstatedir}/log/qpsmtpd -%files apache +%files apache -f %{name}-%{version}-%{release}-apache-filelist %defattr(-,root,root) -%{_prefix}/lib/perl5/site_perl/Apache/Qpsmtpd.pm -%{_mandir}/man3/Apache::Qpsmtpd.3pm.gz %config(noreplace) %{_sysconfdir}/httpd/conf.d/* %doc %{_docdir}/%{name}-apache-%{version}/README.selinux -%files async +%files async -f %{name}-%{version}-%{release}-async-filelist %defattr(-,root,root) -%{_bindir}/qpsmtpd-async -%{_prefix}/lib/perl5/site_perl/Danga/Client.pm -%{_prefix}/lib/perl5/site_perl/Danga/TimeoutSocket.pm -%{_prefix}/lib/perl5/site_perl/Qpsmtpd/ConfigServer.pm -%{_prefix}/lib/perl5/site_perl/Qpsmtpd/Plugin/Async/DNSBLBase.pm -%{_prefix}/lib/perl5/site_perl/Qpsmtpd/PollServer.pm -%{_mandir}/man1/qpsmtpd-async.1.gz %{_datadir}/%{name}/plugins/async/* %files xinetd