+#
+# Conditional build:
+%bcond_with golang # Go components (nothing useful yet?)
+
+%ifnarch %{ix86} %{x8664} %{arm} aarch64 mips64 mips64le ppc64le
+%undefine with_golang
+%endif
Summary: POSIX.1e capability suite
Summary(pl.UTF-8): Wsparcie dla standardu "capability" POSIX.1e
Summary(pt_BR.UTF-8): Biblioteca para leitura e configuração de capabilities.
Name: libcap
-Version: 2.24
-Release: 3
+Version: 2.31
+Release: 1
Epoch: 1
License: GPL v2 or BSD
Group: Applications/System
Source0: https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/%{name}-%{version}.tar.xz
-# Source0-md5: d43ab9f680435a7fff35b4ace8d45b80
+# Source0-md5: 52120c05dc797b01f5a7ae70f4335e96
Patch0: %{name}-make.patch
-Patch1: no-linux-xattr.patch
URL: https://sites.google.com/site/fullycapable/
BuildRequires: attr-devel
+%{?with_golang:BuildRequires: golang}
BuildRequires: pam-devel
BuildRequires: perl-base
BuildRequires: tar >= 1:1.22
%prep
%setup -q
%patch0 -p1
-%patch1 -p1
%build
-%{__make} \
+%{__make} -j1 \
CC="%{__cc}" \
- OPT_CFLAGS="-Iinclude %{rpmcflags} %{rpmcppflags}" \
DEBUG= \
- OPT_LDFLAGS="%{rpmldflags}" \
- LDLIBS="-L../libcap -lcap"
+ %{!?with_golang:GOLANG=0} \
+ OPT_CFLAGS="-Iinclude %{rpmcflags} %{rpmcppflags}" \
+ OPT_LDFLAGS="%{rpmldflags}"
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} install \
- RAISE_SETFCAP=no \
+%{__make} -j1 install \
FAKEROOT=$RPM_BUILD_ROOT \
+ %{!?with_golang:GOLANG=0} \
+ RAISE_SETFCAP=no \
lib=%{_lib}
+cp -p libcap/libpsx.a $RPM_BUILD_ROOT%{_libdir}
+
install -d $RPM_BUILD_ROOT/%{_lib}/security
install -p pam_cap/pam_cap.so $RPM_BUILD_ROOT/%{_lib}/security
install -d $RPM_BUILD_ROOT/etc/security
ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcap.so.*.*) \
$RPM_BUILD_ROOT%{_libdir}/libcap.so
%{__rm} $RPM_BUILD_ROOT/%{_lib}/libcap.so
-%{__mv} $RPM_BUILD_ROOT/%{_lib}/libcap.a $RPM_BUILD_ROOT%{_libdir}
+%{__mv} $RPM_BUILD_ROOT/%{_lib}/lib{cap,psx}.a $RPM_BUILD_ROOT%{_libdir}
chmod a+x $RPM_BUILD_ROOT/%{_lib}/*.so*
%attr(755,root,root) %{_sbindir}/capsh
%attr(755,root,root) %{_sbindir}/getcap
%attr(755,root,root) %{_sbindir}/getpcaps
+# TODO: cap_setfcap=i
%attr(755,root,root) %{_sbindir}/setcap
%{_mandir}/man1/capsh.1*
%{_mandir}/man8/getcap.8*
+%{_mandir}/man8/getpcaps.8*
%{_mandir}/man8/setcap.8*
%files libs
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libcap.so
+%{_libdir}/libpsx.a
%{_includedir}/sys/capability.h
+%{_includedir}/sys/psx_syscall.h
%{_pkgconfigdir}/libcap.pc
+%{_pkgconfigdir}/libpsx.pc
%{_mandir}/man3/libcap*.3*
+%{_mandir}/man3/libpsx*.3*
%{_mandir}/man3/cap_*
%{_mandir}/man3/capgetp.3*
%{_mandir}/man3/capsetp.3*
+%{_mandir}/man3/psx*.3*
%files static
%defattr(644,root,root,755)