[copr-selinux] Update copr-selinux to 1.35-1 Resolves: #1077795 - co-own /usr/share/selinux/mls Resolves: #1077795

Miroslav Suchý msuchy at fedoraproject.org
Wed Oct 22 14:55:59 UTC 2014


commit 09c4e736b190e2e93dceabd4766e5bb8c1dd96f0
Author: Miroslav Suchý <msuchy at redhat.com>
Date:   Wed Oct 22 16:55:59 2014 +0200

    Update copr-selinux to 1.35-1
    Resolves: #1077795 - co-own /usr/share/selinux/mls
    Resolves: #1077795 - use macro for /usr/share/
    Resolves: #1077795 - spec cleanup

 .gitignore        |    1 +
 copr-selinux.spec |  130 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 sources           |    1 +
 3 files changed, 132 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..f810afa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/copr-selinux-1.35.tar.gz
diff --git a/copr-selinux.spec b/copr-selinux.spec
new file mode 100644
index 0000000..25120c3
--- /dev/null
+++ b/copr-selinux.spec
@@ -0,0 +1,130 @@
+%if 0%{?rhel} < 7 && 0%{?rhel} > 0
+%global _pkgdocdir %{_docdir}/%{name}-%{version}
+%global __python2 %{__python}
+%endif
+
+%global moduletype apps
+%global modulename copr
+%{!?_selinux_policy_version: %global _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' %{_datadir}/selinux/devel/policyhelp 2>/dev/null)}
+
+Name:       copr-selinux
+Version:    1.35
+Release:    1%{?dist}
+Summary:    SELinux module for COPR
+
+Group:      Applications/Productivity
+License:    GPLv2+
+URL:        https://fedorahosted.org/copr/
+# Source is created by
+# git clone https://git.fedorahosted.org/git/copr.git
+# cd copr/selinux
+# tito build --tgz
+# content is same as https://git.fedorahosted.org/cgit/copr.git/snapshot/%{name}-%{version}-1.tar.gz
+# but checksum does not match due different metadata
+Source0: %{name}-%{version}.tar.gz
+
+BuildArch:  noarch
+BuildRequires: asciidoc
+BuildRequires: libxslt
+BuildRequires:  checkpolicy, selinux-policy-devel
+BuildRequires:  policycoreutils
+Requires(post): policycoreutils, libselinux-utils
+Requires(post): policycoreutils-python
+Requires(post): selinux-policy-targeted
+Requires(postun): policycoreutils
+%if "%{_selinux_policy_version}" != ""
+Requires:      selinux-policy >= %{_selinux_policy_version}
+%endif
+
+
+%description
+COPR is lightweight build system. It allows you to create new project in WebUI,
+and submit new builds and COPR will create yum repository from latest builds.
+
+This package include SELinux targeted module for COPR
+
+%prep
+%setup -q
+
+
+%build
+# convert manages
+a2x -d manpage -f manpage man/copr-selinux-enable.8.asciidoc
+a2x -d manpage -f manpage man/copr-selinux-relabel.8.asciidoc
+
+perl -i -pe 'BEGIN { $VER = join ".", grep /^\d+$/, split /\./, "%{version}.%{release}"; } s!\@\@VERSION\@\@!$VER!g;' %{modulename}.te
+for selinuxvariant in targeted mls; do
+    make NAME=${selinuxvariant} -f %{_datadir}/selinux/devel/Makefile
+    bzip2 -9 %{modulename}.pp
+    mv %{modulename}.pp.bz2 %{modulename}.pp.bz2.${selinuxvariant}
+    make NAME=${selinuxvariant} -f %{_datadir}/selinux/devel/Makefile clean
+done
+
+%install
+for selinuxvariant in targeted mls; do
+    install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
+    install -p -m 644 %{modulename}.pp.bz2.${selinuxvariant} \
+           %{buildroot}%{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp.bz2
+done
+# Install SELinux interfaces
+install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
+install -p -m 644 %{modulename}.if \
+  %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}/%{modulename}.if
+# Install copr-selinux-enable which will be called in %%posttrans
+install -d %{buildroot}%{_sbindir}
+install -p -m 755 %{name}-enable %{buildroot}%{_sbindir}/%{name}-enable
+install -p -m 755 %{name}-relabel %{buildroot}%{_sbindir}/%{name}-relabel
+
+install -d %{buildroot}%{_mandir}/man8
+install -p -m 644 man/%{name}-enable.8 %{buildroot}/%{_mandir}/man8/
+install -p -m 644 man/%{name}-relabel.8 %{buildroot}/%{_mandir}/man8/
+
+%post
+if /usr/sbin/selinuxenabled ; then
+   %{_sbindir}/%{name}-enable
+fi
+
+%posttrans
+if /usr/sbin/selinuxenabled ; then
+   %{_sbindir}/%{name}-relabel
+fi
+
+%postun
+# Clean up after package removal
+if [ $1 -eq 0 ]; then
+  for selinuxvariant in targeted mls; do
+      /usr/sbin/semodule -s ${selinuxvariant} -l > /dev/null 2>&1 \
+        && /usr/sbin/semodule -s ${selinuxvariant} -r %{modulename} || :
+    done
+fi
+%{_sbindir}/restorecon -rvvi %{_sharedstatedir}/copr
+
+%files
+%doc LICENSE
+%{_datadir}/selinux/*/%{modulename}.pp.bz2
+# empty, do not distribute it for now
+%exclude %{_datadir}/selinux/devel/include/%{moduletype}/%{modulename}.if
+%{_sbindir}/%{name}-enable
+%{_sbindir}/%{name}-relabel
+%{_mandir}/man8/%{name}-enable.8*
+%{_mandir}/man8/%{name}-relabel.8*
+%dir %{_datadir}/selinux/mls
+
+%changelog
+* Wed Oct 22 2014 Miroslav Suchý <msuchy at redhat.com> 1.35-1
+- remove old changelogs
+
+* Mon Oct 20 2014 Miroslav Suchý <msuchy at redhat.com> 1.34-1
+- 1077795 - co-own /usr/share/selinux/mls
+
+* Tue Oct 14 2014 Miroslav Suchý <msuchy at redhat.com> 1.33-1
+- 1077795 - use macro for /usr/share/
+
+* Mon Oct 13 2014 Miroslav Suchý <msuchy at redhat.com> 1.32-1
+- 1077795 - spec cleanup
+
+* Wed May 21 2014 Miroslav Suchý <msuchy at redhat.com> 1.31-1
+- follow selinux packaging draft
+
+* Tue Mar 18 2014 Miroslav Suchý <msuchy at redhat.com> 1.30-1
+- finish move selinux into separate package
diff --git a/sources b/sources
index e69de29..edc428e 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+51aed9b520f01a51eb268d3a7f0a6d40  copr-selinux-1.35.tar.gz


More information about the scm-commits mailing list