Added SELinux settings

This commit is contained in:
Jerzy Drozdz 2022-09-30 16:51:10 +02:00
parent c781e6cdf0
commit b5f821078e
1 changed files with 24 additions and 4 deletions

28
ly.spec
View File

@ -1,6 +1,6 @@
Name: ly Name: ly
Version: 0.5.3 Version: 0.5.3
Release: 1%{?dist} Release: 2%{?dist}
Summary: a TUI display manager Summary: a TUI display manager
License: WTFPL License: WTFPL
@ -12,7 +12,10 @@ BuildRequires: gcc gcc-c++
BuildRequires: kernel-devel pam-devel BuildRequires: kernel-devel pam-devel
BuildRequires: libxcb-devel BuildRequires: libxcb-devel
BuildRequires: systemd-rpm-macros BuildRequires: systemd-rpm-macros
BuildRequires: gawk
Requires(post): policycoreutils-python-utils
Requires(postun): policycoreutils-python-utils
%systemd_requires %systemd_requires
%description %description
@ -24,11 +27,13 @@ Ly is a lightweight TUI (ncurses-like) display manager for Linux and BSD.
%build %build
%make_build %make_build
mv -f res/config.ini config.ini_orig
awk '{print}/#save_file/{print "save_file = %{_sharedstatedir}/%{name}/save"}' config.ini_orig > res/config.ini
%install %install
%make_install installsystemd %make_install installsystemd
install -m 755 -d %{buildroot}%{_sharedstatedir}/%{name}
%check %check
@ -36,18 +41,33 @@ Ly is a lightweight TUI (ncurses-like) display manager for Linux and BSD.
%files %files
%license license.md %license license.md
%doc readme.md %doc readme.md
%{_sysconfdir}/ly %config(noreplace) %{_sysconfdir}/ly
%{_sysconfdir}/pam.d/* %config %{_sysconfdir}/pam.d/*
%{_unitdir}/* %{_unitdir}/*
%{_bindir}/* %{_bindir}/*
%{_sharedstatedir}/%{name}
%post %post
%systemd_post %{name}.service %systemd_post %{name}.service
semanage fcontext --add --ftype f --type xdm_exec_t '%{_bindir}/ly' 2>/dev/null || :
semanage fcontext --add --ftype a --type xdm_var_lib_t '%{_sharedstatedir}/%{name}' 2>/dev/null || :
restorecon -R %{_bindir}/ly %{_sharedstatedir}/%{name} || :
%preun %preun
%systemd_preun %{name}.service %systemd_preun %{name}.service
%postun
if [ $1 -eq 0];then
semanage fcontext --delete --type xdm_exe_t '%{_bindir}/ly' 2>/dev/null || :
semanage fcontext --delete --type xdm_var_lib_t '%{_sharedstatedir}/%{name}' 2>/dev/null || :
fi
%changelog %changelog
* Fri Sep 30 2022 Jerzy Drozdz <jerzy.drozdz@jdsieci.pl> - 0.5.3-2
- Added setting SELinux contexts
- Added configuration option for state files
- Configuration directory and pam service set to \%config
* Thu Sep 29 2022 Jerzy Drozdz <jerzy.drozdz@jdsieci.pl> - 0.5.3-1 * Thu Sep 29 2022 Jerzy Drozdz <jerzy.drozdz@jdsieci.pl> - 0.5.3-1
- Initial build - Initial build