a407d14
# Define `python3_sitearch' if there is no one:
a407d14
%{!?python3_sitearch:%global python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
a407d14
a407d14
# Enable Python 3 in Fedora and RHEL > 7 as default:
a407d14
%if 0%{?fedora} || 0%{?rhel} > 7
a407d14
# Add `--without python3' option (enable python3 by default):
a407d14
%bcond_without python3
a407d14
%else
a407d14
# Add `--with python3' option (disable python3 by default):
a407d14
%bcond_with python3
a407d14
%endif
a407d14
a407d14
# Drop Python 2 in Fedora >= 30 and RHEL > 7 as default:
a407d14
%if 0%{?fedora} >= 30 || 0%{?rhel} > 7
a407d14
%global drop_python2 1
a407d14
%global configure_with_python2 no
a407d14
%else
a407d14
# Define `python2_sitearch' if there is no one:
a407d14
%{!?python2_sitearch:%global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
a407d14
%global configure_with_python2 yes
a407d14
%endif
a407d14
a407d14
%if %{with python3}
a407d14
%global configure_with_python3 yes
a407d14
%else
a407d14
%global configure_with_python3 no
a407d14
%endif
a407d14
a407d14
# Additional configure options:
a407d14
%global with_pythons --with-python=%{configure_with_python2} --with-python3=%{?configure_with_python3}
1cf439a
1cf439a
Summary: An utility for manipulating storage encryption keys and passphrases
1cf439a
Name: volume_key
a407d14
Version: 0.3.12
3c2df9d
Release: 21%{?dist}
dda2026
License: GPL-2.0-only AND (MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later)
a407d14
URL: https://pagure.io/%{name}/
a407d14
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
1cf439a
a407d14
Source0: https://releases.pagure.org/%{name}/%{name}-%{version}.tar.xz
860134b
# Support all LUKS devices
860134b
# - backport of 26c09768662d8958debe8c9410dae9fda02292c3
860134b
Patch0: volume_key-0.3.12-support_LUKS2_and_more.patch
bbac9eb
# Fix resource leaks
bbac9eb
# - backport of bf6618ec0b09b4e51fc97fa021e687fbd87599ba
bbac9eb
Patch1: volume_key-0.3.12-fix_resource_leaks.patch
db4e433
BuildRequires: autoconf, automake, libtool
487b693
BuildRequires: make
6d34f80
BuildRequires: gcc
89d7d73
BuildRequires: cryptsetup-devel, gettext-devel, glib2-devel, /usr/bin/gpg2
6c794a9
BuildRequires: gpgme-devel, libblkid-devel, nss-devel
6c794a9
BuildRequires: python3-devel, python3-setuptools
a407d14
%if 0%{?drop_python2} < 1
a407d14
BuildRequires: python2-devel
a407d14
%endif
6d34f80
# Needed by %%check:
6d34f80
BuildRequires: nss-tools
1cf439a
a407d14
%global desc_common The main goal of the software is to allow restoring access to an encrypted\
a407d14
hard drive if the primary user forgets the passphrase.  The encryption key\
a407d14
back up can also be useful for extracting data after a hardware or software\
a407d14
failure that corrupts the header of the encrypted volume, or to access the\
1cf439a
company data after an employee leaves abruptly.
1cf439a
a407d14
%global desc_app This package provides a command-line tool for manipulating storage volume\
a407d14
encryption keys and storing them separately from volumes.\
a407d14
\
a407d14
%{desc_common}
a407d14
a407d14
%global desc_lib This package provides lib%{name}, a library for manipulating storage volume\
a407d14
encryption keys and storing them separately from volumes.\
a407d14
\
a407d14
%{desc_common}
a407d14
a407d14
%global desc_python(V:) This package provides %%{-V:Python %%{-V*}}%%{!-V:Python} bindings for lib%{name}, a library for\
a407d14
manipulating storage volume encryption keys and storing them separately from\
a407d14
volumes.\
a407d14
\
a407d14
%{desc_common}\
a407d14
\
a407d14
%{name} currently supports only the LUKS volume encryption format.  Support\
a407d14
for other formats is possible, some formats are planned for future releases.
a407d14
a407d14
%description
a407d14
%{desc_app}
a407d14
1cf439a
%package devel
1cf439a
Summary: A library for manipulating storage encryption keys and passphrases
a407d14
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
1cf439a
1cf439a
%description devel
a407d14
%{desc_lib}
1cf439a
1cf439a
%package libs
1cf439a
Summary: A library for manipulating storage encryption keys and passphrases
6d34f80
Requires: /usr/bin/gpg2
1cf439a
1cf439a
%description libs
a407d14
%{desc_lib}
1cf439a
a407d14
%if 0%{?drop_python2} < 1
a407d14
%package -n python2-%{name}
a407d14
%{?python_provide:%python_provide python2-%{name}}
a407d14
Summary: Python bindings for lib%{name}
a407d14
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
1cf439a
a407d14
%description -n python2-%{name}
a407d14
%desc_python
a407d14
%endif
1cf439a
a407d14
%if %{with python3}
a407d14
%package -n python3-%{name}
a407d14
%{?python_provide:%python_provide python3-%{name}}
a407d14
Summary: Python 3 bindings for lib%{name}
a407d14
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
1cf439a
a407d14
%description -n python3-%{name}
a407d14
%desc_python -V 3
a407d14
%endif
1cf439a
1cf439a
%prep
08740c7
%setup -q
860134b
%patch0 -p1
bbac9eb
%patch1 -p1
db4e433
autoreconf -fiv
1cf439a
1cf439a
%build
a407d14
%configure %{?with_pythons}
89d7d73
%make_build
1cf439a
1cf439a
%install
89d7d73
%make_install
1cf439a
3309ca4
# Remove libtool archive
3309ca4
find %{buildroot} -type f -name "*.la" -delete
3309ca4
860134b
%find_lang %{name}
860134b
6d34f80
%check
a407d14
make check || { \
a407d14
echo "======================== ./test-suite.log ========================"; \
a407d14
cat ./test-suite.log; \
a407d14
echo "=================================================================="; \
a407d14
exit 1; \
a407d14
}
6d34f80
97c67a9
%ldconfig_scriptlets libs
1cf439a
1cf439a
%files
82c3707
%doc README contrib
a407d14
%{_bindir}/%{name}
a407d14
%{_mandir}/man8/%{name}.8*
1cf439a
1cf439a
%files devel
a407d14
%{_includedir}/%{name}
a407d14
%{_libdir}/lib%{name}.so
1cf439a
a407d14
%files libs -f %{name}.lang
1cf439a
%doc AUTHORS COPYING ChangeLog NEWS
a407d14
%{_libdir}/lib%{name}.so.*
a407d14
a407d14
%if 0%{?drop_python2} < 1
a407d14
%files -n python2-%{name}
a407d14
%{python2_sitearch}/_%{name}.so
a407d14
%{python2_sitearch}/%{name}.py*
a407d14
%endif
1cf439a
a407d14
%if %{with python3}
a407d14
%files -n python3-%{name}
a407d14
%{python3_sitearch}/_%{name}.so
a407d14
%{python3_sitearch}/%{name}.py*
a407d14
%{python3_sitearch}/__pycache__/%{name}.*
a407d14
%endif
1cf439a
1cf439a
%changelog
3c2df9d
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-21
3c2df9d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
3c2df9d
dbc3ddc
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-20
dbc3ddc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
dbc3ddc
c8f5c5b
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 0.3.12-19
c8f5c5b
- Rebuilt for Python 3.12
c8f5c5b
105ff46
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-18
105ff46
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
105ff46
d910ad6
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-17
d910ad6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
d910ad6
bcce6fb
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.3.12-16
bcce6fb
- Rebuilt for Python 3.11
bcce6fb
55fd48c
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-15
55fd48c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
55fd48c
89d7d73
* Wed Aug 04 2021 Jiri Kucera <jkucera@redhat.com> - 0.3.12-14
89d7d73
- Fix FTBFS
89d7d73
- Move License tag back to GPLv2 (this is the effective license)
89d7d73
- Use make macros
89d7d73
2d86730
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-13
2d86730
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
2d86730
4dbc7ef
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.3.12-12
4dbc7ef
- Rebuilt for Python 3.10
4dbc7ef
bbac9eb
* Wed Mar 31 2021 Jiri Kucera <jkucera@redhat.com> - 0.3.12-11
bbac9eb
- Fix resource leaks
bbac9eb
00a0819
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-10
00a0819
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
00a0819
aa27156
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-9
aa27156
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
aa27156
a9ce2b4
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.3.12-8
a9ce2b4
- Rebuilt for Python 3.9
a9ce2b4
025ab48
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-7
025ab48
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
025ab48
1d537b4
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.3.12-6
1d537b4
- Rebuilt for Python 3.8.0rc1 (#1748018)
1d537b4
7d16cd4
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.3.12-5
7d16cd4
- Rebuilt for Python 3.8
7d16cd4
d0331dc
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-4
d0331dc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
d0331dc
601eea7
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.12-3
601eea7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
601eea7
860134b
* Wed Jan 23 2019 Jiri Kucera <jkucera@redhat.com> - 0.3.12-2
860134b
- Add support for LUKS2 and more
860134b
- Fix License tag
860134b
a407d14
* Mon Oct 08 2018 Jiri Kucera <jkucera@redhat.com> - 0.3.12-1
a407d14
- Update to volume_key-0.3.12
a407d14
  Resolves: #1634850
a407d14
48e35c6
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.10-2
48e35c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
48e35c6
6d34f80
* Wed May 16 2018 Jiri Kucera <jkucera@redhat.com> - 0.3.10-1
6d34f80
- Update to volume_key-0.3.10
6d34f80
  Resolves: #1479349, #1517016
6d34f80
91b20b0
* Wed Feb 14 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.3.9-20
91b20b0
- Update Python 2 dependency declarations to new packaging standards
91b20b0
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
91b20b0
b28d111
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.9-19
b28d111
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
b28d111
97c67a9
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.3.9-18
97c67a9
- Switch to %%ldconfig_scriptlets
97c67a9
6fbd69e
* Tue Nov 7 2017 Miloslav Trmač <mitr@redhat.com> - 0.3.9-17
6fbd69e
- Update for libcryptsetup ABI change
6fbd69e
2894bfa
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 0.3.9-16
2894bfa
- Python 2 binary package renamed to python2-volume_key
2894bfa
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
2894bfa
f2216ba
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.9-15
f2216ba
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
f2216ba
c5b69b3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.9-14
c5b69b3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c5b69b3
2aaaf55
* Mon May 29 2017 Miloslav Trmač <mitr@redhat.com> - 0.3.9-13
2aaaf55
- Point URL: and Source: to the new home at pagure.io
2aaaf55
  Resolves: 1456378
2aaaf55
8f83183
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.9-12
8f83183
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
8f83183
d2f8364
* Sat Dec 10 2016 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.3.9-11
d2f8364
- Rebuild for gpgme 1.18
d2f8364
7b2adf2
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.9-10
7b2adf2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
7b2adf2
78e5420
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.9-9
78e5420
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
78e5420
c6eb606
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.9-8
c6eb606
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
c6eb606
6a7979d
* Tue Jan 13 2015 Miloslav Trmač <mitr@redhat.com> - 0.3.9-7
6a7979d
- Don't #include <config.h> in libvolume_key.h
6a7979d
  Patch by Vratislav Podzimek <vpodzime@redhat.com>.
6a7979d
1ff6710
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.9-6
1ff6710
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
1ff6710
8fab58a
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.9-5
8fab58a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
8fab58a
3d0316b
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.9-4
3d0316b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
3d0316b
545816c
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.9-3
545816c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
545816c
48a54bc
* Thu Nov 22 2012 Miloslav Trmač <mitr@redhat.com> - 0.3.9-2
48a54bc
- Fix a crash when trying to use passphrase encryption in FIPS mode
48a54bc
6b0d58e
* Sat Sep 22 2012 Miloslav Trmač <mitr@redhat.com> - 0.3.9-1
6b0d58e
- Update to volume_key-0.3.9
6b0d58e
85c6d09
* Mon Aug  6 2012 Miloslav Trmač <mitr@redhat.com> - 0.3.8-4
85c6d09
- Use BuildRequires: /usr/bin/gpg instead of gnupg, for compatibility with RHEL
85c6d09
56b0682
* Mon Jul 23 2012 Miloslav Trmač <mitr@redhat.com> - 0.3.8-3
56b0682
- Add Requires: /usr/bin/gpg
56b0682
  Resolves: #842074
56b0682
538deea
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.8-2
538deea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
538deea
d367a1f
* Sat Mar  3 2012 Miloslav Trmač <mitr@redhat.com> - 0.3.8-1
d367a1f
- Update to volume_key-0.3.8
d367a1f
60cc6e0
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.7-3
60cc6e0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
60cc6e0
db21301
* Fri Oct 14 2011 Miloslav Trmač <mitr@redhat.com> - 0.3.7-2
db21301
- Rebuild with newer libcryptsetup
db21301
91a56fa
* Wed Aug 24 2011 Miloslav Trmač <mitr@redhat.com> - 0.3.7-1
91a56fa
- Update to volume_key-0.3.7
91a56fa
6de3b0c
* Fri Jun 10 2011 Miloslav Trmač <mitr@redhat.com> - 0.3.6-2
6de3b0c
- Fix a typo
6de3b0c
  Resolves: #712256
6de3b0c
020f1c3
* Thu Mar 31 2011 Miloslav Trmač <mitr@redhat.com> - 0.3.6-1
020f1c3
- Update to volume_key-0.3.6
020f1c3
312c50a
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.5-3
312c50a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
312c50a
6c38de1
* Fri Feb  4 2011 Miloslav Trmač <mitr@redhat.com> - 0.3.5-2
6c38de1
- Use %%{?_isa} in Requires:
6c38de1
82c3707
* Wed Nov 24 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.5-1
82c3707
- Update to volume_key-0.3.5
82c3707
4886de9
* Mon Oct 18 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.4-4
4886de9
- Tell the user if asking for the same passphrase again
4886de9
  Resolves: #641111
4886de9
- Check certificate file before interacting with the user
4886de9
  Resolves: #643897
4886de9
f93fc19
* Fri Oct  8 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.4-3
f93fc19
- Make it possible to interrupt password prompts
f93fc19
  Resolves: #641111
f93fc19
2e6d0e5
* Wed Sep 29 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.4-2
2e6d0e5
- Clarify which block device should be passed as an argument
2e6d0e5
  Resolves: #636541
2e6d0e5
- Recognize SSL error messages from NSS as well
2e6d0e5
  Resolves: #638732
2e6d0e5
62a674e
* Fri Aug 27 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.4-1
62a674e
- Update to volume_key-0.3.4
62a674e
14d952f
* Mon Jul 26 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.3-4
14d952f
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
14d952f
b4b07aa
* Thu Jul 22 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.3-3
b4b07aa
- Fix build with new gpgme
b4b07aa
25078df
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 0.3.3-2
25078df
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
25078df
a710b21
* Fri Mar 26 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.3-1
a710b21
- Update to volume_key-0.3.3
a710b21
4128c34
* Thu Mar  4 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.2-1
4128c34
- Update to volume_key-0.3.2
4128c34
- Drop no longer necessary references to BuildRoot:
4128c34
a677246
* Fri Feb  5 2010 Miloslav Trmač <mitr@redhat.com> - 0.3.1-2
a677246
- Fix a crash when an empty passphrase is provided
a677246
  Resolves: #558410
a677246
2c2f8b1
* Fri Dec 11 2009 Miloslav Trmač <mitr@redhat.com> - 0.3.1-1
2c2f8b1
- Update to volume_key-0.3.1.
2c2f8b1
08740c7
* Wed Sep 30 2009 Miloslav Trmač <mitr@redhat.com> - 0.3-1
08740c7
- Update to volume_key-0.3.
08740c7
- Drop bundled libcryptsetup.
08740c7
74ce693
* Sat Aug  8 2009 Miloslav Trmač <mitr@redhat.com> - 0.2-3
74ce693
- Handle changed "TYPE=crypto_LUKS" from libblkid
74ce693
- Preserve file timestamps during installation
74ce693
a5e6329
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-2
a5e6329
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
a5e6329
1cf439a
* Tue Jun 30 2009 Miloslav Trmač <mitr@redhat.com> - 0.2-1
1cf439a
- Initial build.