File tinc.spec of Package tinc

Name:           tinc
Version:        1.0.32
Release:        0
License:        GPL-2.0+
Summary:        Virtual private network daemon
Group:          Productivity/Networking/Other
#BuildRequires:  libgcrypt-devel, openssl >= 1.0.0, openssl-devel, lzo-devel, readline-devel, ncurses-devel, autoconf, automake, libtool
BuildRequires:  openssl >= 1.0.0, openssl-devel, lzo-devel, autoconf, automake, libtool
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Requires(post): info
Requires(preun): info

%if 0%{?suse_version} >= 1210
%bcond_without systemd
%bcond_with systemd

%if %{with systemd}
BuildRequires: systemd-rpm-macros

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.


%setup -q

make %{?_smp_mflags}

make install DESTDIR=%{buildroot} %{?_smp_mflags}

# copy systemd unit files
%if %{with systemd}
	install -D -m 644 distro/tinc.service %{buildroot}%{_unitdir}/tinc.service
	install -D -m 644 distro/tinc@.service %{buildroot}%{_unitdir}/tinc@.service

%service_add_pre tinc.service

/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :

%service_add_post tinc.service

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

%service_del_preun tinc@.service tinc.service

%service_del_postun tinc.service


%doc %{_mandir}/man5/tinc.conf.5*
%doc %{_mandir}/man8/tincd.8*
%doc %{_infodir}/*