From 9a53be0cb65d470e54822b2145cd11ecd8f22d49 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 4 Feb 2011 15:50:49 +0100 Subject: [PATCH] change socket directory to $HOME/.screen Drop screen group and add bcond macro to build the package with multiuser support. --- screen.spec | 24 +++++++++++++++--------- screen.tmpfs | 2 -- 2 files changed, 15 insertions(+), 11 deletions(-) delete mode 100644 screen.tmpfs diff --git a/screen.spec b/screen.spec index 5255c24..611f5d9 100644 --- a/screen.spec +++ b/screen.spec @@ -1,3 +1,5 @@ +%bcond_with multiuser + Summary: A screen manager that supports multiple logins on one terminal Name: screen Version: 4.1.0 @@ -5,7 +7,6 @@ Release: 0.1.20101110git066b098%{?dist} License: GPLv2+ Group: Applications/System URL: http://www.gnu.org/software/screen -Requires(pre): /usr/sbin/groupadd Requires(preun): /sbin/install-info Requires(post): /sbin/install-info BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -16,7 +17,6 @@ BuildRequires: automake # snapshot from git://git.savannah.gnu.org/screen.git Source0: screen-20101110git066b098.tar.bz2 Source1: screen.pam -Source2: screen.tmpfs Patch1: screen-4.0.3-libs.patch Patch2: screen-4.0.3-screenrc.patch @@ -52,6 +52,7 @@ support multiple logins on one terminal. --with-pty-mode=0620 \ --with-pty-group=$(getent group tty | cut -d : -f 3) \ --with-sys-screenrc="%{_sysconfdir}/screenrc" \ +%{!?with_multiuser: --disable-socket-dir} \ --with-socket-dir="%{_localstatedir}/run/screen" # We would like to have braille support. @@ -77,12 +78,17 @@ cat etc/screenrc >> $RPM_BUILD_ROOT%{_sysconfdir}/screenrc mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d install -p -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/screen +%if %{with multiuser} # Create the socket dir mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/screen # And tell systemd to recreate it on start with tmpfs mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d -install -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/screen.conf +cat < $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/screen.conf +# screen needs directory in /var/run +d /var/run/screen 0755 root root +EOF +%endif # Remove files from the buildroot which we don't want packaged rm -f $RPM_BUILD_ROOT%{_infodir}/dir @@ -90,10 +96,6 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/dir %clean rm -rf $RPM_BUILD_ROOT -%pre -/usr/sbin/groupadd -g 84 -r -f screen -: - %post /sbin/install-info %{_infodir}/screen.info.gz %{_infodir}/dir --entry="* screen: (screen). Terminal multiplexer." &> /dev/null : @@ -107,14 +109,18 @@ fi %files %defattr(-,root,root,-) %doc NEWS README doc/FAQ doc/README.DOTSCREEN COPYING -%attr(2755,root,screen) %{_bindir}/screen %{_mandir}/man1/screen.* %{_infodir}/screen.info* %{_datadir}/screen -%attr(775,root,screen) %{_localstatedir}/run/screen %config(noreplace) %{_sysconfdir}/screenrc %config(noreplace) %{_sysconfdir}/pam.d/screen +%if %{with multiuser} +%attr(4755,root,root) %{_bindir}/screen +%attr(755,root,root) %{_localstatedir}/run/screen %{_sysconfdir}/tmpfiles.d/screen.conf +%else +%attr(755,root,root) %{_bindir}/screen +%endif %changelog * Fri Nov 12 2010 Miroslav Lichvar - 4.0.3-16 diff --git a/screen.tmpfs b/screen.tmpfs deleted file mode 100644 index e693ce1..0000000 --- a/screen.tmpfs +++ /dev/null @@ -1,2 +0,0 @@ -# screen needs directory in /var/run -d /var/run/screen 0775 root screen