File ecryptfs-utils.spec of Package ecryptfs-utils

# spec file for package ecryptfs-utils
# Copyright (c) 2018 SUSE LINUX 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

%define lname   libecryptfs1
Name:           ecryptfs-utils
Version:        111
Release:        0
Summary:        Userspace Utilities for ecryptfs
License:        GPL-2.0
Group:          Productivity/Security
Source1:        baselibs.conf
Source2:        ecryptfs-mount-private.png
# PATCH-FIX-OPENSUSE fix for systemd and no UUID in fstab
Patch0:         ecryptfs-setup-swap-SuSE.patch
# PATCH-FIX-OPENSUSE build with -fpie/-pie
Patch1:         ecryptfs-utils-src-utils-Makefile.patch
Patch2:         ecryptfs-utils-openssl11.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  fdupes
BuildRequires:  gtk2-devel
BuildRequires:  intltool
BuildRequires:  keyutils-devel
BuildRequires:  keyutils-libs
BuildRequires:  libgcrypt-devel
BuildRequires:  libtool
BuildRequires:  mozilla-nss-devel
BuildRequires:  openssl-devel
BuildRequires:  pam-config
BuildRequires:  pam-devel
BuildRequires:  pkcs11-helper-devel
BuildRequires:  pkg-config
#BuildRequires:  python3-devel
#BuildRequires:  swig
BuildRequires:  trousers-devel
BuildRequires:  update-desktop-files
Requires(pre):  pam-config
Requires(pre):  permissions
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

A stacked cryptographic filesystem for Linux.

%package -n %{lname}
Summary:        Shared library for %{name}
Group:          System/Libraries

%description -n %{lname}
A stacked cryptographic filesystem for Linux.

%package devel
Summary:        Development files for %{name}
Group:          Development/Languages/C and C++
Requires:       %{lname} = %{version}

%description devel
A stacked cryptographic filesystem for Linux.

%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p0

export RPM_OPT_FLAGS="%{optflags} -fno-strict-aliasing"
autoreconf -fiv
%configure \
	--docdir=%{_defaultdocdir}/%{name} \
	--disable-static \
	--disable-pywrap \
	--enable-tspi \
	--enable-pkcs11-helper \
make %{?_smp_mflags}

make %{?_smp_mflags} check

make DESTDIR=%{buildroot} install %{?_smp_mflags}
mkdir -p %{buildroot}/%{_datadir}/applications
install -m644 %{SOURCE2} %{buildroot}%{_datadir}/%{name}/ecryptfs-mount-private.png
printf "Encoding=UTF-8\n" >>%{buildroot}/%{_datadir}/%{name}/ecryptfs-mount-private.desktop
printf "Encoding=UTF-8\n" >>%{buildroot}/%{_datadir}/%{name}/ecryptfs-setup-private.desktop
printf "Icon=%{_datadir}/%{name}/ecryptfs-mount-private.png\n" >>%{buildroot}/%{_datadir}/%{name}/ecryptfs-mount-private.desktop
printf "Icon=%{_datadir}/%{name}/ecryptfs-mount-private.png\n" >>%{buildroot}/%{_datadir}/%{name}/ecryptfs-setup-private.desktop
sed -i 's|^_||' %{buildroot}/%{_datadir}/%{name}/ecryptfs-mount-private.desktop
sed -i 's|^_||' %{buildroot}/%{_datadir}/%{name}/ecryptfs-setup-private.desktop
mv %{buildroot}/%{_datadir}/%{name}/ecryptfs-setup-private.desktop %{buildroot}/%{_datadir}/applications
%suse_update_desktop_file %{buildroot}/%{_datadir}/%{name}/ecryptfs-mount-private.desktop
%suse_update_desktop_file -r ecryptfs-setup-private System Security
%find_lang %{name}
# replace duplicate files by symlinks
%fdupes -s %{buildroot}
# do not ship .la files
find %{buildroot} -type f -name "*.la" -delete -print

#we need ecryptfs kernel module
mkdir -p %{buildroot}%{_libexecdir}/modules-load.d/
echo -e "# ecryptfs module is needed before ecryptfs mount, so mount helper can \n# check for file name encryption support\necryptfs" >%{buildroot}%{_libexecdir}/modules-load.d/ecryptfs.conf

%verify_permissions -e /sbin/mount.ecryptfs_private

%set_permissions /sbin/mount.ecryptfs_private
%{_sbindir}/pam-config -a --ecryptfs

%post -n %{lname} -p /sbin/ldconfig

if [ "$1" -eq 0 ]; then
	%{_sbindir}/pam-config -d --ecryptfs

%postun -n %{lname} -p /sbin/ldconfig

%files -f %{name}.lang
%defattr(-, root, root)
%doc COPYING NEWS README THANKS doc/ecryptfs-faq.html
%verify(not mode) /sbin/mount.ecryptfs_private
%dir %{_libexecdir}/modules-load.d

%files -n %{lname}
%defattr(-, root, root)

%files devel
%defattr(-, root, root)

openSUSE Build Service is sponsored by