RPM_BUILD_ROOT -> %%{buildroot}, put braces around lspp and use_alternatives

Patch by David Walser (Mageia)
This commit is contained in:
Jiri Popelka 2015-07-07 10:08:06 +02:00
parent 10beaefb72
commit af6fe591d9

View File

@ -11,7 +11,7 @@ Summary: CUPS printing system
Name: cups Name: cups
Epoch: 1 Epoch: 1
Version: 2.0.3 Version: 2.0.3
Release: 2%{?dist} Release: 3%{?dist}
License: GPLv2 License: GPLv2
Url: http://www.cups.org/ Url: http://www.cups.org/
Source0: http://www.cups.org/software/%{version}/cups-%{version}-source.tar.bz2 Source0: http://www.cups.org/software/%{version}/cups-%{version}-source.tar.bz2
@ -85,7 +85,7 @@ BuildRequires: automake
# Make sure we get postscriptdriver tags. # Make sure we get postscriptdriver tags.
BuildRequires: python-cups BuildRequires: python-cups
%if %lspp %if %{lspp}
BuildRequires: libselinux-devel BuildRequires: libselinux-devel
BuildRequires: audit-libs-devel BuildRequires: audit-libs-devel
%endif %endif
@ -111,7 +111,7 @@ Requires: cups-filters
Summary: CUPS printing system - client programs Summary: CUPS printing system - client programs
License: GPLv2 License: GPLv2
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
%if %use_alternatives %if %{use_alternatives}
Provides: /usr/bin/lpq /usr/bin/lpr /usr/bin/lp /usr/bin/cancel /usr/bin/lprm /usr/bin/lpstat Provides: /usr/bin/lpq /usr/bin/lpr /usr/bin/lp /usr/bin/cancel /usr/bin/lprm /usr/bin/lpstat
Requires: /usr/sbin/alternatives Requires: /usr/sbin/alternatives
%endif %endif
@ -261,7 +261,7 @@ Sends IPP requests to the specified URI and tests and/or displays the results.
# Set the default for SyncOnClose to Yes. # Set the default for SyncOnClose to Yes.
%patch38 -p1 -b .synconclose %patch38 -p1 -b .synconclose
%if %lspp %if %{lspp}
# LSPP support. # LSPP support.
%patch100 -p1 -b .lspp %patch100 -p1 -b .lspp
%endif %endif
@ -286,7 +286,7 @@ autoconf -I config-scripts
export CFLAGS="$RPM_OPT_FLAGS -fstack-protector-all -DLDAP_DEPRECATED=1" export CFLAGS="$RPM_OPT_FLAGS -fstack-protector-all -DLDAP_DEPRECATED=1"
# --enable-debug to avoid stripping binaries # --enable-debug to avoid stripping binaries
%configure --with-docdir=%{_datadir}/%{name}/www --enable-debug \ %configure --with-docdir=%{_datadir}/%{name}/www --enable-debug \
%if %lspp %if %{lspp}
--enable-lspp \ --enable-lspp \
%endif %endif
--with-cupsd-file-perm=0755 \ --with-cupsd-file-perm=0755 \
@ -305,65 +305,65 @@ export CFLAGS="$RPM_OPT_FLAGS -fstack-protector-all -DLDAP_DEPRECATED=1"
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
make BUILDROOT=$RPM_BUILD_ROOT install make BUILDROOT=%{buildroot} install
rm -rf $RPM_BUILD_ROOT%{_initddir} \ rm -rf %{buildroot}%{_initddir} \
$RPM_BUILD_ROOT%{_sysconfdir}/init.d \ %{buildroot}%{_sysconfdir}/init.d \
$RPM_BUILD_ROOT%{_sysconfdir}/rc?.d %{buildroot}%{_sysconfdir}/rc?.d
mkdir -p $RPM_BUILD_ROOT%{_unitdir} mkdir -p %{buildroot}%{_unitdir}
find $RPM_BUILD_ROOT%{_datadir}/cups/model -name "*.ppd" |xargs gzip -n9f find %{buildroot}%{_datadir}/cups/model -name "*.ppd" |xargs gzip -n9f
%if %use_alternatives %if %{use_alternatives}
pushd $RPM_BUILD_ROOT%{_bindir} pushd %{buildroot}%{_bindir}
for i in cancel lp lpq lpr lprm lpstat; do for i in cancel lp lpq lpr lprm lpstat; do
mv $i $i.cups mv $i $i.cups
done done
cd $RPM_BUILD_ROOT%{_sbindir} cd %{buildroot}%{_sbindir}
mv lpc lpc.cups mv lpc lpc.cups
cd $RPM_BUILD_ROOT%{_mandir}/man1 cd %{buildroot}%{_mandir}/man1
for i in cancel lp lpq lpr lprm lpstat; do for i in cancel lp lpq lpr lprm lpstat; do
mv $i.1 $i-cups.1 mv $i.1 $i-cups.1
done done
cd $RPM_BUILD_ROOT%{_mandir}/man8 cd %{buildroot}%{_mandir}/man8
mv lpc.8 lpc-cups.8 mv lpc.8 lpc-cups.8
popd popd
%endif %endif
mv $RPM_BUILD_ROOT%{_unitdir}/org.cups.cupsd.path $RPM_BUILD_ROOT%{_unitdir}/cups.path mv %{buildroot}%{_unitdir}/org.cups.cupsd.path %{buildroot}%{_unitdir}/cups.path
mv $RPM_BUILD_ROOT%{_unitdir}/org.cups.cupsd.service $RPM_BUILD_ROOT%{_unitdir}/cups.service mv %{buildroot}%{_unitdir}/org.cups.cupsd.service %{buildroot}%{_unitdir}/cups.service
mv $RPM_BUILD_ROOT%{_unitdir}/org.cups.cupsd.socket $RPM_BUILD_ROOT%{_unitdir}/cups.socket mv %{buildroot}%{_unitdir}/org.cups.cupsd.socket %{buildroot}%{_unitdir}/cups.socket
mv $RPM_BUILD_ROOT%{_unitdir}/org.cups.cups-lpd.socket $RPM_BUILD_ROOT%{_unitdir}/cups-lpd.socket mv %{buildroot}%{_unitdir}/org.cups.cups-lpd.socket %{buildroot}%{_unitdir}/cups-lpd.socket
mv $RPM_BUILD_ROOT%{_unitdir}/org.cups.cups-lpd@.service $RPM_BUILD_ROOT%{_unitdir}/cups-lpd@.service mv %{buildroot}%{_unitdir}/org.cups.cups-lpd@.service %{buildroot}%{_unitdir}/cups-lpd@.service
/bin/sed -i -e "s,org.cups.cupsd,cups,g" $RPM_BUILD_ROOT%{_unitdir}/cups.service /bin/sed -i -e "s,org.cups.cupsd,cups,g" %{buildroot}%{_unitdir}/cups.service
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps $RPM_BUILD_ROOT%{_sysconfdir}/X11/sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/X11/applnk/System $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d mkdir -p %{buildroot}%{_datadir}/pixmaps %{buildroot}%{_sysconfdir}/X11/sysconfig %{buildroot}%{_sysconfdir}/X11/applnk/System %{buildroot}%{_sysconfdir}/logrotate.d
install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/pixmaps install -p -m 644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps
install -p -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/cups install -p -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/cups
install -p -m 755 %{SOURCE7} $RPM_BUILD_ROOT%{cups_serverbin}/backend/ncp install -p -m 755 %{SOURCE7} %{buildroot}%{cups_serverbin}/backend/ncp
# Ship an rpm macro for where to put driver executables. # Ship an rpm macro for where to put driver executables.
mkdir -p $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d
install -m 0644 %{SOURCE8} $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d install -m 0644 %{SOURCE8} %{buildroot}%{_rpmconfigdir}/macros.d
# Ship a printers.conf file, and a client.conf file. That way, they get # Ship a printers.conf file, and a client.conf file. That way, they get
# their SELinux file contexts set correctly. # their SELinux file contexts set correctly.
touch $RPM_BUILD_ROOT%{_sysconfdir}/cups/printers.conf touch %{buildroot}%{_sysconfdir}/cups/printers.conf
touch $RPM_BUILD_ROOT%{_sysconfdir}/cups/classes.conf touch %{buildroot}%{_sysconfdir}/cups/classes.conf
touch $RPM_BUILD_ROOT%{_sysconfdir}/cups/client.conf touch %{buildroot}%{_sysconfdir}/cups/client.conf
touch $RPM_BUILD_ROOT%{_sysconfdir}/cups/subscriptions.conf touch %{buildroot}%{_sysconfdir}/cups/subscriptions.conf
touch $RPM_BUILD_ROOT%{_sysconfdir}/cups/lpoptions touch %{buildroot}%{_sysconfdir}/cups/lpoptions
# LSB 3.2 printer driver directory # LSB 3.2 printer driver directory
mkdir -p $RPM_BUILD_ROOT%{_datadir}/ppd mkdir -p %{buildroot}%{_datadir}/ppd
# Remove unshipped files. # Remove unshipped files.
rm -rf $RPM_BUILD_ROOT%{_mandir}/cat? $RPM_BUILD_ROOT%{_mandir}/*/cat? rm -rf %{buildroot}%{_mandir}/cat? %{buildroot}%{_mandir}/*/cat?
rm -f $RPM_BUILD_ROOT%{_datadir}/applications/cups.desktop rm -f %{buildroot}%{_datadir}/applications/cups.desktop
rm -rf $RPM_BUILD_ROOT%{_datadir}/icons rm -rf %{buildroot}%{_datadir}/icons
# there are pdf-banners shipped with cups-filters (#919489) # there are pdf-banners shipped with cups-filters (#919489)
rm -rf $RPM_BUILD_ROOT%{_datadir}/cups/banners rm -rf %{buildroot}%{_datadir}/cups/banners
rm -f $RPM_BUILD_ROOT%{_datadir}/cups/data/testprint rm -f %{buildroot}%{_datadir}/cups/data/testprint
# install /usr/lib/tmpfiles.d/cups.conf (bug #656566, bug #893834) # install /usr/lib/tmpfiles.d/cups.conf (bug #656566, bug #893834)
mkdir -p ${RPM_BUILD_ROOT}%{_tmpfilesdir} mkdir -p ${RPM_BUILD_ROOT}%{_tmpfilesdir}
@ -389,7 +389,7 @@ c /dev/lp2 0660 root lp - 6:2
c /dev/lp3 0660 root lp - 6:3 c /dev/lp3 0660 root lp - 6:3
EOF EOF
find $RPM_BUILD_ROOT -type f -o -type l | sed ' find %{buildroot} -type f -o -type l | sed '
s:.*\('%{_datadir}'/\)\([^/_]\+\)\(.*\.po$\):%lang(\2) \1\2\3: s:.*\('%{_datadir}'/\)\([^/_]\+\)\(.*\.po$\):%lang(\2) \1\2\3:
/^%lang(C)/d /^%lang(C)/d
/^\([^%].*\)/d /^\([^%].*\)/d
@ -413,7 +413,7 @@ done
exit 0 exit 0
%post client %post client
%if %use_alternatives %if %{use_alternatives}
/usr/sbin/alternatives --install %{_bindir}/lpr print %{_bindir}/lpr.cups 40 \ /usr/sbin/alternatives --install %{_bindir}/lpr print %{_bindir}/lpr.cups 40 \
--slave %{_bindir}/lp print-lp %{_bindir}/lp.cups \ --slave %{_bindir}/lp print-lp %{_bindir}/lp.cups \
--slave %{_bindir}/lpq print-lpq %{_bindir}/lpq.cups \ --slave %{_bindir}/lpq print-lpq %{_bindir}/lpq.cups \
@ -444,7 +444,7 @@ exit 0
exit 0 exit 0
%preun client %preun client
%if %use_alternatives %if %{use_alternatives}
if [ $1 -eq 0 ] ; then if [ $1 -eq 0 ] ; then
/usr/sbin/alternatives --remove print %{_bindir}/lpr.cups /usr/sbin/alternatives --remove print %{_bindir}/lpr.cups
fi fi
@ -618,6 +618,9 @@ rm -f %{cups_serverbin}/backend/smb
%{_mandir}/man5/ipptoolfile.5.gz %{_mandir}/man5/ipptoolfile.5.gz
%changelog %changelog
* Tue Jul 07 2015 Jiri Popelka <jpopelka@redhat.com> - 1:2.0.3-3
- RPM_BUILD_ROOT -> %%{buildroot}, put braces around lspp and use_alternatives
* Thu Jun 25 2015 Tim Waugh <twaugh@redhat.com> - 1:2.0.3-2 * Thu Jun 25 2015 Tim Waugh <twaugh@redhat.com> - 1:2.0.3-2
- Fix slow resume of jobs after restart (STR #4646). - Fix slow resume of jobs after restart (STR #4646).
- Fix redirection from CGI scripts (bug #1232030, STR #4538). - Fix redirection from CGI scripts (bug #1232030, STR #4538).