]>
Commit | Line | Data |
---|---|---|
59181a03 ER |
1 | # TODO: |
2 | # - --with-ssh=/usr/bin/ssh does has no effect, it still tries to find ssh from $PATH and fail | |
44310f53 | 3 | # (as of 1.4g, configure is older than configure.ac and probably somehow hacked) |
6170e6df | 4 | Summary: Automatically restart SSH sessions and tunnels |
b5c992f4 | 5 | Summary(pl.UTF-8): Automatyczny restart sesji i tuneli SSH |
6170e6df | 6 | Name: autossh |
44310f53 | 7 | Version: 1.4g |
0e465fe1 | 8 | Release: 1 |
44310f53 JB |
9 | # autossh.c contains 0-clause BSD, daemon.h 4-clause BSD |
10 | License: BSD | |
6170e6df | 11 | Group: Applications/Networking |
44310f53 JB |
12 | Source0: https://www.harding.motd.ca/autossh/%{name}-%{version}.tgz |
13 | # Source0-md5: 2b804bc1bf6d2f2afaa526d02df7c0a2 | |
9c62d432 | 14 | Source1: %{name}.init |
15 | Source2: %{name}.tab | |
12fe5d5c | 16 | Source3: %{name}.tmpfiles |
44310f53 | 17 | URL: https://www.harding.motd.ca/autossh/ |
4ad402f4 | 18 | BuildRequires: rpmbuild(macros) >= 1.647 |
b5a59623 | 19 | Requires: openssh-clients |
6170e6df | 20 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
21 | ||
22 | %description | |
23 | Autossh is a program to start a copy of ssh and monitor it, restarting | |
24 | it as necessary should it die or stop passing traffic. The idea and | |
25 | the mechanism are from rstunnel (Reliable SSH Tunnel), but implemented | |
26 | in C. The author's view is that it is not as fiddly as rstunnel to get | |
27 | to work. Connection monitoring using a loop of port forwardings. Backs | |
28 | off on rate of connection attempts when experiencing rapid failures | |
29 | such as connection refused. Compiled and tested on OpenBSD, Linux, and | |
30 | Solaris; should work fine on other BSDs (except Mac OS 10). | |
31 | ||
71ce230d JR |
32 | %description -l pl.UTF-8 |
33 | autossh jest programem uruchamiającym kopię ssh i monitorującym ją, | |
34 | restartując w miarę potrzeby, jeśli umrze lub przestanie przekazywać | |
35 | ruch. Idea i mechanizm pochodzą z rstunnela (Reliable SSH Tunnel), ale | |
36 | zaimplementowano je w C. Według autora nie trzeba się tak patyczkować, | |
37 | jak z rstunnelem, aby go uruchomić. Monitorowanie połączenia używa | |
38 | pętli przekazywania portów. Częstotliwość prób połączeń jest | |
39 | zmniejszana w przypadku napotkania nagłych awarii, takich jak | |
40 | odrzucenie połączenia. Program skompilowano i sprawdzono na OpenBSD, | |
41 | Linuksie i Solarisie; powinien działać także na innych BSD (oprócz | |
a6e1aeab JB |
42 | MacOS 10). |
43 | ||
9c62d432 | 44 | %package init |
45 | Summary: autossh configuration as system service | |
46 | Summary(pl.UTF-8): konfiguracja autossh jako usługi systemowej | |
47 | Group: Networking/Daemons | |
b5a59623 | 48 | Requires(post,preun): /sbin/chkconfig |
be674896 | 49 | Requires: %{name} = %{version}-%{release} |
9c62d432 | 50 | Requires: awk |
51 | Requires: rc-scripts >= 0.4.0.20 | |
52 | ||
53 | %description init | |
b5a59623 | 54 | this package contains init script and example configuration file, that |
55 | allows to run autossh as Unix system service. | |
9c62d432 | 56 | |
57 | %description init -l pl.UTF-8 | |
b5a59623 | 58 | Ten pakiet zawiera skrypt startowy oraz przykładowy plik |
59 | konfiguracyjny, które pozwalają uruchamić autossh jako uniksową usługę | |
60 | systemową. | |
9c62d432 | 61 | |
6170e6df | 62 | %prep |
3f2dfd94 | 63 | %setup -q |
6170e6df | 64 | |
65 | %build | |
44310f53 JB |
66 | %configure \ |
67 | ac_cv_lib_nsl_gethostbyname=no \ | |
68 | ac_cv_path_ssh=/usr/bin/ssh | |
b5a59623 | 69 | %{__make} |
6170e6df | 70 | |
71 | %install | |
72 | rm -rf $RPM_BUILD_ROOT | |
12fe5d5c | 73 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/var/run/%{name},%{_bindir},%{_mandir}/man1} \ |
4ad402f4 | 74 | $RPM_BUILD_ROOT%{systemdtmpfilesdir} |
9c62d432 | 75 | |
7d8d706a ER |
76 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
77 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/autossh.tab | |
4ad402f4 | 78 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf |
6170e6df | 79 | |
7d8d706a ER |
80 | install -p autossh $RPM_BUILD_ROOT%{_bindir} |
81 | cp -p autossh.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
6170e6df | 82 | |
83 | %clean | |
84 | rm -rf $RPM_BUILD_ROOT | |
85 | ||
a0a31d25 | 86 | %post init |
9c62d432 | 87 | /sbin/chkconfig --add autossh |
88 | %service autossh restart "autossh" | |
89 | ||
a0a31d25 | 90 | %preun init |
9c62d432 | 91 | if [ "$1" = "0" ]; then |
92 | %service autossh stop | |
93 | /sbin/chkconfig --del autossh | |
94 | fi | |
95 | ||
6170e6df | 96 | %files |
97 | %defattr(644,root,root,755) | |
98 | %doc README CHANGES autossh.host rscreen | |
9c62d432 | 99 | %attr(755,root,root) %{_bindir}/autossh |
100 | %{_mandir}/man1/autossh.1* | |
101 | ||
102 | %files init | |
103 | %defattr(644,root,root,755) | |
b5a59623 | 104 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.tab |
9c62d432 | 105 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
4ad402f4 | 106 | %{systemdtmpfilesdir}/%{name}.conf |
9c62d432 | 107 | %dir /var/run/autossh |