File tinc.spec of Package tinc

Name:           tinc
Version:        1.1pre18
Summary:        A virtual private network daemon
License:        GPLv2+
URL:            https://www.tinc-vpn.org/
Group:          Applications/Internet

Release:        1%{?dist}
Source0:        https://tinc-vpn.org/packages/%{name}-%{version}.tar.gz

BuildRequires:  autoconf
BuildRequires:  autoconf-archive
BuildRequires:  automake

BuildRequires:  openssl-devel
BuildRequires:  lzo-devel
BuildRequires:  zlib-devel
BuildRequires:  systemd
%if %{defined suse}
BuildRequires:  systemd-units
%endif
BuildRequires:  readline-devel
BuildRequires:  ncurses-devel
BuildRequires:  texinfo

Requires:  openssl
Requires:  lzo
Requires:  zlib
Requires:  readline
Requires:  ncurses-libs

Requires(post):   info
Requires(post):   systemd
Requires(preun):  info
Requires(preun):  systemd
Requires(postun): systemd

%description
tinc is a Virtual Private Network (VPN) daemon that uses tunnelling
and encryption to create a secure private network between hosts on
the Internet. Because the tunnel appears to the IP level network
code as a normal network device, there is no need to adapt any
existing software. This tunnelling allows VPN sites to share
information with each other over the Internet without exposing any
information to others.

%prep
%autosetup

%build
autoreconf -fsi
%configure --with-systemd=%{_unitdir}
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot} INSTALL="install -p"
rm -f %{buildroot}%{_infodir}/dir

%post
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
%systemd_post %{name}@.service

%preun
if [ $1 = 0 ] ; then
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
fi
%systemd_preun %{name}@.service

%postun
%systemd_postun_with_restart %{name}@.service

%files
%doc AUTHORS COPYING.README NEWS README THANKS doc/sample* doc/*.tex
%license COPYING
%{_mandir}/man*/%{name}*.*
%{_infodir}/%{name}.info.gz
%{_sbindir}/%{name}
%{_sbindir}/%{name}d
%{_unitdir}/%{name}*.service
%exclude /usr/share/bash-completion/completions/*
openSUSE Build Service is sponsored by