# 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: Routing daemon for the ampr network
Name: ampr-ripd
Version: 1.15
Release: 1%{?dist}
License: GPLv2+
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: ampr-ripd.service
Patch0: ampr-ripd-1.15-install-fix.patch
Patch1: ampr-ripd-1.15-examples-noshebang.patch
Patch2: ampr-ripd-1.15-pidfile.patch
%description
Routing daemon written in C similar to Hessu's rip44d including optional
resending of RIPv2 broadcasts for router injection.
%prep
%setup -qc
%patch0 -p1 -b .install-fix
%patch1 -p1 -b .examples-noshebang
%patch2 -p1 -b .pidfile
%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} ampr-run.sh find_pass.sh
%post
%systemd_post %{name}.service
%preun
%systemd_preun %{name}.service
%postun
%systemd_postun_with_restart %{name}.service
%files
%doc COPYING manual.txt
%{_sbindir}/ampr-ripd
%{_datadir}/%{name}
%{_mandir}/man1/*
%{_unitdir}/%{name}.service
%changelog
* Thu Sep 22 2016 Jaroslav Škarvada <jskarvad@redhat.com> - 1.15-1
- New version
Resolves: rhbz#1378260
- Updated / de-fuzzified patches
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.13-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Fri Nov 21 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 1.13-1
- New version
Resolves: rhbz#1166335
- Updated pidfile patch
* Mon Sep 8 2014 Jan Synáček <jsynacek@redhat.com> - 1.11-2
- Make debuginfo available (#1139051)
* Tue Jul 22 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 1.11-1
- Initial release