File ntrack.spec of Package ntrack
#
# spec file for package ntrack
#
# 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/
#
%define soname 0
%define glib_soname 2
%define gobject_soname 1
%define qt4_soname 1
Name: ntrack
Version: 016
Release: 0
Summary: Network connectivity tracking library for desktop applications
License: LGPL-3.0+
Group: System/Libraries
Url: https://launchpad.net/ntrack
Source: http://launchpad.net/ntrack/main/%{version}/+download/ntrack-%{version}.tar.gz
Patch1: fix-build.diff
%if %suse_version > 1210
BuildRequires: libnl3-devel
%define libnl_soname 3_x
%else
%if %suse_version == 1210
# 12.1 has libnl3, but it lacks a critical fix. So go with 1.1
BuildRequires: libnl-1_1-devel
%else
BuildRequires: libnl-devel
%endif
%define libnl_soname 1
%endif
BuildRequires: pkgconfig(QtCore)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(pygobject-2.0)
BuildRequires: python-devel
BuildRequires: libtool
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
ntrack aims to be a lightweight and easy to use library for application developers
that want to get events on network online status changes such as online, offline or route changes.
%package -n lib%{name}%{soname}
Summary: Network connectivity tracking library for desktop applications
Group: System/Libraries
Requires: %{name}-libnl%{libnl_soname}
%description -n lib%{name}%{soname}
ntrack aims to be a lightweight and easy to use library for application developers
that want to get events on network online status changes such as online, offline or route changes.
%package devel
Summary: Network connectivity tracking library for desktop applications
Group: Development/Libraries/C and C++
Requires: lib%{name}%{soname} = %{version}
%description devel
ntrack aims to be a lightweight and easy to use library for application developers
that want to get events on network online status changes such as online, offline or route changes.
Development files for lib%{name}%{soname}.
%package -n lib%{name}-qt4-%{qt4_soname}
Summary: Network connectivity tracking library for desktop applications
Group: System/Libraries
%description -n lib%{name}-qt4-%{qt4_soname}
ntrack aims to be a lightweight and easy to use library for application developers
that want to get events on network online status changes such as online, offline or route changes.
Qt4 monitor API to get network connectivity change updates.
%package -n lib%{name}-qt4-devel
Summary: Network connectivity tracking library for desktop applications
Group: Development/Libraries/C and C++
Requires: lib%{name}-qt4-%{qt4_soname} = %{version}
Requires: %{name}-devel = %{version}
%description -n lib%{name}-qt4-devel
ntrack aims to be a lightweight and easy to use library for application developers
that want to get events on network online status changes such as online, offline or route changes.
Developments files for lib%{name}-qt4-%{qt4_soname}.
%package -n lib%{name}-glib%{glib_soname}
Summary: Network connectivity tracking library for desktop applications
Group: System/Libraries
%description -n lib%{name}-glib%{glib_soname}
ntrack aims to be a lightweight and easy to use library for application developers
that want to get events on network online status changes such as online, offline or route changes.
Glib monitor API to get network connectivity change updates.
%package -n lib%{name}-glib-devel
Summary: Network connectivity tracking library for desktop applications
Group: Development/Libraries/C and C++
Requires: lib%{name}-glib%{glib_soname} = %{version}
Requires: %{name}-devel = %{version}
%description -n lib%{name}-glib-devel
ntrack aims to be a lightweight and easy to use library for application developers
that want to get events on network online status changes such as online, offline or route changes.
Developments files for lib%{name}-glib%{glib_soname}.
%package -n lib%{name}-gobject%{gobject_soname}
Summary: Network connectivity tracking library for desktop applications
Group: System/Libraries
%description -n lib%{name}-gobject%{gobject_soname}
ntrack aims to be a lightweight and easy to use library for application developers
that want to get events on network online status changes such as online, offline or route changes.
GObject monitor API to get network connectivity change updates.
%package -n lib%{name}-gobject-devel
Summary: Network connectivity tracking library for desktop applications
Group: Development/Libraries/C and C++
Requires: lib%{name}-gobject%{gobject_soname} = %{version}
Requires: %{name}-devel = %{version}
%description -n lib%{name}-gobject-devel
ntrack aims to be a lightweight and easy to use library for application developers
that want to get events on network online status changes such as online, offline or route changes.
Developments files for lib%{name}-gobject%{gobject_soname}.
%package -n python-lib%{name}
Summary: Network connectivity tracking library for desktop applications
Group: System/Libraries
Requires: python >= %{py_ver}
%description -n python-lib%{name}
ntrack aims to be a lightweight and easy to use library for application developers
that want to get events on network online status changes such as online, offline or route changes.
Python monitor API to get network connectivity change updates.
%package libnl%{libnl_soname}
Summary: Network connectivity tracking library for desktop applications
Group: System/Libraries
%description libnl%{libnl_soname}
ntrack aims to be a lightweight and easy to use library for application developers
that want to get events on network online status changes such as online, offline or route changes.
%prep
%setup -q
%patch1
autoreconf -fi
%build
%configure --disable-static \
--with-glib2 \
--with-gobject \
--with-pygobject \
--with-qt4
make
%install
%make_install
rm -v %{buildroot}%{_datadir}/doc/ntrack/*
rm -v %{buildroot}%{_libdir}/*.la
rm -v %{buildroot}%{_libdir}/ntrack/modules/*.la
rm -v %{buildroot}%{py_sitedir}/*.la
%clean
%{?buildroot:rm -rf %{buildroot}}
%post -n lib%{name}%{soname} -p /sbin/ldconfig
%post -n lib%{name}-qt4-%{qt4_soname} -p /sbin/ldconfig
%post -n lib%{name}-glib%{glib_soname} -p /sbin/ldconfig
%post -n lib%{name}-gobject%{gobject_soname} -p /sbin/ldconfig
%postun -n lib%{name}%{soname} -p /sbin/ldconfig
%postun -n lib%{name}-qt4-%{qt4_soname} -p /sbin/ldconfig
%postun -n lib%{name}-glib%{glib_soname} -p /sbin/ldconfig
%postun -n lib%{name}-gobject%{gobject_soname} -p /sbin/ldconfig
%files -n lib%{name}%{soname}
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%_libdir/libntrack.so.%{soname}*
%files devel
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%dir %_includedir/ntrack
%dir %_includedir/ntrack/common
%_includedir/ntrack/common/ntrack.h
%_includedir/ntrack/common/ntrackbase.h
%_includedir/ntrack/common/ntrackcompare.h
%_includedir/ntrack/common/ntrackidpool.h
%_includedir/ntrack/common/ntracklist.h
%_includedir/ntrack/common/ntrackmacros.h
%_includedir/ntrack/common/ntrackmonitor.h
%_includedir/ntrack/common/ntrackutil.h
%_libdir/libntrack.so
%_libdir/pkgconfig/libntrack.pc
%files -n lib%{name}-qt4-%{qt4_soname}
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%_libdir/libntrack-qt4.so.%{qt4_soname}*
%files -n lib%{name}-qt4-devel
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%dir %_includedir/ntrack
%dir %_includedir/ntrack/qt4
%_includedir/ntrack/qt4/QNtrack.h
%_libdir/libntrack-qt4.so
%_libdir/pkgconfig/libntrack-qt4.pc
%files -n lib%{name}-glib%{glib_soname}
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%_libdir/libntrack-glib.so.%{glib_soname}*
%files -n lib%{name}-glib-devel
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%dir %_includedir/ntrack
%dir %_includedir/ntrack/glib
%_includedir/ntrack/glib/ntrack-enums.h
%_includedir/ntrack/glib/ntrack-glib.h
%_includedir/ntrack/glib/ntrack-gsource.h
%_libdir/libntrack-glib.so
%_libdir/pkgconfig/libntrack-glib.pc
%files -n lib%{name}-gobject%{gobject_soname}
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%_libdir/libntrack-gobject.so.%{gobject_soname}*
%files -n lib%{name}-gobject-devel
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%dir %_includedir/ntrack
%dir %_includedir/ntrack/gobject
%_includedir/ntrack/gobject/ntrack-enumtypes.h
%_includedir/ntrack/gobject/ntrack-gmarshal.h
%_includedir/ntrack/gobject/ntrack-gmonitor.h
%_includedir/ntrack/gobject/ntrack-gobject.h
%_libdir/libntrack-gobject.so
%_libdir/pkgconfig/libntrack-gobject.pc
%files -n python-lib%{name}
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%py_sitedir/pyntrack.so
%files libnl%{libnl_soname}
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
%dir %_libdir/ntrack
%dir %_libdir/ntrack/modules
%_libdir/ntrack/modules/ntrack-libnl%{libnl_soname}.so
%changelog