python-django-debreach/python-django-debreach.spec

93 lines
2.9 KiB
RPMSpec
Raw Normal View History

2022-11-07 14:51:51 +08:00
%global _empty_manifest_terminate_build 0
2021-01-29 15:31:44 +08:00
%global pypi_name django-debreach
Name: python-%{pypi_name}
2022-11-07 14:51:51 +08:00
Version: 2.1.0
Release: 1
2021-01-29 15:31:44 +08:00
Summary: Basic/extra mitigation against the BREACH attack for Django projects
2022-05-11 14:57:57 +08:00
License: BSD-2-Clause
2021-01-29 15:31:44 +08:00
URL: http://github.com/lpomfrey/django-debreach
2022-11-07 14:51:51 +08:00
Source0: https://files.pythonhosted.org/packages/1f/1a/2bc5970d6b848c7ff4ab2932493a8e25bbed47f7668e4c3338152defc01a/django-debreach-2.1.0.tar.gz
Patch0: 0001-add-setup.py.patch
2021-01-29 15:31:44 +08:00
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-Django
BuildRequires: python3-setuptools
BuildRequires: python3-sphinx
2022-11-07 14:51:51 +08:00
BuildRequires: python3-pip
BuildRequires: python3-wheel
2021-01-29 15:31:44 +08:00
%description
Basic/extra mitigation against the BREACH attack for Django projects.
When combined with rate limiting in your web-server, or by using something
like django-ratelimit, the techniques here should provide at least some
protection against the BREACH attack.
%package -n python3-%{pypi_name}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
Requires: python3dist(django) >= 2.0
%description -n python3-%{pypi_name}
Basic/extra mitigation against the BREACH attack for Django projects.
When combined with rate limiting in your web-server, or by using something
like django-ratelimit, the techniques here should provide at least some
protection against the BREACH attack.
%prep
%autosetup -n %{pypi_name}-%{version}
2022-11-07 14:51:51 +08:00
%patch0
2021-01-29 15:31:44 +08:00
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
%py3_build
2022-11-07 14:51:51 +08:00
2021-01-29 15:31:44 +08:00
%install
%py3_install
2022-11-07 14:51:51 +08:00
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
2021-01-29 15:31:44 +08:00
%check
PYTHONPATH=. %{__python3} setup.py test
2022-11-07 14:51:51 +08:00
%files -n python3-%{pypi_name} -f filelist.lst
%dir %{python3_sitelib}/*
%{_docdir}/python-%{pypi_name}/docs/*
2021-01-29 15:31:44 +08:00
%changelog
2022-11-07 14:51:51 +08:00
* Mon Nov 07 2022 jiangxinyu <jiangxinyu@kylinos.cn> - 2.1.0-1
- Upgrade package to version 2.1.0
2022-05-11 14:57:57 +08:00
* Wed May 11 2022 yangping <yangping69@h-partners> - 2.0.1-2
- License compliance rectification
2022-11-07 14:51:51 +08:00
* Fri Jan 29 2021 liusheng <liusheng2048@gmail.com> - 2.0.1-1
2021-01-29 15:31:44 +08:00
- Init package for python-django-debreach