Blame SPECS/libpwquality.spec

ab5e72
%if 0%{?fedora} || 0%{?rhel} > 7
ab5e72
# Enable python3 build by default
ab5e72
%bcond_without python3
ab5e72
%else
ab5e72
%bcond_with python3
ab5e72
%endif
ab5e72
ab5e72
%if 0%{?rhel} > 7 || 0%{?fedora} > 30
ab5e72
# Disable python2 build by default
ab5e72
%bcond_with python2
ab5e72
%else
ab5e72
%bcond_without python2
ab5e72
%endif
ab5e72
ab5e72
Summary: A library for password generation and password quality checking
ab5e72
Name: libpwquality
ab5e72
Version: 1.4.4
ab5e72
Release: 8%{?dist}
ab5e72
# The package is BSD licensed with option to relicense as GPLv2+
ab5e72
# - this option is redundant as the BSD license allows that anyway.
ab5e72
License: BSD or GPLv2+
ab5e72
Source0: https://github.com/libpwquality/libpwquality/releases/download/libpwquality-%{version}/libpwquality-%{version}.tar.bz2
ab5e72
ab5e72
Patch100: libpwquality-1.4.4-rhel9-i18n.patch
ab5e72
ab5e72
%global _pwqlibdir %{_libdir}
ab5e72
%global _moduledir %{_libdir}/security
ab5e72
%global _secconfdir %{_sysconfdir}/security
ab5e72
ab5e72
Requires: cracklib-dicts >= 2.8
ab5e72
Requires: pam%{?_isa}
ab5e72
Requires: cracklib
ab5e72
BuildRequires: make
ab5e72
BuildRequires: gcc
ab5e72
BuildRequires: cracklib-devel
ab5e72
BuildRequires: gettext
ab5e72
BuildRequires: pam-devel
ab5e72
%if %{with python2}
ab5e72
BuildRequires: python2-devel
ab5e72
%endif
ab5e72
%if %{with python3}
ab5e72
BuildRequires: python3-devel
ab5e72
BuildRequires: python3-setuptools
ab5e72
%endif
ab5e72
ab5e72
URL: https://github.com/libpwquality/libpwquality/
ab5e72
ab5e72
# we don't want to provide private python extension libs
ab5e72
%define __provides_exclude_from ^(%{python_sitearch}|%{python3_sitearch})/.*\.so$.
ab5e72
ab5e72
%description
ab5e72
This is a library for password quality checks and generation
ab5e72
of random passwords that pass the checks.
ab5e72
This library uses the cracklib and cracklib dictionaries
ab5e72
to perform some of the checks.
ab5e72
ab5e72
%package devel
ab5e72
Summary: Support for development of applications using the libpwquality library
ab5e72
Requires: libpwquality%{?_isa} = %{version}-%{release}
ab5e72
Requires: pkgconfig
ab5e72
ab5e72
%description devel
ab5e72
Files needed for development of applications using the libpwquality
ab5e72
library.
ab5e72
See the pwquality.h header file for the API.
ab5e72
ab5e72
%if %{with python2}
ab5e72
%package -n python2-pwquality
ab5e72
%{?python_provide:%python_provide python2-pwquality}
ab5e72
Summary: Python bindings for the libpwquality library
ab5e72
Requires: libpwquality%{?_isa} = %{version}-%{release}
ab5e72
ab5e72
%description -n python2-pwquality
ab5e72
This is pwquality Python module that provides Python bindings
ab5e72
for the libpwquality library. These bindings can be used
ab5e72
for easy password quality checking and generation of random
ab5e72
pronounceable passwords from Python applications.
ab5e72
%endif
ab5e72
ab5e72
%if %{with python3}
ab5e72
%package -n python3-pwquality
ab5e72
Summary: Python bindings for the libpwquality library
ab5e72
Requires: libpwquality%{?_isa} = %{version}-%{release}
ab5e72
ab5e72
%description -n python3-pwquality
ab5e72
This is pwquality Python module that provides Python bindings
ab5e72
for the libpwquality library. These bindings can be used
ab5e72
for easy password quality checking and generation of random
ab5e72
pronounceable passwords from Python applications.
ab5e72
%endif
ab5e72
ab5e72
%prep
ab5e72
%setup -q
ab5e72
ab5e72
%if %{with python3} && %{with python2}
ab5e72
rm -rf %{py3dir}
ab5e72
cp -a . %{py3dir}
ab5e72
%endif
ab5e72
%patch100 -p1 -b .rhel9-i18n
ab5e72
ab5e72
%build
ab5e72
%if %{with python2}
ab5e72
%configure \
ab5e72
	--with-securedir=%{_moduledir} \
ab5e72
	--with-pythonsitedir=%{python2_sitearch} \
ab5e72
	--with-python-binary=%{__python2} \
ab5e72
	--disable-static
ab5e72
ab5e72
%make_build
ab5e72
%endif
ab5e72
%if %{with python3} && %{with python2}
ab5e72
pushd %{py3dir}
ab5e72
%endif
ab5e72
%if %{with python3}
ab5e72
%configure \
ab5e72
	--with-securedir=%{_moduledir} \
ab5e72
	--with-pythonsitedir=%{python3_sitearch} \
ab5e72
	--with-python-binary=%{__python3} \
ab5e72
	--disable-static
ab5e72
ab5e72
%make_build
ab5e72
%endif
ab5e72
%if %{with python3} && %{with python2}
ab5e72
popd
ab5e72
%endif
ab5e72
ab5e72
%install
ab5e72
%make_install
ab5e72
ab5e72
%if %{with python3} && %{with python2}
ab5e72
pushd %{py3dir}
ab5e72
%make_install -C python
ab5e72
popd
ab5e72
%endif
ab5e72
ab5e72
%if "%{_pwqlibdir}" != "%{_libdir}"
ab5e72
pushd $RPM_BUILD_ROOT%{_libdir}
ab5e72
mv libpwquality.so.* $RPM_BUILD_ROOT%{_pwqlibdir}
ab5e72
ln -sf %{_pwqlibdir}/libpwquality.so.*.* libpwquality.so
ab5e72
popd
ab5e72
%endif
ab5e72
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
ab5e72
rm -f $RPM_BUILD_ROOT%{_moduledir}/*.la
ab5e72
ab5e72
mkdir $RPM_BUILD_ROOT%{_secconfdir}/pwquality.conf.d
ab5e72
ab5e72
%find_lang libpwquality
ab5e72
ab5e72
%check
ab5e72
# Nothing yet
ab5e72
ab5e72
%ldconfig_scriptlets
ab5e72
ab5e72
%files -f libpwquality.lang
ab5e72
%license COPYING
ab5e72
%doc README NEWS AUTHORS
ab5e72
%{_bindir}/pwmake
ab5e72
%{_bindir}/pwscore
ab5e72
%{_moduledir}/pam_pwquality.so
ab5e72
%{_pwqlibdir}/libpwquality.so.*
ab5e72
%config(noreplace) %{_secconfdir}/pwquality.conf
ab5e72
%{_secconfdir}/pwquality.conf.d
ab5e72
%{_mandir}/man1/*
ab5e72
%{_mandir}/man5/*
ab5e72
%{_mandir}/man8/*
ab5e72
ab5e72
%files devel
ab5e72
%{_includedir}/pwquality.h
ab5e72
%{_libdir}/libpwquality.so
ab5e72
%{_libdir}/pkgconfig/*.pc
ab5e72
%{_mandir}/man3/*
ab5e72
ab5e72
%if %{with python2}
ab5e72
%files -n python2-pwquality
ab5e72
%{python2_sitearch}/pwquality.so
ab5e72
%{python2_sitearch}/*.egg-info
ab5e72
%endif
ab5e72
ab5e72
%if %{with python3}
ab5e72
%files -n python3-pwquality
ab5e72
%{python3_sitearch}/*.so
ab5e72
%{python3_sitearch}/*.egg-info
ab5e72
%endif
ab5e72
ab5e72
%changelog
ab5e72
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.4.4-8
ab5e72
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
ab5e72
  Related: rhbz#1991688
ab5e72
ab5e72
* Wed Aug 04 2021 Dmitry Belyavskiy <dbelyavs@redhat.com> - 1.4.4-7
ab5e72
- Explicitly rebuild the localization
ab5e72
- Resolves: rhbz#1938621
ab5e72
ab5e72
* Mon Jul 26 2021 Dmitry Belyavskiy <dbelyavs@redhat.com> - 1.4.4-6
ab5e72
- rebuilt
ab5e72
ab5e72
* Mon Jul 26 2021 Dmitry Belyavskiy <dbelyavs@redhat.com> - 1.4.4-5
ab5e72
- added i18n updates for de, fr, ja, ko, zh_CN
ab5e72
- Resolves: rhbz#1963858
ab5e72
- Resolves: rhbz#1938621
ab5e72
ab5e72
* Thu Apr 29 2021 Dmitry Belyavskiy <dbelyavs@redhat.com> - 1.4.4-4
ab5e72
- cracklib-dicts is a hard requirement, not a recomendation.
ab5e72
- Resolves rhbz#1947882
ab5e72
ab5e72
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.4.4-3
ab5e72
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
ab5e72
ab5e72
* Tue Jan 26 10:55:14 EST 2021 Paul Wouters <pwouters@redhat.com> - 1.4.4-2
ab5e72
- Resolves rhbz#1919026 libpwquaily rpm requires cracklib-dict to function but RPM missing requirement
ab5e72
ab5e72
* Tue Oct 13 2020 Tomáš Mráz <tmraz@redhat.com> 1.4.4-1
ab5e72
- Translation updates
ab5e72
- Fix regression with enabling the cracklib check during build
ab5e72
ab5e72
* Mon Oct 12 2020 Tomáš Mráz <tmraz@redhat.com> 1.4.3-1
ab5e72
- Multiple translation updates
ab5e72
- Add usersubstr check for substrings of N characters from the username
ab5e72
  patch by Danny Sauer
ab5e72
ab5e72
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 1.4.2-4
ab5e72
- Use make macros
ab5e72
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
ab5e72
ab5e72
* Thu Oct 31 2019 Tomáš Mráz <tmraz@redhat.com> 1.4.2-1
ab5e72
- Fix previous release regression in handling retry, enforce_for_root,
ab5e72
  and local_users_only options
ab5e72
ab5e72
* Tue Sep 17 2019 Tomáš Mráz <tmraz@redhat.com> 1.4.1-1
ab5e72
- Disable python2 bindings in Fedora 31 and above
ab5e72
- Add conditionals for Python2 and Python3
ab5e72
- pam_pwquality: Abort the retry loop if user requests it
ab5e72
- Allow setting retry, enforce_for_root, and local_users_only options
ab5e72
  in the pwquality.conf config file
ab5e72
ab5e72
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.4.0-5
ab5e72
- Switch to %%ldconfig_scriptlets
ab5e72
ab5e72
* Sun Dec 17 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.4.0-4
ab5e72
- Python 2 binary package renamed to python2-pwquality
ab5e72
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
ab5e72
ab5e72
* Fri May 26 2017 Tomáš Mráz <tmraz@redhat.com> 1.4.0-1
ab5e72
- Do not try to check presence of too short username in password
ab5e72
- Make the user name check optional (via usercheck option)
ab5e72
- Add an 'enforcing' option to make the checks to be warning-only
ab5e72
  in PAM
ab5e72
- The difok = 0 setting will disable all old password similarity
ab5e72
  checks except new and old passwords being identical
ab5e72
- Updated translations from Zanata
ab5e72
ab5e72
* Mon Aug 24 2015 Tomáš Mráz <tmraz@redhat.com> 1.3.0-2
ab5e72
- Fix possible stack overflow in the generate function (#1255935)
ab5e72
ab5e72
* Thu Jul 23 2015 Tomáš Mráz <tmraz@redhat.com> 1.3.0-1
ab5e72
- Change the defaults for credits, difok, and minlen
ab5e72
- Make the cracklib check optional but on by default
ab5e72
- Add implicit support for parsing  <cfgfile>.d/*.conf files
ab5e72
- Add libpwquality API manual page
ab5e72
ab5e72
* Wed Aug  6 2014 Tomáš Mráz <tmraz@redhat.com> 1.2.4-1
ab5e72
- fix license handling (by Tom Callaway)
ab5e72
- add Python3 module subpackage
ab5e72
ab5e72
* Thu Sep 12 2013 Tomáš Mráz <tmraz@redhat.com> 1.2.3-1
ab5e72
- fix problem with parsing the pam_pwquality options
ab5e72
  patch by Vladimir Sorokin.
ab5e72
- updated translations from Transifex
ab5e72
- treat empty user or password as NULL
ab5e72
- move the library to /usr
ab5e72
ab5e72
* Wed Jun 19 2013 Tomas Mraz <tmraz@redhat.com> 1.2.2-1
ab5e72
- manual page fixes
ab5e72
- make it possible to set the maxsequence configuration value
ab5e72
- updated translations from Transifex
ab5e72
ab5e72
* Thu Dec 20 2012 Tomas Mraz <tmraz@redhat.com> 1.2.1-1
ab5e72
- properly free pwquality settings
ab5e72
- add extern "C" to public header
ab5e72
- updated translations from Transifex
ab5e72
ab5e72
* Thu Aug 16 2012 Tomas Mraz <tmraz@redhat.com> 1.2.0-1
ab5e72
- add maxsequence check for too long monotonic character sequence.
ab5e72
- clarified alternative licensing to GPLv2+.
ab5e72
- add local_users_only option to skip the pwquality checks for
ab5e72
  non-locals. (thanks to Stef Walter)
ab5e72
ab5e72
* Wed Jun 13 2012 Tomas Mraz <tmraz@redhat.com> 1.1.1-1
ab5e72
- use rpm built-in filtering of provides (rhbz#830153)
ab5e72
- remove strain debug fprintf() (rhbz#831567)
ab5e72
ab5e72
* Thu May 24 2012 Tomas Mraz <tmraz@redhat.com> 1.1.0-1
ab5e72
- fix leak when throwing PWQError exception
ab5e72
- added pkgconfig file
ab5e72
- call the simplicity checks before the cracklib check
ab5e72
- add enforce_for_root option to the PAM module
ab5e72
- updated translations from Transifex
ab5e72
ab5e72
* Thu Dec  8 2011 Tomas Mraz <tmraz@redhat.com> 1.0.0-1
ab5e72
- added a few additional password quality checks
ab5e72
- bugfix in configuration file parsing
ab5e72
ab5e72
* Fri Nov 11 2011 Tomas Mraz <tmraz@redhat.com> 0.9.9-1
ab5e72
- added python bindings and documentation
ab5e72
ab5e72
* Mon Oct 10 2011 Tomas Mraz <tmraz@redhat.com> 0.9-2
ab5e72
- fixes for problems found in review (missing BR on pam-devel,
ab5e72
  License field, Source URL, Require pam, other cleanups)
ab5e72
ab5e72
* Mon Oct  3 2011 Tomas Mraz <tmraz@redhat.com> 0.9-1
ab5e72
- first spec file for libpwquality