]> git.proxmox.com Git - mirror_frr.git/blobdiff - redhat/frr.spec.in
Merge pull request #2684 from netravnen/feature/bgpd/well-known-communities
[mirror_frr.git] / redhat / frr.spec.in
index 7ec92aa48c614f14c5ecb2067b185ec5ce72f7f6..85fb309048e9bfc4fe220cd9d425d02cebc51fb1 100644 (file)
@@ -12,6 +12,7 @@
 # with-feature options
 %{!?with_babeld:        %global  with_babeld        1 }
 %{!?with_bgp_vnc:       %global  with_bgp_vnc       0 }
+%{!?with_cumulus:       %global  with_cumulus       0 }
 %{!?with_eigrpd:        %global  with_eigrpd        1 }
 %{!?with_fpm:           %global  with_fpm           1 }
 %{!?with_ldpd:          %global  with_ldpd          1 }
@@ -141,6 +142,7 @@ License:        GPLv2+
 Group:          System Environment/Daemons
 Source0:        https://github.com/FRRouting/frr/archive/%{name}-%{frrversion}.tar.gz
 URL:            https://www.frrouting.org
+Requires(pre):  shadow-utils
 Requires(preun): info
 Requires(post): info
 BuildRequires:  bison >= 2.7
@@ -316,6 +318,9 @@ developing OSPF-API and frr applications.
 %else
     --disable-watchfrr \
 %endif
+%if %{with_cumulus}
+    --enable-cumulus \
+%endif
 %if %{with_bgp_vnc}
     --enable-bgp-vnc \
 %else
@@ -340,7 +345,7 @@ popd
 
 %install
 mkdir -p %{buildroot}%{_sysconfdir}/{frr,sysconfig,logrotate.d,pam.d,default} \
-         %{buildroot}/var/log/frr %{buildroot}%{_infodir}
+         %{buildroot}%{_localstatedir}/log/frr %{buildroot}%{_infodir}
 make DESTDIR=%{buildroot} INSTALL="install -p" CP="cp -p" SPHINXBUILD=%{sphinx} install
 
 # Remove this file, as it is uninstalled and causes errors when building on RH9
@@ -365,6 +370,10 @@ ln -s %{_sbindir}/frr %{buildroot}%{_initddir}/frr
 %endif
 
 install %{zeb_rh_src}/daemons %{buildroot}%{_sysconfdir}/frr
+# add rpki module to daemon
+%if %{with_rpki}
+    sed -i -e 's/^\(bgpd_options=\)\(.*\)\(".*\)/\1\2 -M rpki\3/' %{buildroot}%{_sysconfdir}/frr/daemons
+%endif
 install -m644 %{zeb_rh_src}/frr.pam %{buildroot}%{_sysconfdir}/pam.d/frr
 install -m644 %{zeb_rh_src}/frr.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/frr
 install -d -m750 %{buildroot}%{rundir}
@@ -373,25 +382,23 @@ install -d -m750 %{buildroot}%{rundir}
 %pre
 # add vty_group
 %if 0%{?vty_group:1}
-if getent group %{vty_group} > /dev/null ; then : ; else \
-    /usr/sbin/groupadd -r -g %vty_gid %{vty_group} > /dev/null || : ; fi
+    getent group %{vty_group} >/dev/null || groupadd -r -g %{vty_gid} %{vty_group}
 %endif
 
 # add frr user and group
 %if 0%{?frr_user:1}
-# Ensure that frr_gid gets correctly allocated
-if getent group %{frr_user} >/dev/null; then : ; else \
-    /usr/sbin/groupadd -g %frr_gid %{frr_user} > /dev/null || : ; \
-fi
-if getent passwd %{frr_user} >/dev/null ; then : ; else \
-    /usr/sbin/useradd  -u %frr_uid -g %frr_gid \
-        -M -r -s /sbin/nologin -c "FRRouting suite" \
-        -d %{rundir} %{frr_user} 2> /dev/null || : ; \
-fi
-%if 0%{?vty_group:1}
-    /usr/sbin/usermod -a -G %{vty_group} %{frr_user}
-%endif
+    # Ensure that frr_gid gets correctly allocated
+    getent group %{frr_user} >/dev/null || groupadd -g %{frr_gid} %{frr_user}
+    getent passwd %{frr_user} >/dev/null || \
+    useradd -r -u %{frr_uid} -g %{frr_user} \
+        -s /sbin/nologin -c "FRRouting suite" \
+        -d %{rundir} %{frr_user}
+
+    %if 0%{?vty_group:1}
+        usermod -a -G %{vty_group} %{frr_user}
+    %endif
 %endif
+exit 0
 
 
 %post
@@ -541,11 +548,11 @@ fi
 %doc ChangeLog NEWS README
 %if 0%{?frr_user:1}
     %dir %attr(751,%{frr_user},%{frr_user}) %{configdir}
-    %dir %attr(750,%{frr_user},%{frr_user}) /var/log/frr
+    %dir %attr(750,%{frr_user},%{frr_user}) %{_localstatedir}/log/frr
     %dir %attr(751,%{frr_user},%{frr_user}) %{rundir}
 %else
     %dir %attr(750,root,root) %{configdir}
-    %dir %attr(750,root,root) /var/log/frr
+    %dir %attr(750,root,root) %{_localstatedir}/log/frr
     %dir %attr(750,root,root) %{rundir}
 %endif
 %if 0%{?vty_group:1}
@@ -583,14 +590,14 @@ fi
     %{_sbindir}/babeld
 %endif
 %{_libdir}/lib*.so.0
-%attr(755,root,root) %{_libdir}/lib*.so.0.*
+%{_libdir}/lib*.so.0.*
 %if %{with_fpm}
-    %attr(755,root,root) %{_libdir}/frr/modules/zebra_fpm.so
+    %{_libdir}/frr/modules/zebra_fpm.so
 %endif
 %if %{with_rpki}
-    %attr(755,root,root) %{_libdir}/frr/modules/bgpd_rpki.so
+    %{_libdir}/frr/modules/bgpd_rpki.so
 %endif
-%attr(755,root,root) %{_libdir}/frr/modules/zebra_irdp.so
+%{_libdir}/frr/modules/zebra_irdp.so
 %{_bindir}/*
 %config(noreplace) %{configdir}/[!v]*.conf*
 %config(noreplace) %attr(750,%{frr_user},%{frr_user}) %{configdir}/daemons
@@ -620,22 +627,22 @@ fi
 %if %{with_ospfclient}
     %{_sbindir}/ospfclient
 %endif
-%dir %attr(755,root,root) %{_includedir}/%{name}
-%{_includedir}/%name/*.h
-%dir %attr(755,root,root) %{_includedir}/%{name}/ospfd
-%{_includedir}/%name/ospfd/*.h
+%dir %{_includedir}/%{name}
+%{_includedir}/%{name}/*.h
+%dir %{_includedir}/%{name}/ospfd
+%{_includedir}/%{name}/ospfd/*.h
 %if %{with_ospfapi}
-    %dir %attr(755,root,root) %{_includedir}/%{name}/ospfapi
-    %{_includedir}/%name/ospfapi/*.h
+    %dir %{_includedir}/%{name}/ospfapi
+    %{_includedir}/%{name}/ospfapi/*.h
 %endif
 %if %{with_eigrpd}
-    %dir %attr(755,root,root) %{_includedir}/%{name}/eigrpd
-    %{_includedir}/%name/eigrpd/*.h
+    %dir %{_includedir}/%{name}/eigrpd
+    %{_includedir}/%{name}/eigrpd/*.h
 %endif
 
 
 %changelog
-* Sun May 20 2018 Martin Winter <mwinter@opensourcerouting.org> - %{version}
+* Sun May 20 2018 Martin Winter <mwinter@opensourcerouting.org>
 - Fixed RPKI RPM build
 
 * Sun Mar  4 2018 Martin Winter <mwinter@opensourcerouting.org>