]> git.pld-linux.org Git - packages/libcap-ng.git/blob - libcap-ng.spec
e4b6cd2a7344deef393f6f087992507f5e08c5be
[packages/libcap-ng.git] / libcap-ng.spec
1 #
2 # Conditional build:
3 %bcond_without  python          # (any) Python bindings
4 %bcond_without  python2         # CPython 2 bindings
5 %bcond_without  python3         # CPython 3 bindings
6 #
7 %if %{without python}
8 %undefine       with_python2
9 %undefine       with_python3
10 %endif
11 Summary:        Next Generation of POSIX capabilities library
12 Summary(pl.UTF-8):      Biblioteka POSIX capabilities nowej generacji
13 Name:           libcap-ng
14 Version:        0.7.9
15 # 0.7.9 is broken, see https://github.com/stevegrubb/libcap-ng/issues/5
16 Release:        0.2
17 License:        LGPL v2.1+ (library), GPL v2+ (utilities)
18 Group:          Libraries
19 Source0:        http://people.redhat.com/sgrubb/libcap-ng/%{name}-%{version}.tar.gz
20 # Source0-md5:  2398d695508fab9ce33668c53a89b0e9
21 Patch0:         vserver.patch
22 URL:            http://people.redhat.com/sgrubb/libcap-ng/
23 BuildRequires:  attr-devel
24 BuildRequires:  automake
25 BuildRequires:  linux-libc-headers >= 7:2.6.33.1
26 %{?with_python2:BuildRequires:  python-devel >= 2}
27 %{?with_python3:BuildRequires:  python3-devel >= 1:3.2}
28 BuildRequires:  rpm-pythonprov
29 BuildRequires:  rpmbuild(macros) >= 1.219
30 %{?with_python:BuildRequires:   swig-python}
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 The libcap-ng library should make programming with POSIX capabilities
35 easier. The library has some utilities to help you analyse a system
36 for apps that may have too much privileges.
37
38 %description -l pl.UTF-8
39 Biblioteka libcap-ng powinna uczynić programowanie POSIX-owych
40 capabilities łatwiejszym. Zawiera narzędzia pomagające w analizie
41 systemu pod kątem aplikacji posiadających zbyt duże uprawnienia.
42
43 %package devel
44 Summary:        Header files for libcap-ng library
45 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki libcap-ng
46 License:        LGPL v2.1+
47 Group:          Development/Libraries
48 Requires:       %{name} = %{version}-%{release}
49 Requires:       linux-libc-headers >= 7:2.6.26
50
51 %description devel
52 Header files for libcap-ng library.
53
54 %description devel -l pl.UTF-8
55 Pliki nagłówkowe biblioteki libcap-ng.
56
57 %package static
58 Summary:        Static libcap-ng library
59 Summary(pl.UTF-8):      Statyczna biblioteka libcap-ng
60 License:        LGPL v2.1+
61 Group:          Development/Libraries
62 Requires:       %{name}-devel = %{version}-%{release}
63
64 %description static
65 Static libcap-ng library.
66
67 %description static -l pl.UTF-8
68 Statyczna biblioteka libcap-ng.
69
70 %package utils
71 Summary:        Utilities for analysing and setting file capabilities
72 Summary(pl.UTF-8):      Narzędzia do analizy i ustawiania capabilities dla plików
73 License:        GPL v2+
74 Group:          Applications/System
75 Requires:       %{name} = %{version}-%{release}
76
77 %description utils
78 This package contains applications to analyse the POSIX capabilities
79 of all the program running on a system. It also lets you set the file
80 system based capabilities.
81
82 %description utils -l pl.UTF-8
83 Ten pakiet zawiera aplikacje do analizy POSIX-owych capabilities
84 wszystkich programów działających w systemie; pozwala także ustawiać
85 capabilities w systemie plików.
86
87 %package -n python-capng
88 Summary:        Python 2 interface to libcap-ng library
89 Summary(pl.UTF-8):      Interfejs Pythona 2 do biblioteki libcap-ng
90 Group:          Libraries/Python
91 Requires:       %{name} = %{version}-%{release}
92
93 %description -n python-capng
94 Python 2 interface to libcap-ng library.
95
96 %description -n python-capng -l pl.UTF-8
97 Interfejs Pythona 2 do biblioteki libcap-ng.
98
99 %package -n python3-capng
100 Summary:        Python 3 interface to libcap-ng library
101 Summary(pl.UTF-8):      Interfejs Pythona 3 do biblioteki libcap-ng
102 Group:          Libraries/Python
103 Requires:       %{name} = %{version}-%{release}
104
105 %description -n python3-capng
106 Python 3 interface to libcap-ng library.
107
108 %description -n python3-capng -l pl.UTF-8
109 Interfejs Pythona 3 do biblioteki libcap-ng.
110
111 %prep
112 %setup -q
113 %patch0 -p1
114
115 # force regeneration after captab.h change in vserver patch
116 %{__rm} bindings/{python,python3}/capng.py
117
118 %build
119 %configure \
120         %{!?with_python2:--without-python} \
121         %{!?with_python3:--without-python3}
122 %{__make}
123
124 %install
125 rm -rf $RPM_BUILD_ROOT
126
127 %{__make} install \
128         DESTDIR=$RPM_BUILD_ROOT
129
130 install -d $RPM_BUILD_ROOT/%{_lib}
131 %{__mv} $RPM_BUILD_ROOT%{_libdir}/libcap-ng.so.* $RPM_BUILD_ROOT/%{_lib}
132 ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcap-ng.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/libcap-ng.so
133
134 %if %{with python2}
135 %py_postclean
136 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/_capng.la
137 %endif
138 %if %{with python3}
139 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/_capng.la
140 %py3_comp $RPM_BUILD_ROOT%{py3_sitedir}
141 %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir}
142 %endif
143
144 %clean
145 rm -rf $RPM_BUILD_ROOT
146
147 %post   -p /sbin/ldconfig
148 %postun -p /sbin/ldconfig
149
150 %files
151 %defattr(644,root,root,755)
152 %doc AUTHORS ChangeLog README
153 %attr(755,root,root) /%{_lib}/libcap-ng.so.*.*.*
154 %attr(755,root,root) %ghost /%{_lib}/libcap-ng.so.0
155
156 %files devel
157 %defattr(644,root,root,755)
158 %attr(755,root,root) %{_libdir}/libcap-ng.so
159 %{_libdir}/libcap-ng.la
160 %{_includedir}/cap-ng.h
161 %{_pkgconfigdir}/libcap-ng.pc
162 %{_aclocaldir}/cap-ng.m4
163 %{_mandir}/man3/capng_*.3*
164
165 %files static
166 %defattr(644,root,root,755)
167 %{_libdir}/libcap-ng.a
168
169 %files utils
170 %defattr(644,root,root,755)
171 %attr(755,root,root) %{_bindir}/captest
172 %attr(755,root,root) %{_bindir}/filecap
173 %attr(755,root,root) %{_bindir}/netcap
174 %attr(755,root,root) %{_bindir}/pscap
175 %{_mandir}/man8/captest.8*
176 %{_mandir}/man8/filecap.8*
177 %{_mandir}/man8/netcap.8*
178 %{_mandir}/man8/pscap.8*
179
180 %if %{with python2}
181 %files -n python-capng
182 %defattr(644,root,root,755)
183 %attr(755,root,root) %{py_sitedir}/_capng.so
184 %{py_sitedir}/capng.py[co]
185 %endif
186
187 %if %{with python3}
188 %files -n python3-capng
189 %defattr(644,root,root,755)
190 %attr(755,root,root) %{py3_sitedir}/_capng.so
191 %{py3_sitedir}/capng.py
192 %{py3_sitedir}/__pycache__/capng.cpython-*.py[co]
193 %endif
This page took 0.079611 seconds and 2 git commands to generate.