1 |
%define major 2 |
2 |
%define libname %mklibname cap %{major} |
3 |
%define develname %mklibname cap -d |
4 |
|
5 |
Summary: Library for getting and setting POSIX.1e capabilities |
6 |
Name: libcap |
7 |
Version: 2.19 |
8 |
Release: %mkrel 7 |
9 |
Group: System/Kernel and hardware |
10 |
License: BSD/GPLv2 |
11 |
URL: http://www.kernel.org/pub/linux/libs/security/linux-privs/ |
12 |
Source0: http://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/%{name}-%{version}.tar.gz |
13 |
Source1: ftp://ftp.kernel.org/pub/linux/libs/security/linux-privs/kernel-2.4/capfaq-0.2.txt |
14 |
Patch0: libcap-2.16-linkage_fix.diff |
15 |
BuildRequires: attr-devel |
16 |
BuildRequires: pam-devel |
17 |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot |
18 |
|
19 |
%description |
20 |
%{name} is a library for getting and setting POSIX.1e (formerly POSIX 6) |
21 |
draft 15 capabilities. |
22 |
|
23 |
%package utils |
24 |
Summary: Administration tools for POSIX.1e capabilities |
25 |
Group: System/Kernel and hardware |
26 |
|
27 |
%description utils |
28 |
%{name} is a library for getting and setting POSIX.1e (formerly POSIX 6) |
29 |
draft 15 capabilities. |
30 |
|
31 |
This package contains utilities to control these capabilities. |
32 |
|
33 |
%package -n pam_cap |
34 |
Summary: PAM module for getting and setting POSIX.1e capabilities |
35 |
Group: System/Libraries |
36 |
|
37 |
%description -n pam_cap |
38 |
The purpose of this module is to enforce inheritable capability sets for a |
39 |
specified user. |
40 |
|
41 |
%package -n %{libname} |
42 |
Summary: Library for getting and setting POSIX.1e capabilities |
43 |
Group: System/Kernel and hardware |
44 |
Provides: %{name} = %{version}-%{release} |
45 |
|
46 |
%description -n %{libname} |
47 |
%{name} is a library for getting and setting POSIX.1e (formerly POSIX 6) |
48 |
draft 15 capabilities. |
49 |
|
50 |
%package -n %{develname} |
51 |
Summary: Development files for %{name} |
52 |
Group: Development/Kernel |
53 |
Requires: %{libname} = %{version}-%{release} |
54 |
Provides: %{name}-devel = %{version}-%{release} |
55 |
Provides: cap-devel = %{version}-%{release} |
56 |
Conflicts: %{mklibname cap 1 -d} |
57 |
|
58 |
%description -n %{develname} |
59 |
Development files (Headers, libraries for static linking, etc) for %{name}. |
60 |
|
61 |
%{name} is a library for getting and setting POSIX.1e (formerly POSIX 6) |
62 |
draft 15 capabilities. |
63 |
|
64 |
Install %{name}-devel if you want to develop or compile applications supporting |
65 |
Linux kernel capabilities. |
66 |
|
67 |
%prep |
68 |
|
69 |
%setup -q |
70 |
%patch0 -p0 |
71 |
|
72 |
install -m644 %{SOURCE1} . |
73 |
|
74 |
perl -pi -e 's,^man_prefix=.*,man_prefix=\$\(prefix)/share,g' Make.Rules |
75 |
|
76 |
%build |
77 |
%serverbuild |
78 |
|
79 |
# voodoo magic |
80 |
LDFLAGS=`rpm --eval %%configure|grep LDFLAGS|cut -d\" -f2` |
81 |
perl -pi -e "s|^CFLAGS\ :=.*|CFLAGS\ :=$CFLAGS|g" Make.Rules |
82 |
perl -pi -e "s|^LDFLAGS\ :=.*|LDFLAGS\ :=$LDFLAGS|g" Make.Rules |
83 |
|
84 |
%make prefix=%{_prefix} |
85 |
|
86 |
%install |
87 |
rm -rf %{buildroot} |
88 |
|
89 |
install -d %{buildroot}%{_sysconfdir}/security |
90 |
|
91 |
make install prefix=%{_prefix} LIBDIR=%{buildroot}/%{_lib} FAKEROOT=%{buildroot} |
92 |
|
93 |
# conflics with man-pages |
94 |
rm -f %{buildroot}%{_mandir}/man2/* |
95 |
|
96 |
install -m0640 pam_cap/capability.conf %{buildroot}%{_sysconfdir}/security/ |
97 |
|
98 |
%clean |
99 |
rm -rf %{buildroot} |
100 |
|
101 |
%files utils |
102 |
%defattr(-,root,root) |
103 |
%doc CHANGELOG License README contrib |
104 |
%{_sbindir}/capsh |
105 |
%{_sbindir}/getcap |
106 |
%{_sbindir}/getpcaps |
107 |
%{_sbindir}/setcap |
108 |
%{_mandir}/man8/getcap.8* |
109 |
%{_mandir}/man8/setcap.8* |
110 |
|
111 |
%files -n pam_cap |
112 |
%defattr(-,root,root) |
113 |
%doc pam_cap/License |
114 |
%attr(0640,root,root) %config(noreplace) %{_sysconfdir}/security/capability.conf |
115 |
/%{_lib}/security/pam_cap.so |
116 |
|
117 |
%files -n %{libname} |
118 |
%defattr(-,root,root) |
119 |
/%{_lib}/lib*.so.%{major}* |
120 |
|
121 |
%files -n %{develname} |
122 |
%defattr(-,root,root) |
123 |
%doc capfaq-0.2.txt |
124 |
%{_includedir}/* |
125 |
/%{_lib}/*.so |
126 |
/%{_lib}/*.a |
127 |
%{_mandir}/man3/* |
128 |
%{_mandir}/man1/capsh.1.* |
129 |
|
130 |
|
131 |
|