11d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
21d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
31d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichSummary: An alternate posix capabilities library
41d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichName: libcap-ng
51d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichVersion: 0.7
61d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichRelease: 1
71d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichLicense: LGPLv2+
81d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichGroup: System Environment/Libraries
91d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichURL: http://people.redhat.com/sgrubb/libcap-ng
101d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichSource0: http://people.redhat.com/sgrubb/libcap-ng/%{name}-%{version}.tar.gz
111d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichBuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
121d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichBuildRequires: kernel-headers >= 2.6.11 
131d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichBuildRequires: libattr-devel
141d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
151d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%description
161d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichLibcap-ng is a library that makes using posix capabilities easier
171d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
181d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%package devel
191d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichSummary: Header files for libcap-ng library
201d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichLicense: LGPLv2+
211d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichGroup: Development/Libraries
221d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichRequires: kernel-headers >= 2.6.11
231d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichRequires: %{name} = %{version}-%{release}
241d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichRequires: pkgconfig
251d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
261d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%description devel
271d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichThe libcap-ng-devel package contains the files needed for developing
281d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichapplications that need to use the libcap-ng library.
291d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
301d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%package python
311d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichSummary: Python bindings for libcap-ng library
321d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichLicense: LGPLv2+
331d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichGroup: Development/Libraries
341d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichBuildRequires: python-devel swig
351d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichRequires: %{name} = %{version}-%{release}
361d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
371d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%description python
381d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichThe libcap-ng-python package contains the bindings so that libcap-ng
391d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichand can be used by python applications.
401d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
411d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%package utils
421d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichSummary: Utilities for analyzing and setting file capabilities
431d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichLicense: GPLv2+
441d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichGroup: Development/Libraries
451d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
461d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%description utils
471d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichThe libcap-ng-utils package contains applications to analyze the
481d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichposix capabilities of all the program running on a system. It also
491d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichlets you set the file system based capabilities.
501d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
511d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%prep
521d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%setup -q
531d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
541d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%build
551d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%configure --libdir=/%{_lib}
561d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichmake %{?_smp_mflags}
571d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
581d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%install
591d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichrm -rf $RPM_BUILD_ROOT
601d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichmake DESTDIR="${RPM_BUILD_ROOT}" install
611d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
621d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich# Move the symlink
631d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichrm -f $RPM_BUILD_ROOT/%{_lib}/%{name}.so
641d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichmkdir -p $RPM_BUILD_ROOT%{_libdir}
651d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichVLIBNAME=$(ls $RPM_BUILD_ROOT/%{_lib}/%{name}.so.*.*.*)
661d1011a3c5049a7f9eef99d22f3704e4367579ccNick KralevichLIBNAME=$(basename $VLIBNAME)
671d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichln -s ../../%{_lib}/$LIBNAME $RPM_BUILD_ROOT%{_libdir}/%{name}.so
681d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
691d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich# Move the pkgconfig file
701d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichmv $RPM_BUILD_ROOT/%{_lib}/pkgconfig $RPM_BUILD_ROOT%{_libdir}
711d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
721d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich# Remove a couple things so they don't get picked up
731d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichrm -f $RPM_BUILD_ROOT/%{_lib}/libcap-ng.la
741d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichrm -f $RPM_BUILD_ROOT/%{_lib}/libcap-ng.a
751d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichrm -f $RPM_BUILD_ROOT/%{_libdir}/python?.?/site-packages/_capng.a
761d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichrm -f $RPM_BUILD_ROOT/%{_libdir}/python?.?/site-packages/_capng.la
771d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
781d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%check
791d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichmake check
801d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
811d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%clean
821d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevichrm -rf $RPM_BUILD_ROOT
831d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
841d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%post -p /sbin/ldconfig
851d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
861d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%postun -p /sbin/ldconfig
871d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
881d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
891d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%files
901d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%defattr(-,root,root,-)
911d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%doc COPYING.LIB
921d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%attr(0755,root,root) /%{_lib}/libcap-ng.so.*
931d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
941d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%files devel
951d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%defattr(-,root,root,-)
961d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%attr(0644,root,root) %{_mandir}/man3/*
971d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%attr(0644,root,root) %{_includedir}/cap-ng.h
981d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%attr(0755,root,root) %{_libdir}/libcap-ng.so
991d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%attr(0644,root,root) %{_datadir}/aclocal/cap-ng.m4
1001d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%{_libdir}/pkgconfig/libcap-ng.pc
1011d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
1021d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%files python
1031d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%defattr(-,root,root,-)
1041d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%attr(755,root,root) /%{_libdir}/python?.?/site-packages/_capng.so
1051d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%{python_sitearch}/capng.py*
1061d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
1071d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%files utils
1081d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%defattr(-,root,root,-)
1091d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%doc COPYING
1101d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%attr(0755,root,root) %{_bindir}/*
1111d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%attr(0644,root,root) %{_mandir}/man8/*
1121d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
1131d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich%changelog
1141d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich* Tue Jul 24 2012 Steve Grubb <sgrubb@redhat.com> 0.7-1
1151d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich- New upstream release
1161d1011a3c5049a7f9eef99d22f3704e4367579ccNick Kralevich
117