]> git.pld-linux.org Git - packages/rssh.git/blob - rssh.spec
- updated sf URL
[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://downloads.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} $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 %clean
66 rm -rf $RPM_BUILD_ROOT
67
68 %post
69 if [ ! -f /etc/shells ]; then
70         umask 022
71         echo "%{_bindir}/%{name}" > /etc/shells
72         echo "%{_bindir}/scpsh" >> /etc/shells
73         echo "%{_bindir}/sftpsh" >> /etc/shells
74 else
75         if ! grep -q '^%{_bindir}/%{name}$' /etc/shells; then
76                 echo "%{_bindir}/%{name}" >> /etc/shells
77         fi
78         if ! grep -q '^%{_bindir}/scpsh$' /etc/shells; then
79                 echo "%{_bindir}/scpsh" >> /etc/shells
80         fi
81         if ! grep -q '^%{_bindir}/sftpsh$' /etc/shells; then
82                 echo "%{_bindir}/sftpsh" >> /etc/shells
83         fi
84 fi
85
86 %preun
87 if [ "$1" = "0" ]; then
88         %{__sed} -i -e '/^%(echo %{_bindir} | sed -e 's,/,\\/,g')\/\(%{name}\|scpsh\|sftpsh\)$/d' /etc/shells
89 fi
90
91 %triggerpostun -- %{name} < 2.3.2-0.6
92 # make compat symlinks, the symlinks are discarded using %ghost on package uninstall
93 ln -sf %{_bindir}/%{name} /bin/%{name}
94 ln -sf %{_bindir}/scpsh /bin/scpsh
95 ln -sf %{_bindir}/sftpsh /bin/sftpsh
96
97 %files
98 %defattr(644,root,root,755)
99 %doc AUTHORS ChangeLog README CHROOT SECURITY mkchroot.sh
100 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/rssh.conf
101 %attr(755,root,root) %{_bindir}/%{name}
102 %attr(755,root,root) %{_bindir}/scpsh
103 %attr(755,root,root) %{_bindir}/sftpsh
104 %attr(4755,root,root) %{_libexecdir}/rssh_chroot_helper
105 %{_mandir}/man?/*
106 # legacy
107 %ghost /bin/%{name}
108 %ghost /bin/scpsh
109 %ghost /bin/sftpsh
This page took 0.070661 seconds and 4 git commands to generate.