2020-09-03 15:29:18 +08:00
|
|
|
%bcond_without python2
|
|
|
|
|
%bcond_without python3
|
|
|
|
|
|
2019-09-30 10:35:53 -04:00
|
|
|
%define dictdir %{_datadir}/cracklib
|
|
|
|
|
%define dictpath %{dictdir}/pw_dict
|
|
|
|
|
|
|
|
|
|
Name: cracklib
|
2020-01-10 16:13:42 +08:00
|
|
|
Version: 2.9.7
|
2020-09-14 11:33:45 +08:00
|
|
|
Release: 4
|
2019-09-30 10:35:53 -04:00
|
|
|
Summary: A password-checking library
|
|
|
|
|
|
|
|
|
|
License: LGPLv2+
|
|
|
|
|
URL: http://sourceforge.net/projects/cracklib/
|
2020-09-14 11:33:45 +08:00
|
|
|
Source0: https://github.com/cracklib/cracklib/releases/download/v%{version}/cracklib-%{version}.tar.gz
|
|
|
|
|
Source1: https://github.com/cracklib/cracklib/releases/download/v%{version}/cracklib-words-%{version}.gz
|
2020-01-18 16:46:18 +08:00
|
|
|
Patch9000: fix-problem-of-error-message-about-simplistic-passwo.patch
|
2019-09-30 10:35:53 -04:00
|
|
|
|
|
|
|
|
BuildRequires: gcc, words, gettext, gettext-autopoint, zlib-devel
|
2020-09-03 15:29:18 +08:00
|
|
|
%if %{with python2}
|
2019-09-30 10:35:53 -04:00
|
|
|
BuildRequires: python2-devel
|
2020-09-03 15:29:18 +08:00
|
|
|
%endif
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
|
%endif
|
2019-09-30 10:35:53 -04:00
|
|
|
Conflicts: cracklib-dicts < 2.8
|
|
|
|
|
Requires: gzip
|
|
|
|
|
|
|
|
|
|
Provides: cracklib-dicts
|
|
|
|
|
Provides: %{name}-python = %{version}-%{release}
|
|
|
|
|
Provides: %{name}-python%{?_isa} = %{version}-%{release}
|
|
|
|
|
Obsoletes: cracklib-dicts
|
|
|
|
|
Obsoletes: %{name}-python < %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
CrackLib tests passwords to determine whether they match certain
|
|
|
|
|
security-oriented characteristics, with the purpose of preventing users
|
|
|
|
|
from choosing passwords that could easily be guessed.
|
|
|
|
|
|
|
|
|
|
CrackLib is a library containing a C function which may be used in a
|
|
|
|
|
"passwd"-like program. If you install CrackLib, you will also want to
|
|
|
|
|
install the cracklib-dicts package.
|
|
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
|
Summary: Development files for %{name}
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
|
The cracklib-devel package contains the header files and libraries needed
|
|
|
|
|
for compiling applications which use cracklib.
|
|
|
|
|
|
|
|
|
|
%package_help
|
|
|
|
|
|
2020-09-03 15:29:18 +08:00
|
|
|
%if %{with python2}
|
2019-09-30 10:35:53 -04:00
|
|
|
%package -n python2-cracklib
|
|
|
|
|
Summary: Python 2 bindings for applications which use cracklib
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description -n python2-cracklib
|
|
|
|
|
The python2-cracklib package contains a module which permits applications
|
|
|
|
|
written in the Python 2 programming language to use cracklib.
|
2020-09-03 15:29:18 +08:00
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
%package -n python3-cracklib
|
|
|
|
|
Summary: Python 3 bindings for applications which use cracklib
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
%description -n python3-cracklib
|
|
|
|
|
The python3-cracklib package contains a module which permits applications
|
|
|
|
|
written in the Python 3 programming language to use cracklib.
|
|
|
|
|
%endif
|
2019-09-30 10:35:53 -04:00
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%autosetup -n %{name}-%{version} -p1
|
|
|
|
|
|
|
|
|
|
mkdir cracklib-dicts
|
2020-01-10 16:13:42 +08:00
|
|
|
for dict in %{SOURCE1}
|
2019-09-30 10:35:53 -04:00
|
|
|
do
|
|
|
|
|
cp -fv ${dict} cracklib-dicts/
|
|
|
|
|
done
|
|
|
|
|
chmod +x util/cracklib-format
|
|
|
|
|
|
2020-09-03 15:29:18 +08:00
|
|
|
%if %{with python3}
|
|
|
|
|
rm -rf %{py3dir}
|
|
|
|
|
cp -a . %{py3dir}
|
|
|
|
|
%endif
|
|
|
|
|
|
2019-09-30 10:35:53 -04:00
|
|
|
%build
|
2020-09-03 15:29:18 +08:00
|
|
|
%if %{with python2}
|
2019-09-30 10:35:53 -04:00
|
|
|
sed -i 's,util/cracklib-check <,util/cracklib-check $(DESTDIR)/$(DEFAULT_CRACKLIB_DICT) <,' Makefile.in
|
2020-09-03 15:29:18 +08:00
|
|
|
export PYTHON=%{__python2}
|
2019-09-30 10:35:53 -04:00
|
|
|
%configure \
|
|
|
|
|
--disable-static \
|
|
|
|
|
--with-pic \
|
|
|
|
|
--with-python \
|
|
|
|
|
--with-default-dict=%{dictpath}
|
|
|
|
|
make -C po update-gmo
|
|
|
|
|
make
|
2020-09-03 15:29:18 +08:00
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
pushd %{py3dir}
|
|
|
|
|
sed -i 's,util/cracklib-check <,util/cracklib-check $(DESTDIR)/$(DEFAULT_CRACKLIB_DICT) <,' Makefile.in
|
|
|
|
|
py3include=`python3-config --includes | awk -F' ' '{print $1;}'`
|
|
|
|
|
export PYTHON=%{__python3}
|
|
|
|
|
export CFLAGS="%{optflags} $py3include"
|
|
|
|
|
abiflags=`python3-config --abiflags`
|
|
|
|
|
py_version="%{python3_version}$abiflags"
|
|
|
|
|
%configure \
|
|
|
|
|
am_cv_python_version="$py_version" \
|
|
|
|
|
--disable-static \
|
|
|
|
|
--with-pic \
|
|
|
|
|
--with-python \
|
|
|
|
|
--with-default-dict=%{dictpath}
|
|
|
|
|
make -C po update-gmo
|
|
|
|
|
make
|
|
|
|
|
popd
|
|
|
|
|
%endif
|
2019-09-30 10:35:53 -04:00
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
2020-09-03 15:29:18 +08:00
|
|
|
%if %{with python2}
|
2019-09-30 10:35:53 -04:00
|
|
|
make install DESTDIR=$RPM_BUILD_ROOT 'pythondir=${pyexecdir}'
|
2020-09-03 15:29:18 +08:00
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
pushd %{py3dir}
|
|
|
|
|
make install DESTDIR=$RPM_BUILD_ROOT 'pythondir=${pyexecdir}'
|
|
|
|
|
popd
|
|
|
|
|
%endif
|
|
|
|
|
|
2019-09-30 10:35:53 -04:00
|
|
|
./util/cracklib-format cracklib-dicts/* | \
|
|
|
|
|
./util/cracklib-packer $RPM_BUILD_ROOT/%{dictpath}
|
|
|
|
|
./util/cracklib-format $RPM_BUILD_ROOT/%{dictdir}/cracklib-small | \
|
|
|
|
|
./util/cracklib-packer $RPM_BUILD_ROOT/%{dictdir}/cracklib-small
|
|
|
|
|
rm -f $RPM_BUILD_ROOT/%{dictdir}/cracklib-small
|
|
|
|
|
sed s,/usr/lib/cracklib_dict,%{dictpath},g lib/crack.h > $RPM_BUILD_ROOT/%{_includedir}/crack.h
|
|
|
|
|
ln -s cracklib-format $RPM_BUILD_ROOT/%{_sbindir}/mkdict
|
|
|
|
|
ln -s cracklib-packer $RPM_BUILD_ROOT/%{_sbindir}/packer
|
|
|
|
|
touch $RPM_BUILD_ROOT/top
|
|
|
|
|
|
|
|
|
|
toprelpath=..
|
|
|
|
|
touch $RPM_BUILD_ROOT/top
|
|
|
|
|
while ! test -f $RPM_BUILD_ROOT/%{_libdir}/$toprelpath/top ; do
|
|
|
|
|
toprelpath=../$toprelpath
|
|
|
|
|
done
|
|
|
|
|
rm -f $RPM_BUILD_ROOT/top
|
|
|
|
|
if test %{dictpath} != %{_libdir}/cracklib_dict ; then
|
|
|
|
|
ln -s $toprelpath%{dictpath}.hwm $RPM_BUILD_ROOT/%{_libdir}/cracklib_dict.hwm
|
|
|
|
|
ln -s $toprelpath%{dictpath}.pwd $RPM_BUILD_ROOT/%{_libdir}/cracklib_dict.pwd
|
|
|
|
|
ln -s $toprelpath%{dictpath}.pwi $RPM_BUILD_ROOT/%{_libdir}/cracklib_dict.pwi
|
|
|
|
|
fi
|
|
|
|
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/python*/site-packages/_cracklib*.*a
|
|
|
|
|
rm -f $RPM_BUILD_ROOT/%{_libdir}/libcrack.la
|
|
|
|
|
|
|
|
|
|
%find_lang %{name}
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
make test
|
|
|
|
|
|
|
|
|
|
%ldconfig_scriptlets
|
|
|
|
|
|
|
|
|
|
%files -f %{name}.lang
|
|
|
|
|
%defattr(-,root,root)
|
|
|
|
|
%doc README-LICENSE AUTHORS
|
|
|
|
|
%license COPYING.LIB
|
|
|
|
|
%{_sbindir}/*cracklib*
|
|
|
|
|
%{_sbindir}/mkdict
|
|
|
|
|
%{_sbindir}/packer
|
|
|
|
|
%{_libdir}/libcrack.so.*
|
|
|
|
|
%{_libdir}/cracklib_dict.*
|
|
|
|
|
%dir %{_datadir}/cracklib
|
|
|
|
|
%{_datadir}/cracklib/pw_dict.*
|
|
|
|
|
%{_datadir}/cracklib/cracklib-small.*
|
|
|
|
|
%{_datadir}/cracklib/cracklib.magic
|
|
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
|
%{_includedir}/*
|
|
|
|
|
%{_libdir}/libcrack.so
|
|
|
|
|
|
|
|
|
|
%files help
|
|
|
|
|
%doc README README-WORDS NEWS
|
|
|
|
|
|
2020-09-03 15:29:18 +08:00
|
|
|
%if %{with python2}
|
2019-09-30 10:35:53 -04:00
|
|
|
%files -n python2-cracklib
|
2020-09-03 15:29:18 +08:00
|
|
|
%{_libdir}/python2*/site-packages/_cracklib*.so
|
|
|
|
|
%{_libdir}/python2*/site-packages/*.py*
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
%files -n python3-cracklib
|
|
|
|
|
%{_libdir}/python3*/site-packages/_cracklib*.so
|
|
|
|
|
%{_libdir}/python3*/site-packages/*.py*
|
|
|
|
|
%{_libdir}/python3*/site-packages/__pycache__/*
|
|
|
|
|
%endif
|
2019-09-30 10:35:53 -04:00
|
|
|
|
|
|
|
|
%changelog
|
2020-09-14 11:33:45 +08:00
|
|
|
* Mon Sep 14 2020 wangchen <wangchen137@huawei.com> - 2.9.7-4
|
|
|
|
|
- Modify the URL of Source
|
|
|
|
|
|
2020-09-03 15:29:18 +08:00
|
|
|
* Thu Sep 3 2020 zhangxingliang <zhangxingliang3@huawei.com> - 2.9.7-3
|
|
|
|
|
- Add python3-cracklib package
|
|
|
|
|
|
2020-01-18 16:46:18 +08:00
|
|
|
* Sat Jan 18 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.9.7-2
|
|
|
|
|
- fix problem of error message about simplistic password
|
|
|
|
|
|
2020-01-10 16:13:42 +08:00
|
|
|
* Fri Jan 10 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.9.7-1
|
|
|
|
|
- clean code
|
|
|
|
|
|
|
|
|
|
* Fri Sep 27 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.9.6-17
|
2019-09-30 10:35:53 -04:00
|
|
|
- Add python2-cracklib package
|
|
|
|
|
|
2020-01-10 16:13:42 +08:00
|
|
|
* Fri Sep 20 2019 openEuler Buildteam <buildteam@openeuler.org> - 2.9.6-16
|
2019-09-30 10:35:53 -04:00
|
|
|
- Package init
|