2020-05-11 18:03:40 +00:00
|
|
|
#
|
|
|
|
|
# spec file for package cscreen
|
|
|
|
|
#
|
2024-03-08 16:02:21 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2020-05-11 18:03:40 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
2020-05-11 18:41:09 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2020-05-11 18:03:40 +00:00
|
|
|
#
|
|
|
|
|
|
2020-05-11 18:41:09 +00:00
|
|
|
|
2020-06-07 12:00:42 +00:00
|
|
|
%define USERNAME _cscreen
|
2022-03-09 14:33:27 +00:00
|
|
|
%define HOMEDIR %_localstatedir/lib/cscreen
|
2020-05-11 18:03:40 +00:00
|
|
|
Name: cscreen
|
2024-03-18 22:09:45 +00:00
|
|
|
Version: 1.8
|
2020-05-11 18:41:09 +00:00
|
|
|
Release: 0
|
2020-05-11 18:03:40 +00:00
|
|
|
Summary: Console screen
|
2020-05-11 18:41:09 +00:00
|
|
|
License: BSD-4-Clause
|
2020-05-11 18:03:40 +00:00
|
|
|
Group: System/Management
|
2020-06-09 16:27:59 +00:00
|
|
|
URL: https://github.com/openSUSE/cscreen
|
2022-03-09 14:33:27 +00:00
|
|
|
Source: %name-%version.tar.xz
|
|
|
|
|
Source1: %name-rpmlintrc
|
2021-04-20 10:25:19 +00:00
|
|
|
BuildRequires: sudo
|
2020-06-09 19:54:16 +00:00
|
|
|
Recommends: logrotate
|
2020-05-11 18:03:40 +00:00
|
|
|
Requires: screen
|
|
|
|
|
Requires: sudo
|
2021-04-20 11:51:05 +00:00
|
|
|
Requires(postun): coreutils
|
2024-02-05 22:49:18 +00:00
|
|
|
BuildRequires: pkgconfig(systemd)
|
|
|
|
|
BuildRequires: sysuser-tools
|
|
|
|
|
Requires(pre): system-user-%name = %version-%release
|
|
|
|
|
%{?systemd_ordering}
|
2020-05-11 18:03:40 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
%description
|
2020-05-11 18:41:09 +00:00
|
|
|
This package allows to run multiple consoles in one 'screen' and
|
2020-05-11 18:03:40 +00:00
|
|
|
to start the screen automatically during boot.
|
|
|
|
|
|
2024-02-05 22:49:18 +00:00
|
|
|
%package -n system-user-%name
|
|
|
|
|
Summary: System user %USERNAME
|
2024-03-18 22:09:45 +00:00
|
|
|
%if 0%{?suse_version} > 1320
|
2024-02-05 22:49:18 +00:00
|
|
|
Requires(pre): group(dialout)
|
|
|
|
|
Requires(pre): group(tty)
|
2024-03-18 22:09:45 +00:00
|
|
|
%endif
|
2024-02-05 22:49:18 +00:00
|
|
|
%?sysusers_requires
|
|
|
|
|
|
|
|
|
|
%description -n system-user-%name
|
|
|
|
|
System user %USERNAME
|
|
|
|
|
|
2020-05-11 18:03:40 +00:00
|
|
|
%prep
|
2024-03-08 16:02:21 +00:00
|
|
|
%autosetup -p1
|
2020-05-11 18:03:40 +00:00
|
|
|
#
|
|
|
|
|
%build
|
|
|
|
|
#
|
|
|
|
|
%install
|
2022-03-09 14:33:27 +00:00
|
|
|
> %name.files
|
|
|
|
|
if ! test -d %_sysconfdir/sudoers.d
|
2021-04-20 11:51:05 +00:00
|
|
|
then
|
2022-03-09 14:33:27 +00:00
|
|
|
echo '%%dir %_sysconfdir/sudoers.d' >> %name.files
|
2021-04-20 11:51:05 +00:00
|
|
|
fi
|
2022-03-09 14:33:27 +00:00
|
|
|
mkdir -p %buildroot/%_sbindir
|
2020-05-11 18:03:40 +00:00
|
|
|
|
2024-03-18 22:09:45 +00:00
|
|
|
install -Dm644 cscreen.service %buildroot/%_unitdir/cscreend.service
|
2022-03-09 14:33:27 +00:00
|
|
|
pushd %buildroot/%_sbindir
|
|
|
|
|
ln -sf service %buildroot%_sbindir/rccscreend
|
2020-05-11 18:03:40 +00:00
|
|
|
popd
|
2022-03-09 13:14:55 +00:00
|
|
|
mkdir -vp %buildroot%_tmpfilesdir
|
|
|
|
|
tee %buildroot%_tmpfilesdir/%name.conf <<'_EOF_'
|
2024-03-08 16:02:21 +00:00
|
|
|
d %_rundir/%name 0750 %USERNAME %USERNAME -
|
2022-03-09 13:14:55 +00:00
|
|
|
_EOF_
|
2024-02-05 22:49:18 +00:00
|
|
|
suc='system-user-%name.conf'
|
|
|
|
|
tee "${suc}" <<'_EOC_'
|
2024-03-08 16:02:21 +00:00
|
|
|
u %USERNAME - "cscreen daemon user" %HOMEDIR /bin/bash
|
2024-02-05 22:49:18 +00:00
|
|
|
m %USERNAME dialout
|
|
|
|
|
m %USERNAME tty
|
|
|
|
|
_EOC_
|
|
|
|
|
mkdir -p '%buildroot%_sysusersdir'
|
|
|
|
|
cp -avLt "$_" "${suc}"
|
|
|
|
|
%sysusers_generate_pre "${suc}" system-user-%name
|
2020-05-11 18:03:40 +00:00
|
|
|
|
2022-03-09 14:33:27 +00:00
|
|
|
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
|
2024-03-18 22:09:45 +00:00
|
|
|
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
|
2022-03-09 14:33:27 +00:00
|
|
|
install -Dm755 src/cscreen %buildroot/%_bindir/%name
|
|
|
|
|
install -Dm755 src/cscreen_update_config.sh %buildroot/%_bindir/cscreen_update_config.sh
|
2020-05-11 18:03:40 +00:00
|
|
|
|
2022-03-09 14:33:27 +00:00
|
|
|
mkdir -p %buildroot%_localstatedir/log/screen/old
|
2024-03-08 16:02:21 +00:00
|
|
|
mkdir -pm700 %buildroot/%HOMEDIR
|
|
|
|
|
mkdir -pm700 %buildroot/%HOMEDIR/.ssh
|
2020-06-07 12:00:42 +00:00
|
|
|
|
2020-05-11 18:03:40 +00:00
|
|
|
%pre
|
2022-03-09 14:33:27 +00:00
|
|
|
%service_add_pre cscreend.service
|
2020-05-11 18:03:40 +00:00
|
|
|
|
2020-05-11 18:41:09 +00:00
|
|
|
%post
|
2022-03-09 14:33:27 +00:00
|
|
|
%service_add_post cscreend.service
|
2022-03-09 13:14:55 +00:00
|
|
|
%tmpfiles_create %_tmpfilesdir/%name.conf
|
2020-05-11 18:03:40 +00:00
|
|
|
|
|
|
|
|
%preun
|
2022-03-09 14:33:27 +00:00
|
|
|
%service_del_preun cscreend.service
|
2020-05-11 18:03:40 +00:00
|
|
|
|
|
|
|
|
%postun
|
2020-09-18 06:51:23 +00:00
|
|
|
%if %{defined service_del_postun_without_restart}
|
2022-03-09 14:33:27 +00:00
|
|
|
%service_del_postun_without_restart cscreend.service
|
2020-05-11 18:03:40 +00:00
|
|
|
%else
|
2020-09-18 06:51:23 +00:00
|
|
|
DISABLE_RESTART_ON_UPDATE=yes
|
2022-03-09 14:33:27 +00:00
|
|
|
%service_del_postun cscreend.service
|
2020-09-18 06:51:23 +00:00
|
|
|
%endif
|
2024-03-18 22:09:45 +00:00
|
|
|
if [ -d %_rundir/uscreens/S-cscreen ];then
|
2020-06-10 10:18:59 +00:00
|
|
|
if [ "$1" = "0" ];then
|
2020-06-09 19:54:16 +00:00
|
|
|
# Only delete on uninstall
|
2024-03-18 22:09:45 +00:00
|
|
|
rm -rf %_rundir/uscreens/S-cscreen
|
2020-06-09 19:54:16 +00:00
|
|
|
fi
|
2020-06-07 12:00:42 +00:00
|
|
|
fi
|
2020-05-11 18:03:40 +00:00
|
|
|
|
2024-02-05 22:49:18 +00:00
|
|
|
%pre -n system-user-%name -f system-user-%name.pre
|
|
|
|
|
%files -n system-user-%name
|
|
|
|
|
%_sysusersdir/*.conf
|
|
|
|
|
|
2022-03-09 14:33:27 +00:00
|
|
|
%files -f %name.files
|
2024-03-18 22:09:45 +00:00
|
|
|
%doc README.md
|
2020-06-09 16:27:59 +00:00
|
|
|
%doc docs/motd_example
|
2021-04-20 11:51:05 +00:00
|
|
|
%if 0%{?suse_version} > 1320
|
2020-06-07 12:00:42 +00:00
|
|
|
%license License
|
2020-08-26 16:18:22 +00:00
|
|
|
%endif
|
2022-03-09 14:33:27 +00:00
|
|
|
%_bindir/%name
|
|
|
|
|
%_bindir/cscreen_update_config.sh
|
|
|
|
|
%_datadir/%name
|
|
|
|
|
%_tmpfilesdir/%name.conf
|
|
|
|
|
%_unitdir/cscreend.service
|
|
|
|
|
%_sbindir/rccscreend
|
2020-05-11 18:03:40 +00:00
|
|
|
|
2022-03-09 14:33:27 +00:00
|
|
|
%attr(0640,root,root) %config %_sysconfdir/sudoers.d/%name
|
2024-03-08 16:02:21 +00:00
|
|
|
%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
|
2022-03-09 14:33:27 +00:00
|
|
|
%config(noreplace) %_sysconfdir/logrotate.d/%name
|
2020-05-11 18:03:40 +00:00
|
|
|
|
|
|
|
|
%changelog
|