python-FormEncode/python-formencode.spec
caodongxia f850eea0ba update to 2.0.1
(cherry picked from commit a5b351095740fb82af3d01eb435d81ff4f9fe706)
2022-08-09 09:27:10 +08:00

74 lines
2.7 KiB
RPMSpec

%global srcname FormEncode
Name: python-%{srcname}
Version: 2.0.1
Release: 1
Summary: HTML form validation, generation, and convertion package
License: MIT and Python
URL: http://formencode.org/
Source0: https://files.pythonhosted.org/packages/source/F/%{srcname}/%{srcname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python3-pip
%description
FormEncode validates and converts nested structures. It allows for a
declarative form of defining the validation, and decoupled processes
for filling and generating forms.
%package -n python3-formencode
Summary: HTML form validation, generation, and convertion package
BuildRequires: python3-devel python3-setuptools python3-docutils
BuildRequires: python3-setuptools_scm
Requires: python3-setuptools python-formencode-langpacks
%{?python_provide:%python_provide python3-formencode}
%description -n python3-formencode
FormEncode validates and converts nested structures. It allows for a
declarative form of defining the validation, and decoupled processes
for filling and generating forms.
This package contains the python3 version of the module.
%package -n python-formencode-langpacks
Summary: Locale files for the python-formencode library
%description -n python-formencode-langpacks
The FormEncode library validates and converts nested structures. This package
contains the locale files for localizing the message strings in code within the
library.
%prep
%autosetup -n %{srcname}-%{version} -p1
%build
sed -i "s|'setuptools_scm_git_archive',||" setup.py
%py3_build
%install
%py3_install
rm -rf $RPM_BUILD_ROOT%{python3_sitelib}/docs/
install -d -m 0755 $RPM_BUILD_ROOT%{python3_sitelib}/formencode/i18n
pushd formencode
cp -arf i18n/* $RPM_BUILD_ROOT%{python3_sitelib}/formencode/i18n
popd
for file in $RPM_BUILD_ROOT%{python3_sitelib}/formencode/i18n/* ; do
if [ -d $file ] ; then
if [ -e $file/LC_MESSAGES/%{srcname}.mo ] ; then
mkdir -p $RPM_BUILD_ROOT%{_datadir}/locale/`basename $file`/LC_MESSAGES/
mv $file/LC_MESSAGES/%{srcname}.mo $RPM_BUILD_ROOT%{_datadir}/locale/`basename $file`/LC_MESSAGES/
fi
fi
done
rm -rf $RPM_BUILD_ROOT%{python3_sitelib}/formencode/i18n
rm -rf $RPM_BUILD_ROOT/usr/LICENSE.txt
%find_lang %{srcname}
%files -n python3-formencode
%doc FormEncode.egg-info/PKG-INFO LICENSE.txt docs
%{python3_sitelib}/formencode/
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info/
%files -n python-formencode-langpacks -f %{srcname}.lang
%changelog
* Mon Aug 8 2022 caodongxia <caodongxia@h-partners.com> - 2.0.1-1
- Update to 2.0.1
* Wed May 26 2021 Ge Wang <wangge20@huawei.com> - 2.0.0-1
- Package init