1%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
2
3Summary: An alternate posix capabilities library
4Name: libcap-ng
5Version: 0.7
6Release: 1
7License: LGPLv2+
8Group: System Environment/Libraries
9URL: http://people.redhat.com/sgrubb/libcap-ng
10Source0: http://people.redhat.com/sgrubb/libcap-ng/%{name}-%{version}.tar.gz
11BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
12BuildRequires: kernel-headers >= 2.6.11
13BuildRequires: libattr-devel
14
15%description
16Libcap-ng is a library that makes using posix capabilities easier
17
18%package devel
19Summary: Header files for libcap-ng library
20License: LGPLv2+
21Group: Development/Libraries
22Requires: kernel-headers >= 2.6.11
23Requires: %{name} = %{version}-%{release}
24Requires: pkgconfig
25
26%description devel
27The libcap-ng-devel package contains the files needed for developing
28applications that need to use the libcap-ng library.
29
30%package python
31Summary: Python bindings for libcap-ng library
32License: LGPLv2+
33Group: Development/Libraries
34BuildRequires: python-devel swig
35Requires: %{name} = %{version}-%{release}
36
37%description python
38The libcap-ng-python package contains the bindings so that libcap-ng
39and can be used by python applications.
40
41%package utils
42Summary: Utilities for analyzing and setting file capabilities
43License: GPLv2+
44Group: Development/Libraries
45
46%description utils
47The libcap-ng-utils package contains applications to analyze the
48posix capabilities of all the program running on a system. It also
49lets you set the file system based capabilities.
50
51%prep
52%setup -q
53
54%build
55%configure --libdir=/%{_lib}
56make %{?_smp_mflags}
57
58%install
59rm -rf $RPM_BUILD_ROOT
60make DESTDIR="${RPM_BUILD_ROOT}" install
61
62# Move the symlink
63rm -f $RPM_BUILD_ROOT/%{_lib}/%{name}.so
64mkdir -p $RPM_BUILD_ROOT%{_libdir}
65VLIBNAME=$(ls $RPM_BUILD_ROOT/%{_lib}/%{name}.so.*.*.*)
66LIBNAME=$(basename $VLIBNAME)
67ln -s ../../%{_lib}/$LIBNAME $RPM_BUILD_ROOT%{_libdir}/%{name}.so
68
69# Move the pkgconfig file
70mv $RPM_BUILD_ROOT/%{_lib}/pkgconfig $RPM_BUILD_ROOT%{_libdir}
71
72# Remove a couple things so they don't get picked up
73rm -f $RPM_BUILD_ROOT/%{_lib}/libcap-ng.la
74rm -f $RPM_BUILD_ROOT/%{_lib}/libcap-ng.a
75rm -f $RPM_BUILD_ROOT/%{_libdir}/python?.?/site-packages/_capng.a
76rm -f $RPM_BUILD_ROOT/%{_libdir}/python?.?/site-packages/_capng.la
77
78%check
79make check
80
81%clean
82rm -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
117