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