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