[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: viewvc package



On Tue, 2007-07-03 at 12:27 +1000, Bojan Smojver wrote:

> cvsgraph-1.6.1-3.fc6 (a.k.a. the current F7 thingy) builds just fine on
> EL5, with no modification.

And, if cvsgraph does make into EPEL5, I was thinking of something like
the attached for the spec file. Unfortunately, we'd probably have to
bring back the -selinux package for EPEL...

The patch is against Fedora development spec.

-- 
Bojan
Index: viewvc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/viewvc/devel/viewvc.spec,v
retrieving revision 1.8
diff -u -r1.8 viewvc.spec
--- viewvc.spec	3 Jun 2007 05:34:14 -0000	1.8
+++ viewvc.spec	3 Jul 2007 03:48:53 -0000
@@ -1,7 +1,7 @@
 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
 # EL4 & EL5 do not have cvsgraph or enscript.. yet
-%if 0%{?rhel}
+%if 0%{?rhel} && "%rhel" < "5"
 %define with_cvsgraph_enscript 0
 %else
 %define with_cvsgraph_enscript 1
@@ -17,7 +17,7 @@
 
 Name:           viewvc
 Version:        1.0.4
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Browser interface for CVS and SVN version control repositories
 
 Group:          Development/Tools
@@ -28,8 +28,10 @@
 Patch0:         viewvc-temp-location.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+%if !0%{?rhel}
 Obsoletes:      %{name}-selinux < 1.0.3-13
 Conflicts:      selinux-policy < 2.5.10-2
+%endif
 
 BuildArch:      noarch
 BuildRequires:  python-devel >= 2.0
@@ -53,6 +55,18 @@
 This version only supports CVS repositories.
 %endif
 
+%if 0%{?rhel}
+%package selinux
+Summary:          SElinux file contexts for ViewVC
+Group:            Development/Tools
+Requires:         %{name} = %{version}-%{release}
+Requires(post):   policycoreutils
+Requires(postun): policycoreutils
+
+%description selinux
+SELinux file contexts for ViewVC
+%endif
+
 %prep
 %setup -q
 %patch0 -p0 -b .temp-location
@@ -124,6 +138,20 @@
 %clean
 %{__rm} -rf %{buildroot}
 
+%if 0%{?rhel}
+%post selinux
+# Set SELinux file context in the policy
+/usr/sbin/semanage fcontext -a -t httpd_sys_script_rw_t '%{_localstatedir}/spool/viewvc(/.*)?' 2>/dev/null || :
+# Actually change the context
+/sbin/restorecon -R %{_localstatedir}/spool/viewvc || :
+
+%postun selinux
+# SELinux support
+if [ $1 -eq 0 ]; then  # final removal
+  /usr/sbin/semanage fcontext -d -t httpd_sys_script_rw_t '%{_localstatedir}/spool/viewvc(/.*)?' 2>/dev/null || :
+fi
+%endif
+
 %files
 %defattr(-, root, root, -)
 %doc CHANGES README INSTALL TODO COMMITTERS viewvc.org
@@ -133,7 +161,14 @@
 %{_datadir}/*
 %attr(0700,apache,apache) %{_localstatedir}/spool/viewvc
 
+%if 0%{?rhel}
+%files selinux
+%endif
+
 %changelog
+* Tue Jul  2 2007 Bojan Smojver <bojan rexursive com> - 1.0.4-3
+- Bring back selinux package for EPEL
+
 * Sun Jun  3 2007 Bojan Smojver <bojan rexursive com> - 1.0.4-2
 - Avoid import cycle errors (temporary fix)
 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]