Blame SPECS/netcf.spec

42eb09
Name:           netcf
42eb09
Version:        0.2.8
42eb09
Release:        10%{?dist}%{?extra_release}
42eb09
Summary:        Cross-platform network configuration library
42eb09
42eb09
Group:          System Environment/Libraries
42eb09
License:        LGPLv2+
42eb09
URL:            https://fedorahosted.org/netcf/
42eb09
Source0:        https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
42eb09
42eb09
# Patches
42eb09
# One patch per line, in this format:
42eb09
# Patch001: file1.patch
42eb09
# Patch002: file2.patch
42eb09
# ...
42eb09
#
42eb09
# The patches will automatically be put into the build source tree
42eb09
# during the %prep stage (using git, which is now required for an rpm
42eb09
# build)
42eb09
#
42eb09
Patch001: netcf-call-aug_load-at-most-once-per-second.patch
42eb09
Patch002: netcf-optimize-aug_match-query-for-all-ifcfg-files-related.patch
42eb09
Patch003: netcf-linux-include-bond-element-for-bonds-with-no-slaves.patch 
42eb09
Patch004: netcf-Properly-classify-bond-devices-with-no-slaves.patch 
42eb09
42eb09
# Default to skipping autoreconf.  Distros can change just this one
42eb09
# line (or provide a command-line override) if they backport any
42eb09
# patches that touch configure.ac or Makefile.am.
42eb09
%{!?enable_autotools:%define enable_autotools 0}
42eb09
42eb09
# git is used to build a source tree with patches applied (see the
42eb09
# %prep section)
42eb09
BuildRequires: git
42eb09
42eb09
# Fedora 20 / RHEL-7 are where netcf first uses systemd. Although earlier
42eb09
# Fedora has systemd, netcf still used sysvinit there.
42eb09
%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
42eb09
    %define with_systemd 1
42eb09
%else
42eb09
    %define with_systemd 0
42eb09
%endif
42eb09
42eb09
%if %{with_systemd}
42eb09
BuildRequires: systemd
42eb09
Requires(post): systemd
42eb09
Requires(preun): systemd
42eb09
Requires(postun): systemd
42eb09
%endif
42eb09
%if 0%{?enable_autotools}
42eb09
BuildRequires: autoconf
42eb09
BuildRequires: automake
42eb09
BuildRequires: gettext-devel
42eb09
BuildRequires: libtool
42eb09
BuildRequires: /usr/bin/pod2man
42eb09
%endif
42eb09
42eb09
BuildRequires:  readline-devel augeas-devel >= 0.5.2
42eb09
BuildRequires:  libxml2-devel libxslt-devel
42eb09
42eb09
# force the --with-libnl1 option on F17/RHEL6 and earlier
42eb09
%if (0%{?fedora} && 0%{?fedora} < 18) || (0%{?rhel} && 0%{?rhel} < 7)
42eb09
%define with_libnl1 1
42eb09
%else
42eb09
%define with_libnl1 0
42eb09
%endif
42eb09
42eb09
# require libnl3 on F18/RHEL7 and later
42eb09
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
42eb09
BuildRequires:  libnl3-devel
42eb09
%else
42eb09
BuildRequires:  libnl-devel
42eb09
%endif
42eb09
42eb09
Requires:       %{name}-libs = %{version}-%{release}
42eb09
42eb09
Provides: bundled(gnulib)
42eb09
42eb09
%description
42eb09
Netcf is a library used to modify the network configuration of a
42eb09
system. Network configurations are expressed in a platform-independent
42eb09
XML format, which netcf translates into changes to the system's
42eb09
'native' network configuration files.
42eb09
42eb09
%package        devel
42eb09
Summary:        Development files for %{name}
42eb09
Group:          Development/Libraries
42eb09
Requires:       %{name}-libs = %{version}-%{release}
42eb09
Requires:       pkgconfig
42eb09
42eb09
%description    devel
42eb09
The %{name}-devel package contains libraries and header files for
42eb09
developing applications that use %{name}.
42eb09
42eb09
%package        libs
42eb09
Summary:        Libraries for %{name}
42eb09
Group:          System Environment/Libraries
42eb09
42eb09
%description    libs
42eb09
The libraries for %{name}.
42eb09
42eb09
%prep
42eb09
%setup -q
42eb09
42eb09
# Patches have to be stored in a temporary file because RPM has
42eb09
# a limit on the length of the result of any macro expansion;
42eb09
# if the string is longer, it's silently cropped
42eb09
%{lua:
42eb09
    tmp = os.tmpname();
42eb09
    f = io.open(tmp, "w+");
42eb09
    count = 0;
42eb09
    for i, p in ipairs(patches) do
42eb09
        f:write(p.."\n");
42eb09
        count = count + 1;
42eb09
    end;
42eb09
    f:close();
42eb09
    print("PATCHCOUNT="..count.."\n")
42eb09
    print("PATCHLIST="..tmp.."\n")
42eb09
}
42eb09
42eb09
git init -q
42eb09
git config user.name rpm-build
42eb09
git config user.email rpm-build
42eb09
git config gc.auto 0
42eb09
git add .
42eb09
git commit -q -a --author 'rpm-build <rpm-build>' \
42eb09
           -m '%{name}-%{version} base'
42eb09
42eb09
COUNT=$(grep '\.patch$' $PATCHLIST | wc -l)
42eb09
if [ $COUNT -ne $PATCHCOUNT ]; then
42eb09
    echo "Found $COUNT patches in $PATCHLIST, expected $PATCHCOUNT"
42eb09
    exit 1
42eb09
fi
42eb09
if [ $COUNT -gt 0 ]; then
42eb09
    xargs git am <$PATCHLIST || exit 1
42eb09
fi
42eb09
echo "Applied $COUNT patches"
42eb09
rm -f $PATCHLIST
42eb09
42eb09
42eb09
%build
42eb09
%if %{with_libnl1}
42eb09
%define _with_libnl1 --with-libnl1
42eb09
%endif
42eb09
%if %{with_systemd}
42eb09
    %define sysinit --with-sysinit=systemd
42eb09
%else
42eb09
    %define sysinit --with-sysinit=initscripts
42eb09
%endif
42eb09
42eb09
42eb09
%if 0%{?enable_autotools}
42eb09
 autoreconf -if
42eb09
%endif
42eb09
42eb09
%configure --disable-static \
42eb09
           %{?_with_libnl1} \
42eb09
           %{sysinit}
42eb09
make %{?_smp_mflags}
42eb09
42eb09
%install
42eb09
make install DESTDIR=$RPM_BUILD_ROOT SYSTEMD_UNIT_DIR=%{_unitdir} \
42eb09
     INSTALL="%{__install} -p"
42eb09
find $RPM_BUILD_ROOT -name '*.la' -delete
42eb09
42eb09
%preun libs
42eb09
42eb09
%if %{with_systemd}
42eb09
    %systemd_preun netcf-transaction.service
42eb09
%else
42eb09
if [ $1 = 0 ]; then
42eb09
    /sbin/chkconfig --del netcf-transaction
42eb09
fi
42eb09
%endif
42eb09
42eb09
%post libs
42eb09
42eb09
/sbin/ldconfig
42eb09
%if %{with_systemd}
42eb09
    %systemd_post netcf-transaction.service
42eb09
    /bin/systemctl --no-reload enable netcf-transaction.service >/dev/null 2>&1 || :
42eb09
%else
42eb09
/sbin/chkconfig --add netcf-transaction
42eb09
%endif
42eb09
42eb09
%postun libs
42eb09
42eb09
/sbin/ldconfig
42eb09
%if %{with_systemd}
42eb09
    %systemd_postun netcf-transaction.service
42eb09
%endif
42eb09
42eb09
%files
42eb09
%{_bindir}/ncftool
42eb09
%{_mandir}/man1/ncftool.1*
42eb09
42eb09
%files libs
42eb09
%{_datadir}/netcf
42eb09
%{_libdir}/*.so.*
42eb09
%if %{with_systemd}
42eb09
%{_unitdir}/netcf-transaction.service
42eb09
%else
42eb09
%{_sysconfdir}/rc.d/init.d/netcf-transaction
42eb09
%endif
42eb09
%attr(0755, root, root) %{_libexecdir}/netcf-transaction.sh
42eb09
%doc AUTHORS COPYING NEWS
42eb09
42eb09
%files devel
42eb09
%doc
42eb09
%{_includedir}/*
42eb09
%{_libdir}/*.so
42eb09
%{_libdir}/pkgconfig/netcf.pc
42eb09
42eb09
%changelog
42eb09
* Mon Jul 30 2018 Eric Garver <egarver@redhat.com> - 0.2.8-10
42eb09
- Remove artificial dependency on bridge-utils. rhbz #1605333
42eb09
42eb09
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.8-9
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
42eb09
42eb09
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.8-8
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
42eb09
42eb09
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.8-7
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
42eb09
42eb09
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.8-6
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
42eb09
42eb09
* Thu Jan 12 2017 Igor Gnatenko <ignatenko@redhat.com> - 0.2.8-5
42eb09
- Rebuild for readline 7.x
42eb09
42eb09
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.8-4
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
42eb09
42eb09
* Wed Oct 14 2015 Laine Stump <laine@redhat.com>
42eb09
 - Improve performance with large number of interfaces
42eb09
   (Bug 1268384, Bug 1271341)
42eb09
 - recognize bond devices with no slaves
42eb09
42eb09
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.8-2
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
42eb09
42eb09
* Wed Apr 08 2015 Laine Stump <laine@redhat.com> - 0.2.8-1
42eb09
 - rebase to netcf-0.2.8
42eb09
 - Fix build on systems with newer libnl3 that doesn't
42eb09
   #include <linux/if.h>
42eb09
42eb09
* Mon Apr 06 2015 Laine Stump <laine@redhat.com> - 0.2.7-1
42eb09
 - rebase to netcf-0.2.7
42eb09
 - resolve CVE-2014-8119
42eb09
 - support multiple IPv4 addresses in interface config (redhat driver)
42eb09
 - allow static IPv4 config simultaneous with DHCPv4 (redhat driver)
42eb09
 - recognize IPADDR0/NETMASK0/PREFIX0
42eb09
 - remove extra quotes from IPV6ADDR_SECONDARIES (redhat+suse drivers)
42eb09
 - miscellaneous systemd service fixes
42eb09
 - use git to apply patches in rpm specfile
42eb09
 - revert the 0.2.6-2 specfile patch mentioned below (now fixed properly)
42eb09
42eb09
* Thu Jan  8 2015 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.2.6-2
42eb09
- do not write to the console (#1135744)
42eb09
42eb09
* Fri Aug 22 2014 Laine Stump <laine@redhat.com> - 0.2.6-1
42eb09
 - allow interleaved elements in interface XML schema
42eb09
 - allow <link> element in vlan and bond interfaces
42eb09
42eb09
* Wed Aug 20 2014 Laine Stump <laine@redhat.com> - 0.2.5-1
42eb09
 - report link state/speed in interface status
42eb09
 - change DHCPv6 to DHCPV6C in ifcfg files
42eb09
 - max vlan id is 4095, not 4096
42eb09
42eb09
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-3
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
42eb09
42eb09
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.4-2
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
42eb09
42eb09
* Wed May 14 2014 Laine Stump <laine@redhat.com> - 0.2.4-1
42eb09
 - wait for IFF_UP and IFF_RUNNING after calling ifup
42eb09
 - don't require IFF_RUNNING for bridge devices
42eb09
 - avoid memory leak in debian when listing interfaces
42eb09
 - avoid use of uninitialized data when getting mac address
42eb09
   (fixes https://bugzilla.redhat.com/show_bug.cgi?id=1046594 )
42eb09
 - limit interface names to IFNAMSIZ-1 characters in length
42eb09
 - support systemd for netcf-transaction
42eb09
42eb09
* Sat May 03 2014 Cole Robinson <crobinso@redhat.com> - 0.2.3-7
42eb09
- Fix reading bridge stp value (bz #1031053)
42eb09
42eb09
* Thu Apr 24 2014 Tomáš Mráz <tmraz@redhat.com> - 0.2.3-6
42eb09
- Rebuild for new libgcrypt
42eb09
42eb09
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.3-5
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
42eb09
42eb09
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.3-4
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
42eb09
42eb09
* Sun Jan 20 2013 Richard W.M. Jones <rjones@redhat.com> - 0.2.3-3
42eb09
- Rebuild for libnl soname breakage (RHBZ#901569).
42eb09
42eb09
* Fri Jan 18 2013 Daniel P. Berrange <berrange@redhat.com> - 0.2.3-2
42eb09
- Rebuild for libnl3 soname change
42eb09
42eb09
* Fri Dec 21 2012 Laine Stump <laine@redhat.com> - 0.2.3-1
42eb09
- Rebase to netcf-0.2.3
42eb09
- eliminate calls to nl_cache_mngt_provide(), to avoid
42eb09
  non-threadsafe code in libnl (and because it isn't needed
42eb09
  anyway) (This non-threadsafe code could lead to a segfault)
42eb09
- portability fixes for FreeBSD
42eb09
- fix bug when a config file has two config parameters with
42eb09
  identical names
42eb09
- add HACKING document
42eb09
- always bail immediately if get_augeas fails (doing otherwise
42eb09
  could lead to a segfault)
42eb09
42eb09
* Sat Aug 25 2012 Laine Stump <laine@redhat.com> - 0.2.2-1
42eb09
- Rebase to netcf-0.2.2
42eb09
- specfile: require libnl3-devel for rpm builds on Fedora 18+ and
42eb09
  RHEL7+. Likewise, force libnl1 for F17- and RHEL6.x-, even if
42eb09
  libnl3-devel is installed.
42eb09
42eb09
* Fri Aug 10 2012 Laine Stump <laine@redhat.com> - 0.2.1-1
42eb09
- Rebase to netcf-0.2.1
42eb09
- update gnulib to fix broken build on systems with nwer glibc (which no
42eb09
  longer provides gets()).
42eb09
- add ncftool manpage
42eb09
- interfaces are only "active" if both UP and RUNNING.
42eb09
- add "bundled(gnulib)" to specfile to indicate that we use a local
42eb09
  copy of gnulib sources (used by Fedora/RHEL when determining the scope
42eb09
  of security bugs).
42eb09
- Fix ipcalc_netmask, which was trimming off the last digit in
42eb09
  character representations of full-length netmasks (all 4 octets
42eb09
  having 3 chars each)
42eb09
- other minor bugfixes
42eb09
42eb09
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.9-3
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
42eb09
42eb09
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.9-2
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
42eb09
42eb09
* Tue Jul 26 2011 Laine Stump <laine@redhat.com> - 0.1.9-1
42eb09
- Rebase to netcf-0.1.9
42eb09
- always add <bridge> element to bridge, even if there is no physdev present
42eb09
- don't log error if interface isn't found in kernel during status report
42eb09
- allow building with C++
42eb09
- update gnulib
42eb09
42eb09
* Tue Jun 21 2011 Laine Stump <laine@redhat.com> - 0.1.8-1
42eb09
- Rebase to netcf-0.1.8
42eb09
- new transactional change APIs: ncf_change_(begin|commit|rollback)
42eb09
- add stdout/stderr to error text when an external program fails
42eb09
- make error reporting of failed execs more exact/correct
42eb09
- Remove unnecessary "Requires" of libxml2 and augeas from pkgconfig file
42eb09
  to pulling in extra packages when building an application that uses netcf.
42eb09
42eb09
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.7-2
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
42eb09
42eb09
* Mon Sep 27 2010 Laine Stump <laine@redhat.com> - 0.1.7-1
42eb09
- New version
42eb09
42eb09
* Tue Apr 20 2010 Laine Stump <laine@redhat.com> - 0.1.6-1
42eb09
- New version
42eb09
- Remove patch n0001-src-dutil.c-add-missing-includes-for-stat.patch,
42eb09
  included upstream
42eb09
42eb09
* Mon Feb 15 2010 David Lutterkort <lutter@redhat.com> - 0.1.5-2
42eb09
- patch1: add missing includes for stat in dutil.c
42eb09
42eb09
* Mon Nov 30 2009 David Lutterkort <lutter@redhat.com> - 0.1.5-1
42eb09
- New version
42eb09
42eb09
* Thu Nov  5 2009 David Lutterkort <lutter@redhat.com> - 0.1.4-1
42eb09
- New version
42eb09
42eb09
* Tue Oct 27 2009 David Lutterkort <lutter@redhat.com> - 0.1.3-1
42eb09
- New version
42eb09
42eb09
* Fri Sep 25 2009 David Lutterkort <lutter@redhat.com> - 0.1.2-1
42eb09
- New Version
42eb09
42eb09
* Wed Sep 16 2009 David Lutterkort <lutter@redhat.com> - 0.1.1-1
42eb09
- Remove patch netcf-0.1.0-fix-initialization-of-libxslt.patch,
42eb09
  included upstream
42eb09
42eb09
* Tue Sep 15 2009 Mark McLoughlin <markmc@redhat.com> - 0.1.0-3
42eb09
- Fix libvirtd segfault caused by libxslt init issue (#523382)
42eb09
42eb09
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.0-2
42eb09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
42eb09
42eb09
* Mon Jul 13 2009 David Lutterkort <lutter@redhat.com> - 0.1.0-1
42eb09
- BR on augeas-0.5.2
42eb09
- Drop explicit requires for augeas-libs
42eb09
42eb09
* Wed Apr 15 2009 David Lutterkort <lutter@redhat.com> - 0.0.2-1
42eb09
- Updates acording to Fedora review
42eb09
42eb09
* Fri Feb 27 2009 David Lutterkort <lutter@redhat.com> - 0.0.1-1
42eb09
- Initial specfile