diff --git a/libcap-ng-python.changes b/libcap-ng-python.changes new file mode 100644 index 0000000..eba25d6 --- /dev/null +++ b/libcap-ng-python.changes @@ -0,0 +1,37 @@ +------------------------------------------------------------------- +Thu Oct 14 11:18:28 UTC 2010 - coolo@novell.com + +- split out python packages now that libcap-ng is used in many + low level tools it creates cycles + +------------------------------------------------------------------- +Thu May 6 17:55:55 UTC 2010 - pascal.bleser@opensuse.org + +- update to 0.6.4: + * the library now uses kernel thread ID for capget/set calls + * a display problem of filesystem based capabilities was fixed + * netcap now prints device name for packet socket apps + +- add baselibs.conf to build libcap-ng0-32bit + +------------------------------------------------------------------- +Fri Mar 12 10:01:51 UTC 2010 - pascal.bleser@opensuse.org + +- update to 0.6.3: + * in netcap and pscap use the effective uid + * in capng_change_id, only retain setpcap if clearing the bounding set + +- add rpmlintrc to disable false positive warnings + +- symlink license files on openSUSE + +------------------------------------------------------------------- +Wed Mar 10 16:02:51 UTC 2010 - prusnak@suse.cz + +- fixed Requires of python subpackage + +------------------------------------------------------------------- +Fri Feb 26 12:14:04 UTC 2010 - prusnak@suse.cz + +- imported package from Fedora (version 0.6.2) + diff --git a/libcap-ng-python.spec b/libcap-ng-python.spec new file mode 100644 index 0000000..574ea92 --- /dev/null +++ b/libcap-ng-python.spec @@ -0,0 +1,146 @@ +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} + +Summary: An alternate POSIX capabilities library +Name: libcap-ng-python +Version: 0.6.4 +%define soname 0 +%define rname libcap-ng +Release: 0 +License: LGPLv2+ +Group: System/Libraries +URL: http://people.redhat.com/sgrubb/libcap-ng +# http://people.redhat.com/sgrubb/libcap-ng/libcap-ng-%{version}.tar.gz +Source0: libcap-ng-%{version}.tar.bz2 +Source1: pre_checkin.sh +Source2: baselibs.conf +Source99: libcap-ng.rpmlintrc +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: kernel-headers >= 2.6.11 +BuildRequires: libattr-devel pkg-config + +%description +Libcap-ng is a library that makes using posix capabilities easier + +%if "%{name}" == "%{rname}" +%package -n %{name}%{soname} +Summary: An alternate POSIX capabilities library +License: LGPLv2+ +Group: System/Libraries + +%description -n %{name}%{soname} +Libcap-ng is a library that makes using posix capabilities easier + +%package devel +Summary: Header files for libcap-ng library +License: LGPLv2+ +Group: Development/Libraries/C and C++ +Requires: kernel-headers >= 2.6.11 +Requires: %{name}%{soname} = %{version} +Requires: pkgconfig + +%description devel +The libcap-ng-devel package contains the files needed for developing +applications that need to use the libcap-ng library. + +%package utils +Summary: Utilities for analysing and setting file capabilities +License: GPLv2+ +Group: System/Base + +%description utils +The libcap-ng-utils package contains applications to analyse the +posix capabilities of all the program running on a system. It also +lets you set the file system based capabilities. + +%else +%package -n python-capng +Summary: Python bindings for libcap-ng library +License: LGPLv2+ +Group: Development/Libraries/Python +BuildRequires: python-devel swig +Requires: %{name}%{soname} = %{version} +%py_requires + +%description -n python-capng +The libcap-ng-python package contains the bindings so that libcap-ng +and can be used by python applications. + +%endif + +%prep +%setup -q -n %{rname}-%{version} + +%build +%configure --libdir="/%{_lib}" +%__make %{?_smp_mflags} + +%install +%__make DESTDIR="%{buildroot}" install + +# Move the symlink +%__rm -f "%{buildroot}/%{_lib}/%{rname}.so" +%__mkdir_p "%{buildroot}%{_libdir}" +VLIBNAME=$(/bin/ls -1 "%{buildroot}/%{_lib}/%{rname}.so".*.*.*) +[ -n "$VLIBNAME" ] || { echo "ERROR: failed to find %{buildroot}/%{_lib}/%{rname}.so.*.*.*" >&2; exit 1; } +LIBNAME=$(basename "$VLIBNAME") +%__ln_s "../../%{_lib}/$LIBNAME" "%{buildroot}%{_libdir}/%{rname}.so" + +# Move the pkgconfig file +%__install -d "%{buildroot}%{_libdir}" +%__mv "%{buildroot}/%{_lib}/pkgconfig" "%{buildroot}%{_libdir}/pkgconfig" + +# Remove a couple things so they don't get picked up +%__rm -f "%{buildroot}/%{_lib}/%{rname}".{a,la} +%__rm -f "%{buildroot}%{python_sitearch}/_capng".{a,la} + +%if "%{name}" == "%{rname}-python" +%__rm -f %{buildroot}/%{_lib}/lib*.so* +%__rm -f %{buildroot}/%{_libdir}/lib*.so* +%__rm -rf %{buildroot}/%{_libdir}/pkgconfig +%__rm -rf %{buildroot}/%{_bindir} +%__rm -rf %{buildroot}/%{_mandir} +%__rm -rf %{buildroot}/%{_includedir} +%__rm -rf %{buildroot}/%{_datadir}/aclocal +%endif + +%clean +%{?buildroot:%__rm -rf "%{buildroot}"} + +%if "%{name}" == "%{rname}" +%post -n %{name}%{soname} -p /sbin/ldconfig + +%postun -n %{name}%{soname} -p /sbin/ldconfig + +%files -n %{name}%{soname} +%defattr(-,root,root,-) +%doc COPYING.LIB +%attr(0755,root,root) /%{_lib}/%{rname}.so.%{soname} +%attr(0755,root,root) /%{_lib}/%{rname}.so.%{soname}.* + +%files devel +%defattr(-,root,root,-) +%attr(0644,root,root) %{_mandir}/man3/*.3%{ext_man} +%attr(0644,root,root) %{_includedir}/cap-ng.h +%attr(0755,root,root) %{_libdir}/%{rname}.so +%attr(0644,root,root) %{_datadir}/aclocal/cap-ng.m4 +%{_libdir}/pkgconfig/%{rname}.pc + +%files utils +%defattr(-,root,root,-) +%doc COPYING +%attr(0755,root,root) %{_bindir}/captest +%attr(0755,root,root) %{_bindir}/filecap +%attr(0755,root,root) %{_bindir}/netcap +%attr(0755,root,root) %{_bindir}/pscap +%attr(0644,root,root) %{_mandir}/man8/*.8%{ext_man} + +%else +%files -n python-capng +%defattr(-,root,root,-) +%attr(755,root,root) %{python_sitearch}/_capng.so +%{python_sitearch}/capng.py* + +%endif + +%changelog diff --git a/libcap-ng.changes b/libcap-ng.changes index 63b2159..eba25d6 100644 --- a/libcap-ng.changes +++ b/libcap-ng.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Oct 14 11:18:28 UTC 2010 - coolo@novell.com + +- split out python packages now that libcap-ng is used in many + low level tools it creates cycles + ------------------------------------------------------------------- Thu May 6 17:55:55 UTC 2010 - pascal.bleser@opensuse.org diff --git a/libcap-ng.spec b/libcap-ng.spec index e5d6c60..3b1d4df 100644 --- a/libcap-ng.spec +++ b/libcap-ng.spec @@ -1,87 +1,75 @@ -# -# spec file for package libcap-ng (Version 0.6.4) -# -# 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/ -# - - %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} -Summary: An alternate POSIX capabilities library - -Name: libcap-ng -Version: 0.6.4 -Release: 1 +Summary: An alternate POSIX capabilities library +Name: libcap-ng +Version: 0.6.4 %define soname 0 -License: LGPLv2+ -Group: System Environment/Libraries -Url: http://people.redhat.com/sgrubb/libcap-ng +%define rname libcap-ng +Release: 0 +License: LGPLv2+ +Group: System/Libraries +URL: http://people.redhat.com/sgrubb/libcap-ng # http://people.redhat.com/sgrubb/libcap-ng/libcap-ng-%{version}.tar.gz -Source0: libcap-ng-%{version}.tar.bz2 -Source99: libcap-ng.rpmlintrc -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: kernel-headers >= 2.6.11 -BuildRequires: libattr-devel +Source0: libcap-ng-%{version}.tar.bz2 +Source1: pre_checkin.sh +Source2: baselibs.conf +Source99: libcap-ng.rpmlintrc +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: kernel-headers >= 2.6.11 +BuildRequires: libattr-devel pkg-config python-base %description Libcap-ng is a library that makes using posix capabilities easier +%if "%{name}" == "%{rname}" %package -n %{name}%{soname} - -Summary: An alternate POSIX capabilities library -License: LGPLv2+ -Group: System Environment/Libraries +Summary: An alternate POSIX capabilities library +License: LGPLv2+ +Group: System/Libraries %description -n %{name}%{soname} Libcap-ng is a library that makes using posix capabilities easier %package devel -Summary: Header files for libcap-ng library -License: LGPLv2+ -Group: Development/Libraries -Requires: kernel-headers >= 2.6.11 -Requires: %{name}%{soname} = %{version} -Requires: pkgconfig +Summary: Header files for libcap-ng library +License: LGPLv2+ +Group: Development/Libraries/C and C++ +Requires: kernel-headers >= 2.6.11 +Requires: %{name}%{soname} = %{version} +Requires: pkgconfig %description devel The libcap-ng-devel package contains the files needed for developing applications that need to use the libcap-ng library. -%package -n python-capng -Summary: Python bindings for libcap-ng library -License: LGPLv2+ -Group: Development/Libraries -BuildRequires: python-devel swig -Requires: %{name}%{soname} = %{version} - -%description -n python-capng -The libcap-ng-python package contains the bindings so that libcap-ng -and can be used by python applications. - %package utils -Summary: Utilities for analysing and setting file capabilities -License: GPLv2+ -Group: Development/Libraries +Summary: Utilities for analysing and setting file capabilities +License: GPLv2+ +Group: System/Base %description utils The libcap-ng-utils package contains applications to analyse the posix capabilities of all the program running on a system. It also lets you set the file system based capabilities. +%else +%package -n python-capng +Summary: Python bindings for libcap-ng library +License: LGPLv2+ +Group: Development/Libraries/Python +BuildRequires: python-devel swig +Requires: %{name}%{soname} = %{version} +%py_requires + +%description -n python-capng +The libcap-ng-python package contains the bindings so that libcap-ng +and can be used by python applications. + +%endif + %prep -%setup -q +%setup -q -n %{rname}-%{version} %build %configure --libdir="/%{_lib}" @@ -91,24 +79,35 @@ lets you set the file system based capabilities. %__make DESTDIR="%{buildroot}" install # Move the symlink -%__rm -f "%{buildroot}/%{_lib}/%{name}.so" +%__rm -f "%{buildroot}/%{_lib}/%{rname}.so" %__mkdir_p "%{buildroot}%{_libdir}" -VLIBNAME=$(/bin/ls -1 "%{buildroot}/%{_lib}/%{name}.so".*.*.*) -[ -n "$VLIBNAME" ] || { echo "ERROR: failed to find %{buildroot}/%{_lib}/%{name}.so.*.*.*" >&2; exit 1; } +VLIBNAME=$(/bin/ls -1 "%{buildroot}/%{_lib}/%{rname}.so".*.*.*) +[ -n "$VLIBNAME" ] || { echo "ERROR: failed to find %{buildroot}/%{_lib}/%{rname}.so.*.*.*" >&2; exit 1; } LIBNAME=$(basename "$VLIBNAME") -%__ln_s "../../%{_lib}/$LIBNAME" "%{buildroot}%{_libdir}/%{name}.so" +%__ln_s "../../%{_lib}/$LIBNAME" "%{buildroot}%{_libdir}/%{rname}.so" # Move the pkgconfig file %__install -d "%{buildroot}%{_libdir}" %__mv "%{buildroot}/%{_lib}/pkgconfig" "%{buildroot}%{_libdir}/pkgconfig" # Remove a couple things so they don't get picked up -%__rm -f "%{buildroot}/%{_lib}/libcap-ng".{a,la} +%__rm -f "%{buildroot}/%{_lib}/%{rname}".{a,la} %__rm -f "%{buildroot}%{python_sitearch}/_capng".{a,la} +%if "%{name}" == "%{rname}-python" +%__rm -f %{buildroot}/%{_lib}/lib*.so* +%__rm -f %{buildroot}/%{_libdir}/lib*.so* +%__rm -rf %{buildroot}/%{_libdir}/pkgconfig +%__rm -rf %{buildroot}/%{_bindir} +%__rm -rf %{buildroot}/%{_mandir} +%__rm -rf %{buildroot}/%{_includedir} +%__rm -rf %{buildroot}/%{_datadir}/aclocal +%endif + %clean %{?buildroot:%__rm -rf "%{buildroot}"} +%if "%{name}" == "%{rname}" %post -n %{name}%{soname} -p /sbin/ldconfig %postun -n %{name}%{soname} -p /sbin/ldconfig @@ -116,21 +115,16 @@ LIBNAME=$(basename "$VLIBNAME") %files -n %{name}%{soname} %defattr(-,root,root,-) %doc COPYING.LIB -%attr(0755,root,root) /%{_lib}/libcap-ng.so.%{soname} -%attr(0755,root,root) /%{_lib}/libcap-ng.so.%{soname}.* +%attr(0755,root,root) /%{_lib}/%{rname}.so.%{soname} +%attr(0755,root,root) /%{_lib}/%{rname}.so.%{soname}.* %files devel %defattr(-,root,root,-) %attr(0644,root,root) %{_mandir}/man3/*.3%{ext_man} %attr(0644,root,root) %{_includedir}/cap-ng.h -%attr(0755,root,root) %{_libdir}/libcap-ng.so +%attr(0755,root,root) %{_libdir}/%{rname}.so %attr(0644,root,root) %{_datadir}/aclocal/cap-ng.m4 -%{_libdir}/pkgconfig/libcap-ng.pc - -%files -n python-capng -%defattr(-,root,root,-) -%attr(755,root,root) %{python_sitearch}/_capng.so -%{python_sitearch}/capng.py* +%{_libdir}/pkgconfig/%{rname}.pc %files utils %defattr(-,root,root,-) @@ -141,4 +135,12 @@ LIBNAME=$(basename "$VLIBNAME") %attr(0755,root,root) %{_bindir}/pscap %attr(0644,root,root) %{_mandir}/man8/*.8%{ext_man} +%else +%files -n python-capng +%defattr(-,root,root,-) +%attr(755,root,root) %{python_sitearch}/_capng.so +%{python_sitearch}/capng.py* + +%endif + %changelog diff --git a/pre_checkin.sh b/pre_checkin.sh new file mode 100644 index 0000000..4440557 --- /dev/null +++ b/pre_checkin.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo -n "Generating python spec " + +cp libcap-ng.spec libcap-ng-python.spec +cp libcap-ng.changes libcap-ng-python.changes + +perl -pi -e "s/^Name:.*libcap-ng$/Name: libcap-ng-python/" libcap-ng-python.spec + +echo "Done." +