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