rpms/cups-pdf/EL-4 cups-pdf.spec,1.5,1.6

Remi Collet (remi) fedora-extras-commits at redhat.com
Mon May 7 05:53:13 UTC 2007


Author: remi

Update of /cvs/extras/rpms/cups-pdf/EL-4
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7993

Modified Files:
	cups-pdf.spec 
Log Message:
    EL4/FC3/FC4 modified spec


Index: cups-pdf.spec
===================================================================
RCS file: /cvs/extras/rpms/cups-pdf/EL-4/cups-pdf.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- cups-pdf.spec	6 May 2007 07:00:34 -0000	1.5
+++ cups-pdf.spec	7 May 2007 05:52:37 -0000	1.6
@@ -1,11 +1,18 @@
 # Module SElinux
 %define module cups_pdf
 
+%if %{?fedora}%{?rhel} >= 5
+%define usesel 1
+%else
+%define usesel 0
+%endif
+
+
 Summary:        Extension for creating pdf-Files with CUPS
 Summary(fr):    Extension de CUPS pour créer des fichiers PDF
 Name:           cups-pdf
 Version:        2.4.6
-Release:        1%{?dist}
+Release:        2%{?dist}
 Group:          Applications/Publishing
 Source0:        http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/src/%{name}_%{version}.tar.gz
 Source1:        INSTALL.cups-pdf
@@ -15,8 +22,12 @@
 URL:            http://cip.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/
 License:        GPL
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires:       ghostscript, cups, policycoreutils
-BuildRequires:  selinux-policy-devel, checkpolicy, cups-devel
+Requires:       ghostscript, cups
+BuildRequires:  cups-devel
+%if %{usesel}
+Requires:       policycoreutils
+BuildRequires:  selinux-policy-devel, checkpolicy
+%endif
 
 # These are the defaults paths defined in config.h
 # CUPS-PDF spool directory
@@ -61,11 +72,18 @@
 # Relocate output on user's Desktop
 %patch1 -p0
 
+%if %{usesel}
+echo Will Use SE Linux
+%else
+echo Will NOT use SE Linux
+%endif
+
 %build
 pushd src
 %{__cc} $RPM_OPT_FLAGS -o cups-pdf cups-pdf.c
 popd
 
+%if %{usesel}
 # SElinux 
 %{__mkdir} selinux
 pushd selinux
@@ -74,6 +92,7 @@
 echo "%{CPSPOOL} system_u:object_r:print_spool_t:s0" >>%{module}.fc
 make -f %{_datadir}/selinux/devel/Makefile
 popd
+%endif
 
 # Avoid perl dependencies
 %{__chmod} -x contrib/pstitleiconv-0.2/pstitleiconv
@@ -94,9 +113,11 @@
 %{__install} -m644 extra/cups-pdf.conf %{buildroot}%{ETCCUPS}/cups-pdf.conf
 %{__install} -m755 src/cups-pdf %{buildroot}%{CPBACKEND}
 
+%if %{usesel}
 # SElinux 
 %{__mkdir_p} %{buildroot}%{_datadir}/selinux/packages/%{name}
 %{__install} -m644 selinux/%{module}.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/%{module}.pp
+%endif
 
 %clean
 rm -rf %{buildroot}
@@ -109,16 +130,25 @@
 %attr(700, root, root) %{CPBACKEND}/cups-pdf
 %config(noreplace) %{ETCCUPS}/cups-pdf.conf
 %{_datadir}/cups/model/PostscriptColor.ppd
+%if %{usesel}
 %{_datadir}/selinux/packages/%{name}/%{module}.pp
+%endif
 
 %post
+%if %{usesel}
 # Install/update Selinux policy
 semodule -i %{_datadir}/selinux/packages/%{name}/%{module}.pp || :
 fixfiles -R %{name} restore
+%endif
 
 # First install : create the printer if cupsd is running
 if [ "$1" -eq "1" -a -f "%{_var}/run/cupsd.pid" ]
 then
+%if %{?fedora}%{?rhel} < 5
+    # Restart CUPS on old Fedora/RHEL to discover the new "backend"
+    /sbin/service cups condrestart
+%endif
+
     if [ -d /proc/$(cat %{_var}/run/cupsd.pid) ]
     then
         /usr/sbin/lpadmin -p Cups-PDF -v cups-pdf:/ -m PostscriptColor.ppd -E || :
@@ -130,11 +160,16 @@
     # Delete the printer
     /usr/sbin/lpadmin -x Cups-PDF || :
 
+%if %{usesel}
     # Remove the SElinux policy.
     semodule -r %{module} || :
+%endif
 fi
 
 %changelog
+* Sun May 06 2007 Remi Collet <Fedora at FamilleCollet.com> 2.4.6-2
+- spec changes for RHEL 4 and Fedora Core 3 and 4 (no selinux)
+
 * Sun May 06 2007 Remi Collet <Fedora at FamilleCollet.com> 2.4.6-1
 - update to 2.4.6
 




More information about the fedora-extras-commits mailing list