%global commit0 0c99dfff2a824c6f7210ff700c56b2c3d51e64cd %global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) # can't compile with python 3.x %define python3 %{nil} %global common_desc \ The nototools python package contains python scripts \ used to maintain the Noto Fonts project, \ including the google.com/get/noto website. Name: nototools Version: 0 Release: 0.20170926.git%{shortcommit0}%{?dist} Summary: Noto fonts support tools and scripts plus web site generation # In nototools source ## nototools code is in ASL 2.0 license ### third_party ucd code is in Unicode license License: ASL 2.0 URL: https://github.com/googlei18n/nototools Source0: https://github.com/googlei18n/nototools/archive/%{commit0}.tar.gz#/nototools-%{shortcommit0}.tar.gz BuildArch: noarch BuildRequires: python2-devel %if %{with python3} BuildRequires: python3-devel %endif # with python3 Requires: python2-nototools = %{version}-%{release} %description %common_desc %if %{with python3} %package -n python3-nototools Summary: Noto tools for python 3 %description -n python3-nototools %common_desc %endif # with python3 %package -n python2-nototools Summary: Noto tools for python 2 Requires: python2dist(fonttools) BuildRequires: python2dist(fonttools) %description -n python2-nototools %common_desc %prep %autosetup -c # remove unneeded files rm -rf nototools-%{commit0}/third_party/{cldr,dspl,fontcrunch,ohchr,spiro,udhr,unicode} mv %{name}-%{commit0} python2 %if %{with python3} cp -a python2 python3 %endif # with python3 # for documents cp python2/*.md python2/LICENSE . %build pushd python2 %py2_build popd %if %{with python3} pushd python3 %py3_build popd %endif # with python3 %install %if %{with python3} pushd python3 %py3_install popd %endif # with python3 pushd 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 popd %check pushd python2 %{__python2} setup.py test popd %if %{with python3} pushd python3 %{__python3} setup.py test popd %endif %files %license LICENSE %doc CONTRIBUTING.md README.md %{_bindir}/add_vs_cmap.py %{_bindir}/autofix_for_release.py %{_bindir}/create_image.py %{_bindir}/decompose_ttc.py %{_bindir}/drop_hints.py %{_bindir}/dump_otl.py %{_bindir}/fix_khmer_and_lao_coverage.py %{_bindir}/fix_noto_cjk_thin.py %{_bindir}/generate_sample_text.py %{_bindir}/generate_website_2_data.py %{_bindir}/merge_fonts.py %{_bindir}/merge_noto.py %{_bindir}/noto_lint.py %{_bindir}/notocoverage %{_bindir}/notodiff %{_bindir}/scale.py %{_bindir}/subset.py %{_bindir}/subset_symbols.py %{_bindir}/test_vertical_extents.py %files -n python2-nototools %{python2_sitelib}/nototools %{python2_sitelib}/nototools-0.0.1-py2.7.egg-info %{python2_sitelib}/third_party %if %{with python3} %files -n python3-nototools %{python3_sitelib}/nototools %{python3_sitelib}/nototools-0.0.1-py3.?.egg-info %{python3_sitelib}/third_party %endif # with python3 %changelog * Mon Dec 18 2017 Peng Wu - 0-0.20170926.git0c99dff - Initial package