alt10
[autosshd_ALT.git] / autosshd.spec
blob43a427c808e3c1997ed2f72f4aeb64e1a6e41fcf
1 # vim: set ft=spec : -*- rpm-spec -*-
2 %define autossh_user _autossh
3 %define autossh_group _autossh
4 %define autossh_dir /var/lib/autosshd
6 Name: autosshd
7 Version: 0.0.3
8 Release: alt10
10 Summary: System administration - AutoSSH system level service
12 Group: System/Servers
13 License: GPL
14 Url: http://wiki.etersoft.ru/Autosshd
16 Packager: Danil Mikhailov <danil@altlinux.org>
18 #Source-git: https://github.com/vitlav/autosshd
19 Source: %name-%version.tar
21 BuildArch: noarch
23 BuildPreReq: rpm-build-intro
25 Requires: shadow-utils openssh-common
26 Requires: autossh
28 %description
29 Run autossh as system service at startup.
31 %prep
32 %setup
34 %install
35 mkdir -p %buildroot%_sysconfdir/autossh.d/
37 mkdir -p %buildroot%_runtimedir/%name/
38 mkdir -p %buildroot%_locksubsysdir/autossh.d/
39 mkdir -p %buildroot/%_tmpfilesdir/
41 cat <<EOF >%buildroot/%_tmpfilesdir/%name.conf
42 d %_runtimedir/%name 0755 %autossh_user %autossh_group
43 d %_locksubsysdir/autossh.d/ 0755 root root
44 EOF
46 mkdir -p %buildroot/%autossh_dir/.ssh/
47 #echo "StrictHostKeyChecking no" > %buildroot%autossh_dir/.ssh/config
49 mkdir -p %buildroot%_docdir/%name/
51 install -D -m754 etc/rc.d/init.d/autosshd %buildroot%_initdir/%name
52 # TODO: we need automate filling of this config
53 install -D -m644 etc/sysconfig/autosshd %buildroot%_sysconfigdir/%name
55 install -m644 etc/autossh.d/*.conf.template %buildroot%_sysconfdir/autossh.d/
57 mkdir -p %buildroot%_datadir/%name/
58 mkdir -p %buildroot%_bindir/
59 mkdir -p %buildroot/lib/systemd/system/
60 cp usr/bin/autosshd-ssh %buildroot%_bindir/
61 cp share/autossh-conf %buildroot%_datadir/%name/
62 cp share/autosshd.setup* %buildroot%_datadir/%name/
63 cp lib/systemd/system/autosshd.service %buildroot/lib/systemd/system/autosshd.service
65 %pre
66 # Add the "_autossh" user
67 %_sbindir/groupadd -r -f %autossh_group 2>/dev/null ||:
68 %_sbindir/useradd -M -r -g %autossh_group -c 'Autossh daemon' \
69 -s /dev/null -d %autossh_dir %autossh_user 2>/dev/null ||:
71 %post
72 %post_service %name
74 %preun
75 %preun_service %name
77 %files
78 %doc doc/*
79 %attr(750,%autossh_user,%autossh_group) %dir %autossh_dir/
80 %config(noreplace) %attr(750,%autossh_user,%autossh_group) %autossh_dir/.ssh/
81 %config(noreplace) %_sysconfigdir/%name
82 %_sysconfdir/autossh.d/
83 %_initdir/%name
84 %_tmpfilesdir/%name.conf
85 %attr(750,%autossh_user,%autossh_group) %dir %_runtimedir/%name/
86 %dir %_locksubsysdir/autossh.d/
87 %dir %_datadir/%name/
88 %_datadir/%name/autossh-conf
89 %_datadir/%name/autosshd.setup
90 %_datadir/%name/autosshd.setup.user
91 %_bindir/autosshd-ssh
92 /lib/systemd/system/autosshd.service
94 %changelog
95 * Tue Oct 06 2015 Danil Mikhailov <danil@altlinux.org> 0.0.3-alt10
96 - added initial autosshd-auth for automatic authorisation on anyssh.ru
97 - added cheking for existing config
98 - added changelog
99 - merge branch 'master' of git.eter:/people/danil/packages/autosshd
100 - small fix
101 - new build 0.0.3-alt4 (with rpmlog script)
102 - added changelog
103 - correct manual in config files
104 - new build 0.0.3-alt5 (with rpmlog script)
105 - added changelog
106 - merge remote-tracking branch 'gear/sisyphus'
107 - 0.0.3-alt7
108 - added initial autosshd-auth for automatic authorisation on anyssh.ru fixed ssh test alt8
109 - added 400 permission as allowed
110 - change runlevel to 60
111 - added initial realisation of systemd init service
112 - new build 0.0.3-alt9 (with rpmlog script)
113 - added systemd service to spec
114 - aUTOSSH_LOGFILE sets only if was empty
115 - fixed bug with not stop properly by adding mainlockfile
116 - fixed /var/lock/subsys/autossh.d/ dir name
117 - change home dir var, fix var name permission
118 - fixed /var/lock/subsys/autossh.d/ dir name in spec
119 - fixed systemd service
120 - change systemd service type to forking [work]
122 * Wed Sep 30 2015 Danil Mikhailov <danil@altlinux.org> 0.0.3-alt9
123 - Added initial realisation of systemd init service
124 - Change runlevel to 60
125 - Added 400 permission as allowed
127 * Mon Dec 29 2014 Danil Mikhailov <danil@altlinux.org> 0.0.3-alt8
128 - fixed test sudo autosshd-ssh anyssh.ru
130 * Wed Dec 17 2014 Vitaly Lipatov <lav@altlinux.ru> 0.0.3-alt7
131 - small fixes
133 * Thu Nov 27 2014 Danil Mikhailov <danil@altlinux.org> 0.0.3-alt6
134 - Cleanup git log
136 * Thu Sep 18 2014 Danil Mikhailov <danil@altlinux.org> 0.0.3-alt5
137 - Correct manual in config files
139 * Wed Sep 17 2014 Danil Mikhailov <danil@altlinux.org> 0.0.3-alt4
140 - added cheking for existing config
142 * Wed Sep 17 2014 Danil Mikhailov <danil@altlinux.org> 0.0.3-alt3
143 - move files in right directory
144 - fix start when already running
146 * Thu Sep 11 2014 Danil Mikhailov <danil@altlinux.org> 0.0.3-alt2
147 - rewrite doc
148 - rewrite init script
149 - added new scripts:
150 - autosshd-conf for export variables to _anyssh user
151 - autosshd-ssh for test connection over ssh
153 * Mon Jul 07 2014 Vitaly Lipatov <lav@altlinux.ru> 0.0.3-alt1
154 - development release
155 - rewrite init script
156 - add anyssh.ru.conf.example
157 - add unused generate key script
158 - cleanup spec, move initialize code to a separate script
160 * Sat Jan 11 2014 Ivan Zakharyaschev <imz@altlinux.org> 0.0.2-alt8
161 - doc: Added links to some guides (how to make use of autosshd).
163 * Fri Jan 10 2014 Ivan Zakharyaschev <imz@altlinux.org> 0.0.2-alt7
164 - Declare lav@ as the maintainer
166 * Sat Dec 28 2013 Ivan Zakharyaschev <imz@altlinux.org> 0.0.2-alt6
167 - Handle /var/lock/subsys/* and /var/run/* in tmpfiles.d
168 (otherwise they used to be gone from the tmpfs after a reboot)
170 * Sat Dec 28 2013 Ivan Zakharyaschev <imz@altlinux.org> 0.0.2-alt5
171 - Fix user deletion after an upgrade according to http://www.altlinux.org/PseudoUserPolicy
173 * Sat Dec 28 2013 Ivan Zakharyaschev <imz@altlinux.org> 0.0.2-alt4
174 - Correct wrong paths in scripts, configs, and examples.
176 * Tue Nov 19 2013 Vitaly Lipatov <lav@altlinux.ru> 0.0.2-alt3
177 - initial build to ALT Linux Sisyphus
179 * Tue Oct 08 2013 Vitaly Lipatov <lav@altlinux.ru> 0.0.2-alt2
180 - cleanup spec
182 * Mon Apr 09 2012 Dmitriy Kruglikov <dkr@altlinux.org> 0.0.2-alt1
183 - Code rewritten to work with multiple connections
185 * Thu Apr 05 2012 Dmitriy Kruglikov <dkr@altlinux.org> 0.0.1-alt4
186 - Fixed bugs in postinstall and postuninstal scripts
188 * Tue Apr 03 2012 Dmitriy Kruglikov <dkr@altlinux.org> 0.0.1-alt3
189 - Fixes
191 * Tue Apr 03 2012 Dmitriy Kruglikov <dkr@altlinux.org> 0.0.1-alt2
192 - Ready for testing
194 * Mon Apr 02 2012 Dmitriy Kruglikov <dkr@altlinux.org> 0.0.1-alt1
195 - Initial draft