nototools/nototools.spec
2019-11-30 16:42:39 +08:00

108 lines
2.7 KiB
RPMSpec

%global commit0 9c4375f07c9adc00c700c5d252df6a25d7425870
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
Name: nototools
Version: 0
Release: 1.20190712.git%{shortcommit0}
Summary: Noto fonts support tools and scripts plus web site generation
License: ASL 2.0
URL: https://github.com/googlei18n/nototools
Source0: https://github.com/googlei18n/nototools/archive/%{commit0}/nototools-%{shortcommit0}.tar.gz
Patch0000: nototools-fixes-indent.patch
Patch0001: nototools-python3.patch
Patch0002: nototools-python3-replace-two-more-xrange-with-range.patch
BuildArch: noarch
BuildRequires: python2-devel python3-devel
Requires: python2-nototools = %{version}-%{release} python3-nototools = %{version}-%{release}
%description
The tools package contains python scripts, \
these scripts used to maintain the Noto Fonts project.
%package help
Summary: document for nototools
%description help
Help document for nototools
%package -n python3-nototools
Summary: Noto tools for python 3
Requires: python3dist(fonttools)
BuildRequires: python3dist(fonttools)
%description -n python3-nototools
The tools package contains python3 scripts.
%package -n python2-nototools
Summary: Noto tools for python 2
Requires: python2dist(fonttools)
BuildRequires: python2dist(fonttools)
%description -n python2-nototools
The tools package contains python2 scripts.
%prep
%autosetup -c -p0
rm -rf nototools-%{commit0}/third_party/{cldr,dspl,fontcrunch,ohchr,spiro,udhr,unicode}
mv %{name}-%{commit0} python2
cp -a python2 python3
cp python2/*.md python2/LICENSE .
%build
cd python2
%py2_build
cd ..
cd python3
%py3_build
cd ..
%install
cd python3
%py3_install
for lib in %{buildroot}%{python3_sitelib}/nototools/*.py; do
sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
touch -r $lib $lib.new &&
mv $lib.new $lib
done
cd ..
cd python2
%py2_install
for lib in %{buildroot}%{python2_sitelib}/nototools/*.py; do
sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
touch -r $lib $lib.new &&
mv $lib.new $lib
done
cd ..
%check
cd python2
%{__python2} setup.py test
cd ..
%files
%license LICENSE
%{_bindir}/*.py
%{_bindir}/notocoverage
%{_bindir}/notodiff
%files help
%doc CONTRIBUTING.md README.md
%files -n python2-nototools
%{python2_sitelib}/nototools
%{python2_sitelib}/nototools-0.0.1-py2.7.egg-info
%{python2_sitelib}/third_party
%files -n python3-nototools
%{python3_sitelib}/nototools
%{python3_sitelib}/nototools-0.0.1-py3.?.egg-info
%{python3_sitelib}/third_party
%changelog
* Thu Nov 21 2019 zhujunhao <zhujunhao5@huawei.com> - 0-1.20190712.git9c4375f
- Initial package