X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=libcap.spec;h=f4813973f57ba610e804253bf232a35cda4b1614;hb=a097656b3d21be0af4ef96155b77bf982c57f63b;hp=39e7d3cdd6f8c12fdb8b88a16455786a8011bcc7;hpb=9be0f7795d8d9d0d113251221eec111738b4936b;p=packages%2Flibcap.git diff --git a/libcap.spec b/libcap.spec index 39e7d3c..f481397 100644 --- a/libcap.spec +++ b/libcap.spec @@ -1,18 +1,29 @@ +# +# 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.10 +Version: 2.58 Release: 1 Epoch: 1 -License: GPL or BSD +License: GPL v2 or BSD Group: Applications/System -Source0: ftp://ftp.kernel.org/pub/linux/libs/security/linux-privs/libcap2/%{name}-%{version}.tar.gz -# Source0-md5: d2351abe273a68ffdb5fd50c3ea4572a -Patch0: %{name}-make.patch -URL: http://www.kernel.org/pub/linux/libs/security/linux-privs/ +Source0: https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/%{name}-%{version}.tar.xz +# Source0-md5: 09b7b62c7b69f9a58098efa7b1d34f64 +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 +BuildRequires: xz +Requires: %{name}-libs = %{epoch}:%{version}-%{release} BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _sbindir /sbin @@ -28,12 +39,24 @@ Biblioteka, programy oraz strony manuala zawierające implementację %description -l pt_BR.UTF-8 Biblioteca para leitura e configuração de capabilities. +%package libs +Summary: libcap library +Summary(pl.UTF-8): Biblioteka libcap +Group: Libraries +Conflicts: libcap < 1:2.16-2 + +%description libs +libcap library. + +%description libs -l pl.UTF-8 +Biblioteka libcap. + %package devel Summary: Header files and development documentation for libcap Summary(pl.UTF-8): Pliki nagłówkowe i dokumentacja do libcap Summary(pt_BR.UTF-8): Arquivos de desenvolvimento para capabilities Group: Development/Libraries -Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: %{name}-libs = %{epoch}:%{version}-%{release} %description devel Header files and development documentation for libcap. @@ -60,7 +83,7 @@ Statyczna biblioteka libcap. Summary: Capability module for PAM Summary(pl.UTF-8): Moduł PAM capability Group: Libraries -Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: %{name}-libs = %{epoch}:%{version}-%{release} Requires: pam %description -n pam-pam_cap @@ -71,42 +94,46 @@ Moduł PAM capability wymuszający dziedziczone zbiory uprawnień. %prep %setup -q -%patch0 -p1 %build -%{__make} \ +LDFLAGS="%{rpmldflags}" \ +%{__make} -j1 \ CC="%{__cc}" \ - COPTFLAG="%{rpmcflags}" \ + COPTS="%{rpmcflags} %{rpmcppflags}" \ + BUILD_CC="%{__cc}" \ + BUILD_COPTS="%{rpmcflags} %{rpmcppflags}" \ DEBUG= \ - LDFLAGS="%{rpmldflags}" + %{!?with_golang:GOLANG=0} %install rm -rf $RPM_BUILD_ROOT -%{__make} install \ +%{__make} -j1 install \ FAKEROOT=$RPM_BUILD_ROOT \ + %{!?with_golang:GOLANG=0} \ + PKGCONFIGDIR=%{_pkgconfigdir} \ + RAISE_SETFCAP=no \ lib=%{_lib} install -d $RPM_BUILD_ROOT/%{_lib}/security -install pam_cap/pam_cap.so $RPM_BUILD_ROOT/%{_lib}/security +install -p pam_cap/pam_cap.so $RPM_BUILD_ROOT/%{_lib}/security install -d $RPM_BUILD_ROOT/etc/security -install pam_cap/capability.conf $RPM_BUILD_ROOT/etc/security +cp -a pam_cap/capability.conf $RPM_BUILD_ROOT/etc/security install -d $RPM_BUILD_ROOT%{_libdir} -install libcap/libcap.a $RPM_BUILD_ROOT%{_libdir} -ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/libcap.so.*.*) \ - $RPM_BUILD_ROOT%{_libdir}/libcap.so -rm $RPM_BUILD_ROOT/%{_lib}/libcap.so - -# newer versions exist in man-pages -# and these syscalls are specific to Linux/glibc, not libcap -rm -f $RPM_BUILD_ROOT%{_mandir}/man2/cap{get,set}.2 +for libname in libcap libpsx ; do + ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/${libname}.so.*.*) \ + $RPM_BUILD_ROOT%{_libdir}/${libname}.so + %{__rm} $RPM_BUILD_ROOT/%{_lib}/${libname}.so + %{__mv} $RPM_BUILD_ROOT/%{_lib}/${libname}.a $RPM_BUILD_ROOT%{_libdir} +done +chmod a+x $RPM_BUILD_ROOT/%{_lib}/*.so* %clean rm -rf $RPM_BUILD_ROOT -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig %files %defattr(644,root,root,755) @@ -114,26 +141,49 @@ rm -rf $RPM_BUILD_ROOT %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 -%attr(755,root,root) /%{_lib}/libcap.so.*.* -%attr(755,root,root) %ghost /%{_lib}/libcap.so.2 +%{_mandir}/man1/capsh.1* +%{_mandir}/man8/captree.8* %{_mandir}/man8/getcap.8* +%{_mandir}/man8/getpcaps.8* %{_mandir}/man8/setcap.8* +%files libs +%defattr(644,root,root,755) +%attr(755,root,root) /%{_lib}/libcap.so.*.* +%attr(755,root,root) %ghost /%{_lib}/libcap.so.2 +%attr(755,root,root) /%{_lib}/libpsx.so.*.* +%attr(755,root,root) %ghost /%{_lib}/libpsx.so.2 + %files devel %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/libcap.so +%attr(755,root,root) %{_libdir}/libpsx.so %{_includedir}/sys/capability.h -%{_mandir}/man3/cap_* +%{_includedir}/sys/psx_syscall.h +%{_pkgconfigdir}/libcap.pc +%{_pkgconfigdir}/libpsx.pc +%{_mandir}/man3/libcap*.3* +%{_mandir}/man3/libpsx*.3* +%{_mandir}/man3/cap_*.3* %{_mandir}/man3/capgetp.3* %{_mandir}/man3/capsetp.3* +%{_mandir}/man3/psx_*.3* %files static %defattr(644,root,root,755) %{_libdir}/libcap.a +%{_libdir}/libpsx.a %files -n pam-pam_cap %defattr(644,root,root,755) %doc pam_cap/License %attr(755,root,root) /%{_lib}/security/pam_cap.so %config(noreplace) %verify(not md5 mtime size) /etc/security/capability.conf + +# TODO: golang - where? +# installs under +#%{_datadir}/gocode/src/kernel.org/pub/linux/libs/security/libcap +# or should we use +#%{_libdir}/golang/src/libcap