File netcf.spec of Package netcf

#
# spec file for package netcf
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           netcf
Version:        0.1.6
Release:        0
Summary:        Cross-platform network configuration library
License:        LGPL-2.1+
Group:          Productivity/Networking/System
Url:            https://fedorahosted.org/netcf/
Source0:        https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
Source1:        baselibs.conf
Patch0:         netcf-suse.patch
Patch1:         persist_net_rules.patch
Patch2:         routes_lens.patch
Patch3:         sles-automake.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  augeas-devel >= 0.5.2
BuildRequires:  automake
BuildRequires:  libnl-1_1-devel
BuildRequires:  libxml2-devel
BuildRequires:  libxslt-devel
BuildRequires:  pkg-config
BuildRequires:  readline-devel

%description
A library for modifying the network configuration of a system. Network
configurations are expresed in a platform-independent XML format, which
netcf translates into changes to the system's 'native' network
configuration files.

%define __shrlibname lib%{name}1

%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{__shrlibname} = %{version}
Requires:       augeas-devel
Requires:       libxml2-devel
Requires:       libxslt-devel
Requires:       pkgconfig

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.

%package        -n libnetcf1
Summary:        Libraries for %{name}
Group:          System/Libraries

%description    -n libnetcf1
The libraries for %{name}.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%if 0%{?sles_version} <= 11
%patch3 -p1
%endif
aclocal -I gnulib/m4

%if 0%{?suse_version} >= 1130 && 0%{?suse_version} < 1220
automake
%else
automake --add-missing
%endif
autoconf

%build
%configure --disable-static
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="%{__install} -p"
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'

%clean
rm -rf $RPM_BUILD_ROOT

%post -n %{__shrlibname} -p /sbin/ldconfig

%postun -n %{__shrlibname} -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%{_bindir}/ncftool

%files -n libnetcf1
%defattr(-,root,root,-)
%{_datadir}/netcf
%{_libdir}/*.so.*
%doc AUTHORS COPYING NEWS

%files devel
%defattr(-,root,root,-)
%doc
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/netcf.pc

%changelog
openSUSE Build Service is sponsored by