]> git.pld-linux.org Git - packages/rssh.git/blob - rssh.spec
5f7c267c2045b7502bfadc87694e2aceb39240c3
[packages/rssh.git] / rssh.spec
1 Summary:        A restricted shell for assigning scp- or sftp-only access
2 Summary(pl.UTF-8):      Okrojona powłoka dająca dostęp tylko do scp i/lub sftp
3 Name:           rssh
4 Version:        2.3.4
5 Release:        1
6 License:        BSD-like
7 Group:          Applications/Shells
8 Source0:        http://dl.sourceforge.net/rssh/%{name}-%{version}.tar.gz
9 # Source0-md5:  5211f5fe206704f813a3cec61f487042
10 Patch0:         %{name}-userbuild.patch
11 Patch1:         %{name}-mkchroot.patch
12 Patch2:         %{name}-rsync-protocol.patch
13 URL:            http://www.pizzashack.org/rssh/
14 BuildRequires:  autoconf
15 BuildRequires:  automake
16 BuildRequires:  openssh-clients >= 3.5p1
17 Requires(post): grep
18 Requires(preun):        sed >= 4.0
19 Conflicts:      openssh-server < 3.5p1
20 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22 %undefine       with_ccache
23
24 %description
25 rssh is a small shell that provides the ability for system
26 administrators to give specific users access to a given system via scp
27 or sftp only.
28
29 %description -l pl.UTF-8
30 rssh jest małym shellem, który pozwala administratorowi ograniczyć
31 dostęp na danym koncie tylko do scp i/lub sftp.
32
33 %prep
34 %setup -q
35 %patch0 -p1
36 %patch1
37 %patch2 -p1
38
39 %build
40 %{__aclocal}
41 %{__automake}
42 %{__autoconf}
43 %configure \
44         --with-scp=/usr/bin/scp \
45         --with-sftp-server=/usr/%{_lib}/openssh/sftp-server
46
47 %{__make}
48
49 %install
50 rm -rf $RPM_BUILD_ROOT
51 install -d $RPM_BUILD_ROOT/bin
52
53 %{__make} install \
54          DESTDIR=$RPM_BUILD_ROOT
55
56 mv -f $RPM_BUILD_ROOT%{_sysconfdir}/rssh.conf{.default,}
57 ln -sf rssh $RPM_BUILD_ROOT%{_bindir}/scpsh
58 ln -sf rssh $RPM_BUILD_ROOT%{_bindir}/sftpsh
59
60 # legacy
61 ln -s %{_bindir}/%{name} $RPM_BUILD_ROOT/bin/%{name}
62 ln -s %{_bindir}/scpsh $RPM_BUILD_ROOT/bin/scpsh
63 ln -s %{_bindir}/sftpsh $RPM_BUILD_ROOT/bin/sftpsh
64
65
66 %clean
67 rm -rf $RPM_BUILD_ROOT
68
69 %post
70 if [ ! -f /etc/shells ]; then
71         umask 022
72         echo "%{_bindir}/%{name}" > /etc/shells
73         echo "%{_bindir}/scpsh" >> /etc/shells
74         echo "%{_bindir}/sftpsh" >> /etc/shells
75 else
76         if ! grep -q '^%{_bindir}/%{name}$' /etc/shells; then
77                 echo "%{_bindir}/%{name}" >> /etc/shells
78         fi
79         if ! grep -q '^%{_bindir}/scpsh$' /etc/shells; then
80                 echo "%{_bindir}/scpsh" >> /etc/shells
81         fi
82         if ! grep -q '^%{_bindir}/sftpsh$' /etc/shells; then
83                 echo "%{_bindir}/sftpsh" >> /etc/shells
84         fi
85 fi
86
87 %preun
88 if [ "$1" = "0" ]; then
89         %{__sed} -i -e '/^%(echo %{_bindir} | sed -e 's,/,\\/,g')\/\(%{name}\|scpsh\|sftpsh\)$/d' /etc/shells
90 fi
91
92 %triggerpostun -- %{name} < 2.3.2-0.6
93 # make compat symlinks, the symlinks are discarded using %ghost on package uninstall
94 ln -sf %{_bindir}/%{name} /bin/%{name}
95 ln -sf %{_bindir}/scpsh /bin/scpsh
96 ln -sf %{_bindir}/sftpsh /bin/sftpsh
97
98 %files
99 %defattr(644,root,root,755)
100 %doc AUTHORS ChangeLog README CHROOT SECURITY mkchroot.sh
101 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rssh.conf
102 %attr(755,root,root) %{_bindir}/%{name}
103 %attr(755,root,root) %{_bindir}/scpsh
104 %attr(755,root,root) %{_bindir}/sftpsh
105 %attr(4755,root,root) %{_libexecdir}/rssh_chroot_helper
106 %{_mandir}/man?/*
107 # legacy
108 %ghost /bin/%{name}
109 %ghost /bin/scpsh
110 %ghost /bin/sftpsh
This page took 0.084111 seconds and 2 git commands to generate.