]> git.pld-linux.org Git - packages/autossh.git/blobdiff - autossh.spec
- updated to 1.4g, drop -lnsl from linking
[packages/autossh.git] / autossh.spec
index c049ef528248d7d5c69456c413f9049a1f22280c..b0693e5060a884131d9ce9fcc77d611171dddc70 100644 (file)
@@ -1,13 +1,22 @@
+# TODO:
+# - --with-ssh=/usr/bin/ssh does has no effect, it still tries to find ssh from $PATH and fail
+#   (as of 1.4g, configure is older than configure.ac and probably somehow hacked)
 Summary:       Automatically restart SSH sessions and tunnels
-Summary(pl):   Automatyczny restart sesji i tuneli SSH
+Summary(pl.UTF-8):     Automatyczny restart sesji i tuneli SSH
 Name:          autossh
-Version:       1.2d
+Version:       1.4g
 Release:       1
-License:       GPL
+# autossh.c contains 0-clause BSD, daemon.h 4-clause BSD
+License:       BSD
 Group:         Applications/Networking
-Vendor:                Carson Harding <carson.harding@shaw.ca>
-Source0:       http://www.harding.motd.ca/autossh/%{name}-%{version}.tgz
-URL:           http://www.harding.motd.ca/autossh/
+Source0:       https://www.harding.motd.ca/autossh/%{name}-%{version}.tgz
+# Source0-md5: 2b804bc1bf6d2f2afaa526d02df7c0a2
+Source1:       %{name}.init
+Source2:       %{name}.tab
+Source3:       %{name}.tmpfiles
+URL:           https://www.harding.motd.ca/autossh/
+BuildRequires: rpmbuild(macros) >= 1.647
+Requires:      openssh-clients
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -20,36 +29,79 @@ off on rate of connection attempts when experiencing rapid failures
 such as connection refused. Compiled and tested on OpenBSD, Linux, and
 Solaris; should work fine on other BSDs (except Mac OS 10).
 
-%description -l pl
-autossh jest programem uruchamiaj±cym kopiê ssh i monitoruj±cym j±,
-restartuj±c w miarê potrzeby, je¶li umrze lub przestanie przekazywaæ
-ruch. Idea i mechanizm pochodz± z rstunnela (Reliable SSH Tunnel), ale
-zaimplementowano je w C. Wed³ug autora nie trzeba siê tak patyczkowaæ,
-jak z rstunnelem, aby go uruchomiæ. Monitorowanie po³±czenia u¿ywa
-pêtli przekazywania portów. Czêstotliwo¶æ prób po³±czeñ jest
-zmniejszana w przypadku napotkania nag³ych awarii, takich jak
-odrzucenie po³±czenia. Program skompilowano i sprawdzono na OpenBSD,
-Linuksie i Solarisie; powinien dzia³aæ tak¿e na innych BSD (oprócz
+%description -l pl.UTF-8
+autossh jest programem uruchamiającym kopię ssh i monitorującym ją,
+restartując w miarę potrzeby, jeśli umrze lub przestanie przekazywać
+ruch. Idea i mechanizm pochodzą z rstunnela (Reliable SSH Tunnel), ale
+zaimplementowano je w C. Według autora nie trzeba się tak patyczkować,
+jak z rstunnelem, aby go uruchomić. Monitorowanie połączenia używa
+pętli przekazywania portów. Częstotliwość prób połączeń jest
+zmniejszana w przypadku napotkania nagłych awarii, takich jak
+odrzucenie połączenia. Program skompilowano i sprawdzono na OpenBSD,
+Linuksie i Solarisie; powinien działać także na innych BSD (oprócz
 MacOS 10).
 
+%package init
+Summary:       autossh configuration as system service
+Summary(pl.UTF-8):     konfiguracja autossh jako usługi systemowej
+Group:         Networking/Daemons
+Requires(post,preun):  /sbin/chkconfig
+Requires:      %{name} = %{version}-%{release}
+Requires:      awk
+Requires:      rc-scripts >= 0.4.0.20
+
+%description init
+this package contains init script and example configuration file, that
+allows to run autossh as Unix system service.
+
+%description init -l pl.UTF-8
+Ten pakiet zawiera skrypt startowy oraz przykładowy plik
+konfiguracyjny, które pozwalają uruchamić autossh jako uniksową usługę
+systemową.
+
 %prep
-%setup -q -n %{name}-%{version}
+%setup -q
 
 %build
-%{__make} -f Makefile.linux
+%configure \
+       ac_cv_lib_nsl_gethostbyname=no \
+       ac_cv_path_ssh=/usr/bin/ssh
+%{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
+install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/var/run/%{name},%{_bindir},%{_mandir}/man1} \
+       $RPM_BUILD_ROOT%{systemdtmpfilesdir}
+
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/autossh.tab
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
 
-install autossh $RPM_BUILD_ROOT%{_bindir}
-install autossh.1 $RPM_BUILD_ROOT%{_mandir}/man1
+install -p autossh $RPM_BUILD_ROOT%{_bindir}
+cp -p autossh.1 $RPM_BUILD_ROOT%{_mandir}/man1
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post init
+/sbin/chkconfig --add autossh
+%service autossh restart "autossh"
+
+%preun init
+if [ "$1" = "0" ]; then
+       %service autossh stop
+       /sbin/chkconfig --del autossh
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc README CHANGES autossh.host rscreen
-%attr(755,root,root) %{_bindir}/*
-%{_mandir}/man1/*
+%attr(755,root,root) %{_bindir}/autossh
+%{_mandir}/man1/autossh.1*
+
+%files init
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.tab
+%attr(754,root,root) /etc/rc.d/init.d/%{name}
+%{systemdtmpfilesdir}/%{name}.conf
+%dir /var/run/autossh
This page took 0.071512 seconds and 4 git commands to generate.