9
0
forked from pool/cscreen

Compare commits

41 Commits

Author SHA256 Message Date
6f54c1384f Accepting request 1161569 from systemsmanagement
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/1161569
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cscreen?expand=0&rev=11
2024-03-26 18:26:30 +00:00
45734a3424 - version 1.8
- disable screen and colon command in example cscreenrc
- reduce the default nice level to 3 for entire screen session
- provide sol-via-impi.sh and sol-via-ssh.sh

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=49
2024-03-18 22:09:45 +00:00
9378341c94 Accepting request 1158076 from systemsmanagement
- version 1.7
- screen uses select(2), which is limited to FD_SETSIZE open file descriptors

OBS-URL: https://build.opensuse.org/request/show/1158076
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cscreen?expand=0&rev=10
2024-03-15 19:30:38 +00:00
e109d0b3cd - version 1.7
- screen uses select(2), which is limited to FD_SETSIZE open file descriptors

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=47
2024-03-14 19:06:32 +00:00
b67ee2360d Accepting request 1156411 from systemsmanagement
- version 1.6
- Fix sysusers.d usage to make system-user-cscreen installable
- Remove pre-systemd support

OBS-URL: https://build.opensuse.org/request/show/1156411
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cscreen?expand=0&rev=9
2024-03-11 14:32:18 +00:00
2ffb4313fc A cscreen-1.6.tar.xz
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=45
2024-03-08 16:05:28 +00:00
ae92e97d67 - version 1.6
- Fix sysusers.d usage to make system-user-cscreen installable
- Remove pre-systemd support

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=44
2024-03-08 16:02:21 +00:00
c856fd8199 Accepting request 1146287 from systemsmanagement
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/1146287
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cscreen?expand=0&rev=8
2024-02-13 21:43:12 +00:00
9e225fde9a - version 1.5
- Create system-user-cscreen
- add example for virsh console (bsc#1213936)

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=42
2024-02-05 22:49:18 +00:00
c9737d39ce Accepting request 962216 from systemsmanagement
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/962216
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cscreen?expand=0&rev=7
2022-03-16 19:21:39 +00:00
0348fd2bae - version 1.4
- remove braces from rpm macros
- expand %name in rpm specfile for some files
- Include new tmpfile in files section

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=40
2022-03-09 14:33:27 +00:00
64ca8d4413 typo
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=39
2022-03-09 13:19:55 +00:00
968830ec8c -cscreen-1.2.tar.xz
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=38
2022-03-09 13:19:39 +00:00
6883829dfa baserev update by copy to link target
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=37
2022-03-09 13:14:55 +00:00
5ed0325f4a Accepting request 923043 from systemsmanagement
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/923043
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cscreen?expand=0&rev=6
2021-10-04 16:40:48 +00:00
ebd6791748 - version 1.2
- fix default logtstamp string

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=35
2021-09-27 13:57:52 +00:00
eba6b406df Accepting request 889025 from systemsmanagement
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/889025
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cscreen?expand=0&rev=5
2021-04-28 23:38:30 +00:00
1309c46a62 - version 1.1
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=33
2021-04-21 12:44:02 +00:00
697bfe6a8b own entire _datadir
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=32
2021-04-21 12:16:37 +00:00
55b98ef81d - set hard status in cscreenrc example
- use wrapper script for shell/SHELL
- fix screen execution

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=31
2021-04-21 12:12:29 +00:00
f126743d48 - version 0.10
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=30
2021-04-20 13:58:43 +00:00
0c6d3c25b0 fix
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=29
2021-04-20 11:54:20 +00:00
6cf84eff3d - start cscreen earlier by ordering it right after local-fs.target
- add zombie_timeout to default cscreenrc
- adjust Requires for scriptlets
- package cscreen-rpmlintrc
- Set LimitNOFILE= to compensate for lack of SCREEN_FILE_LIMIT
- use fillup and sysconfig only with sysv
- fillup file should be owned by root
- use DISABLE_RESTART_ON_UPDATE also with sysv
- %license macro does not work reliably in 13.2
- check if rpm macro has_systemd exists
- own suders.d if needed
- use name macro consistently
- remove Requires for apparently unused mailx

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=28
2021-04-20 11:51:05 +00:00
ec6f391531 - version 0.9
- use screen variable in cscreen script
- use SCREEN_OWNER in cscreen script
- use SCREENRC variable consistently
- use SCREEN_NAME variable consistently
- remove leading slash from sysv SCREEN_NAME
- move defscrollback to SCREEN_HISTORY
- Pass more characters to the remote system (bsc#1162835).
- Get rid of /etc/sudoers.d directory to avoid file conflicts at install time

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=27
2021-04-20 10:25:19 +00:00
3937608095 Accepting request 837283 from systemsmanagement
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/837283
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cscreen?expand=0&rev=4
2020-09-25 14:36:22 +00:00
58ebfc6776 sync with github
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=25
2020-09-18 07:03:19 +00:00
83698ce334 service_del_postun_without_restart is new, stay compatible
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=24
2020-09-18 06:51:23 +00:00
8b130c1395 Accepting request 835137 from home:fbui:branches:systemsmanagement
- Make use of %service_del_postun_without_restart
  And stop using DISABLE_RESTART_ON_UPDATE as this interface is
  obsolete.

OBS-URL: https://build.opensuse.org/request/show/835137
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=23
2020-09-18 06:48:20 +00:00
e73c1a9e68 Accepting request 831686 from systemsmanagement
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/831686
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cscreen?expand=0&rev=3
2020-09-04 09:12:07 +00:00
b45c6353f1 - version 0.8
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=21
2020-08-27 10:28:51 +00:00
3f702cafc9 use git tag as rpm version number
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=20
2020-08-27 10:07:41 +00:00
e0e6e849bf - Fix shell syntax in FORCE_UPDATE test
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=19
2020-08-27 09:57:59 +00:00
a97c5223b7 - add defattr
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=18
2020-08-26 16:22:01 +00:00
831c1f67bb - Wrap %license
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=17
2020-08-26 16:18:22 +00:00
bc7c777b35 - add BuildRoot
- Move lock file from /etc/cscreenrc_allow_update to /dev/shm/.cscreenrc_allow_update

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=16
2020-08-26 16:14:42 +00:00
45177b395b - Set DISABLE_RESTART_ON_UPDATE=yes
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=15
2020-08-25 10:44:46 +00:00
0810a1d645 - carry permissions of sudoers.d content
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=14
2020-08-25 10:26:45 +00:00
11c1029c1e - Remove BuildRequires screen and sudo
- Add hint how to use SCREEN_OWNER with systemd
- Adjust default username in sysv rccscreen
- Adjust comment in cscreen to refer to default username
- mark sudoers as config to preserve local modifications
- Use correct user _cscreen for logrotate.conf
- Add execute permissions to /var/log/screen

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=13
2020-08-25 10:14:26 +00:00
4dc599de69 Accepting request 829010 from systemsmanagement
OBS-URL: https://build.opensuse.org/request/show/829010
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cscreen?expand=0&rev=2
2020-08-25 07:40:27 +00:00
884d921960 Accepting request 828991 from home:olh:branches:systemsmanagement
- Adjust permissions for ~_cscreen

OBS-URL: https://build.opensuse.org/request/show/828991
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/cscreen?expand=0&rev=11
2020-08-24 16:18:39 +00:00
481377c916 Accepting request 813172 from systemsmanagement
First submitrequest of a screen (screenrc) wrapper

We use this internally for years already.
See NON_Public:BuildOPS or NON_Public:infrastructure.
I polished this up quite a bit (use _cscreen instead of root),
etc. and it would be nice to have this in openSUSE:Factory
for broader feedback and usage.

OBS-URL: https://build.opensuse.org/request/show/813172
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cscreen?expand=0&rev=1
2020-06-11 08:03:07 +00:00
6 changed files with 214 additions and 102 deletions

View File

@@ -1,9 +1,11 @@
<services>
<service mode="disabled" name="obs_scm">
<param name="url">git://github.com/openSUSE/cscreen.git</param>
<param name="url">https://github.com/openSUSE/cscreen.git</param>
<param name="scm">git</param>
<param name="revision">master</param>
<param name="versionformat">0.7</param>
<param name="revision">161c01c01ee4103fd5be1b31c211307e2a016092</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">[v]?([^\+]+)(.*)</param>
<param name="versionrewrite-replacement">\1</param>
<param name="extract">cscreen.spec</param>
<param name="extract">cscreen-rpmlintrc</param>
</service>

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3bbbf10a0d382b2d615d1a5f3df23b731a4014d42c3ebda57cfd76be50617ab6
size 18120

3
cscreen-1.8.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e3db67afcb718cd6aa2b3360f99a9de3c0a43944199597ba14db0902ea1339fb
size 7900

3
cscreen-rpmlintrc Normal file
View File

@@ -0,0 +1,3 @@
addFilter('suse-logrotate-user-writable-log-dir')
addFilter('non-conffile-in-etc')
addFilter('hidden-file-or-dir')

View File

@@ -1,3 +1,118 @@
-------------------------------------------------------------------
Mon Mar 18 18:18:18 UTC 2024 - olaf@aepfle.de
- version 1.8
- disable screen and colon command in example cscreenrc
- reduce the default nice level to 3 for entire screen session
- provide sol-via-impi.sh and sol-via-ssh.sh
-------------------------------------------------------------------
Thu Mar 14 14:14:14 UTC 2024 - olaf@aepfle.de
- version 1.7
- screen uses select(2), which is limited to FD_SETSIZE open file descriptors
-------------------------------------------------------------------
Fri Mar 8 16:00:49 UTC 2024 - olaf@aepfle.de
- version 1.6
- Fix sysusers.d usage to make system-user-cscreen installable
- Remove pre-systemd support
-------------------------------------------------------------------
Mon Feb 5 05:05:05 UTC 2024 - olaf@aepfle.de
- version 1.5
- Create system-user-cscreen
- add example for virsh console (bsc#1213936)
-------------------------------------------------------------------
Wed Mar 9 14:14:14 UTC 2022 - olaf@aepfle.de
- version 1.4
- remove braces from rpm macros
- expand %name in rpm specfile for some files
- Include new tmpfile in files section
-------------------------------------------------------------------
Wed Mar 9 13:13:13 UTC 2022 - olaf@aepfle.de
- version 1.3
- restrict usage of cscreen to a trusted set of users (bsc#1196451, CVE-2022-21946)
- remove usage of fixed path /tmp/cscreen.debug (bsc#1196446, CVE-2022-21945)
-------------------------------------------------------------------
Mon Sep 27 13:48:15 UTC 2021 - olaf@aepfle.de
- version 1.2
- fix default logtstamp string
-------------------------------------------------------------------
Wed Apr 21 12:13:14 UTC 2021 - olaf@aepfle.de
- version 1.1
- set hard status in cscreenrc example
- use wrapper script for shell/SHELL
- fix screen execution
-------------------------------------------------------------------
Tue Apr 20 10:20:30 UTC 2021 - olaf@aepfle.de
- version 1.0
- start cscreen earlier by ordering it right after local-fs.target
- add zombie_timeout to default cscreenrc
- adjust Requires for scriptlets
- package cscreen-rpmlintrc
- Set LimitNOFILE= to compensate for lack of SCREEN_FILE_LIMIT
- use fillup and sysconfig only with sysv
- fillup file should be owned by root
- use DISABLE_RESTART_ON_UPDATE also with sysv
- %license macro does not work reliably in 13.2
- check if rpm macro has_systemd exists
- own suders.d if needed
- use name macro consistently
- remove Requires for apparently unused mailx
- use screen variable in cscreen script
- use SCREEN_OWNER in cscreen script
- use SCREENRC variable consistently
- use SCREEN_NAME variable consistently
- remove leading slash from sysv SCREEN_NAME
- move defscrollback to SCREEN_HISTORY
- Pass more characters to the remote system (bsc#1162835).
- Get rid of /etc/sudoers.d directory to avoid file conflicts at install time
-------------------------------------------------------------------
Fri Sep 11 18:25:10 UTC 2020 - Franck Bui <fbui@suse.com>
- Make use of %service_del_postun_without_restart
And stop using DISABLE_RESTART_ON_UPDATE as this interface is
obsolete.
-------------------------------------------------------------------
Tue Aug 25 10:10:10 UTC 2020 - olaf@aepfle.de
- version 0.8
- Fix shell syntax in FORCE_UPDATE test
- add defattr
- Wrap %license
- add BuildRoot
- Move lock file from /etc/cscreenrc_allow_update to /dev/shm/.cscreenrc_allow_update
- Set DISABLE_RESTART_ON_UPDATE=yes
- carry permissions of sudoers.d content
- Remove BuildRequires screen and sudo
- Add hint how to use SCREEN_OWNER with systemd
- Adjust default username in sysv rccscreen
- Adjust comment in cscreen to refer to default username
- mark sudoers as config to preserve local modifications
- Use correct user _cscreen for logrotate.conf
- Add execute permissions to /var/log/screen
-------------------------------------------------------------------
Mon Aug 24 15:15:15 UTC 2020 - olaf@aepfle.de
- Adjust permissions for ~_cscreen
-------------------------------------------------------------------
Wed Jun 10 09:45:43 UTC 2020 - Thomas Renninger <trenn@suse.de>

View File

@@ -1,7 +1,7 @@
#
# spec file for package cscreen
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,142 +16,134 @@
#
%define GROUPNAME _cscreen
%define USERNAME _cscreen
%define HOMEDIR %{_localstatedir}/lib/cscreen
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
%endif
%if 0%{?suse_version} > 1210
%define has_systemd 1
BuildRequires: pkgconfig(systemd)
%{?systemd_ordering}
%else
%define has_systemd 0
Requires(pre): %insserv_prereq
%endif
%define HOMEDIR %_localstatedir/lib/cscreen
Name: cscreen
Version: 0.7
Version: 1.8
Release: 0
Summary: Console screen
License: BSD-4-Clause
Group: System/Management
URL: https://github.com/openSUSE/cscreen
Source: %{name}-%{version}.tar.xz
BuildRequires: screen
Source: %name-%version.tar.xz
Source1: %name-rpmlintrc
BuildRequires: sudo
Recommends: logrotate
Requires: mailx
Requires: screen
Requires: sudo
Requires(postun): /usr/bin/rm
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: %fillup_prereq
PreReq: shadow
Requires(postun): coreutils
BuildRequires: pkgconfig(systemd)
BuildRequires: sysuser-tools
Requires(pre): system-user-%name = %version-%release
%{?systemd_ordering}
BuildArch: noarch
%description
This package allows to run multiple consoles in one 'screen' and
to start the screen automatically during boot.
%package -n system-user-%name
Summary: System user %USERNAME
%if 0%{?suse_version} > 1320
Requires(pre): group(dialout)
Requires(pre): group(tty)
%endif
%?sysusers_requires
%description -n system-user-%name
System user %USERNAME
%prep
%setup
%autosetup -p1
#
%build
#
%install
mkdir -p %{buildroot}/%{_sbindir}
> %name.files
if ! test -d %_sysconfdir/sudoers.d
then
echo '%%dir %_sysconfdir/sudoers.d' >> %name.files
fi
mkdir -p %buildroot/%_sbindir
%if %{?has_systemd}
install -Dm644 systemd/cscreen.service %{buildroot}/%{_unitdir}/%{name}d.service
pushd %{buildroot}/%{_sbindir}
ln -sf service %{buildroot}%{_sbindir}/rc%{name}d
install -Dm644 cscreen.service %buildroot/%_unitdir/cscreend.service
pushd %buildroot/%_sbindir
ln -sf service %buildroot%_sbindir/rccscreend
popd
%else
install -Dm755 systemd/cscreen.init %{buildroot}/%{_sysconfdir}/init.d/cscreend
pushd %{buildroot}/%{_sbindir}
ln -s %{_sysconfdir}/init.d/%{name}d rc%{name}d
popd
%endif
mkdir -vp %buildroot%_tmpfilesdir
tee %buildroot%_tmpfilesdir/%name.conf <<'_EOF_'
d %_rundir/%name 0750 %USERNAME %USERNAME -
_EOF_
suc='system-user-%name.conf'
tee "${suc}" <<'_EOC_'
u %USERNAME - "cscreen daemon user" %HOMEDIR /bin/bash
m %USERNAME dialout
m %USERNAME tty
_EOC_
mkdir -p '%buildroot%_sysusersdir'
cp -avLt "$_" "${suc}"
%sysusers_generate_pre "${suc}" system-user-%name
install -Dm640 configs/%{name}.config %{buildroot}/%{_sysconfdir}/%{name}rc
install -Dm644 configs/%{name}.logrotate %{buildroot}/%{_sysconfdir}/logrotate.d/%{name}
install -Dm644 configs/%{name}.sudoers %{buildroot}%{_sysconfdir}/sudoers.d/cscreen
install -Dm644 configs/%{name}.sysconfig %{buildroot}/%{_fillupdir}/sysconfig.%{name}
install -Dm755 src/%{name} %{buildroot}/%{_bindir}/%{name}
install -Dm755 src/%{name}_update_config.sh %{buildroot}/%{_bindir}/cscreen_update_config.sh
mkdir -p %{buildroot}%{_localstatedir}/log/screen/old
mkdir -pm770 %{buildroot}/%{HOMEDIR}
mkdir -pm700 %{buildroot}/%{HOMEDIR}/.ssh
install -Dm640 configs/cscreen.config %buildroot/%_sysconfdir/cscreenrc
install -Dm644 configs/cscreen.logrotate %buildroot/%_sysconfdir/logrotate.d/%name
install -Dm644 configs/cscreen.sudoers %buildroot%_sysconfdir/sudoers.d/%name
install -Dm755 src/cscreen-shell %buildroot/%_datadir/%name/cscreen-shell
install -Dm555 src/sol-via-ipmi.sh %buildroot/%_datadir/%name/sol-via-ipmi.sh
install -Dm555 src/sol-via-ssh.sh %buildroot/%_datadir/%name/sol-via-ssh.sh
install -Dm755 src/cscreen %buildroot/%_bindir/%name
install -Dm755 src/cscreen_update_config.sh %buildroot/%_bindir/cscreen_update_config.sh
mkdir -p %buildroot%_localstatedir/log/screen/old
mkdir -pm700 %buildroot/%HOMEDIR
mkdir -pm700 %buildroot/%HOMEDIR/.ssh
%pre
%if %{?has_systemd}
%service_add_pre %{name}d.service
%endif
getent group %{GROUPNAME} >/dev/null || groupadd -r %{GROUPNAME}
if getent group tty >/dev/null;then
TTY_GROUP="-G tty"
if getent group dialout >/dev/null;then
TTY_GROUP="$TTY_GROUP,dialout"
fi
else
TTY_GROUP=""
echo "WARNING: Could not find tty group"
fi
getent passwd %{USERNAME} >/dev/null || \
useradd -r -g %{GROUPNAME} -d %{HOMEDIR} -s /bin/bash \
-c "cscreen daemon user" %{USERNAME} $TTY_GROUP
%service_add_pre cscreend.service
%post
%if %{?has_systemd}
%service_add_post %{name}d.service
%else
%{fillup_and_insserv %{name}d }
%endif
%fillup_only %{name}
%service_add_post cscreend.service
%tmpfiles_create %_tmpfilesdir/%name.conf
%preun
%if %{?has_systemd}
%service_del_preun %{name}d.service
%else
%stop_on_removal %{name}d
%endif
%service_del_preun cscreend.service
%postun
%if %{?has_systemd}
%service_del_postun %{name}d.service
%if %{defined service_del_postun_without_restart}
%service_del_postun_without_restart cscreend.service
%else
%restart_on_update %{name}d
%insserv_cleanup
DISABLE_RESTART_ON_UPDATE=yes
%service_del_postun cscreend.service
%endif
if [ -d /run/uscreens/S-cscreen ];then
if [ -d %_rundir/uscreens/S-cscreen ];then
if [ "$1" = "0" ];then
# Only delete on uninstall
rm -rf /run/uscreens/S-cscreen
rm -rf %_rundir/uscreens/S-cscreen
fi
fi
%files
%doc docs/motd_example
%license License
%{_bindir}/%{name}
%{_bindir}/cscreen_update_config.sh
%if %{?has_systemd}
%{_unitdir}/cscreend.service
%else
%{_sysconfdir}/init.d/cscreend
%endif
%{_sbindir}/rc%{name}d
%pre -n system-user-%name -f system-user-%name.pre
%files -n system-user-%name
%_sysusersdir/*.conf
%{_sysconfdir}/sudoers.d/cscreen
%attr(644,%{USERNAME}, %{GROUPNAME}) %dir %{_localstatedir}/log/screen
%attr(644,%{USERNAME}, %{GROUPNAME}) %dir %{_localstatedir}/log/screen/old
%attr(644,%{USERNAME}, %{GROUPNAME}) %{_fillupdir}/sysconfig.%{name}
%attr(770,%{USERNAME}, %{GROUPNAME}) %dir %{HOMEDIR}
%attr(700,%{USERNAME}, %{GROUPNAME}) %dir %{HOMEDIR}/.ssh
%attr(644,%{USERNAME}, %{GROUPNAME}) %config(noreplace) %{_sysconfdir}/%{name}rc
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%files -f %name.files
%doc README.md
%doc docs/motd_example
%if 0%{?suse_version} > 1320
%license License
%endif
%_bindir/%name
%_bindir/cscreen_update_config.sh
%_datadir/%name
%_tmpfilesdir/%name.conf
%_unitdir/cscreend.service
%_sbindir/rccscreend
%attr(0640,root,root) %config %_sysconfdir/sudoers.d/%name
%attr(755,%{USERNAME}, %{USERNAME}) %dir %_localstatedir/log/screen
%attr(755,%{USERNAME}, %{USERNAME}) %dir %_localstatedir/log/screen/old
%attr(700,%{USERNAME}, %{USERNAME}) %dir %HOMEDIR
%attr(700,%{USERNAME}, %{USERNAME}) %dir %HOMEDIR/.ssh
%attr(644,%{USERNAME}, %{USERNAME}) %config(noreplace) %_sysconfdir/cscreenrc
%config(noreplace) %_sysconfdir/logrotate.d/%name
%changelog