File rush.spec of Package rush
#
# spec file for package rush
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global optflags %{optflags} -g -fPIE
Name: rush
Version: 2.0
Release: 0
Summary: Restricted User Shell
License: GPL-3.0-or-later
Group: System/Shells
URL: http://www.gnu.org/software/rush/
Source: https://download.gnu.org.ua/pub/release/rush/rush-%{version}.tar.xz
Source1: rush.permissions
Source2: rush.permissions.paranoid
Source99: rpmlintrc
BuildRequires: autoconf
BuildRequires: glibc-devel
BuildRequires: libtool
BuildRequires: pwdutils
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: %{install_info_prereq}
PreReq: permissions
PreReq: pwdutils
%description
GNU Rush is a Restricted User Shell designed for sites providing limited
remote access to their resources, such as SVN or Git repositories, scp, or
the like. Using a sophisticated configuration file, Rush gives you complete
control over the command lines that users execute, as well as over the usage
of system resources such as virtual memory, CPU time, etc. In particular,
it allows you to run remote programs in a chrooted environment, which is
important with such programs as sftp-server or scp that lack this ability.
Note that for security reasons, only the users in the group "rush" may
use %{_sbindir}/rush as a shell, so make sure to add them to that group.
%prep
%setup -q
%build
LDFLAGS=-pie
export LDFLAGS
%configure
make %{?_smp_mflags}
%install
%make_install STRIPPROG=
install -D -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/permissions.d/%{name}
install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/permissions.d/%{name}.paranoid
%find_lang rush
%verifyscript
%verify_permissions -e %{_sbindir}/rush
%post
%install_info --info-dir=%{_infodir} %{_infodir}/rush.info*
%{_bindir}/getent group rush >/dev/null 2>&1 || %{_sbindir}/groupadd -r rush
%set_permissions %{_sbindir}/rush
%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/rush.info*
%files -f rush.lang
%license COPYING
%doc AUTHORS ChangeLog NEWS README
%config(noreplace) %{_sysconfdir}/rush.rc
%{_bindir}/rush-po
%{_bindir}/rushlast
%{_bindir}/rushwho
%verify(not mode group) %attr(4750,root,rush) %{_sbindir}/rush
%{_infodir}/rush.info%{?ext_info}
%config(noreplace) %{_sysconfdir}/permissions.d/%{name}
%config(noreplace) %{_sysconfdir}/permissions.d/%{name}.paranoid
%{_mandir}/man?/rush*%{?ext_man}
%changelog