Blob Blame History Raw
# hardened build if not overriden
%{!?_hardened_build:%global _hardened_build 1}

%if %{?_hardened_build}%{!?_hardened_build:0}
%global cflags_harden -fpie
%global ldflags_harden -pie -z relro -z now
%endif

Summary: An user-space IPIP encapsulation daemon for the ampr network
Name: amprd
Version: 1.4
Release: 3%{?dist}
License: GPLv3+
Group: Applications/Communications
URL: http://www.yo2loj.ro/hamprojects/
BuildRequires: dos2unix, systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Source0: http://www.yo2loj.ro/hamprojects/%{name}-%{version}.tgz
Source1: amprd.service
Patch0: amprd-1.4-install-fix.patch
Patch1: amprd-1.4-pidfile.patch
Patch2: amprd-1.4-examples-noshebang.patch

%description
An user-space IPIP encapsulation daemon with automatic RIPv2 multicast
processing and multiple tunnel support for the ampr network.
All RIPv2 processing, encapsulation, decapsulation and routing happens
inside the daemon and it offers one or more virtual TUN interfaces to
the system for your 44net traffic.

%prep
%setup -qc
%patch0 -p1 -b .install-fix
%patch1 -p1 -b .pidfile
%patch2 -p1 -b .examples-noshebang

dos2unix minGlue.h

%build
make %{?_smp_mflags} CFLAGS="%{optflags} %{?cflags_harden}" LDFLAGS="%{?__global_ldflags} %{?ldflags_harden}"

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

# Systemd
install -Dpm 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service

# Examples
install -Dd %{buildroot}%{_datadir}/%{name}
install -Dpm 644 -t %{buildroot}%{_datadir}/%{name} startup_example.sh interfaces_example

%post
%systemd_post %{name}.service

%preun
%systemd_preun %{name}.service

%postun
%systemd_postun_with_restart %{name}.service

%files
%doc COPYING README

%{_sbindir}/amprd
%config(noreplace) %{_sysconfdir}/amprd.conf
%{_datadir}/%{name}
%{_var}/lib/amprd
%{_unitdir}/amprd.service

%changelog
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Fri Aug 29 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 1.4-2
- Fixed ldflags_harden

* Tue Jul 29 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 1.4-1
- Initial release