You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
2.3 KiB

%define basedir %{_datadir}/icinga-L10n
Name: icinga-l10n
Version: 1.3.0
Release: 1%{?dist}
Summary: Icinga L10n
License: GPLv2+
URL: https://icinga.com
Source0: https://github.com/Icinga/L10n/archive/v%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
%description
L10n (short for Localization) provides all translations available for Icinga.
%package selinux
Summary: Icinga L10n SELinux policy
Source100: icinga-l10n.te
Source101: icinga-l10n.fc
BuildRequires: checkpolicy
BuildRequires: selinux-policy-devel
Requires: icinga-l10n = 1.3.0
Requires: selinux-policy >= %{_selinux_policy_version}
Requires(post): policycoreutils
Requires(postun): policycoreutils
%description selinux
SELinux policy for Icinga L10n.
%prep
%setup -q -n L10n-%{version}
mkdir SELinux
cp %{SOURCE100} SELinux/
cp %{SOURCE101} SELinux/
%build
cd SELinux
for selinuxvariant in mls targeted; do
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile
mv icinga-l10n.pp icinga-l10n.pp.${selinuxvariant}
make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
done
%install
mkdir -p %{buildroot}/%{basedir}
cp *.md %{buildroot}/%{basedir}
cp LICENSE %{buildroot}/%{basedir}
cp -prv locale %{buildroot}/%{basedir}
find %{buildroot}/%{basedir}/locale -name *.po -delete
for selinuxvariant in mls targeted; do
install -Dpm 0644 SELinux/icinga-l10n.pp.${selinuxvariant} %{buildroot}/%{_datadir}/selinux/${selinuxvariant}/icinga-l10n.pp
done
%clean
rm -rf %{buildroot}
%post selinux
for selinuxvariant in mls targeted; do
/usr/sbin/semodule -s ${selinuxvariant} -i /usr/share/selinux/${selinuxvariant}/icinga-l10n.pp &> /dev/null || true
done
/usr/sbin/fixfiles -R icinga-l10n restore || true
for dir in /usr/share/icinga-L10n; do
/usr/sbin/restorecon -R ${dir} || true
done
%postun selinux
if [ $1 -eq 0 ]; then
for selinuxvariant in mls targeted; do
/usr/sbin/semodule -s ${selinuxvariant} -r icinga-l10n &> /dev/null || true
done
/usr/sbin/fixfiles -R icinga-l10n restore || true
for dir in /usr/share/icinga-L10n; do
if [ -d ${dir} ]; then
/usr/sbin/restorecon -R ${dir} &> /dev/null || true
fi
done
fi
%files
%defattr(-,root,root)
%{basedir}
#%doc README.md CONTRIBUTING.md
%license LICENSE
%files selinux
%{_datadir}/selinux/*/icinga-l10n.pp
%changelog