diff --git a/container-selinux.spec b/container-selinux.spec index 15610c7..a5aec49 100644 --- a/container-selinux.spec +++ b/container-selinux.spec @@ -4,11 +4,12 @@ %global git0 https://github.com/projectatomic/container-selinux %if 0%{?fedora} || 0%{?rhel} > 7 %global commit0 d248f9197acde3e7c489f2ee09c10f8b29ef1a68 +%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) %else # use upstream's RHEL-1.12 branch for CentOS 7 -%global commit0 56c32da8a72f9e7af5daeaebac5b887830d123b1 +%global el_commit0 56c32da8a72f9e7af5daeaebac5b887830d123b1 +%global shortcommit0 %(c=%{el_commit0}; echo ${c:0:7}) %endif -%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) # container-selinux stuff (prefix with ds_ for version/release etc.) # Some bits borrowed from the openstack-selinux package @@ -42,6 +43,7 @@ URL: %{git0} Summary: SELinux policies for container runtimes Source0: %{git0}/archive/%{commit0}/%{name}-%{shortcommit0}.tar.gz BuildArch: noarch +BuildRequires: git BuildRequires: pkgconfig(systemd) BuildRequires: selinux-policy >= %{selinux_policyver} BuildRequires: selinux-policy-devel >= %{selinux_policyver} @@ -64,7 +66,11 @@ Provides: docker-selinux = %{epoch}:%{version}-%{release} SELinux policy modules for use with container runtimes. %prep -%setup -q -n %{name}-%{commit0} +%if 0%{?fedora} || 0%{?rhel} > 7 +%autosetup -Sgit -n %{name}-%{commit0} +%else +%autosetup -Sgit -n %{name}-%{el_commit0} +%endif %build make