File libcap-ng.spec of Package libcap-ng
x
1
#
2
# spec file for package libcap-ng (Version 0.6.5)
3
#
4
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via http://bugs.opensuse.org/
16
#
17
18
19
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
20
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
21
22
Summary: An alternate POSIX capabilities library
23
24
Name: libcap-ng
25
Version: 0.6.5
26
Release: 1
27
%define soname 0
28
%define rname libcap-ng
29
License: LGPLv2+
30
Group: System/Libraries
31
Url: http://people.redhat.com/sgrubb/libcap-ng
32
# http://people.redhat.com/sgrubb/libcap-ng/libcap-ng-%{version}.tar.gz
33
Source0: libcap-ng-%{version}.tar.bz2
34
Source1: pre_checkin.sh
35
Source2: baselibs.conf
36
Source99: libcap-ng.rpmlintrc
37
BuildRoot: %{_tmppath}/%{name}-%{version}-build
38
BuildRequires: kernel-headers >= 2.6.11
39
BuildRequires: libattr-devel pkg-config python-base
40
41
%description
42
Libcap-ng is a library that makes using posix capabilities easier
43
44
%if "%{name}" == "%{rname}"
45
46
%package -n %{name}%{soname}
47
48
Summary: An alternate POSIX capabilities library
49
License: LGPLv2+
50
Group: System/Libraries
51
52
%description -n %{name}%{soname}
53
Libcap-ng is a library that makes using posix capabilities easier
54
55
%package devel
56
Summary: Header files for libcap-ng library
57
License: LGPLv2+
58
Group: Development/Libraries/C and C++
59
Requires: kernel-headers >= 2.6.11
60
Requires: %{name}%{soname} = %{version}
61
Requires: pkgconfig
62
63
%description devel
64
The libcap-ng-devel package contains the files needed for developing
65
applications that need to use the libcap-ng library.
66
67
%package utils
68
Summary: Utilities for analysing and setting file capabilities
69
License: GPLv2+
70
Group: System/Base
71
72
%description utils
73
The libcap-ng-utils package contains applications to analyse the
74
posix capabilities of all the program running on a system. It also
75
lets you set the file system based capabilities.
76
77
%else
78
79
%package -n python-capng
80
Summary: Python bindings for libcap-ng library
81
License: LGPLv2+
82
Group: Development/Libraries/Python
83
BuildRequires: python-devel swig
84
Requires: %{rname}%{soname} = %{version}
85
%py_requires
86
87
%description -n python-capng
88
The libcap-ng-python package contains the bindings so that libcap-ng
89
and can be used by python applications.
90
91
%endif
92
93
%prep
94
%setup -q -n %{rname}-%{version}
95
96
%build
97
%configure --libdir="/%{_lib}"
98
%__make %{?_smp_mflags}
99
100
%install
101
%__make DESTDIR="%{buildroot}" install
102
103
# Move the symlink
104
%__rm -f "%{buildroot}/%{_lib}/%{rname}.so"
105
%__mkdir_p "%{buildroot}%{_libdir}"
106
VLIBNAME=$(/bin/ls -1 "%{buildroot}/%{_lib}/%{rname}.so".*.*.*)
107
[ -n "$VLIBNAME" ] || { echo "ERROR: failed to find %{buildroot}/%{_lib}/%{rname}.so.*.*.*" >&2; exit 1; }
108
LIBNAME=$(basename "$VLIBNAME")
109
%__ln_s "../../%{_lib}/$LIBNAME" "%{buildroot}%{_libdir}/%{rname}.so"
110
111
# Move the pkgconfig file
112
%__install -d "%{buildroot}%{_libdir}"
113
%__mv "%{buildroot}/%{_lib}/pkgconfig" "%{buildroot}%{_libdir}/pkgconfig"
114
115
# Remove a couple things so they don't get picked up
116
%__rm -f "%{buildroot}/%{_lib}/%{rname}".{a,la}
117
%__rm -f "%{buildroot}%{python_sitearch}/_capng".{a,la}
118
119
%if "%{name}" == "%{rname}-python"
120
%__rm -f %{buildroot}/%{_lib}/lib*.so*
121
%__rm -f %{buildroot}/%{_libdir}/lib*.so*
122
%__rm -rf %{buildroot}/%{_libdir}/pkgconfig
123
%__rm -rf %{buildroot}/%{_bindir}
124
%__rm -rf %{buildroot}/%{_mandir}
125
%__rm -rf %{buildroot}/%{_includedir}
126
%__rm -rf %{buildroot}/%{_datadir}/aclocal
127
%endif
128
129
%clean
130
%{?buildroot:%__rm -rf "%{buildroot}"}
131
132
%if "%{name}" == "%{rname}"
133
134
%post -n %{name}%{soname} -p /sbin/ldconfig
135
136
%postun -n %{name}%{soname} -p /sbin/ldconfig
137
138
%files -n %{name}%{soname}
139
%defattr(-,root,root,-)
140
%doc COPYING.LIB
141
%attr(0755,root,root) /%{_lib}/%{rname}.so.%{soname}
142
%attr(0755,root,root) /%{_lib}/%{rname}.so.%{soname}.*
143
144
%files devel
145
%defattr(-,root,root,-)
146
%attr(0644,root,root) %{_mandir}/man3/*.3%{ext_man}
147
%attr(0644,root,root) %{_includedir}/cap-ng.h
148
%attr(0755,root,root) %{_libdir}/%{rname}.so
149
%attr(0644,root,root) %{_datadir}/aclocal/cap-ng.m4
150
%{_libdir}/pkgconfig/%{rname}.pc
151
152
%files utils
153
%defattr(-,root,root,-)
154
%doc COPYING
155
%attr(0755,root,root) %{_bindir}/captest
156
%attr(0755,root,root) %{_bindir}/filecap
157
%attr(0755,root,root) %{_bindir}/netcap
158
%attr(0755,root,root) %{_bindir}/pscap
159
%attr(0644,root,root) %{_mandir}/man8/*.8%{ext_man}
160
161
%else
162
163
%files -n python-capng
164
%defattr(-,root,root,-)
165
%attr(755,root,root) %{python_sitearch}/_capng.so
166
%{python_sitearch}/capng.py*
167
168
%endif
169
170
%changelog
171