e64f66
# Define `python3_sitearch' if there is no one:
e64f66
%{!?python3_sitearch:%global python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
e64f66
e64f66
# Enable Python 3 in Fedora and RHEL > 7 as default:
e64f66
%if 0%{?fedora} || 0%{?rhel} > 7
e64f66
# Add `--without python3' option (enable python3 by default):
e64f66
%bcond_without python3
e64f66
%else
e64f66
# Add `--with python3' option (disable python3 by default):
e64f66
%bcond_with python3
e64f66
%endif
e64f66
e64f66
# Drop Python 2 in Fedora >= 30 and RHEL > 7 as default:
e64f66
%if 0%{?fedora} >= 30 || 0%{?rhel} > 7
e64f66
%global drop_python2 1
e64f66
%global configure_with_python2 no
e64f66
%else
e64f66
# Define `python2_sitearch' if there is no one:
e64f66
%{!?python2_sitearch:%global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
e64f66
%global configure_with_python2 yes
e64f66
%endif
e64f66
e64f66
%if %{with python3}
e64f66
%global configure_with_python3 yes
e64f66
%else
e64f66
%global configure_with_python3 no
e64f66
%endif
e64f66
e64f66
# Additional configure options:
e64f66
%global with_pythons --with-python=%{configure_with_python2} --with-python3=%{?configure_with_python3}
e64f66
e64f66
Summary: An utility for manipulating storage encryption keys and passphrases
e64f66
Name: volume_key
e64f66
Version: 0.3.12
e64f66
Release: 15%{?dist}
e64f66
License: GPLv2
e64f66
URL: https://pagure.io/%{name}/
e64f66
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
e64f66
e64f66
Source0: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.xz
e64f66
# Support all LUKS devices
e64f66
# - backport of 26c09768662d8958debe8c9410dae9fda02292c3
e64f66
Patch0: volume_key-0.3.12-support_LUKS2_and_more.patch
e64f66
# Fix resource leaks
e64f66
# - backport of bf6618ec0b09b4e51fc97fa021e687fbd87599ba
e64f66
Patch1: volume_key-0.3.12-fix_resource_leaks.patch
e64f66
BuildRequires: make
e64f66
BuildRequires: gcc
e64f66
BuildRequires: cryptsetup-devel, gettext-devel, glib2-devel, /usr/bin/gpg2
e64f66
BuildRequires: gpgme-devel, libblkid-devel, nss-devel, python3-devel
e64f66
%if 0%{?drop_python2} < 1
e64f66
BuildRequires: python2-devel
e64f66
%endif
e64f66
# Needed by %%check:
e64f66
BuildRequires: nss-tools
e64f66
e64f66
%global desc_common The main goal of the software is to allow restoring access to an encrypted\
e64f66
hard drive if the primary user forgets the passphrase.  The encryption key\
e64f66
back up can also be useful for extracting data after a hardware or software\
e64f66
failure that corrupts the header of the encrypted volume, or to access the\
e64f66
company data after an employee leaves abruptly.
e64f66
e64f66
%global desc_app This package provides a command-line tool for manipulating storage volume\
e64f66
encryption keys and storing them separately from volumes.\
e64f66
\
e64f66
%{desc_common}
e64f66
e64f66
%global desc_lib This package provides lib%{name}, a library for manipulating storage volume\
e64f66
encryption keys and storing them separately from volumes.\
e64f66
\
e64f66
%{desc_common}
e64f66
e64f66
%global desc_python(V:) This package provides %%{-V:Python %%{-V*}}%%{!-V:Python} bindings for lib%{name}, a library for\
e64f66
manipulating storage volume encryption keys and storing them separately from\
e64f66
volumes.\
e64f66
\
e64f66
%{desc_common}\
e64f66
\
e64f66
%{name} currently supports only the LUKS volume encryption format.  Support\
e64f66
for other formats is possible, some formats are planned for future releases.
e64f66
e64f66
%description
e64f66
%{desc_app}
e64f66
e64f66
%package devel
e64f66
Summary: A library for manipulating storage encryption keys and passphrases
e64f66
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
e64f66
e64f66
%description devel
e64f66
%{desc_lib}
e64f66
e64f66
%package libs
e64f66
Summary: A library for manipulating storage encryption keys and passphrases
e64f66
Requires: /usr/bin/gpg2
e64f66
e64f66
%description libs
e64f66
%{desc_lib}
e64f66
e64f66
%if 0%{?drop_python2} < 1
e64f66
%package -n python2-%{name}
e64f66
%{?python_provide:%python_provide python2-%{name}}
e64f66
Summary: Python bindings for lib%{name}
e64f66
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
e64f66
e64f66
%description -n python2-%{name}
e64f66
%desc_python
e64f66
%endif
e64f66
e64f66
%if %{with python3}
e64f66
%package -n python3-%{name}
e64f66
%{?python_provide:%python_provide python3-%{name}}
e64f66
Summary: Python 3 bindings for lib%{name}
e64f66
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
e64f66
e64f66
%description -n python3-%{name}
e64f66
%desc_python -V 3
e64f66
%endif
e64f66
e64f66
%prep
e64f66
%setup -q
e64f66
%patch0 -p1
e64f66
%patch1 -p1
e64f66
e64f66
%build
e64f66
%configure %{?with_pythons}
e64f66
make %{?_smp_mflags}
e64f66
e64f66
%install
e64f66
make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p'
e64f66
e64f66
# Remove libtool archive
e64f66
find %{buildroot} -type f -name "*.la" -delete
e64f66
e64f66
%find_lang %{name}
e64f66
e64f66
%check
e64f66
make check || { \
e64f66
echo "======================== ./test-suite.log ========================"; \
e64f66
cat ./test-suite.log; \
e64f66
echo "=================================================================="; \
e64f66
exit 1; \
e64f66
}
e64f66
e64f66
%ldconfig_scriptlets libs
e64f66
e64f66
%files
e64f66
%doc README contrib
e64f66
%{_bindir}/%{name}
e64f66
%{_mandir}/man8/%{name}.8*
e64f66
e64f66
%files devel
e64f66
%{_includedir}/%{name}
e64f66
%{_libdir}/lib%{name}.so
e64f66
e64f66
%files libs -f %{name}.lang
e64f66
%doc AUTHORS COPYING ChangeLog NEWS
e64f66
%{_libdir}/lib%{name}.so.*
e64f66
e64f66
%if 0%{?drop_python2} < 1
e64f66
%files -n python2-%{name}
e64f66
%{python2_sitearch}/_%{name}.so
e64f66
%{python2_sitearch}/%{name}.py*
e64f66
%endif
e64f66
e64f66
%if %{with python3}
e64f66
%files -n python3-%{name}
e64f66
%{python3_sitearch}/_%{name}.so
e64f66
%{python3_sitearch}/%{name}.py*
e64f66
%{python3_sitearch}/__pycache__/%{name}.*
e64f66
%endif
e64f66
e64f66
%changelog
e64f66
* Thu Aug 26 2021 Jiri Kucera <jkucera@redhat.com> - 0.3.12-15
e64f66
- Fix FTBFS
e64f66
  Related: #1986584
e64f66
e64f66
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 0.3.12-14
e64f66
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
e64f66
  Related: rhbz#1991688
e64f66
e64f66
* Fri Aug 06 2021 Jiri Kucera <jkucera@redhat.com> - 0.3.12-13
e64f66
- Adjust License tag to the effective license
e64f66
  Resolves: #1986584
e64f66
e64f66
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.3.12-12
e64f66
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
e64f66
e64f66
* Wed Mar 31 2021 Jiri Kucera <jkucera@redhat.com> - 0.3.12-11
e64f66
- Fix resource leaks
e64f66
  Resolves: #1938896
e64f66
e64f66
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-10
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
e64f66
e64f66
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-9
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
e64f66
e64f66
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.3.12-8
e64f66
- Rebuilt for Python 3.9
e64f66
e64f66
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-7
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
e64f66
e64f66
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.3.12-6
e64f66
- Rebuilt for Python 3.8.0rc1 (#1748018)
e64f66
e64f66
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.3.12-5
e64f66
- Rebuilt for Python 3.8
e64f66
e64f66
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-4
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
e64f66
e64f66
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-3
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
e64f66
e64f66
* Wed Jan 23 2019 Jiri Kucera <jkucera@redhat.com> - 0.3.12-2
e64f66
- Add support for LUKS2 and more
e64f66
- Fix License tag
e64f66
e64f66
* Mon Oct 08 2018 Jiri Kucera <jkucera@redhat.com> - 0.3.12-1
e64f66
- Update to volume_key-0.3.12
e64f66
  Resolves: #1634850
e64f66
e64f66
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.10-2
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
e64f66
e64f66
* Wed May 16 2018 Jiri Kucera <jkucera@redhat.com> - 0.3.10-1
e64f66
- Update to volume_key-0.3.10
e64f66
  Resolves: #1479349, #1517016
e64f66
e64f66
* Wed Feb 14 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.3.9-20
e64f66
- Update Python 2 dependency declarations to new packaging standards
e64f66
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
e64f66
e64f66
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.9-19
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
e64f66
e64f66
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.3.9-18
e64f66
- Switch to %%ldconfig_scriptlets
e64f66
e64f66
* Tue Nov 7 2017 Miloslav Trmač <mitr@redhat.com> - 0.3.9-17
e64f66
- Update for libcryptsetup ABI change
e64f66
e64f66
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.3.9-16
e64f66
- Python 2 binary package renamed to python2-volume_key
e64f66
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
e64f66
e64f66
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.9-15
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
e64f66
e64f66
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.9-14
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
e64f66
e64f66
* Mon May 29 2017 Miloslav Trmač <mitr@redhat.com> - 0.3.9-13
e64f66
- Point URL: and Source: to the new home at pagure.io
e64f66
  Resolves: 1456378
e64f66
e64f66
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.9-12
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
e64f66
e64f66
* Sat Dec 10 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.3.9-11
e64f66
- Rebuild for gpgme 1.18
e64f66
e64f66
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.9-10
e64f66
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
e64f66
e64f66
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.9-9
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e64f66
e64f66
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.9-8
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
e64f66
e64f66
* Tue Jan 13 2015 Miloslav Trmač <mitr@redhat.com> - 0.3.9-7
e64f66
- Don't #include <config.h> in libvolume_key.h
e64f66
  Patch by Vratislav Podzimek <vpodzime@redhat.com>.
e64f66
e64f66
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.9-6
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
e64f66
e64f66
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.9-5
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
e64f66
e64f66
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.9-4
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
e64f66
e64f66
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.9-3
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
e64f66
e64f66
* Thu Nov 22 2012 Miloslav Trmač <mitr@redhat.com> - 0.3.9-2
e64f66
- Fix a crash when trying to use passphrase encryption in FIPS mode
e64f66
e64f66
* Sat Sep 22 2012 Miloslav Trmač <mitr@redhat.com> - 0.3.9-1
e64f66
- Update to volume_key-0.3.9
e64f66
e64f66
* Mon Aug  6 2012 Miloslav Trmač <mitr@redhat.com> - 0.3.8-4
e64f66
- Use BuildRequires: /usr/bin/gpg instead of gnupg, for compatibility with RHEL
e64f66
e64f66
* Mon Jul 23 2012 Miloslav Trmač <mitr@redhat.com> - 0.3.8-3
e64f66
- Add Requires: /usr/bin/gpg
e64f66
  Resolves: #842074
e64f66
e64f66
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.8-2
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
e64f66
e64f66
* Sat Mar  3 2012 Miloslav Trmač <mitr@redhat.com> - 0.3.8-1
e64f66
- Update to volume_key-0.3.8
e64f66
e64f66
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.7-3
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
e64f66
e64f66
* Fri Oct 14 2011 Miloslav Trmač <mitr@redhat.com> - 0.3.7-2
e64f66
- Rebuild with newer libcryptsetup
e64f66
e64f66
* Wed Aug 24 2011 Miloslav Trmač <mitr@redhat.com> - 0.3.7-1
e64f66
- Update to volume_key-0.3.7
e64f66
e64f66
* Fri Jun 10 2011 Miloslav Trmač <mitr@redhat.com> - 0.3.6-2
e64f66
- Fix a typo
e64f66
  Resolves: #712256
e64f66
e64f66
* Thu Mar 31 2011 Miloslav Trmač <mitr@redhat.com> - 0.3.6-1
e64f66
- Update to volume_key-0.3.6
e64f66
e64f66
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.5-3
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
e64f66
e64f66
* Fri Feb  4 2011 Miloslav Trmač <mitr@redhat.com> - 0.3.5-2
e64f66
- Use %%{?_isa} in Requires:
e64f66
e64f66
* Wed Nov 24 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.5-1
e64f66
- Update to volume_key-0.3.5
e64f66
e64f66
* Mon Oct 18 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.4-4
e64f66
- Tell the user if asking for the same passphrase again
e64f66
  Resolves: #641111
e64f66
- Check certificate file before interacting with the user
e64f66
  Resolves: #643897
e64f66
e64f66
* Fri Oct  8 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.4-3
e64f66
- Make it possible to interrupt password prompts
e64f66
  Resolves: #641111
e64f66
e64f66
* Wed Sep 29 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.4-2
e64f66
- Clarify which block device should be passed as an argument
e64f66
  Resolves: #636541
e64f66
- Recognize SSL error messages from NSS as well
e64f66
  Resolves: #638732
e64f66
e64f66
* Fri Aug 27 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.4-1
e64f66
- Update to volume_key-0.3.4
e64f66
e64f66
* Mon Jul 26 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.3-4
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
e64f66
e64f66
* Thu Jul 22 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.3-3
e64f66
- Fix build with new gpgme
e64f66
e64f66
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.3.3-2
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
e64f66
e64f66
* Fri Mar 26 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.3-1
e64f66
- Update to volume_key-0.3.3
e64f66
e64f66
* Thu Mar  4 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.2-1
e64f66
- Update to volume_key-0.3.2
e64f66
- Drop no longer necessary references to BuildRoot:
e64f66
e64f66
* Fri Feb  5 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.1-2
e64f66
- Fix a crash when an empty passphrase is provided
e64f66
  Resolves: #558410
e64f66
e64f66
* Fri Dec 11 2009 Miloslav Trmač <mitr@redhat.com> - 0.3.1-1
e64f66
- Update to volume_key-0.3.1.
e64f66
e64f66
* Wed Sep 30 2009 Miloslav Trmač <mitr@redhat.com> - 0.3-1
e64f66
- Update to volume_key-0.3.
e64f66
- Drop bundled libcryptsetup.
e64f66
e64f66
* Sat Aug  8 2009 Miloslav Trmač <mitr@redhat.com> - 0.2-3
e64f66
- Handle changed "TYPE=crypto_LUKS" from libblkid
e64f66
- Preserve file timestamps during installation
e64f66
e64f66
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-2
e64f66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
e64f66
e64f66
* Tue Jun 30 2009 Miloslav Trmač <mitr@redhat.com> - 0.2-1
e64f66
- Initial build.