[netcf] update to 0.2.4-1

Laine Stump laine at fedoraproject.org
Wed May 14 11:09:46 UTC 2014


commit adec19009b67c3508f029396345d5d48b811a567
Author: Laine Stump <laine at laine.org>
Date:   Wed May 14 14:09:35 2014 +0300

    update to 0.2.4-1

 .gitignore |    1 +
 netcf.spec |   99 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 sources    |    2 +-
 3 files changed, 89 insertions(+), 13 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b4bbd56..cb208a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ netcf-0.1.6.tar.gz
 /netcf-0.2.1.tar.gz
 /netcf-0.2.2.tar.gz
 /netcf-0.2.3.tar.gz
+/netcf-0.2.4.tar.gz
diff --git a/netcf.spec b/netcf.spec
index 24a1b76..0cde23b 100644
--- a/netcf.spec
+++ b/netcf.spec
@@ -1,17 +1,42 @@
 Name:           netcf
-Version:        0.2.3
-Release:        7%{?dist}%{?extra_release}
+Version:        0.2.4
+Release:        1%{?dist}%{?extra_release}
 Summary:        Cross-platform network configuration library
 
 Group:          System Environment/Libraries
 License:        LGPLv2+
 URL:            https://fedorahosted.org/netcf/
 Source0:        https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
-
-# Fix reading bridge stp value (bz #1031053)
-Patch0001: 0001-transform-STP-value-from-yes-no-to-on-off-in-redhat-.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+# Default to skipping autoreconf.  Distros can change just this one
+# line (or provide a command-line override) if they backport any
+# patches that touch configure.ac or Makefile.am.
+%{!?enable_autotools:%define enable_autotools 0}
+
+# Fedora 20 / RHEL-7 are where netcf first uses systemd. Although earlier
+# Fedora has systemd, netcf still used sysvinit there.
+%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
+    %define with_systemd 1
+%else
+    %define with_systemd 0
+%endif
+
+%if %{with_systemd}
+BuildRequires: systemd-units
+Requires(post): systemd-units
+Requires(post): systemd-sysv
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%endif
+%if 0%{?enable_autotools}
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: gettext-devel
+BuildRequires: libtool
+BuildRequires: /usr/bin/pod2man
+%endif
+
 BuildRequires:  readline-devel augeas-devel >= 0.5.2
 BuildRequires:  libxml2-devel libxslt-devel
 
@@ -53,35 +78,71 @@ developing applications that use %{name}.
 Summary:        Libraries for %{name}
 Group:          System Environment/Libraries
 
+# bridge-utils is needed because /sbin/ifup calls brctl
+# if you create a bridge device
+Requires:       bridge-utils
+
 %description    libs
 The libraries for %{name}.
 
 %prep
 %setup -q
 
-# Fix reading bridge stp value (bz #1031053)
-%patch0001 -p1
-
 %build
 %if %{with_libnl1}
 %define _with_libnl1 --with-libnl1
 %endif
+%if %{with_systemd}
+    %define sysinit --with-sysinit=systemd
+%else
+    %define sysinit --with-sysinit=initscripts
+%endif
+
+
+%if 0%{?enable_autotools}
+ autoreconf -if
+%endif
 
 %configure --disable-static \
-           %{?_with_libnl1}
+           %{?_with_libnl1} \
+           %{sysinit}
 make %{?_smp_mflags}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT INSTALL="%{__install} -p"
+make install DESTDIR=$RPM_BUILD_ROOT SYSTEMD_UNIT_DIR=%{_unitdir} \
+     INSTALL="%{__install} -p"
 find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post libs -p /sbin/ldconfig
+%preun libs
+
+%if %{with_systemd}
+    %systemd_preun netcf-transaction.service
+%else
+if [ $1 = 0 ]; then
+    /sbin/chkconfig --del netcf-transaction
+fi
+%endif
 
-%postun libs -p /sbin/ldconfig
+%post libs
+
+/sbin/ldconfig
+%if %{with_systemd}
+    %systemd_post netcf-transaction.service
+    /bin/systemctl --no-reload enable netcf-transaction.service >/dev/null 2>&1 || :
+%else
+/sbin/chkconfig --add netcf-transaction
+%endif
+
+%postun libs
+
+/sbin/ldconfig
+%if %{with_systemd}
+    %systemd_postun netcf-transaction.service
+%endif
 
 %files
 %defattr(-,root,root,-)
@@ -92,7 +153,12 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root,-)
 %{_datadir}/netcf
 %{_libdir}/*.so.*
+%if %{with_systemd}
+%{_unitdir}/netcf-transaction.service
+%else
 %{_sysconfdir}/rc.d/init.d/netcf-transaction
+%endif
+%attr(0755, root, root) %{_libexecdir}/netcf-transaction.sh
 %doc AUTHORS COPYING NEWS
 
 %files devel
@@ -103,6 +169,15 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/pkgconfig/netcf.pc
 
 %changelog
+* Wed May 14 2014 Laine Stump <laine at redhat.com> - 0.2.4-1
+ - wait for IFF_UP and IFF_RUNNING after calling ifup
+ - don't require IFF_RUNNING for bridge devices
+ - avoid memory leak in debian when listing interfaces
+ - avoid use of uninitialized data when getting mac address
+   (fixes https://bugzilla.redhat.com/show_bug.cgi?id=1046594 )
+ - limit interface names to IFNAMSIZ-1 characters in length
+ - support systemd for netcf-transaction
+
 * Sat May 03 2014 Cole Robinson <crobinso at redhat.com> - 0.2.3-7
 - Fix reading bridge stp value (bz #1031053)
 
diff --git a/sources b/sources
index 4dc5d99..29eb4b5 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-bee292470b06201b59af0fad473a1b65  netcf-0.2.3.tar.gz
+91d3a8e26544406ad4b3a1ee376ef6d8  netcf-0.2.4.tar.gz


More information about the scm-commits mailing list