add a fontconfig priority option to %notopkg

allows overriding the default 66 priority with eg "-p 65"
This commit is contained in:
Jens Petersen 2017-07-05 18:52:10 +09:00
parent dbfd774e64
commit 2a1f6c4f88

View File

@ -1,5 +1,5 @@
%global fontname google-noto
%global fontconf 66-%{fontname}
%global fontconf %{fontname}
%global common_desc Noto fonts aims to remove tofu from web by providing fonts for all \
Unicode supported scripts. Its design goal is to achieve visual harmonization\
between multiple scripts. Noto family supports almost all scripts available\
@ -10,7 +10,7 @@ in Unicode.\
Name: %{fontname}-fonts
Version: 20161022
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Hinted and Non Hinted OpenType fonts for Unicode scripts
Group: User Interface/X
License: OFL
@ -18,126 +18,126 @@ URL: https://github.com/googlei18n/noto-fonts/
# downloaded from https://github.com/googlei18n/noto-fonts/tree/86b2e553c3e3e4d6614dadd1fa0a7a6dafd74552 -> download [zip]
# link https://codeload.github.com/googlei18n/noto-fonts/zip/86b2e553c3e3e4d6614dadd1fa0a7a6dafd74552
Source0: noto-fonts-%{commit}.zip
Source2: %{fontconf}-sans.conf
Source3: %{fontconf}-sans-armenian.conf
Source4: %{fontconf}-sans-avestan.conf
Source5: %{fontconf}-sans-bengali.conf
Source6: %{fontconf}-sans-bengali-ui.conf
Source7: %{fontconf}-sans-brahmi.conf
Source8: %{fontconf}-sans-carian.conf
Source9: %{fontconf}-sans-cherokee.conf
Source10: %{fontconf}-sans-coptic.conf
Source11: %{fontconf}-sans-deseret.conf
Source12: %{fontconf}-sans-devanagari.conf
Source13: %{fontconf}-sans-devanagari-ui.conf
Source14: %{fontconf}-sans-egyptian-hieroglyphs.conf
Source15: %{fontconf}-sans-ethiopic.conf
Source16: %{fontconf}-sans-georgian.conf
Source17: %{fontconf}-sans-glagolitic.conf
Source18: %{fontconf}-sans-hebrew.conf
Source19: %{fontconf}-sans-imperial-aramaic.conf
Source20: %{fontconf}-sans-kaithi.conf
Source21: %{fontconf}-sans-kannada.conf
Source22: %{fontconf}-sans-kayah-li.conf
Source23: %{fontconf}-sans-kharoshthi.conf
Source24: %{fontconf}-sans-khmer.conf
Source25: %{fontconf}-sans-khmer-ui.conf
Source26: %{fontconf}-sans-lao.conf
Source27: %{fontconf}-sans-lao-ui.conf
Source28: %{fontconf}-sans-lisu.conf
Source29: %{fontconf}-sans-lycian.conf
Source30: %{fontconf}-sans-lydian.conf
Source31: %{fontconf}-sans-malayalam.conf
Source32: %{fontconf}-sans-malayalam-ui.conf
Source33: %{fontconf}-sans-mandaic.conf
Source34: %{fontconf}-sans-meetei-mayek.conf
Source35: %{fontconf}-sans-nko.conf
Source36: %{fontconf}-sans-old-south-arabian.conf
Source37: %{fontconf}-sans-old-turkic.conf
Source38: %{fontconf}-sans-osmanya.conf
Source39: %{fontconf}-sans-phoenician.conf
Source40: %{fontconf}-sans-shavian.conf
Source41: %{fontconf}-sans-symbols.conf
Source42: %{fontconf}-sans-tagalog.conf
Source43: %{fontconf}-sans-tai-tham.conf
Source44: %{fontconf}-sans-tamil.conf
Source45: %{fontconf}-sans-tamil-ui.conf
Source46: %{fontconf}-sans-telugu.conf
Source47: %{fontconf}-sans-thai.conf
Source48: %{fontconf}-sans-thai-ui.conf
Source49: %{fontconf}-sans-ugaritic.conf
Source50: %{fontconf}-sans-ui.conf
Source51: %{fontconf}-sans-vai.conf
Source52: %{fontconf}-serif-armenian.conf
Source53: %{fontconf}-serif.conf
Source54: %{fontconf}-serif-georgian.conf
Source55: %{fontconf}-serif-khmer.conf
Source56: %{fontconf}-serif-lao.conf
Source57: %{fontconf}-serif-thai.conf
Source58: %{fontconf}-sans-kannada-ui.conf
Source59: %{fontconf}-sans-telugu-ui.conf
Source60: %{fontconf}-sans-gujarati.conf
Source61: %{fontconf}-sans-gujarati-ui.conf
Source62: %{fontconf}-sans-hanunoo.conf
Source63: %{fontconf}-sans-tai-viet.conf
Source64: %{fontconf}-kufi-arabic.conf
Source65: %{fontconf}-naskh-arabic.conf
Source66: %{fontconf}-naskh-arabic-ui.conf
Source67: %{fontconf}-sans-balinese.conf
Source68: %{fontconf}-sans-bamum.conf
Source69: %{fontconf}-sans-batak.conf
Source70: %{fontconf}-sans-buginese.conf
Source71: %{fontconf}-sans-buhid.conf
Source72: %{fontconf}-sans-canadian-aboriginal.conf
Source73: %{fontconf}-sans-cham.conf
Source74: %{fontconf}-sans-cuneiform.conf
Source75: %{fontconf}-sans-cypriot.conf
Source76: %{fontconf}-sans-gothic.conf
Source77: %{fontconf}-sans-gurmukhi.conf
Source78: %{fontconf}-sans-gurmukhi-ui.conf
Source79: %{fontconf}-sans-inscriptional-pahlavi.conf
Source80: %{fontconf}-sans-inscriptional-parthian.conf
Source81: %{fontconf}-sans-javanese.conf
Source82: %{fontconf}-sans-lepcha.conf
Source83: %{fontconf}-sans-limbu.conf
Source84: %{fontconf}-sans-linear-b.conf
Source85: %{fontconf}-sans-mongolian.conf
Source86: %{fontconf}-sans-myanmar.conf
Source87: %{fontconf}-sans-myanmar-ui.conf
Source88: %{fontconf}-sans-new-tai-lue.conf
Source89: %{fontconf}-sans-ogham.conf
Source90: %{fontconf}-sans-ol-chiki.conf
Source91: %{fontconf}-sans-old-italic.conf
Source92: %{fontconf}-sans-old-persian.conf
Source93: %{fontconf}-sans-phags-pa.conf
Source94: %{fontconf}-sans-rejang.conf
Source95: %{fontconf}-sans-runic.conf
Source96: %{fontconf}-sans-samaritan.conf
Source97: %{fontconf}-sans-saurashtra.conf
Source98: %{fontconf}-sans-sinhala.conf
Source99: %{fontconf}-sans-sundanese.conf
Source100: %{fontconf}-sans-syloti-nagri.conf
Source101: %{fontconf}-sans-syriac-eastern.conf
Source102: %{fontconf}-sans-syriac-estrangela.conf
Source103: %{fontconf}-sans-syriac-western.conf
Source104: %{fontconf}-sans-tai-le.conf
Source105: %{fontconf}-sans-tifinagh.conf
Source106: %{fontconf}-sans-yi.conf
Source107: %{fontconf}-sans-tagbanwa.conf
Source108: %{fontconf}-sans-thaana.conf
Source2: 66-%{fontconf}-sans.conf
Source3: 66-%{fontconf}-sans-armenian.conf
Source4: 66-%{fontconf}-sans-avestan.conf
Source5: 66-%{fontconf}-sans-bengali.conf
Source6: 66-%{fontconf}-sans-bengali-ui.conf
Source7: 66-%{fontconf}-sans-brahmi.conf
Source8: 66-%{fontconf}-sans-carian.conf
Source9: 66-%{fontconf}-sans-cherokee.conf
Source10: 66-%{fontconf}-sans-coptic.conf
Source11: 66-%{fontconf}-sans-deseret.conf
Source12: 66-%{fontconf}-sans-devanagari.conf
Source13: 66-%{fontconf}-sans-devanagari-ui.conf
Source14: 66-%{fontconf}-sans-egyptian-hieroglyphs.conf
Source15: 66-%{fontconf}-sans-ethiopic.conf
Source16: 66-%{fontconf}-sans-georgian.conf
Source17: 66-%{fontconf}-sans-glagolitic.conf
Source18: 66-%{fontconf}-sans-hebrew.conf
Source19: 66-%{fontconf}-sans-imperial-aramaic.conf
Source20: 66-%{fontconf}-sans-kaithi.conf
Source21: 66-%{fontconf}-sans-kannada.conf
Source22: 66-%{fontconf}-sans-kayah-li.conf
Source23: 66-%{fontconf}-sans-kharoshthi.conf
Source24: 66-%{fontconf}-sans-khmer.conf
Source25: 66-%{fontconf}-sans-khmer-ui.conf
Source26: 66-%{fontconf}-sans-lao.conf
Source27: 66-%{fontconf}-sans-lao-ui.conf
Source28: 66-%{fontconf}-sans-lisu.conf
Source29: 66-%{fontconf}-sans-lycian.conf
Source30: 66-%{fontconf}-sans-lydian.conf
Source31: 66-%{fontconf}-sans-malayalam.conf
Source32: 66-%{fontconf}-sans-malayalam-ui.conf
Source33: 66-%{fontconf}-sans-mandaic.conf
Source34: 66-%{fontconf}-sans-meetei-mayek.conf
Source35: 66-%{fontconf}-sans-nko.conf
Source36: 66-%{fontconf}-sans-old-south-arabian.conf
Source37: 66-%{fontconf}-sans-old-turkic.conf
Source38: 66-%{fontconf}-sans-osmanya.conf
Source39: 66-%{fontconf}-sans-phoenician.conf
Source40: 66-%{fontconf}-sans-shavian.conf
Source41: 66-%{fontconf}-sans-symbols.conf
Source42: 66-%{fontconf}-sans-tagalog.conf
Source43: 66-%{fontconf}-sans-tai-tham.conf
Source44: 66-%{fontconf}-sans-tamil.conf
Source45: 66-%{fontconf}-sans-tamil-ui.conf
Source46: 66-%{fontconf}-sans-telugu.conf
Source47: 66-%{fontconf}-sans-thai.conf
Source48: 66-%{fontconf}-sans-thai-ui.conf
Source49: 66-%{fontconf}-sans-ugaritic.conf
Source50: 66-%{fontconf}-sans-ui.conf
Source51: 66-%{fontconf}-sans-vai.conf
Source52: 66-%{fontconf}-serif-armenian.conf
Source53: 66-%{fontconf}-serif.conf
Source54: 66-%{fontconf}-serif-georgian.conf
Source55: 66-%{fontconf}-serif-khmer.conf
Source56: 66-%{fontconf}-serif-lao.conf
Source57: 66-%{fontconf}-serif-thai.conf
Source58: 66-%{fontconf}-sans-kannada-ui.conf
Source59: 66-%{fontconf}-sans-telugu-ui.conf
Source60: 66-%{fontconf}-sans-gujarati.conf
Source61: 66-%{fontconf}-sans-gujarati-ui.conf
Source62: 66-%{fontconf}-sans-hanunoo.conf
Source63: 66-%{fontconf}-sans-tai-viet.conf
Source64: 66-%{fontconf}-kufi-arabic.conf
Source65: 66-%{fontconf}-naskh-arabic.conf
Source66: 66-%{fontconf}-naskh-arabic-ui.conf
Source67: 66-%{fontconf}-sans-balinese.conf
Source68: 66-%{fontconf}-sans-bamum.conf
Source69: 66-%{fontconf}-sans-batak.conf
Source70: 66-%{fontconf}-sans-buginese.conf
Source71: 66-%{fontconf}-sans-buhid.conf
Source72: 66-%{fontconf}-sans-canadian-aboriginal.conf
Source73: 66-%{fontconf}-sans-cham.conf
Source74: 66-%{fontconf}-sans-cuneiform.conf
Source75: 66-%{fontconf}-sans-cypriot.conf
Source76: 66-%{fontconf}-sans-gothic.conf
Source77: 66-%{fontconf}-sans-gurmukhi.conf
Source78: 66-%{fontconf}-sans-gurmukhi-ui.conf
Source79: 66-%{fontconf}-sans-inscriptional-pahlavi.conf
Source80: 66-%{fontconf}-sans-inscriptional-parthian.conf
Source81: 66-%{fontconf}-sans-javanese.conf
Source82: 66-%{fontconf}-sans-lepcha.conf
Source83: 66-%{fontconf}-sans-limbu.conf
Source84: 66-%{fontconf}-sans-linear-b.conf
Source85: 66-%{fontconf}-sans-mongolian.conf
Source86: 66-%{fontconf}-sans-myanmar.conf
Source87: 66-%{fontconf}-sans-myanmar-ui.conf
Source88: 66-%{fontconf}-sans-new-tai-lue.conf
Source89: 66-%{fontconf}-sans-ogham.conf
Source90: 66-%{fontconf}-sans-ol-chiki.conf
Source91: 66-%{fontconf}-sans-old-italic.conf
Source92: 66-%{fontconf}-sans-old-persian.conf
Source93: 66-%{fontconf}-sans-phags-pa.conf
Source94: 66-%{fontconf}-sans-rejang.conf
Source95: 66-%{fontconf}-sans-runic.conf
Source96: 66-%{fontconf}-sans-samaritan.conf
Source97: 66-%{fontconf}-sans-saurashtra.conf
Source98: 66-%{fontconf}-sans-sinhala.conf
Source99: 66-%{fontconf}-sans-sundanese.conf
Source100: 66-%{fontconf}-sans-syloti-nagri.conf
Source101: 66-%{fontconf}-sans-syriac-eastern.conf
Source102: 66-%{fontconf}-sans-syriac-estrangela.conf
Source103: 66-%{fontconf}-sans-syriac-western.conf
Source104: 66-%{fontconf}-sans-tai-le.conf
Source105: 66-%{fontconf}-sans-tifinagh.conf
Source106: 66-%{fontconf}-sans-yi.conf
Source107: 66-%{fontconf}-sans-tagbanwa.conf
Source108: 66-%{fontconf}-sans-thaana.conf
Source156: %{fontconf}-sans-oriya.conf
Source157: %{fontconf}-sans-oriya-ui.conf
Source158: %{fontconf}-nastaliq-urdu.conf
Source159: %{fontconf}-sans-tibetan.conf
Source160: %{fontconf}-mono.conf
Source161: %{fontconf}-serif-bengali.conf
Source162: %{fontconf}-serif-devanagari.conf
Source163: %{fontconf}-serif-gujarati.conf
Source164: %{fontconf}-serif-kannada.conf
Source165: %{fontconf}-serif-malayalam.conf
Source166: %{fontconf}-serif-tamil.conf
Source167: %{fontconf}-serif-telugu.conf
Source156: 66-%{fontconf}-sans-oriya.conf
Source157: 66-%{fontconf}-sans-oriya-ui.conf
Source158: 66-%{fontconf}-nastaliq-urdu.conf
Source159: 66-%{fontconf}-sans-tibetan.conf
Source160: 66-%{fontconf}-mono.conf
Source161: 66-%{fontconf}-serif-bengali.conf
Source162: 66-%{fontconf}-serif-devanagari.conf
Source163: 66-%{fontconf}-serif-gujarati.conf
Source164: 66-%{fontconf}-serif-kannada.conf
Source165: 66-%{fontconf}-serif-malayalam.conf
Source166: 66-%{fontconf}-serif-tamil.conf
Source167: 66-%{fontconf}-serif-telugu.conf
# Add appstream metadata files
Source200: %{fontname}.metainfo.xml
@ -161,10 +161,12 @@ Common files for Google Noto fonts.
# -c is for *.*tc fonts instead of *.*tf
# -a overrides the FontName
# -o adds an obsoletes for an older package name
%define notopkg(ca:o:)\
# -p overrides fontconfig .conf priority (default 66)
%define notopkg(ca:o:p:)\
%define pname %(echo %{*} | tr "A-Z " "a-z-")\
%{!-a:%define fname %(echo %{*} | sed -e "s/ //g")}\
%define subpkg %{fontname}-%{pname}\
%define fconf %{-p*}%{!-p:66}-%{fontconf}-%{pname}.conf\
%package -n %{subpkg}-fonts\
Summary: %{*} font\
Requires: fontpackages-filesystem\
@ -188,9 +190,9 @@ fi\
%files -n %{subpkg}-fonts \
%dir %{_fontdir} \
%{_fontdir}/Noto%{-a*}%{!-a:%{fname}}-*.*t%{-c:c}%{!-c:f}\
%{_fontconfig_templatedir}/%{fontconf}-%{pname}.conf\
%config(noreplace) %{_fontconfig_confdir}/%{fontconf}-%{pname}.conf\
#%%_font_pkg -n %%{pname} -f %%{fontconf}-%%{pname}.conf Noto%{-a*}%{!-a:%%{fname}}*.*t%{-c:c}%{!-c:f}\
%{_fontconfig_templatedir}/%{fconf}\
%config(noreplace) %{_fontconfig_confdir}/%{fconf}\
#%%_font_pkg -n %%{pname} -f %{fconf} Noto%{-a*}%{!-a:%%{fname}}*.*t%{-c:c}%{!-c:f}\
%{_datadir}/appdata/%{subpkg}.metainfo.xml
@ -368,10 +370,15 @@ for f in \
serif-bengali serif-devanagari serif-gujarati serif-kannada \
serif-malayalam serif-tamil serif-telugu \
; do
install -m 0644 -p %{_sourcedir}/%{fontconf}-$f.conf \
%{buildroot}%{_fontconfig_templatedir}/%{fontconf}-$f.conf
ln -s %{_fontconfig_templatedir}/%{fontconf}-$f.conf \
%{buildroot}%{_fontconfig_confdir}/%{fontconf}-$f.conf
fconf=$(basename -a %{_sourcedir}/*-%{fontconf}-$f.conf)
if [ "$(echo $fconf | wc -w)" -ne 1 ]; then
echo "Did not find unique \*-%{fontconf}-$f.conf file"
exit 1
fi
install -m 0644 -p %{_sourcedir}/${fconf} \
%{buildroot}%{_fontconfig_templatedir}/${fconf}
ln -s %{_fontconfig_templatedir}/${fconf} \
%{buildroot}%{_fontconfig_confdir}/${fconf}
meta=%{fontname}-$f.metainfo.xml
echo '<?xml version="1.0" encoding="UTF-8"?>' > $meta
@ -394,6 +401,10 @@ done
%changelog
* Wed Jul 5 2017 Jens Petersen <petersen@redhat.com> - 20161022-3
- add a fontconfig priority option to the notopkg macro,
which allows overriding the default 66 priority
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 20161022-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild