Peng Wu b76fbc3
%global commit0 0c99dfff2a824c6f7210ff700c56b2c3d51e64cd
Peng Wu b76fbc3
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
Peng Wu b76fbc3
Peng Wu b76fbc3
# can't compile with python 3.x
Peng Wu b76fbc3
%define python3 %{nil}
Peng Wu b76fbc3
Peng Wu b76fbc3
%global common_desc \
Peng Wu b76fbc3
The nototools python package contains python scripts \
Peng Wu b76fbc3
used to maintain the Noto Fonts project, \
Peng Wu b76fbc3
including the google.com/get/noto website.
Peng Wu b76fbc3
Peng Wu b76fbc3
Name:		nototools
Peng Wu b76fbc3
Version:	0
35a08e1
Release:	0.20170929.git%{shortcommit0}%{?dist}
Peng Wu b76fbc3
Summary:	Noto fonts support tools and scripts plus web site generation
Peng Wu b76fbc3
Peng Wu b76fbc3
# In nototools source
Peng Wu b76fbc3
## nototools code is in ASL 2.0 license
Peng Wu b76fbc3
### third_party ucd code is in Unicode license
Peng Wu b76fbc3
License:	ASL 2.0
Peng Wu b76fbc3
URL:		https://github.com/googlei18n/nototools
Peng Wu b76fbc3
Source0:	https://github.com/googlei18n/nototools/archive/%{commit0}.tar.gz#/nototools-%{shortcommit0}.tar.gz
Peng Wu b76fbc3
Peng Wu b76fbc3
BuildArch:	noarch
Peng Wu b76fbc3
BuildRequires:	python2-devel
Peng Wu b76fbc3
%if %{with python3}
Peng Wu b76fbc3
BuildRequires:	python3-devel
Peng Wu b76fbc3
%endif # with python3
Peng Wu b76fbc3
Peng Wu b76fbc3
Requires:	python2-nototools = %{version}-%{release}
Peng Wu b76fbc3
Peng Wu b76fbc3
%description
Peng Wu b76fbc3
%common_desc
Peng Wu b76fbc3
Peng Wu b76fbc3
%if %{with python3}
Peng Wu b76fbc3
%package     -n python3-nototools
Peng Wu b76fbc3
Summary:	Noto tools for python 3
Peng Wu b76fbc3
Peng Wu b76fbc3
%description -n python3-nototools
Peng Wu b76fbc3
%common_desc
Peng Wu b76fbc3
Peng Wu b76fbc3
%endif # with python3
Peng Wu b76fbc3
Peng Wu b76fbc3
%package     -n python2-nototools
Peng Wu b76fbc3
Summary:	Noto tools for python 2
Peng Wu b76fbc3
Requires:	python2dist(fonttools)
Peng Wu b76fbc3
BuildRequires:	python2dist(fonttools)
Peng Wu b76fbc3
Peng Wu b76fbc3
%description -n python2-nototools
Peng Wu b76fbc3
%common_desc
Peng Wu b76fbc3
Peng Wu b76fbc3
%prep
Peng Wu b76fbc3
%autosetup -c
Peng Wu b76fbc3
# remove unneeded files
Peng Wu b76fbc3
rm -rf nototools-%{commit0}/third_party/{cldr,dspl,fontcrunch,ohchr,spiro,udhr,unicode}
Peng Wu b76fbc3
mv %{name}-%{commit0} python2
Peng Wu b76fbc3
Peng Wu b76fbc3
%if %{with python3}
Peng Wu b76fbc3
cp -a python2 python3
Peng Wu b76fbc3
%endif # with python3
Peng Wu b76fbc3
Peng Wu b76fbc3
# for documents
Peng Wu b76fbc3
cp python2/*.md python2/LICENSE .
Peng Wu b76fbc3
Peng Wu b76fbc3
%build
Peng Wu b76fbc3
pushd python2
Peng Wu b76fbc3
%py2_build
Peng Wu b76fbc3
popd
Peng Wu b76fbc3
Peng Wu b76fbc3
%if %{with python3}
Peng Wu b76fbc3
pushd python3
Peng Wu b76fbc3
%py3_build
Peng Wu b76fbc3
popd
Peng Wu b76fbc3
%endif # with python3
Peng Wu b76fbc3
Peng Wu b76fbc3
Peng Wu b76fbc3
%install
Peng Wu b76fbc3
%if %{with python3}
Peng Wu b76fbc3
pushd python3
Peng Wu b76fbc3
%py3_install
Peng Wu b76fbc3
popd
Peng Wu b76fbc3
%endif # with python3
Peng Wu b76fbc3
Peng Wu b76fbc3
pushd python2
Peng Wu b76fbc3
%py2_install
Peng Wu b76fbc3
for lib in %{buildroot}%{python2_sitelib}/nototools/*.py; do
Peng Wu b76fbc3
 sed '1{\@^#!/usr/bin/env python@d}' $lib > $lib.new &&
Peng Wu b76fbc3
 touch -r $lib $lib.new &&
Peng Wu b76fbc3
 mv $lib.new $lib
Peng Wu b76fbc3
done
Peng Wu b76fbc3
popd
Peng Wu b76fbc3
Peng Wu b76fbc3
Peng Wu b76fbc3
%check
Peng Wu b76fbc3
pushd python2
Peng Wu b76fbc3
%{__python2} setup.py test
Peng Wu b76fbc3
popd
Peng Wu b76fbc3
Peng Wu b76fbc3
%if %{with python3}
Peng Wu b76fbc3
pushd python3
Peng Wu b76fbc3
%{__python3} setup.py test
Peng Wu b76fbc3
popd
Peng Wu b76fbc3
%endif
Peng Wu b76fbc3
Peng Wu b76fbc3
Peng Wu b76fbc3
%files
Peng Wu b76fbc3
%license LICENSE
Peng Wu b76fbc3
%doc CONTRIBUTING.md README.md
Peng Wu b76fbc3
%{_bindir}/add_vs_cmap.py
Peng Wu b76fbc3
%{_bindir}/autofix_for_release.py
Peng Wu b76fbc3
%{_bindir}/create_image.py
Peng Wu b76fbc3
%{_bindir}/decompose_ttc.py
Peng Wu b76fbc3
%{_bindir}/drop_hints.py
Peng Wu b76fbc3
%{_bindir}/dump_otl.py
Peng Wu b76fbc3
%{_bindir}/fix_khmer_and_lao_coverage.py
Peng Wu b76fbc3
%{_bindir}/fix_noto_cjk_thin.py
Peng Wu b76fbc3
%{_bindir}/generate_sample_text.py
Peng Wu b76fbc3
%{_bindir}/generate_website_2_data.py
Peng Wu b76fbc3
%{_bindir}/merge_fonts.py
Peng Wu b76fbc3
%{_bindir}/merge_noto.py
Peng Wu b76fbc3
%{_bindir}/noto_lint.py
Peng Wu b76fbc3
%{_bindir}/notocoverage
Peng Wu b76fbc3
%{_bindir}/notodiff
Peng Wu b76fbc3
%{_bindir}/scale.py
Peng Wu b76fbc3
%{_bindir}/subset.py
Peng Wu b76fbc3
%{_bindir}/subset_symbols.py
Peng Wu b76fbc3
%{_bindir}/test_vertical_extents.py
Peng Wu b76fbc3
Peng Wu b76fbc3
Peng Wu b76fbc3
%files -n python2-nototools
Peng Wu b76fbc3
%{python2_sitelib}/nototools
Peng Wu b76fbc3
%{python2_sitelib}/nototools-0.0.1-py2.7.egg-info
Peng Wu b76fbc3
%{python2_sitelib}/third_party
Peng Wu b76fbc3
Peng Wu b76fbc3
%if %{with python3}
Peng Wu b76fbc3
%files -n python3-nototools
Peng Wu b76fbc3
%{python3_sitelib}/nototools
Peng Wu b76fbc3
%{python3_sitelib}/nototools-0.0.1-py3.?.egg-info
Peng Wu b76fbc3
%{python3_sitelib}/third_party
Peng Wu b76fbc3
%endif # with python3
Peng Wu b76fbc3
Peng Wu b76fbc3
Peng Wu b76fbc3
%changelog
35a08e1
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.20170929.git0c99dff
35a08e1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
35a08e1
378dd53
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.20170928.git0c99dff
378dd53
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
378dd53
af3780d
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.20170927.git0c99dff
af3780d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
af3780d
Peng Wu b76fbc3
* Mon Dec 18 2017 Peng Wu <pwu@redhat.com> - 0-0.20170926.git0c99dff
Peng Wu b76fbc3
- Initial package