From 5eafb511e3879251dbc8e14ec280267e9e9b82c9 Mon Sep 17 00:00:00 2001 From: Raphael Groner Date: Mar 02 2018 23:37:46 +0000 Subject: fix FTBFS --- diff --git a/ecryptfs-utils.spec b/ecryptfs-utils.spec index a3a459c..951bb94 100644 --- a/ecryptfs-utils.spec +++ b/ecryptfs-utils.spec @@ -1,11 +1,13 @@ -%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} -%global _libdir /%{_lib} -%global _sbindir /sbin +%bcond_with python3 + +%global pydesc \ +The package contains a module that permits\ +applications written in the Python programming language to use\ +the interface supplied by the %{name} library. Name: ecryptfs-utils Version: 111 -Release: 7%{?dist} +Release: 8%{?dist} Summary: The eCryptfs mount helper and support libraries License: GPLv2+ URL: https://launchpad.net/ecryptfs @@ -73,12 +75,15 @@ Patch925: %{name}-111-nopasswd.patch # allow building with -Werror Patch999: %{name}-75-werror.patch -Requires: keyutils, cryptsetup-luks, util-linux, gettext +BuildRequires: python-rpm-macros +BuildRequires: swig >= 1.3.31 BuildRequires: libgcrypt-devel keyutils-libs-devel openssl-devel pam-devel BuildRequires: trousers-devel nss-devel desktop-file-utils intltool BuildRequires: pkcs11-helper-devel BuildRequires: automake autoconf libtool glib2-devel gettext-devel perl-podlators libattr-devel +Requires: keyutils, cryptsetup-luks, util-linux, gettext + %description eCryptfs is a stacked cryptographic filesystem that ships in Linux kernel versions 2.6.19 and above. This package provides the mount @@ -96,18 +101,33 @@ Requires: pkgconfig %description devel Userspace development files for eCryptfs. -%package python + +%package -n python2-%{name} Summary: Python bindings for the eCryptfs utils Requires: %{name} = %{version}-%{release} -BuildRequires: python python-devel swig >= 1.3.31 +BuildRequires: python2-devel +Provides: %{name}-python +Obsoletes: %{name}-python < %{version}-%{release} +%{?python_provide:%python_provide python2-%{name}} + +%description -n python2-%{name} %pydesc + + +%package -n python%{python3_pkgversion}-%{name} +Summary: Python bindings for the eCryptfs utils +Requires: %{name} = %{version}-%{release} +BuildRequires: python%{python3_pkgversion}-devel +Provides: %{name}-python +Obsoletes: %{name}-python < %{version}-%{release} +%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}} + +%description -n python%{python3_pkgversion}-%{name} %pydesc -%description python -The %{name}-python package contains a module that permits -applications written in the Python programming language to use -the interface supplied by the %{name} library. %prep -%setup -q +%setup -qc +pushd %{name}-%{version} + %patch1 -p0 -b .openssl11 %patch92 -p1 -b .nocryptdisks @@ -133,24 +153,61 @@ the interface supplied by the %{name} library. sed -i -r 's:^_syslog\(LOG:ecryptfs_\0:' src/pam_ecryptfs/pam_ecryptfs.c +# snprintf directive output may be truncated +sed -i -r 's:(snprintf.*"\%)(s/\%)(s"):\1.42\2.23\3:' \ + tests/kernel/inotify/test.c + +# fix usr-move +sed -i -r 's:(rootsbindir=).*:\1"%{_sbindir}":' configure.ac + +# don't confuse rpmbuild to find and install everything at right places +mv -t.. COPYING AUTHORS NEWS THANKS doc/ README +ln -s -t. ../doc ../README +popd + +mv %{name}-%{version} py2 +%if %{with python3} +cp -a py2 py3 +%endif + + %build +# rhbz#1537244, avoid unversioned python executable +export PYTHON=%{__python2} # openssl 1.1 marks some functions as deprecated export CFLAGS="$RPM_OPT_FLAGS -Werror -Wtype-limits -Wno-unused -Wno-error=deprecated-declarations" -#we're modifing Makefile.am -autoreconf -fiv -%configure --disable-rpath --enable-tspi --enable-nss --enable-pkcs11-helper --enable-tests +for folder in $(find . -name py\* -type d |sort -n) ; do + pushd $folder + + #we're modifing Makefile.am + autoreconf -fiv + %configure --enable-pywrap --enable-tspi --enable-nss \ + --enable-pkcs11-helper --enable-tests --with-pamdir=%{_libdir}/security -#disable rpath -sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool -sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool + popd + %make_build -C $folder + + # some hackery to let next configure know about another python version + %if %{with python3} + export PYTHON_VERSION=3 + export PYTHON=%{__python3} + # bug in configure fails to detect python3 + export PYTHON_NOVERSIONCHECK=1 + export CFLAGS='$(echo \${CFLAGS}) -I '$(find %{_includedir} -name python3\* -type d) + %endif +done -%make_build %install -%make_install +%make_install -C py2 +%if %{with python3} +%make_install -C py3 +%endif + find $RPM_BUILD_ROOT/ -name '*.la' -print -delete rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name} + #install files Makefile forgot to install install -p -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{name}/ecryptfs-mount-private.png printf "Encoding=UTF-8\n" >>$RPM_BUILD_ROOT/%{_datadir}/%{name}/ecryptfs-mount-private.desktop @@ -159,29 +216,34 @@ printf "Icon=%{_datadir}/%{name}/ecryptfs-mount-private.png\n" >>$RPM_BUILD_ROOT printf "Icon=%{_datadir}/%{name}/ecryptfs-mount-private.png\n" >>$RPM_BUILD_ROOT/%{_datadir}/%{name}/ecryptfs-setup-private.desktop sed -i 's|^_||' $RPM_BUILD_ROOT/%{_datadir}/%{name}/ecryptfs-mount-private.desktop sed -i 's|^_||' $RPM_BUILD_ROOT/%{_datadir}/%{name}/ecryptfs-setup-private.desktop -desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/%{name}/ecryptfs-mount-private.desktop -desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/%{name}/ecryptfs-setup-private.desktop chmod +x $RPM_BUILD_ROOT%{_datadir}/%{name}/ecryptfs-mount-private.desktop chmod +x $RPM_BUILD_ROOT%{_datadir}/%{name}/ecryptfs-setup-private.desktop -touch -r src/desktop/ecryptfs-mount-private.desktop \ - $RPM_BUILD_ROOT%{_datadir}/%{name}/ecryptfs-mount-private.desktop -touch -r src/desktop/ecryptfs-setup-private.desktop \ - $RPM_BUILD_ROOT%{_datadir}/%{name}/ecryptfs-mount-private.desktop +for file in $(find py2/src/desktop -name ΒΈ*.desktop) ; do + touch -r $file $RPM_BUILD_ROOT%{_datadir}/%{name}/$(basename $file) +done rm -f $RPM_BUILD_ROOT/%{_datadir}/%{name}/ecryptfs-record-passphrase #we need ecryptfs kernel module mkdir -p $RPM_BUILD_ROOT/usr/lib/modules-load.d/ -echo -e "# ecryptfs module is needed before ecryptfs mount, so mount helper can \n# check for file name encryption support\necryptfs" >$RPM_BUILD_ROOT/usr/lib/modules-load.d/ecryptfs.conf +echo -e "# ecryptfs module is needed before ecryptfs mount, so mount helper can \n# check for file name encryption support\necryptfs" \ + >$RPM_BUILD_ROOT/usr/lib/modules-load.d/ecryptfs.conf %find_lang %{name} + %check -if ldd $RPM_BUILD_ROOT%{_sbindir}/umount.ecryptfs | grep -q '/usr/' +desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/%{name}/*.desktop + +if ldd $RPM_BUILD_ROOT%{_sbindir}/umount.ecryptfs | grep -q '%{_prefix}/' then exit 1 fi -export LD_LIBRARY_PATH=$(pwd)/src/libecryptfs/.libs -make check + +for folder in $(find . -name py\* -type d) ; do + export LD_LIBRARY_PATH=${folder}/src/libecryptfs/.libs + make check -C $folder +done + %pre groupadd -r -f ecryptfs @@ -189,17 +251,18 @@ groupadd -r -f ecryptfs %post /sbin/ldconfig if [ $1 -eq 1 ] ; then - # Initial installation - authconfig --enableecryptfs --update + # Initial installation + authconfig --enableecryptfs --update fi %postun /sbin/ldconfig if [ $1 -eq 0 ] ; then - # Package removal, not upgrade - authconfig --disableecryptfs --update + # Package removal, not upgrade + authconfig --disableecryptfs --update fi + %files -f %{name}.lang %license COPYING %doc README AUTHORS NEWS THANKS @@ -230,7 +293,7 @@ fi %{_libdir}/ecryptfs %{_libdir}/libecryptfs.so.* %{_libdir}/security/pam_ecryptfs.so -/usr/lib/modules-load.d/ecryptfs.conf +%{_prefix}/lib/modules-load.d/ecryptfs.conf %dir %{_datadir}/%{name} %{_datadir}/%{name}/ecryptfs-mount-private.txt %{_datadir}/%{name}/ecryptfs-mount-private.desktop @@ -266,17 +329,23 @@ fi %{_libdir}/pkgconfig/libecryptfs.pc %{_includedir}/ecryptfs.h -%files python -%dir %{python_sitelib}/%{name} -%{python_sitelib}/%{name}/libecryptfs.py -%{python_sitelib}/%{name}/libecryptfs.pyc -%{python_sitelib}/%{name}/libecryptfs.pyo -%dir %{python_sitearch}/%{name} -%{python_sitearch}/%{name}/_libecryptfs.so.0 -%{python_sitearch}/%{name}/_libecryptfs.so.0.0.0 -%{python_sitearch}/%{name}/_libecryptfs.so +%files -n python2-%{name} +%{python2_sitearch}/%{name}/ +%{python2_sitelib}/%{name}/ + +%if %{with python3} +%files -n python%{python3_pkgversion}-%{name} +%{python3_sitearch}/%{name}/ +%{python3_sitelib}/%{name}/ +%endif + %changelog +* Fri Mar 02 2018 Raphael Groner - 111-8 +- avoid unversioned python executable +- add python3 subpackage (experimental, disabled due to a bug with gcc) +- optimize a little bit + * Wed Aug 02 2017 Fedora Release Engineering - 111-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild