lsm5 pushed to docker (master). "set selinux conditional macro (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Fri Apr 17 16:51:13 UTC 2015


>From c29104901794d86c0107f1b104518728f85ec0fa Mon Sep 17 00:00:00 2001
From: Lokesh Mandvekar <lsm5 at fedoraproject.org>
Date: Fri, 17 Apr 2015 11:50:01 -0500
Subject: set selinux conditional macro

Signed-off-by: Lokesh Mandvekar <lsm5 at fedoraproject.org>

diff --git a/docker.spec b/docker.spec
index 9697756..27c3fda 100644
--- a/docker.spec
+++ b/docker.spec
@@ -17,7 +17,12 @@
 
 %global tar_import_path code.google.com/p/go/src/pkg/archive/tar
 
-%if 0%{?fedora} >= 23
+# docker-selinux conditional
+%if 0%{?fedora} >= 22
+%global with_selinux 1
+%endif
+
+%if 0%{?with_selinux}
 # docker-selinux stuff (prefix with ds_ for version/release etc.)
 # Some bits borrowed from the openstack-selinux package
 %global ds_commit 4421e0d80866b4b03f6a16c5b6bfabdf4c8bfa7c
@@ -36,7 +41,7 @@
 
 # Version of SELinux we were using
 %global selinux_policyver 3.13.1-119
-%endif
+%endif # with_selinux
 
 Name: %{repo}
 Version: 1.5.0
@@ -53,9 +58,9 @@ Source3: %{repo}-storage.sysconfig
 Source4: %{repo}-logrotate.sh
 Source5: README.%{repo}-logrotate
 Source6: %{repo}-network.sysconfig
-%if 0%{?fedora} >= 23
+%if 0%{?with_selinux}
 Source7: https://github.com/fedora-cloud/%{repo}-selinux/archive/%{ds_commit}/%{repo}-selinux-%{ds_shortcommit}.tar.gz
-%endif
+%endif # with_selinux
 BuildRequires: git
 BuildRequires: glibc-static
 BuildRequires: golang >= 1.3.3
@@ -70,10 +75,10 @@ Requires: device-mapper-libs >= 1.02.90-1
 %endif
 
 # RE: rhbz#1195804 - ensure min NVR for selinux-policy
-%if 0%{?fedora} >= 23
+%if 0%{?with_selinux}
 Requires: selinux-policy >= 3.13.1-114
 Requires(pre): %{repo}-selinux >= %{version}-%{release}
-%endif
+%endif # with_selinux
 
 # Resolves: rhbz#1045220
 Requires: xz
@@ -221,7 +226,7 @@ Provides: %{repo}-io-logrotate = %{version}-%{release}
 This package installs %{summary}. logrotate is assumed to be installed on
 containers for this to work, failures are silently ignored.
 
-%if 0%{?fedora} >= 23
+%if 0%{?with_selinux}
 %package selinux
 Summary: SELinux policies for Docker
 BuildRequires: selinux-policy
@@ -235,7 +240,7 @@ Provides: %{repo}-io-selinux
 
 %description selinux
 SELinux policy modules for use with Docker.
-%endif
+%endif # with_selinux
 
 %package vim
 Summary: vim syntax highlighting files for Docker
@@ -259,10 +264,10 @@ This package installs %{summary}.
 %autosetup -Sgit -n %{repo}-%{d_commit}
 cp %{SOURCE5} .
 
-%if 0%{?fedora} >= 23
+%if 0%{?with_selinux}
 # unpack %{repo}-selinux
 tar zxf %{SOURCE7}
-%endif
+%endif # with_selinux
 
 %build
 # set up temporary build gopath, and put our directory there
@@ -278,12 +283,12 @@ docs/man/md2man-all.sh
 cp contrib/syntax/vim/LICENSE LICENSE-vim-syntax
 cp contrib/syntax/vim/README.md README-vim-syntax.md
 
-%if 0%{?fedora} >= 23
+%if 0%{?with_selinux}
 # build %{repo}-selinux
 pushd %{repo}-selinux-%{ds_commit}
 make SHARE="%{_datadir}" TARGETS="%{modulenames}"
 popd
-%endif
+%endif # with_selinux
 
 %install
 # install binary
@@ -344,7 +349,7 @@ install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{repo}
 install -p -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/sysconfig/%{repo}-network
 install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{repo}-storage
 
-%if 0%{?fedora} >= 23
+%if 0%{?with_selinux}
 # install SELinux interfaces
 %_format INTERFACES $x.if
 install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
@@ -354,7 +359,7 @@ install -p -m 644 %{repo}-selinux-%{ds_commit}/$INTERFACES %{buildroot}%{_datadi
 %_format MODULES $x.pp.bz2
 install -d %{buildroot}%{_datadir}/selinux/packages
 install -m 0644 %{repo}-selinux-%{ds_commit}/$MODULES %{buildroot}%{_datadir}/selinux/packages
-%endif
+%endif # with_selinux
 
 # sources
 install -d -p %{buildroot}%{gopath}/src/%{import_path}
@@ -398,7 +403,7 @@ exit 0
 %post
 %systemd_post %{repo}
 
-%if 0%{?fedora} >= 23
+%if 0%{?with_selinux}
 %post selinux
 # Install all modules in a single transaction
 %_format MODULES %{_datadir}/selinux/packages/$x.pp.bz2
@@ -407,7 +412,7 @@ if %{_sbindir}/selinuxenabled ; then
 %{_sbindir}/load_policy
 %relabel_files
 fi
-%endif
+%endif # with_selinux
 
 %preun
 %systemd_preun %{repo}
@@ -415,7 +420,7 @@ fi
 %postun
 %systemd_postun_with_restart %{repo}
 
-%if 0%{?fedora} >= 23
+%if 0%{?with_selinux}
 %postun selinux
 if [ $1 -eq 0 ]; then
 %{_sbindir}/semodule -n -r %{modulenames} &> /dev/null || :
@@ -424,7 +429,7 @@ if %{_sbindir}/selinuxenabled ; then
 %relabel_files
 fi
 fi
-%endif
+%endif # with_selinux
 
 %files
 %doc AUTHORS CHANGELOG.md CONTRIBUTING.md LICENSE MAINTAINERS NOTICE README.md 
@@ -455,11 +460,11 @@ fi
 %doc README.%{repo}-logrotate
 %{_sysconfdir}/cron.daily/%{repo}-logrotate
 
-%if 0%{?fedora} >= 23
+%if 0%{?with_selinux}
 %files selinux
 %doc %{repo}-selinux-%{ds_commit}/README.md
 %{_datadir}/selinux/*
-%endif
+%endif # with_selinux
 
 %files vim
 %{_datadir}/vim/vimfiles/doc/%{repo}file.txt
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/docker.git/commit/?h=master&id=c29104901794d86c0107f1b104518728f85ec0fa


More information about the scm-commits mailing list