Nick Kralevich | 1d1011a | 2012-09-06 10:14:03 -0700 | [diff] [blame] | 1 | %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} |
| 2 | |
| 3 | Summary: An alternate posix capabilities library |
| 4 | Name: libcap-ng |
| 5 | Version: 0.7 |
| 6 | Release: 1 |
| 7 | License: LGPLv2+ |
| 8 | Group: System Environment/Libraries |
| 9 | URL: http://people.redhat.com/sgrubb/libcap-ng |
| 10 | Source0: http://people.redhat.com/sgrubb/libcap-ng/%{name}-%{version}.tar.gz |
| 11 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
| 12 | BuildRequires: kernel-headers >= 2.6.11 |
| 13 | BuildRequires: libattr-devel |
| 14 | |
| 15 | %description |
| 16 | Libcap-ng is a library that makes using posix capabilities easier |
| 17 | |
| 18 | %package devel |
| 19 | Summary: Header files for libcap-ng library |
| 20 | License: LGPLv2+ |
| 21 | Group: Development/Libraries |
| 22 | Requires: kernel-headers >= 2.6.11 |
| 23 | Requires: %{name} = %{version}-%{release} |
| 24 | Requires: pkgconfig |
| 25 | |
| 26 | %description devel |
| 27 | The libcap-ng-devel package contains the files needed for developing |
| 28 | applications that need to use the libcap-ng library. |
| 29 | |
| 30 | %package python |
| 31 | Summary: Python bindings for libcap-ng library |
| 32 | License: LGPLv2+ |
| 33 | Group: Development/Libraries |
| 34 | BuildRequires: python-devel swig |
| 35 | Requires: %{name} = %{version}-%{release} |
| 36 | |
| 37 | %description python |
| 38 | The libcap-ng-python package contains the bindings so that libcap-ng |
| 39 | and can be used by python applications. |
| 40 | |
| 41 | %package utils |
| 42 | Summary: Utilities for analyzing and setting file capabilities |
| 43 | License: GPLv2+ |
| 44 | Group: Development/Libraries |
| 45 | |
| 46 | %description utils |
| 47 | The libcap-ng-utils package contains applications to analyze the |
| 48 | posix capabilities of all the program running on a system. It also |
| 49 | lets you set the file system based capabilities. |
| 50 | |
| 51 | %prep |
| 52 | %setup -q |
| 53 | |
| 54 | %build |
| 55 | %configure --libdir=/%{_lib} |
| 56 | make %{?_smp_mflags} |
| 57 | |
| 58 | %install |
| 59 | rm -rf $RPM_BUILD_ROOT |
| 60 | make DESTDIR="${RPM_BUILD_ROOT}" install |
| 61 | |
| 62 | # Move the symlink |
| 63 | rm -f $RPM_BUILD_ROOT/%{_lib}/%{name}.so |
| 64 | mkdir -p $RPM_BUILD_ROOT%{_libdir} |
| 65 | VLIBNAME=$(ls $RPM_BUILD_ROOT/%{_lib}/%{name}.so.*.*.*) |
| 66 | LIBNAME=$(basename $VLIBNAME) |
| 67 | ln -s ../../%{_lib}/$LIBNAME $RPM_BUILD_ROOT%{_libdir}/%{name}.so |
| 68 | |
| 69 | # Move the pkgconfig file |
| 70 | mv $RPM_BUILD_ROOT/%{_lib}/pkgconfig $RPM_BUILD_ROOT%{_libdir} |
| 71 | |
| 72 | # Remove a couple things so they don't get picked up |
| 73 | rm -f $RPM_BUILD_ROOT/%{_lib}/libcap-ng.la |
| 74 | rm -f $RPM_BUILD_ROOT/%{_lib}/libcap-ng.a |
| 75 | rm -f $RPM_BUILD_ROOT/%{_libdir}/python?.?/site-packages/_capng.a |
| 76 | rm -f $RPM_BUILD_ROOT/%{_libdir}/python?.?/site-packages/_capng.la |
| 77 | |
| 78 | %check |
| 79 | make check |
| 80 | |
| 81 | %clean |
| 82 | rm -rf $RPM_BUILD_ROOT |
| 83 | |
| 84 | %post -p /sbin/ldconfig |
| 85 | |
| 86 | %postun -p /sbin/ldconfig |
| 87 | |
| 88 | |
| 89 | %files |
| 90 | %defattr(-,root,root,-) |
| 91 | %doc COPYING.LIB |
| 92 | %attr(0755,root,root) /%{_lib}/libcap-ng.so.* |
| 93 | |
| 94 | %files devel |
| 95 | %defattr(-,root,root,-) |
| 96 | %attr(0644,root,root) %{_mandir}/man3/* |
| 97 | %attr(0644,root,root) %{_includedir}/cap-ng.h |
| 98 | %attr(0755,root,root) %{_libdir}/libcap-ng.so |
| 99 | %attr(0644,root,root) %{_datadir}/aclocal/cap-ng.m4 |
| 100 | %{_libdir}/pkgconfig/libcap-ng.pc |
| 101 | |
| 102 | %files python |
| 103 | %defattr(-,root,root,-) |
| 104 | %attr(755,root,root) /%{_libdir}/python?.?/site-packages/_capng.so |
| 105 | %{python_sitearch}/capng.py* |
| 106 | |
| 107 | %files utils |
| 108 | %defattr(-,root,root,-) |
| 109 | %doc COPYING |
| 110 | %attr(0755,root,root) %{_bindir}/* |
| 111 | %attr(0644,root,root) %{_mandir}/man8/* |
| 112 | |
| 113 | %changelog |
| 114 | * Tue Jul 24 2012 Steve Grubb <sgrubb@redhat.com> 0.7-1 |
| 115 | - New upstream release |
| 116 | |