cc85c8d698923a3c0945c353bf14040020f38710
[platform/upstream/libcap.git] / packaging / libcap.spec
1 Name:           libcap
2 Version:        2.24
3 Release:        1
4 License:        BSD-3-Clause and GPL-2.0
5 Summary:        Library for Capabilities (linux-privs) Support
6 Url:            https://sites.google.com/site/fullycapable/
7 Group:          Base/Libraries
8 Source:         %{name}-%{version}.tar.xz
9 Source2:        baselibs.conf
10 Source1001:     libcap.manifest
11 BuildRequires:  fdupes
12 BuildRequires:  libattr-devel
13 %define debug_package_requires libcap2 = %{version}-%{release}
14
15 %description
16 Capabilities are a measure to limit the omnipotence of the superuser.
17 Currently a program started by root or setuid root has the power to do
18 anything. Capabilities (Linux-Privs) provide a more fine-grained access
19 control. Without kernel patches, you can use this library to drop
20 capabilities within setuid binaries. If you use patches, this can be
21 done automatically by the kernel.
22
23 %package devel
24 Summary:        Development files for libcap
25 Requires:       glibc-devel
26 Requires:       libcap = %{version}
27
28 %description devel
29 Development files (Headers, libraries for static linking, etc) for
30 libcap.
31
32 libcap is a library for getting and setting POSIX.1e (formerly POSIX 6)
33 draft 15 capabilities.
34
35 Install libcap-devel if you want to develop or compile applications
36 using libcap.
37
38 %package tools
39 Summary:        Libcap utility programs
40 Provides:       %{name}-progs
41
42 %description tools
43 This package contains utility programs handling capabilities via
44 libcap.
45
46 %prep
47 %setup -q
48 cp %{SOURCE1001} .
49
50 %build
51 lib=%{_lib} make %{?_smp_mflags} DEBUG="-g %{optflags}"
52
53 %install
54 make install prefix=%{_prefix} DESTDIR=%{buildroot} LIBDIR=%{buildroot}/%{_lib} MANDIR=%{buildroot}%{_mandir} PKGCONFIGDIR=%{buildroot}%{_libdir}/pkgconfig RAISE_SETFCAP=no
55 # remove unneeded files
56 rm -f %{buildroot}/%{_lib}/*.*a
57 # move *.so file to libdir and relink
58 rm -f %{buildroot}/%{_lib}/*.so
59 mkdir -p %{buildroot}%{_libdir}
60 ln -s /%{_lib}/libcap.so.2 %{buildroot}%{_libdir}/libcap.so
61 %fdupes -s %{buildroot}
62
63 %post -p /sbin/ldconfig
64
65 %postun -p /sbin/ldconfig
66
67 %files
68 %manifest %{name}.manifest
69 %defattr(-,root,root)
70 %license License
71 %attr(755,root,root) /%{_lib}/libcap.so.*
72
73 %files tools
74 %manifest %{name}.manifest
75 %defattr(-,root,root)
76 %{_mandir}/man1/*
77 %{_mandir}/man8/*
78 %{_prefix}/sbin/*
79
80 %files devel
81 %manifest %{name}.manifest
82 %defattr(-,root,root)
83 %{_includedir}/sys/capability.h
84 %{_libdir}/*.so
85 %{_libdir}/pkgconfig/*.pc
86 %{_mandir}/man3/*
87
88 %changelog