Blame SPECS/google-noto-cjk-fonts.spec

0678c2
%global commit0 782eab531e724779772302b835661b7b12a6b3a8
0678c2
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
0678c2
0678c2
%global fontname google-noto-cjk
0678c2
%global fontconf google-noto
0678c2
%global fontconf2 65-%{fontconf}-cjk-fonts.conf
0678c2
0678c2
%global common_desc \
0678c2
Noto CJK fonts, supporting Simplified Chinese, Traditional Chinese, \
0678c2
Japanese, and Korean. The supported scripts are Han, Hiragana, Katakana, \
0678c2
Hangul, and Bopomofo. Latin, Greek, Cyrllic, and various symbols are also \
0678c2
supported for compatibility with CJK standards. \
0678c2
%{nil}
0678c2
0678c2
Name:           google-noto-cjk-fonts
0678c2
Version:        20201206
0678c2
Release:        4%{?dist}
0678c2
Summary:        Google Noto Sans CJK Fonts
0678c2
0678c2
License:        OFL
0678c2
URL:            https://github.com/googlei18n/noto-cjk
0678c2
Source0:        https://github.com/googlei18n/noto-cjk/archive/%{commit0}.tar.gz#/noto-cjk-%{shortcommit0}.tar.gz
0678c2
Source1:        genfontconf.py
0678c2
Source2:        genfontconf.sh
0678c2
Source3:        %{fontconf2}
0678c2
0678c2
BuildArch:      noarch
0678c2
BuildRequires:  fontpackages-devel
0678c2
BuildRequires:  python3
0678c2
BuildRequires:  /usr/bin/xmllint
0678c2
Requires:       fontpackages-filesystem
0678c2
Requires:       google-noto-sans-cjk-ttc-fonts
0678c2
Requires:       google-noto-serif-cjk-ttc-fonts
0678c2
0678c2
%if 0%{?fedora}
0678c2
0678c2
Obsoletes:      google-noto-sans-cjk-fonts < 20150617
0678c2
Provides:       google-noto-sans-cjk-fonts = 20150617
0678c2
0678c2
# notocjkrep Package Name
0678c2
%define notocjkrep(:)\
0678c2
%define pname %(echo %{*} | tr "A-Z " "a-z-")\
0678c2
Obsoletes:      google-noto-%{pname}-fonts < 20150617\
0678c2
Provides:       google-noto-%{pname}-fonts = 20150617\
0678c2
Obsoletes:      google-noto-cjk-%{pname}-fonts < %{version}-%{release}\
0678c2
Provides:       google-noto-cjk-%{pname}-fonts = %{version}-%{release}\
0678c2
0678c2
0678c2
%notocjkrep Sans Simplified Chinese
0678c2
%notocjkrep Sans Traditional Chinese
0678c2
%notocjkrep Sans Japanese
0678c2
%notocjkrep Sans Korean
0678c2
0678c2
%endif
0678c2
0678c2
0678c2
%description
0678c2
%common_desc
0678c2
0678c2
%package common
0678c2
Summary:        Common files for Noto CJK fonts
0678c2
0678c2
%description common
0678c2
%common_desc
0678c2
0678c2
Common files for Google Noto CJK fonts.
0678c2
0678c2
0678c2
# notocjkpkg [-n sub-package-name] [-f font-file] [-p priority] Font Name
0678c2
# -n sub package name
0678c2
# -f font file name
0678c2
# -p overrides fontconfig .conf priority (default 66)
0678c2
%define notocjkpkg(n:f:p:) \
0678c2
# override _font_pkg_name to avoid name changes in _font_pkg \
0678c2
%define _font_pkg_name() %1 \
0678c2
%define subpkgname %{-n:%{-n*}} \
0678c2
%define fontfiles %{-f:%{-f*}}\
0678c2
%define fconf %{-p*}%{!-p:66}-%{fontconf}-%{subpkgname}.conf\
0678c2
%package -n     google-noto-%subpkgname-fonts \
0678c2
Summary:        %* font files for %{name} \
0678c2
Requires:       %{name}-common = %{version}-%{release} \
0678c2
\
0678c2
%description -n google-noto-%subpkgname-fonts \
0678c2
%common_desc \
0678c2
\
0678c2
The google-noto-%subpkgname-fonts package contains %* fonts. \
0678c2
\
0678c2
%_font_pkg -n google-noto-%subpkgname-fonts -f %{fconf} %fontfiles \
0678c2
%{nil}
0678c2
0678c2
0678c2
%notocjkpkg -n sans-cjk-ttc -f NotoSansCJK-*.ttc -p 65-0 Sans OTC
0678c2
0678c2
0678c2
%notocjkpkg -n serif-cjk-ttc -f NotoSerifCJK-*.ttc -p 65-0 Serif OTC
0678c2
0678c2
0678c2
%notocjkpkg -n sans-cjk-jp -f NotoSansCJKjp-*.otf Japanese Multilingual Sans OTF
0678c2
0678c2
0678c2
%notocjkpkg -n serif-cjk-jp -f NotoSerifCJKjp-*.otf Japanese Multilingual Serif OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-mono-cjk-jp -f NotoSansMonoCJKjp-*.otf Japanese Multilingual Sans Mono OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-cjk-kr -f NotoSansCJKkr-*.otf Korean Multilingual Sans OTF
0678c2
0678c2
0678c2
%notocjkpkg -n serif-cjk-kr -f NotoSerifCJKkr-*.otf Korean Multilingual Serif OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-mono-cjk-kr -f NotoSansMonoCJKkr-*.otf Korean Multilingual Sans Mono OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-cjk-sc -f NotoSansCJKsc-*.otf Simplified Chinese Multilingual Sans OTF
0678c2
0678c2
0678c2
%notocjkpkg -n serif-cjk-sc -f NotoSerifCJKsc-*.otf Simplified Chinese Multilingual Serif OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-mono-cjk-sc -f NotoSansMonoCJKsc-*.otf Simplified Chinese Multilingual Sans Mono OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-cjk-tc -f NotoSansCJKtc-*.otf Traditional Chinese Multilingual Sans OTF
0678c2
0678c2
0678c2
%notocjkpkg -n serif-cjk-tc -f NotoSerifCJKtc-*.otf Traditional Chinese Multilingual Serif OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-mono-cjk-tc -f NotoSansMonoCJKtc-*.otf Traditional Chinese Multilingual Sans Mono OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-cjk-hk -f NotoSansCJKhk-*.otf Traditional Chinese Multilingual Sans OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-mono-cjk-hk -f NotoSansMonoCJKhk-*.otf Traditional Chinese Multilingual Sans Mono OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-jp -f NotoSansJP-*.otf Japanese Region-specific Sans OTF
0678c2
0678c2
0678c2
%notocjkpkg -n serif-jp -f NotoSerifJP-*.otf Japanese Region-specific Serif OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-kr -f NotoSansKR-*.otf Korean Region-specific Sans OTF
0678c2
0678c2
0678c2
%notocjkpkg -n serif-kr -f NotoSerifKR-*.otf Korean Region-specific Serif OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-sc -f NotoSansSC-*.otf Simplified Chinese Region-specific Sans OTF
0678c2
0678c2
0678c2
%notocjkpkg -n serif-sc -f NotoSerifSC-*.otf Simplified Chinese Region-specific Serif OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-tc -f NotoSansTC-*.otf Traditional Chinese Region-specific Sans OTF
0678c2
0678c2
0678c2
%notocjkpkg -n serif-tc -f NotoSerifTC-*.otf Traditional Chinese Region-specific Serif OTF
0678c2
0678c2
0678c2
%notocjkpkg -n sans-hk -f NotoSansHK-*.otf Traditional Chinese Region-specific Sans OTF
0678c2
0678c2
0678c2
%prep
0678c2
%setup -q -n noto-cjk-%{version}-cjk
0678c2
cp -p %{SOURCE1} %{SOURCE2} .
0678c2
# generate the font conf files
0678c2
bash -x ./genfontconf.sh
0678c2
0678c2
0678c2
%build
0678c2
0678c2
0678c2
%install
0678c2
install -m 0755 -d %{buildroot}%{_fontdir}
0678c2
0678c2
# copy OTC files
0678c2
install -m 0644 -p NotoSansCJK-*.ttc %{buildroot}%{_fontdir}
0678c2
install -m 0644 -p NotoSerifCJK-*.ttc %{buildroot}%{_fontdir}
0678c2
0678c2
# copy Multilingual OTF files
0678c2
install -m 0644 -p NotoSansCJK{jp,kr,sc,tc,hk}-*.otf %{buildroot}%{_fontdir}
0678c2
install -m 0644 -p NotoSerifCJK{jp,kr,sc,tc}-*.otf %{buildroot}%{_fontdir}
0678c2
install -m 0644 -p NotoSansMonoCJK{jp,kr,sc,tc,hk}-*.otf %{buildroot}%{_fontdir}
0678c2
0678c2
# copy Region-specific OTF
0678c2
install -m 0644 -p NotoSans{JP,KR,SC,TC,HK}-*.otf %{buildroot}%{_fontdir}
0678c2
install -m 0644 -p NotoSerif{JP,KR,SC,TC}-*.otf %{buildroot}%{_fontdir}
0678c2
0678c2
0678c2
install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \
0678c2
            %{buildroot}%{_fontconfig_confdir}
0678c2
0678c2
for f in sans-cjk-ttc serif-cjk-ttc \
0678c2
    sans-cjk-jp serif-cjk-jp sans-mono-cjk-jp \
0678c2
    sans-cjk-kr serif-cjk-kr sans-mono-cjk-kr \
0678c2
    sans-cjk-sc serif-cjk-sc sans-mono-cjk-sc \
0678c2
    sans-cjk-tc serif-cjk-tc sans-mono-cjk-tc \
0678c2
    sans-cjk-hk sans-mono-cjk-hk \
0678c2
    sans-jp serif-jp \
0678c2
    sans-kr serif-kr \
0678c2
    sans-sc serif-sc \
0678c2
    sans-tc serif-tc \
0678c2
    sans-hk;
0678c2
do
0678c2
    fconf=$(basename -a *-%{fontconf}-$f.conf)
0678c2
    if [ "$(echo $fconf | wc -w)" -ne 1 ]; then
0678c2
       echo "Did not find unique \*-%{fontconf}-$f.conf file"
0678c2
       exit 1
0678c2
    fi
0678c2
0678c2
    install -m 0644 -p ${fconf} \
0678c2
                %{buildroot}%{_fontconfig_templatedir}/${fconf}
0678c2
0678c2
    ln -s %{_fontconfig_templatedir}/${fconf} \
0678c2
         %{buildroot}%{_fontconfig_confdir}/${fconf}
0678c2
done
0678c2
0678c2
install -m 0644 -p %{SOURCE3} \
0678c2
            %{buildroot}%{_fontconfig_templatedir}/%{fontconf2}
0678c2
0678c2
ln -s %{_fontconfig_templatedir}/%{fontconf2} \
0678c2
     %{buildroot}%{_fontconfig_confdir}/%{fontconf2}
0678c2
0678c2
0678c2
%files
0678c2
0678c2
0678c2
%files common
0678c2
%doc NEWS.md HISTORY.md README-formats.md README-third_party.md
0678c2
%license LICENSE
0678c2
%{_fontconfig_templatedir}/%{fontconf2}
0678c2
%config(noreplace) %{_fontconfig_confdir}/%{fontconf2}
0678c2
0678c2
0678c2
%changelog
0678c2
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 20201206-4
0678c2
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
0678c2
  Related: rhbz#1991688
0678c2
0678c2
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 20201206-3
0678c2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
0678c2
0678c2
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 20201206-2
0678c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
0678c2
0678c2
* Mon Jan 18 2021 Peng Wu <pwu@redhat.com> - 20201206-1
0678c2
- Update to v20201206
0678c2
0678c2
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20190416-7
0678c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
0678c2
0678c2
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 20190416-6
0678c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
0678c2
0678c2
* Tue Aug 13 2019 Peng Wu <pwu@redhat.com> - 20190416-5
0678c2
- Update 65-google-noto-cjk-fonts.conf for HK
0678c2
0678c2
* Thu Aug  1 2019 Peng Wu <pwu@redhat.com> - 20190416-4
0678c2
- Correct lang property of fontconfig in Noto Sans CJK fonts
0678c2
0678c2
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 20190416-3
0678c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
0678c2
0678c2
* Tue May 14 2019 Peng Wu <pwu@redhat.com> - 20190416-2
0678c2
- Include HongKong fonts
0678c2
0678c2
* Wed Apr 17 2019 Peng Wu <pwu@redhat.com> - 20190416-1
0678c2
- Update to git commit be6c059
0678c2
0678c2
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 20170602-10
0678c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
0678c2
0678c2
* Fri Dec 14 2018 Peng Wu <pwu@redhat.com> - 20170602-9
0678c2
- Support Macau locale
0678c2
0678c2
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20170602-8
0678c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
0678c2
0678c2
* Mon Apr 16 2018 Peng Wu <pwu@redhat.com> - 20170602-7
0678c2
- Make Noto CJK OTC files as default CJK fonts
0678c2
0678c2
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 20170602-6
0678c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
0678c2
0678c2
* Mon Jan 22 2018 Akira TAGOH <tagoh@redhat.com> - 20170602-5
0678c2
- Update the priority to change the default font to Noto.
0678c2
0678c2
* Mon Dec 11 2017 Peng Wu <pwu@redhat.com> - 20170602-4
0678c2
- Simplify spec file
0678c2
0678c2
* Thu Dec  7 2017 Peng Wu <pwu@redhat.com> - 20170602-3
0678c2
- Include more fonts and sub package fonts
0678c2
0678c2
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20170602-2
0678c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
0678c2
0678c2
* Wed Jun  7 2017 Peng Wu <pwu@redhat.com> - 20170602-1
0678c2
- Include Serif fonts
0678c2
0678c2
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.004-8
0678c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
0678c2
0678c2
* Fri Dec  2 2016 Peng Wu <pwu@redhat.com> - 1.004-7
0678c2
- Rebuilt to fixes the spec file
0678c2
0678c2
* Fri Dec  2 2016 Peng Wu <pwu@redhat.com> - 1.004-6
0678c2
- Disable Obsoletes for epel: for google-noto-sans-cjk-fonts (rh#1396260)
0678c2
- Disable notocjkrep macro definition for epel
0678c2
0678c2
* Fri Apr 29 2016 Peng Wu <pwu@redhat.com> - 1.004-5
0678c2
- Replace google-noto-sans-cjk-fonts package
0678c2
0678c2
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.004-4
0678c2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
0678c2
0678c2
* Fri Nov 13 2015 Peng Wu <pwu@redhat.com> - 1.004-3
0678c2
- Use TTC Files
0678c2
0678c2
* Mon Oct 26 2015 Peng Wu <pwu@redhat.com> - 1.004-2
0678c2
- Fixes Spec
0678c2
0678c2
* Mon Oct 26 2015 Peng Wu <pwu@redhat.com> - 1.004-1
0678c2
- Initial Version