Blame SPECS/libpwquality.spec

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