distro/redhat: Update to F24 and fix few issues, add nhrpd.service

* redhat/quagga.spec.in: Review Fedora spec file and sync up with any
  useful differences, inc:
 - Add tmpfiles.d/quagga.conf config for Quagga from Fedora
 - Add quagga-filter-perl-requires.sh from Fedora.
 - Move libs to %{_libdir}/quagga as per Fedora
 - use systemd_postun_with_restart for postun
 Add nhrpd.service systemd file.  Simplify/chop down the RPM description.
* Makefile.am: Update to match
diff --git a/redhat/Makefile.am b/redhat/Makefile.am
index fadfe64..b1d49ac 100644
--- a/redhat/Makefile.am
+++ b/redhat/Makefile.am
@@ -4,5 +4,6 @@
 	quagga.logrotate quagga.pam quagga.spec \
 	quagga.sysconfig ripd.init ripd.service ripngd.init ripngd.service \
 	watchquagga.init pimd.init pimd.service zebra.init zebra.service \
+	nhrpd.service \
+	quagga-filter-perl-requires.sh quagga-tmpfs.conf \
 	README.rpm_build.md
-
diff --git a/redhat/nhrpd.service b/redhat/nhrpd.service
new file mode 100644
index 0000000..63f138c
--- /dev/null
+++ b/redhat/nhrpd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Quagga NHRP daemon
+BindsTo=zebra.service
+Wants=network.target
+After=zebra.service network-pre.target
+Before=network.target
+ConditionPathExists=/etc/quagga/nhrpd.conf
+
+[Service]
+Type=forking
+EnvironmentFile=/etc/sysconfig/quagga
+ExecStart=/usr/sbin/nhrpd -d $NHRPD_OPTS -f /etc/quagga/nhrpdd.conf
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
diff --git a/redhat/quagga-filter-perl-requires.sh b/redhat/quagga-filter-perl-requires.sh
new file mode 100755
index 0000000..db82cfd
--- /dev/null
+++ b/redhat/quagga-filter-perl-requires.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/lib/rpm/perl.req $* | grep -v "Net::Telnet"
diff --git a/redhat/quagga-tmpfs.conf b/redhat/quagga-tmpfs.conf
new file mode 100644
index 0000000..8974b64
--- /dev/null
+++ b/redhat/quagga-tmpfs.conf
@@ -0,0 +1 @@
+d	/var/run/quagga	0755 quagga quagga
diff --git a/redhat/quagga.spec.in b/redhat/quagga.spec.in
index b71aa94..ba1eb19 100644
--- a/redhat/quagga.spec.in
+++ b/redhat/quagga.spec.in
@@ -114,13 +114,14 @@
 Release:		@CONFDATE@%{release_rev}%{?dist}
 License:		GPLv2+
 Group:			System Environment/Daemons
-Source0:		http://download.savannah.gnu.org/releases/quagga/%{name}-%{quaggaversion}.tar.gz
-URL:			http://www.quagga.net
+Source0:		https://download.savannah.gnu.org/releases/quagga/%{name}-%{quaggaversion}.tar.gz
+URL:			https://www.quagga.net
 Requires:		ncurses
 Requires(pre):	/sbin/install-info
 Requires(preun): /sbin/install-info
 Requires(post):	/sbin/install-info
 BuildRequires:	texi2html texinfo autoconf patch libcap-devel groff
+BuildRequires:  perl-generators
 %if %{with_snmp}
 BuildRequires:	net-snmp-devel
 Requires:		net-snmp
@@ -144,20 +145,14 @@
 %endif
 Provides:			routingdaemon = %{version}-%{release}
 BuildRoot:			%{_tmppath}/%{name}-%{version}-root
-Obsoletes:			bird gated mrt zebra quagga-sysvinit
+Obsoletes:			mrt zebra quagga-sysvinit
+
+%define __perl_requires %{zeb_rh_src}/quagga-filter-perl-requires.sh
 
 %description
-Quagga is a free software that manages TCP/IP based routing
-protocol. It takes multi-server and multi-thread approach to resolve
-the current complexity of the Internet.
+Quagga is a free software routing protocol suite. 
 
-Quagga supports BGP4, OSPFv2, OSPFv3, ISIS, RIP, RIPng, PIM and NHRP.
-
-Quagga is intended to be used as a Route Server and a Route Reflector. It is
-not a toolkit, it provides full routing power under a new architecture.
-Quagga by design has a process for each protocol.
-
-Quagga is a fork of GNU Zebra.
+Quagga supports BGP, OSPFv2, OSPFv3, ISIS, RIP, RIPng, PIM-SSM and NHRP.
 
 %package contrib
 Summary: contrib tools for quagga
@@ -192,7 +187,7 @@
 
 %configure \
     --sysconfdir=%{_sysconfdir} \
-    --libdir=%{_libdir} \
+    --libdir=%{_libdir}/quagga \
     --libexecdir=%{_libexecdir} \
     --localstatedir=%{_localstatedir} \
 	--disable-werror \
@@ -308,6 +303,13 @@
 	%{buildroot}/etc/sysconfig/quagga
 install -d -m750  %{buildroot}/var/run/quagga
 
+
+%if 0%{?_tmpfilesdir:1}
+	install -d -m 755 %{buildroot}/%{_tmpfilesdir}
+	install -p -m 644 %{zeb_rh_src}/quagga-tmpfs.conf \
+		 %{buildroot}/%{_tmpfilesdir}/quagga.conf
+%endif
+
 %pre
 # add vty_group
 %if 0%{?vty_group:1}
@@ -371,7 +373,9 @@
 done
 %endif
 
-/sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
+if [ -f %{_infodir}/%{name}.inf* ]; then
+	/sbin/install-info %{_infodir}/quagga.info %{_infodir}/dir
+fi
 
 # Create dummy files if they don't exist so basic functions can be used.
 if [ ! -e %{_sysconfdir}/zebra.conf ]; then
@@ -430,7 +434,7 @@
 		for daemon in %all_daemons ; do
 			eval restart=\$restart_${daemon}
 			[ "$restart" = yes ] && \
-				%systemd_postun ${daemon}.service
+				%systemd_postun_with_restart ${daemon}.service
 		done
 		# Restart zebra.
 		[ "$running_zebra" = yes ] && \
@@ -474,6 +478,10 @@
 	%endif
 fi
 
+if [ -f %{_infodir}/%{name}.inf* ]; then
+	/sbin/install-info --delete %{_infodir}/quagga.info %{_infodir}/dir
+fi
+
 %preun
 %if "%{initsystem}" == "systemd"
 	##
@@ -495,7 +503,6 @@
 		done
 	fi
 %endif
-/sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
 
 %clean
 %if !0%{?keep_build:1}
@@ -522,6 +529,9 @@
 %endif
 %{_infodir}/quagga.info.gz
 %{_mandir}/man*/*
+%if %{with_watchquagga}
+	%{_mandir}/man*/watchquagga.*
+%endif
 %{_sbindir}/zebra
 %{_sbindir}/ospfd
 %{_sbindir}/ripd
@@ -541,15 +551,16 @@
 %{_sbindir}/nhrpd
 %endif
 %if %{with_shared}
-%attr(755,root,root) %{_libdir}/lib*.so
-%attr(755,root,root) %{_libdir}/lib*.so.*
+%{_libdir}/quagga/lib*.so
+%{_libdir}/quagga/lib*.so.?
+%attr(755,root,root) %{_libdir}/quagga/lib*.so.?.?.?
 %endif
 %if %{with_vtysh}
 %{_bindir}/*
 %endif
 %config /etc/quagga/[!v]*
 %if "%{initsystem}" == "systemd"
-	%config %{_unitdir}/*.service
+	%{_unitdir}/*.service
 %else
 	%config /etc/rc.d/init.d/zebra
 	%if %{with_watchquagga}
@@ -573,18 +584,21 @@
 %config(noreplace) /etc/sysconfig/quagga
 %config(noreplace) /etc/pam.d/quagga
 %config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
+%{_tmpfilesdir}/quagga.conf
 
 %files contrib
 %defattr(-,root,root)
-%doc tools
+%doc AUTHORS COPYING %attr(0644,root,root) tools
 
 %files devel
 %defattr(-,root,root)
+%doc AUTHORS COPYING
 %if %{with_ospfclient}
 %{_sbindir}/ospfclient
 %endif
-%{_libdir}/*.a
-%{_libdir}/*.la
+%dir %{_libdir}/quagga/
+%{_libdir}/quagga/*.a
+%{_libdir}/quagga/*.la
 %dir %attr(755,root,root) %{_includedir}/%{name}
 %{_includedir}/%name/*.h
 %dir %attr(755,root,root) %{_includedir}/%{name}/ospfd
@@ -595,6 +609,14 @@
 %endif
 
 %changelog
+* Mon Feb 27 2017 Paul Jakma <paul@jakma.org> - %{version}
+- Apply 0001-systemd-various-service-file-improvements.patch from Fedora
+- Review Fedora spec file and sync up with any useful differences, inc:
+- Add tmpfiles.d config for Quagga from Fedora
+- Add quagga-filter-perl-requires.sh from Fedora.
+- Move libs to %{_libdir}/quagga as per Fedora
+- use systemd_postun_with_restart for postun
+
 * Tue Feb 14 2017 Timo Teräs <timo.teras@iki.fi> - %{version}
 - add nhrpd