|
|
09c4e73 |
%if 0%{?rhel} < 7 && 0%{?rhel} > 0
|
|
|
09c4e73 |
%global _pkgdocdir %{_docdir}/%{name}-%{version}
|
|
|
09c4e73 |
%global __python2 %{__python}
|
|
|
09c4e73 |
%endif
|
|
|
09c4e73 |
|
|
|
09c4e73 |
%global moduletype apps
|
|
|
09c4e73 |
%global modulename copr
|
|
|
09c4e73 |
%{!?_selinux_policy_version: %global _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' %{_datadir}/selinux/devel/policyhelp 2>/dev/null)}
|
|
clime |
026cf61 |
%global file_context_file %{_sysconfdir}/selinux/targeted/contexts/files/file_contexts
|
|
clime |
026cf61 |
%global file_context_file_pre %{_localstatedir}/lib/rpm-state/file_contexts.pre
|
|
|
09c4e73 |
|
|
|
09c4e73 |
Name: copr-selinux
|
|
clime |
e828cc8 |
Version: 1.48
|
|
|
dbc4af9 |
Release: 2%{?dist}
|
|
|
09c4e73 |
Summary: SELinux module for COPR
|
|
|
09c4e73 |
|
|
|
09c4e73 |
License: GPLv2+
|
|
clime |
e011bde |
URL: https://pagure.io/copr/copr
|
|
|
09c4e73 |
# Source is created by
|
|
clime |
e011bde |
# git clone https://pagure.io/copr/copr.git
|
|
|
09c4e73 |
# cd copr/selinux
|
|
|
09c4e73 |
# tito build --tgz
|
|
clime |
e011bde |
# content is same as https://pagure.io/copr/copr.git/snapshot/%{name}-%{version}-1.tar.gz
|
|
|
09c4e73 |
# but checksum does not match due different metadata
|
|
|
09c4e73 |
Source0: %{name}-%{version}.tar.gz
|
|
|
09c4e73 |
|
|
|
09c4e73 |
BuildArch: noarch
|
|
|
09c4e73 |
BuildRequires: asciidoc
|
|
|
09c4e73 |
BuildRequires: libxslt
|
|
|
09c4e73 |
BuildRequires: checkpolicy, selinux-policy-devel
|
|
|
09c4e73 |
BuildRequires: policycoreutils
|
|
clime |
b904e2e |
BuildRequires: perl
|
|
|
09c4e73 |
Requires(post): policycoreutils, libselinux-utils
|
|
|
dbc4af9 |
%if 0%{?rhel} && 0%{?rhel} <= 7
|
|
clime |
7b7b079 |
Requires(post): policycoreutils-python
|
|
clime |
7b7b079 |
%else
|
|
|
3024385 |
Requires(post): policycoreutils-python-utils
|
|
clime |
7b7b079 |
%endif
|
|
|
09c4e73 |
Requires(post): selinux-policy-targeted
|
|
|
09c4e73 |
Requires(postun): policycoreutils
|
|
|
09c4e73 |
%if "%{_selinux_policy_version}" != ""
|
|
|
09c4e73 |
Requires: selinux-policy >= %{_selinux_policy_version}
|
|
|
09c4e73 |
%endif
|
|
|
09c4e73 |
|
|
|
09c4e73 |
|
|
|
09c4e73 |
%description
|
|
|
09c4e73 |
COPR is lightweight build system. It allows you to create new project in WebUI,
|
|
|
09c4e73 |
and submit new builds and COPR will create yum repository from latest builds.
|
|
|
09c4e73 |
|
|
|
09c4e73 |
This package include SELinux targeted module for COPR
|
|
|
09c4e73 |
|
|
|
09c4e73 |
%prep
|
|
|
09c4e73 |
%setup -q
|
|
|
09c4e73 |
|
|
|
09c4e73 |
|
|
|
09c4e73 |
%build
|
|
|
09c4e73 |
# convert manages
|
|
|
09c4e73 |
a2x -d manpage -f manpage man/copr-selinux-enable.8.asciidoc
|
|
|
09c4e73 |
a2x -d manpage -f manpage man/copr-selinux-relabel.8.asciidoc
|
|
|
09c4e73 |
|
|
|
09c4e73 |
perl -i -pe 'BEGIN { $VER = join ".", grep /^\d+$/, split /\./, "%{version}.%{release}"; } s!\@\@VERSION\@\@!$VER!g;' %{modulename}.te
|
|
|
09c4e73 |
for selinuxvariant in targeted mls; do
|
|
|
09c4e73 |
make NAME=${selinuxvariant} -f %{_datadir}/selinux/devel/Makefile
|
|
|
09c4e73 |
bzip2 -9 %{modulename}.pp
|
|
|
09c4e73 |
mv %{modulename}.pp.bz2 %{modulename}.pp.bz2.${selinuxvariant}
|
|
|
09c4e73 |
make NAME=${selinuxvariant} -f %{_datadir}/selinux/devel/Makefile clean
|
|
|
09c4e73 |
done
|
|
|
09c4e73 |
|
|
|
09c4e73 |
%install
|
|
|
09c4e73 |
for selinuxvariant in targeted mls; do
|
|
|
09c4e73 |
install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
|
|
|
09c4e73 |
install -p -m 644 %{modulename}.pp.bz2.${selinuxvariant} \
|
|
|
09c4e73 |
%{buildroot}%{_datadir}/selinux/${selinuxvariant}/%{modulename}.pp.bz2
|
|
|
09c4e73 |
done
|
|
|
09c4e73 |
# Install SELinux interfaces
|
|
|
09c4e73 |
install -d %{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}
|
|
|
09c4e73 |
install -p -m 644 %{modulename}.if \
|
|
|
09c4e73 |
%{buildroot}%{_datadir}/selinux/devel/include/%{moduletype}/%{modulename}.if
|
|
|
09c4e73 |
# Install copr-selinux-enable which will be called in %%posttrans
|
|
|
09c4e73 |
install -d %{buildroot}%{_sbindir}
|
|
|
09c4e73 |
install -p -m 755 %{name}-enable %{buildroot}%{_sbindir}/%{name}-enable
|
|
|
09c4e73 |
install -p -m 755 %{name}-relabel %{buildroot}%{_sbindir}/%{name}-relabel
|
|
|
09c4e73 |
|
|
|
09c4e73 |
install -d %{buildroot}%{_mandir}/man8
|
|
|
09c4e73 |
install -p -m 644 man/%{name}-enable.8 %{buildroot}/%{_mandir}/man8/
|
|
|
09c4e73 |
install -p -m 644 man/%{name}-relabel.8 %{buildroot}/%{_mandir}/man8/
|
|
|
09c4e73 |
|
|
clime |
026cf61 |
%pre
|
|
clime |
026cf61 |
if /usr/sbin/selinuxenabled ; then
|
|
clime |
026cf61 |
[ -f %{file_context_file_pre} ] || cp -f %{file_context_file} %{file_context_file_pre}
|
|
clime |
026cf61 |
fi
|
|
clime |
026cf61 |
|
|
|
09c4e73 |
%post
|
|
|
09c4e73 |
if /usr/sbin/selinuxenabled ; then
|
|
|
09c4e73 |
%{_sbindir}/%{name}-enable
|
|
|
09c4e73 |
fi
|
|
|
09c4e73 |
|
|
|
09c4e73 |
%posttrans
|
|
|
09c4e73 |
if /usr/sbin/selinuxenabled ; then
|
|
clime |
026cf61 |
if [ -f %{file_context_file_pre} ]; then
|
|
clime |
026cf61 |
/usr/sbin/fixfiles -C %{file_context_file_pre} restore
|
|
clime |
026cf61 |
rm -f %{file_context_file_pre}
|
|
clime |
026cf61 |
fi
|
|
|
09c4e73 |
fi
|
|
|
09c4e73 |
|
|
|
09c4e73 |
%postun
|
|
|
09c4e73 |
# Clean up after package removal
|
|
|
09c4e73 |
if [ $1 -eq 0 ]; then
|
|
|
09c4e73 |
for selinuxvariant in targeted mls; do
|
|
|
09c4e73 |
/usr/sbin/semodule -s ${selinuxvariant} -l > /dev/null 2>&1 \
|
|
|
09c4e73 |
&& /usr/sbin/semodule -s ${selinuxvariant} -r %{modulename} || :
|
|
|
09c4e73 |
done
|
|
|
09c4e73 |
fi
|
|
|
09c4e73 |
|
|
|
09c4e73 |
%files
|
|
|
3024385 |
%license LICENSE
|
|
|
09c4e73 |
%{_datadir}/selinux/*/%{modulename}.pp.bz2
|
|
|
09c4e73 |
# empty, do not distribute it for now
|
|
|
09c4e73 |
%exclude %{_datadir}/selinux/devel/include/%{moduletype}/%{modulename}.if
|
|
|
09c4e73 |
%{_sbindir}/%{name}-enable
|
|
|
09c4e73 |
%{_sbindir}/%{name}-relabel
|
|
|
09c4e73 |
%{_mandir}/man8/%{name}-enable.8*
|
|
|
09c4e73 |
%{_mandir}/man8/%{name}-relabel.8*
|
|
|
09c4e73 |
%dir %{_datadir}/selinux/mls
|
|
|
09c4e73 |
|
|
|
09c4e73 |
%changelog
|
|
|
dbc4af9 |
* Thu Mar 15 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.48-2
|
|
|
dbc4af9 |
- Update Python 2 dependency declarations to new packaging standards
|
|
|
dbc4af9 |
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
|
|
|
dbc4af9 |
|
|
clime |
e828cc8 |
* Fri Feb 23 2018 clime <clime@redhat.com> 1.48-1
|
|
clime |
e828cc8 |
- remove Group tag
|
|
|
08567a9 |
|
|
clime |
b904e2e |
* Mon Dec 18 2017 Dominik Turecek <dturecek@redhat.com> 1.47-1
|
|
clime |
b904e2e |
- wrap map permission in an optional block
|
|
|
408189a |
|
|
clime |
e011bde |
* Wed Apr 19 2017 clime <clime@redhat.com> 1.46-1
|
|
clime |
e011bde |
- add perl as build dependency
|
|
clime |
e011bde |
|
|
clime |
e011bde |
* Wed Apr 19 2017 clime <clime@redhat.com> 1.45-1
|
|
clime |
e011bde |
- replace fedorahosted links
|
|
|
1b5ba49 |
|
|
clime |
026cf61 |
* Wed Aug 03 2016 Miroslav Suchý 1.44-1
|
|
clime |
026cf61 |
- restore context of only those files, which context changed
|
|
clime |
026cf61 |
|
|
clime |
4de6319 |
* Fri Jul 01 2016 clime <clime@redhat.com> 1.43-1
|
|
clime |
4de6319 |
- Revert "add selinux rule for cgit"
|
|
clime |
4de6319 |
|
|
clime |
7b7b079 |
* Wed Jun 29 2016 Miroslav Suchý <msuchy@redhat.com> 1.42-1
|
|
clime |
7b7b079 |
- add selinux rule for cgit
|
|
clime |
7b7b079 |
|
|
clime |
7b7b079 |
* Sat Jun 04 2016 Miroslav Suchý <miroslav@suchy.cz> 1.41-1
|
|
clime |
7b7b079 |
- adjust selinux policy generation for separated log file paths
|
|
clime |
7b7b079 |
|
|
clime |
7b7b079 |
* Sun May 29 2016 Pete Travis <me@petetravis.com> - 1.40-2
|
|
clime |
7b7b079 |
- separate log file paths for backend and frontend
|
|
clime |
7b7b079 |
|
|
|
6dbdc37 |
* Mon Mar 14 2016 Miroslav Suchý <miroslav@suchy.cz> 1.40-1
|
|
|
6dbdc37 |
- add missing types to requires section
|
|
|
6dbdc37 |
|
|
|
6dbdc37 |
* Fri Feb 12 2016 Miroslav Suchý <msuchy@redhat.com> 1.39-1
|
|
|
6dbdc37 |
- allow copr-dist-git to read dist-git
|
|
|
6dbdc37 |
|
|
|
6dbdc37 |
* Wed Feb 03 2016 Miroslav Suchý <msuchy@redhat.com> 1.38-1
|
|
|
6dbdc37 |
- add rules for dist-git and keygen
|
|
|
7c71cb7 |
|
|
|
3024385 |
* Mon Jul 27 2015 Miroslav Suchý <msuchy@redhat.com> 1.37-1
|
|
|
3024385 |
- 1246610 - depend on policycoreutils-python-utils
|
|
|
3024385 |
|
|
|
3024385 |
* Thu Mar 05 2015 Valentin Gologuzov <vgologuz@redhat.com> 1.36-1
|
|
|
3024385 |
- [selinux] allow httpd_t to write into /var/log/copr/
|
|
|
9b4e8e3 |
|
|
|
09c4e73 |
* Wed Oct 22 2014 Miroslav Suchý <msuchy@redhat.com> 1.35-1
|
|
|
09c4e73 |
- remove old changelogs
|
|
|
09c4e73 |
|
|
|
09c4e73 |
* Mon Oct 20 2014 Miroslav Suchý <msuchy@redhat.com> 1.34-1
|
|
|
09c4e73 |
- 1077795 - co-own /usr/share/selinux/mls
|
|
|
09c4e73 |
|
|
|
09c4e73 |
* Tue Oct 14 2014 Miroslav Suchý <msuchy@redhat.com> 1.33-1
|
|
|
09c4e73 |
- 1077795 - use macro for /usr/share/
|
|
|
09c4e73 |
|
|
|
09c4e73 |
* Mon Oct 13 2014 Miroslav Suchý <msuchy@redhat.com> 1.32-1
|
|
|
09c4e73 |
- 1077795 - spec cleanup
|
|
|
09c4e73 |
|
|
|
09c4e73 |
* Wed May 21 2014 Miroslav Suchý <msuchy@redhat.com> 1.31-1
|
|
|
09c4e73 |
- follow selinux packaging draft
|
|
|
09c4e73 |
|
|
|
09c4e73 |
* Tue Mar 18 2014 Miroslav Suchý <msuchy@redhat.com> 1.30-1
|
|
|
09c4e73 |
- finish move selinux into separate package
|