File netcf.spec of Package netcf

#
# spec file for package netcf (Version 0.1.6)
#
# Copyright (c) 2010 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:        1
Summary:        Cross-platform network configuration library

Group:          Productivity/Networking/System
License:        LGPLv2+
Url:            https://fedorahosted.org/netcf/
Source0:        https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
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 readline-devel
BuildRequires:  libxml2-devel libxslt-devel
BuildRequires:  libnl-devel
BuildRequires:  pkg-config

%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
License:        LGPLv2+
Summary:        Development files for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{__shrlibname} = %{version}
Requires:       pkgconfig
Requires:       augeas-devel libxml2-devel libxslt-devel

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

%package        -n libnetcf1
License:        LGPLv2+
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
automake
%else
automake --add-missing
%endif
autoconf

%build
%configure --disable-static
%if 0%{?suse_version} >= 1130
make CFLAGS="-DOS113" %{?_smp_mflags}
%else
cp data/lenses/persist_net_rules-pre-os113.aug data/lenses/persist_net_rules.aug
make %{?_smp_mflags}
%endif

%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