26 Commits

Author SHA1 Message Date
Leon Grünewald
271b4f8898 Add more files for labels 2021-02-14 14:59:59 +01:00
Leon Grünewald
552d533435 Try to fix path 2021-02-14 14:39:48 +01:00
Leon Grünewald
9d774d93c5 Add name to install 2021-02-14 14:10:04 +01:00
Leon Grünewald
90f18e9b34 We can't relabel nonexistant files anyway 2021-02-14 13:51:04 +01:00
Leon Grünewald
ccb9dfabc5 Move package somewhere else for install 2021-02-14 13:48:51 +01:00
Leon Grünewald
4ba42400ce Use install instead of cp 1 2021-02-11 22:50:10 +01:00
Leon Grünewald
b336b70605 Remove versioning on git clone 2021-02-10 01:52:38 +01:00
Leon Grünewald
9c70ff5576 Add selinux policy tools to needed packages 2021-02-10 01:47:30 +01:00
Leon Grünewald
ec230541f3 Use make selinux macros 2021-02-10 01:46:15 +01:00
Leon Grünewald
d2fcb2e87d Rename target 2021-02-10 01:37:52 +01:00
Leon Grünewald
96a556a345 Move the pp file into the right folder 2021-02-10 01:32:09 +01:00
Leon Grünewald
f79330cda3 Add installselinux to spec.rpkg 2021-02-10 01:23:03 +01:00
Leon Grünewald
3deedba040 WIP SELinux 2021-02-10 01:21:16 +01:00
Leon Grünewald
dfe918358e Add gcc 2021-02-08 03:51:05 +01:00
Leon Grünewald
cd738eafa7 Actually push git before trying to build 2021-02-08 03:46:08 +01:00
Leon Grünewald
289624bc88 Test src stuff 2021-02-08 03:35:45 +01:00
Leon Grünewald
7d4b25fc70 Dont remove spec file 2021-02-08 03:25:55 +01:00
Leon Grünewald
b8b31386e1 move to rpkg again but this time remove setup 2021-02-08 03:06:01 +01:00
Leon Grünewald
a14e6b5224 Just copy everything from github at that point 2021-02-08 02:54:25 +01:00
Leon Grünewald
16922531e2 cd to spec first 2021-02-08 02:34:24 +01:00
Leon Grünewald
5c04c996d5 This makes some more sense now 2021-02-08 02:19:24 +01:00
Leon Grünewald
a7dedbab1b Just the rpmbuild 2021-02-08 01:52:05 +01:00
Leon Grünewald
1926901eda Fix it up 2021-02-08 01:47:01 +01:00
Leon Grünewald
43a40faf79 Build Requires make 2021-02-08 00:58:17 +01:00
Leon Grünewald
974aca51cb Turn into ly.spec.rpkg 2021-02-08 00:33:35 +01:00
Leon Grünewald
6ac03ab27e Add basic spec file and selinux module source 2021-02-08 00:13:19 +01:00
6 changed files with 161 additions and 0 deletions

4
.copr/Makefile Normal file
View File

@@ -0,0 +1,4 @@
srpm:
cd $(spec)
make github
rpmbuild -vv -bs ly.spec --define "_srcrpmdir $(outdir)"

78
ly.spec.rpkg Normal file
View File

@@ -0,0 +1,78 @@
%define relabel_files() \
restorecon -R /usr/bin/ly; \
%define selinux_policyver 3.14.6-34
Name: {{{ git_dir_name }}}
Version: {{{ git_dir_version }}}
Release: 1%{?dist}
Summary: A TUI display manager
License: WTFPL
URL: https://github.com/nullgemm/ly
VCS: {{{ git_dir_vcs }}}
Source: {{{ git_dir_pack }}}
BuildRequires: libxcb-devel
BuildRequires: pam-devel
BuildRequires: make
BuildRequires: git
BuildRequires: gcc
BuildRequires: selinux-policy-devel
Requires: libxcb
Requires: pam
%description
Ly is a lightweight TUI (ncurses-like) display manager for Linux and BSD.
%prep
git clone https://github.com/dhalucario/ly.git ly
cd ly
# git checkout v0.5.2
make github
%build
cd ly
make
%install
cd ly
mkdir -p %{buildroot}/etc/
mkdir -p %{buildroot}/usr/bin/
mkdir -p %{buildroot}/usr/lib/systemd/system/
mkdir -p %{buildroot}/etc/pam.d/
DESTDIR="%{buildroot}" make install
DESTDIR="%{buildroot}" make installselinux
chmod -x %{buildroot}/etc/ly/config.ini
chmod -x %{buildroot}/etc/ly/lang/*
%post
semodule -n -i /usr/share/selinux/packages/ly.pp
if /usr/sbin/selinuxenabled ; then
/usr/sbin/load_policy
%relabel_files
fi;
exit 0
%postun
if [ $1 -eq 0 ]; then
semodule -n -r ly
fi;
exit 0
%files
/usr/bin/ly
/usr/lib/systemd/system/ly.service
/etc/ly/lang/es.ini
/etc/ly/lang/pt.ini
/etc/ly/lang/ru.ini
/etc/ly/lang/en.ini
/etc/ly/lang/fr.ini
/etc/ly/lang/ro.ini
/etc/ly/xsetup.sh
/etc/ly/wsetup.sh
/etc/ly/config.ini
/etc/pam.d/ly
/usr/share/selinux/packages/ly.pp
%changelog
{{{ git_dir_changelog }}}

View File

@@ -92,6 +92,11 @@ installnoconf: $(BIND)/$(NAME)
@install -DZ $(RESD)/ly.service -m 644 -t ${DESTDIR}/usr/lib/systemd/system
@install -DZ $(RESD)/pam.d/ly -m 644 -t ${DESTDIR}/etc/pam.d
installselinux:
@echo "installing selinux modules"
@make -f /usr/share/selinux/devel/Makefile ly.pp
@install -DZ ly.pp ${DESTDIR}/usr/share/selinux/packages/ly.pp
uninstall:
@echo "uninstalling"
@rm -rf ${DESTDIR}/etc/ly

1
selinux/ly.fc Normal file
View File

@@ -0,0 +1 @@
/usr/bin/ly -- gen_context(system_u:object_r:ly_exec_t,s0)

41
selinux/ly.if Normal file
View File

@@ -0,0 +1,41 @@
## <summary>policy for ly</summary>
########################################
## <summary>
## Execute ly_exec_t in the ly domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`ly_domtrans',`
gen_require(`
type ly_t, ly_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, ly_exec_t, ly_t)
')
######################################
## <summary>
## Execute ly in the caller domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`ly_exec',`
gen_require(`
type ly_exec_t;
')
corecmd_search_bin($1)
can_exec($1, ly_exec_t)
')

32
selinux/ly.te Executable file
View File

@@ -0,0 +1,32 @@
policy_module(ly, 1.0.0)
########################################
#
# Declarations
#
type ly_t;
type ly_exec_t;
init_daemon_domain(ly_t, ly_exec_t)
permissive ly_t;
########################################
#
# ly local policy
#
allow ly_t self:capability { setgid setuid };
allow ly_t self:process { fork signal_perms };
allow ly_t self:process transition;
allow ly_t self:fifo_file rw_fifo_file_perms;
allow ly_t self:unix_stream_socket create_stream_socket_perms;
domain_use_interactive_fds(ly_t)
files_read_etc_files(ly_t)
auth_use_nsswitch(ly_t)
logging_send_audit_msgs(ly_t)
miscfiles_read_localization(ly_t)