SHA256
3
0
forked from pool/libcap
libcap/libcap.spec

134 lines
3.8 KiB
RPMSpec

#
# spec file for package libcap (Version 2.16)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: libcap
License: BSD3c
Group: System/Libraries
AutoReqProv: on
Summary: Library for Capabilities (linux-privs) Support
Version: 2.16
Release: 6
Source: ftp://ftp.de.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-%{version}.tar.bz2
Source2: baselibs.conf
Patch: libcap-u64-typedef-fix.diff
#URL: http://www.kernel.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libattr-devel
%if 0%{?suse_version} > 1030
BuildRequires: fdupes
%endif
%define debug_package_requires libcap2 = %{version}-%{release}
%description
Capabilities are a measure to limit the omnipotence of the superuser.
Currently a program started by root or setuid root has the power to do
anything. Capabilities (Linux-Privs) provide a more fine-grained access
control. Without kernel patches, you can use this library to drop
capabilities within setuid binaries. If you use patches, this can be
done automatically by the kernel.
%package -n libcap2
License: BSD3c
Summary: Library for Capabilities (linux-privs) Support
Group: System/Libraries
%description -n libcap2
Capabilities are a measure to limit the omnipotence of the superuser.
Currently a program started by root or setuid root has the power to do
anything. Capabilities (Linux-Privs) provide a more fine-grained access
control. Without kernel patches, you can use this library to drop
capabilities within setuid binaries. If you use patches, this can be
done automatically by the kernel.
%package devel
License: BSD3c
Summary: Development files for libcap
Group: Development/Libraries/C and C++
Requires: glibc-devel libcap2 = %{version}
%description devel
Development files (Headers, libraries for static linking, etc) for
libcap.
libcap is a library for getting and setting POSIX.1e (formerly POSIX 6)
draft 15 capabilities.
Install libcap-devel if you want to develop or compile applications
using libcap.
%package progs
License: BSD3c
Summary: Libcap utility programs
Group: System/Filesystems
%description progs
This package contains utility programs handling capabilities via
libcap.
%prep
%setup -q
%patch -p1
%build
# lib=%{_lib} make %{?_smp_mflags} COPTFLAG="$RPM_OPT_FLAGS"
lib=%{_lib} make %{?_smp_mflags} DEBUG="-g $RPM_OPT_FLAGS"
%install
make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=$RPM_BUILD_ROOT/%{_lib} MANDIR=$RPM_BUILD_ROOT%{_mandir}
# remove unneeded fi
rm -f $RPM_BUILD_ROOT/%{_lib}/*.*a
# move *.so file to libdir and relink
rm -f $RPM_BUILD_ROOT/%{_lib}/*.so
mkdir -p $RPM_BUILD_ROOT%{_libdir}
ln -s /%{_lib}/libcap.so.2 $RPM_BUILD_ROOT%{_libdir}/libcap.so
%if 0%{?suse_version} > 1030
%fdupes -s $RPM_BUILD_ROOT
%endif
%post -n libcap2 -p /sbin/ldconfig
%postun -n libcap2 -p /sbin/ldconfig
%files -n libcap2
%defattr(-,root,root)
%attr(755,root,root) /%{_lib}/libcap.so.*
%files progs
%defattr(-,root,root)
%{_mandir}/man8/*
/sbin/*
%files devel
%defattr(-,root,root)
%doc License README CHANGELOG
%{_includedir}/sys/capability.h
%{_libdir}/*.so
%{_mandir}/man3/*
%changelog