From af6fe591d9ff8fd53a9d686ea57dde730b872675 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Tue, 7 Jul 2015 10:08:06 +0200 Subject: [PATCH] RPM_BUILD_ROOT -> %%{buildroot}, put braces around lspp and use_alternatives Patch by David Walser (Mageia) --- cups.spec | 87 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/cups.spec b/cups.spec index 0fc2a1d..26881c2 100644 --- a/cups.spec +++ b/cups.spec @@ -11,7 +11,7 @@ Summary: CUPS printing system Name: cups Epoch: 1 Version: 2.0.3 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 Url: http://www.cups.org/ Source0: http://www.cups.org/software/%{version}/cups-%{version}-source.tar.bz2 @@ -85,7 +85,7 @@ BuildRequires: automake # Make sure we get postscriptdriver tags. BuildRequires: python-cups -%if %lspp +%if %{lspp} BuildRequires: libselinux-devel BuildRequires: audit-libs-devel %endif @@ -111,7 +111,7 @@ Requires: cups-filters Summary: CUPS printing system - client programs License: GPLv2 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 Requires: /usr/sbin/alternatives %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. %patch38 -p1 -b .synconclose -%if %lspp +%if %{lspp} # LSPP support. %patch100 -p1 -b .lspp %endif @@ -286,7 +286,7 @@ autoconf -I config-scripts export CFLAGS="$RPM_OPT_FLAGS -fstack-protector-all -DLDAP_DEPRECATED=1" # --enable-debug to avoid stripping binaries %configure --with-docdir=%{_datadir}/%{name}/www --enable-debug \ -%if %lspp +%if %{lspp} --enable-lspp \ %endif --with-cupsd-file-perm=0755 \ @@ -305,65 +305,65 @@ export CFLAGS="$RPM_OPT_FLAGS -fstack-protector-all -DLDAP_DEPRECATED=1" make %{?_smp_mflags} %install -make BUILDROOT=$RPM_BUILD_ROOT install +make BUILDROOT=%{buildroot} install -rm -rf $RPM_BUILD_ROOT%{_initddir} \ - $RPM_BUILD_ROOT%{_sysconfdir}/init.d \ - $RPM_BUILD_ROOT%{_sysconfdir}/rc?.d -mkdir -p $RPM_BUILD_ROOT%{_unitdir} +rm -rf %{buildroot}%{_initddir} \ + %{buildroot}%{_sysconfdir}/init.d \ + %{buildroot}%{_sysconfdir}/rc?.d +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 -pushd $RPM_BUILD_ROOT%{_bindir} +%if %{use_alternatives} +pushd %{buildroot}%{_bindir} for i in cancel lp lpq lpr lprm lpstat; do mv $i $i.cups done -cd $RPM_BUILD_ROOT%{_sbindir} +cd %{buildroot}%{_sbindir} mv lpc lpc.cups -cd $RPM_BUILD_ROOT%{_mandir}/man1 +cd %{buildroot}%{_mandir}/man1 for i in cancel lp lpq lpr lprm lpstat; do mv $i.1 $i-cups.1 done -cd $RPM_BUILD_ROOT%{_mandir}/man8 +cd %{buildroot}%{_mandir}/man8 mv lpc.8 lpc-cups.8 popd %endif -mv $RPM_BUILD_ROOT%{_unitdir}/org.cups.cupsd.path $RPM_BUILD_ROOT%{_unitdir}/cups.path -mv $RPM_BUILD_ROOT%{_unitdir}/org.cups.cupsd.service $RPM_BUILD_ROOT%{_unitdir}/cups.service -mv $RPM_BUILD_ROOT%{_unitdir}/org.cups.cupsd.socket $RPM_BUILD_ROOT%{_unitdir}/cups.socket -mv $RPM_BUILD_ROOT%{_unitdir}/org.cups.cups-lpd.socket $RPM_BUILD_ROOT%{_unitdir}/cups-lpd.socket -mv $RPM_BUILD_ROOT%{_unitdir}/org.cups.cups-lpd@.service $RPM_BUILD_ROOT%{_unitdir}/cups-lpd@.service -/bin/sed -i -e "s,org.cups.cupsd,cups,g" $RPM_BUILD_ROOT%{_unitdir}/cups.service +mv %{buildroot}%{_unitdir}/org.cups.cupsd.path %{buildroot}%{_unitdir}/cups.path +mv %{buildroot}%{_unitdir}/org.cups.cupsd.service %{buildroot}%{_unitdir}/cups.service +mv %{buildroot}%{_unitdir}/org.cups.cupsd.socket %{buildroot}%{_unitdir}/cups.socket +mv %{buildroot}%{_unitdir}/org.cups.cups-lpd.socket %{buildroot}%{_unitdir}/cups-lpd.socket +mv %{buildroot}%{_unitdir}/org.cups.cups-lpd@.service %{buildroot}%{_unitdir}/cups-lpd@.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 -install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/pixmaps -install -p -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/cups -install -p -m 755 %{SOURCE7} $RPM_BUILD_ROOT%{cups_serverbin}/backend/ncp +mkdir -p %{buildroot}%{_datadir}/pixmaps %{buildroot}%{_sysconfdir}/X11/sysconfig %{buildroot}%{_sysconfdir}/X11/applnk/System %{buildroot}%{_sysconfdir}/logrotate.d +install -p -m 644 %{SOURCE2} %{buildroot}%{_datadir}/pixmaps +install -p -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/cups +install -p -m 755 %{SOURCE7} %{buildroot}%{cups_serverbin}/backend/ncp # Ship an rpm macro for where to put driver executables. -mkdir -p $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d -install -m 0644 %{SOURCE8} $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d +mkdir -p %{buildroot}%{_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 # their SELinux file contexts set correctly. -touch $RPM_BUILD_ROOT%{_sysconfdir}/cups/printers.conf -touch $RPM_BUILD_ROOT%{_sysconfdir}/cups/classes.conf -touch $RPM_BUILD_ROOT%{_sysconfdir}/cups/client.conf -touch $RPM_BUILD_ROOT%{_sysconfdir}/cups/subscriptions.conf -touch $RPM_BUILD_ROOT%{_sysconfdir}/cups/lpoptions +touch %{buildroot}%{_sysconfdir}/cups/printers.conf +touch %{buildroot}%{_sysconfdir}/cups/classes.conf +touch %{buildroot}%{_sysconfdir}/cups/client.conf +touch %{buildroot}%{_sysconfdir}/cups/subscriptions.conf +touch %{buildroot}%{_sysconfdir}/cups/lpoptions # LSB 3.2 printer driver directory -mkdir -p $RPM_BUILD_ROOT%{_datadir}/ppd +mkdir -p %{buildroot}%{_datadir}/ppd # Remove unshipped files. -rm -rf $RPM_BUILD_ROOT%{_mandir}/cat? $RPM_BUILD_ROOT%{_mandir}/*/cat? -rm -f $RPM_BUILD_ROOT%{_datadir}/applications/cups.desktop -rm -rf $RPM_BUILD_ROOT%{_datadir}/icons +rm -rf %{buildroot}%{_mandir}/cat? %{buildroot}%{_mandir}/*/cat? +rm -f %{buildroot}%{_datadir}/applications/cups.desktop +rm -rf %{buildroot}%{_datadir}/icons # there are pdf-banners shipped with cups-filters (#919489) -rm -rf $RPM_BUILD_ROOT%{_datadir}/cups/banners -rm -f $RPM_BUILD_ROOT%{_datadir}/cups/data/testprint +rm -rf %{buildroot}%{_datadir}/cups/banners +rm -f %{buildroot}%{_datadir}/cups/data/testprint # install /usr/lib/tmpfiles.d/cups.conf (bug #656566, bug #893834) 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 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: /^%lang(C)/d /^\([^%].*\)/d @@ -413,7 +413,7 @@ done exit 0 %post client -%if %use_alternatives +%if %{use_alternatives} /usr/sbin/alternatives --install %{_bindir}/lpr print %{_bindir}/lpr.cups 40 \ --slave %{_bindir}/lp print-lp %{_bindir}/lp.cups \ --slave %{_bindir}/lpq print-lpq %{_bindir}/lpq.cups \ @@ -444,7 +444,7 @@ exit 0 exit 0 %preun client -%if %use_alternatives +%if %{use_alternatives} if [ $1 -eq 0 ] ; then /usr/sbin/alternatives --remove print %{_bindir}/lpr.cups fi @@ -618,6 +618,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man5/ipptoolfile.5.gz %changelog +* Tue Jul 07 2015 Jiri Popelka - 1:2.0.3-3 +- RPM_BUILD_ROOT -> %%{buildroot}, put braces around lspp and use_alternatives + * Thu Jun 25 2015 Tim Waugh - 1:2.0.3-2 - Fix slow resume of jobs after restart (STR #4646). - Fix redirection from CGI scripts (bug #1232030, STR #4538).