File lshell.spec of Package lshell
# vim: set ts=4 sw=4 et:
# Copyright (c) 2012 Pascal Bleser <pascal.bleser@opensuse.org>
#
# 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 http://bugs.opensuse.org/
%{!?py_ver: %global py_ver %(python -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)}
Name: lshell
Version: 0.9.16
Release: 0
Summary: Limited Shell
Source: http://prdownloads.sourceforge.net/lshell/lshell-%{version}.tar.gz
Source1: lshell.logrotate
Source99: lshell-rpmlintrc
URL: http://ghantoos.org/limited-shell-lshell/
Group: System/Shells
License: GNU General Public License version 3 (GPL v3)
BuildRoot: %{_tmppath}/build-%{name}-%{version}
%if 0%{?suse_version} >= 1120
BuildArch: noarch
%endif
BuildRequires: python python-devel
%if 0%{?suse_version} >= 1120
BuildArch: noarch
%endif
Requires: perl
%if 0%{?suse_version} >= 1030
Requires: logrotate
%endif
PreReq: python = %{py_ver}
%description
Limited Shell (lshell) provides a shell configurable per user. This is done
quite simply using a configuration file. It becomes easy to restrict a user's
access to a limited set of commands, choosing to enable/disable any command
over SSH (e.g. SCP, SFTP, rsync, etc.). It also has a logging feature, timer
restriction, and more.
%prep
%setup -q
# fix E: spurious-executable-perm:
%__chmod 0644 CHANGES
%build
%__python ./setup.py build
%install
%__python ./setup.py install --prefix="%{_prefix}" --root="%{buildroot}" \
--record-rpm=rpmfiles.lst
%__perl -ni -e 'print unless m|^(%dir\s+)?%{_mandir}|' rpmfiles.lst
%__rm -rf "%{buildroot}%{_datadir}/doc"
%__perl -ni -e 'print unless m|^(%dir\s+)?%{_datadir}/doc|' rpmfiles.lst
%__install -d "%{buildroot}/var/log/lshell"
%__install -D -m0644 "%{SOURCE1}" "%{buildroot}/etc/logrotate.d/%{name}"
%__perl -ni -e 'print unless m|logrotate\.d|' rpmfiles.lst
%post
/usr/bin/getent group lshell 2>/dev/null || { echo "%{_bindir}/lshell" >> /etc/shells; }
%postun
%__perl -ni -e 'print unless m|^%{_bindir}/lshell$|' /etc/shells || :
%clean
%{?buildroot:%__rm -rf "%{buildroot}"}
%files -f rpmfiles.lst
%defattr(-,root,root)
%doc CHANGES COPYING README.md
%config(noreplace) %{_sysconfdir}/lshell.conf
%config /etc/logrotate.d/%{name}
%attr(0775,root,users) /var/log/lshell
%doc %{_mandir}/man1/lshell.1*
%changelog