1 # vim: set ft=spec : -*- rpm-spec -*-
2 %define autossh_user _autossh
3 %define autossh_group _autossh
9 Summary: System administration
- AutoSSH system level service
12 Url
: http
://etersoft.ru
15 Packager: Dmitriy Kruglikov
<dkr@altlinux.ru
>
19 PreReq
: pwgen shadow
-utils openssh
-common
24 Run autossh as system service at startup
31 mkdir -p
%buildroot%_initdir
32 mkdir -p
%buildroot%_sysconfdir/sysconfig
33 mkdir -p
%buildroot/var
/run
/autosshd
34 mkdir -p
%buildroot/var
/lib
/autosshd
/.ssh
35 mkdir -p
%buildroot%_docdir/autosshd
36 install -D
-m644 doc
/README
%buildroot%_docdir/autosshd
/README
37 install -D
-m750 etc
/rc.d
/init.d
/autosshd
%buildroot%_initdir/autosshd
38 install -D
-m644 etc
/sysconfig
/autosshd
%buildroot%_sysconfdir/sysconfig
/autosshd
42 if ! [ -f
/var
/lib
/autosshd
/.ssh
/id_dsa
]; then
43 # Add the "_autossh" user
44 %_sbindir/groupadd
-r
-f
%autossh_group 2>/dev
/null ||
:
45 %_sbindir/useradd
-r
-g
%autossh_group -c 'Autossh daemon' \
46 -s
/dev
/null
-d
/var
/lib
/autosshd
%autossh_user 2>/dev
/null ||
:
47 %_sbindir/usermod
-p `pwgen
-s
24 1`
%autossh_user
48 mkdir -p
/var
/lib
/autosshd
/.ssh
49 /usr
/bin
/ssh
-keygen
-t dsa
-b
1024 -C "AutoSSH daemon"
-N ""
-q
-f
/var
/lib
/autosshd
/.ssh
/id_dsa
50 echo "StrictHostKeyChecking no"
> /var
/lib
/autosshd
/.ssh
/config
51 cp
/var
/lib
/autosshd
/.ssh
/id_dsa.pub
/var
/lib
/autosshd
/.ssh
/authorized_keys
52 chown
-R
%autossh_user:%autossh_group /var
/lib
/autosshd
/
53 chown
%autossh_user:%autossh_group /var
/run
/autosshd
/
64 %config(noreplace
) %_sysconfdir/sysconfig
/autosshd
65 %dir /var
/lib
/autosshd
66 %dir /var
/run
/autosshd
67 %dir %_docdir/autosshd
69 %attr(0644,root
,root
) %_docdir/autosshd
/README
72 * Tue Apr
03 2012 Dmitriy Kruglikov
<dkr@altlinux.org
> 0.0.1-alt3
75 * Tue Apr
03 2012 Dmitriy Kruglikov
<dkr@altlinux.org
> 0.0.1-alt2
78 * Mon Apr
02 2012 Dmitriy Kruglikov
<dkr@altlinux.org
> 0.0.1-alt1