]> git.pld-linux.org Git - packages/rssh.git/blob - rssh.spec
- cosmetics, remove empty files, added CHROOT, SECURITY and mkchroot.sh
[packages/rssh.git] / rssh.spec
1 Summary:        A restricted shell for assigning scp- or sftp-only access
2 Summary(pl):    Okrojona pow³oka daj±ca dostêp tylko do scp i sftp
3 Name:           rssh
4 Version:        2.2.1
5 Release:        2
6 License:        BSD-like
7 Group:          Applications/Shells
8 Source0:        http://www.pizzashack.org/rssh/src/%{name}-%{version}.tar.gz
9 # Source0-md5:  2d427ee7f4ea46b075fa0ab3f39b4089
10 Patch0:         %{name}-userbuild.patch
11 Patch1:         %{name}-mkchroot.patch
12 URL:            http://rssh.sourceforge.net/
13 BuildRequires:  autoconf
14 BuildRequires:  automake
15 BuildRequires:  openssh-clients >= 3.5p1
16 Requires:       openssh-server >= 3.5p1
17 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19 %define         _bindir         /bin
20
21 %description
22 rssh is a small shell that provides the ability for system
23 administrators to give specific users access to a given system via scp
24 or sftp only.
25
26 %description -l pl
27 rssh jest ma³ym shellem, który pozwala administratorowi ograniczyæ
28 dostêp na danym koncie tylko do scp i/lub sftp.
29
30 %prep
31 %setup -q
32 %patch0 -p1
33 %patch1
34
35 %build
36 %{__aclocal}
37 %{__automake}
38 %{__autoconf}
39 %configure \
40         --with-scp=/usr/bin/scp \
41         --with-sftp-server=/usr/lib/openssh/sftp-server
42
43 %{__make}
44
45 %install
46 rm -rf $RPM_BUILD_ROOT
47
48 %{__make} install \
49          DESTDIR=$RPM_BUILD_ROOT
50
51 ln -sf rssh $RPM_BUILD_ROOT/bin/scpsh
52 ln -sf rssh $RPM_BUILD_ROOT/bin/sftpsh
53
54 %clean
55 rm -rf $RPM_BUILD_ROOT
56
57 %post
58 umask 022
59 if [ ! -f /etc/shells ]; then
60         echo "%{_bindir}/%{name}" > /etc/shells
61         echo "%{_bindir}/scpsh" >> /etc/shells
62         echo "%{_bindir}/sftpsh" >> /etc/shells
63 else
64         if ! grep -q '^%{_bindir}/%{name}$' /etc/shells; then
65                 echo "%{_bindir}/%{name}" >> /etc/shells
66         fi
67         if ! grep -q '^%{_bindir}/scpsh$' /etc/shells; then
68                 echo "%{_bindir}/scpsh" >> /etc/shells
69         fi
70         if ! grep -q '^%{_bindir}/sftpsh$' /etc/shells; then
71                 echo "%{_bindir}/sftpsh" >> /etc/shells
72         fi
73 fi
74
75 %preun
76 umask 022
77 if [ "$1" = "0" ]; then
78         grep -v %{_bindir}/%{name} /etc/shells | grep -v %{_bindir}/scpsh | grep -v %{_bindir}/sftpsh > /etc/shells.new
79         mv -f /etc/shells.new /etc/shells
80 fi
81
82 %files
83 %defattr(644,root,root,755)
84 %doc AUTHORS ChangeLog README CHROOT SECURITY mkchroot.sh
85 %attr(644,root,root) %config(noreplace) %verify(not size mtime md5) /etc/rssh.conf
86 %attr(755,root,root) %{_bindir}/%{name}
87 %attr(755,root,root) %{_bindir}/scpsh
88 %attr(755,root,root) %{_bindir}/sftpsh
89 %attr(4755,root,root) %{_libdir}/rssh_chroot_helper
90 %{_mandir}/man?/*
This page took 0.066881 seconds and 3 git commands to generate.