1
0
google-noto-fonts/generate-specfile.sh

97 lines
4.4 KiB
Bash
Raw Normal View History

#!/bin/sh
pkg_name="google-noto-fonts"
for a in *.zip; do
mkdir -p $pkg_name
unzip -o -d $pkg_name $a
done
rm $pkg_name/LICENSE*.txt
# remove draft fonts for now
rm -f $pkg_name/*Draft.*tf
# use otc file for CJK
rm -f $pkg_name/NotoSans*CJK*.otf
cp -f $pkg_name.spec.in $pkg_name.spec
for h in hinted; do
ls $pkg_name/ | sed -e 's:Noto::' -e 's:-.*\..tf::' -e 's:\..tf::' -e 's:\.ttc::' | sort -f | uniq | while read font; do
ui=`(echo $font | grep -q UI) && echo UI`
Accepting request 461022 from home:frispete:fonts Here's a RFC SR The changelog isn't complete, but I haven't found a real changelog apart from git, and the zip doesn't tell, which git branch/tag/date it is generated from... I filed an issue because of this. I also noticed, that some fonts are gone: noto-sans-hans 20140716-1.4 noto-sans-hant 20140716-1.4 noto-sans-jp 20140716-1.4 noto-sans-kr 20140716-1.4 noto-sans-pahlavi 20140716-1.4 noto-sans-parthian 20140716-1.4 noto-sans-sumeroakkadiancuneiform 20140716-1.4 Don't know, if this is to be expected? The generate-specfile.sh had to be adjusted due to some new fonts. The serif variable naming/handling is questionable still.. Anyway, here it is: - update to version 20161025 - new: Mono Font - new: Naskh Arabic Font - new: Bengali Sans Serif Font - new: Devanagari Sans Serif Font - new: Gujarati Sans Serif Font - new: Gurmukhi Sans Serif Font - new: Kannada Sans Serif Font - new: Khmer Sans Serif Font - new: Lao Sans Serif Font - new: Malayalam Sans Serif Font - new: Myanmar Sans Serif Font - new: Oriya Sans Serif Font - new: Tamil Sans Serif Font - new: Telugu Sans Serif Font - new: Thai Sans Serif Font - new: Sans UI Font - new: Bengali Font - new: Devanagari Font - new: Gujarati Font - new: Kannada Font - new: Malayalam Font - new: Tamil Font - new: Telugu Font - fix generate-specfile.sh: - handle UI fonts, that do not start with Sans ot Serif - fix description of fonts, that do not start with Sans ot Serif - flag sans fonts only, that really deserve it OBS-URL: https://build.opensuse.org/request/show/461022 OBS-URL: https://build.opensuse.org/package/show/M17N:fonts/google-noto-fonts?expand=0&rev=30
2017-03-02 01:35:55 +00:00
font=${font%%$ui}
serif=`echo $font | sed 's:\(Sans\|Serif\).*:\1:'`
script=`echo $font | sed "s:$serif\(.*\):\1:"`
packagename="noto-$serif"
if [ ! -z $script ]; then
packagename="$packagename-$script"
fi
if [ ! -z $ui ]; then
packagename="$packagename-$ui"
fi
packagename=`echo "$packagename" | tr [A-Z] [a-z]`
if [ $serif == "Sans" ]; then
Accepting request 461022 from home:frispete:fonts Here's a RFC SR The changelog isn't complete, but I haven't found a real changelog apart from git, and the zip doesn't tell, which git branch/tag/date it is generated from... I filed an issue because of this. I also noticed, that some fonts are gone: noto-sans-hans 20140716-1.4 noto-sans-hant 20140716-1.4 noto-sans-jp 20140716-1.4 noto-sans-kr 20140716-1.4 noto-sans-pahlavi 20140716-1.4 noto-sans-parthian 20140716-1.4 noto-sans-sumeroakkadiancuneiform 20140716-1.4 Don't know, if this is to be expected? The generate-specfile.sh had to be adjusted due to some new fonts. The serif variable naming/handling is questionable still.. Anyway, here it is: - update to version 20161025 - new: Mono Font - new: Naskh Arabic Font - new: Bengali Sans Serif Font - new: Devanagari Sans Serif Font - new: Gujarati Sans Serif Font - new: Gurmukhi Sans Serif Font - new: Kannada Sans Serif Font - new: Khmer Sans Serif Font - new: Lao Sans Serif Font - new: Malayalam Sans Serif Font - new: Myanmar Sans Serif Font - new: Oriya Sans Serif Font - new: Tamil Sans Serif Font - new: Telugu Sans Serif Font - new: Thai Sans Serif Font - new: Sans UI Font - new: Bengali Font - new: Devanagari Font - new: Gujarati Font - new: Kannada Font - new: Malayalam Font - new: Tamil Font - new: Telugu Font - fix generate-specfile.sh: - handle UI fonts, that do not start with Sans ot Serif - fix description of fonts, that do not start with Sans ot Serif - flag sans fonts only, that really deserve it OBS-URL: https://build.opensuse.org/request/show/461022 OBS-URL: https://build.opensuse.org/package/show/M17N:fonts/google-noto-fonts?expand=0&rev=30
2017-03-02 01:35:55 +00:00
serif_dsc="Sans Serif "
else
serif_dsc=""
fi
obsoletes=$packagename
if [ "$script" == "CJK" ]; then
for l in jp kr sc tc ; do
obsoletes="$obsoletes noto-sans-cjk$l noto-sans-cjk$l-fonts "
done
for j in zh-CN zh-SG zh-TW zh-HK zh-MO ja ko ; do
scalables="$scalables scalable-font-$j"
done
fi
packagename="$packagename-fonts"
Accepting request 461022 from home:frispete:fonts Here's a RFC SR The changelog isn't complete, but I haven't found a real changelog apart from git, and the zip doesn't tell, which git branch/tag/date it is generated from... I filed an issue because of this. I also noticed, that some fonts are gone: noto-sans-hans 20140716-1.4 noto-sans-hant 20140716-1.4 noto-sans-jp 20140716-1.4 noto-sans-kr 20140716-1.4 noto-sans-pahlavi 20140716-1.4 noto-sans-parthian 20140716-1.4 noto-sans-sumeroakkadiancuneiform 20140716-1.4 Don't know, if this is to be expected? The generate-specfile.sh had to be adjusted due to some new fonts. The serif variable naming/handling is questionable still.. Anyway, here it is: - update to version 20161025 - new: Mono Font - new: Naskh Arabic Font - new: Bengali Sans Serif Font - new: Devanagari Sans Serif Font - new: Gujarati Sans Serif Font - new: Gurmukhi Sans Serif Font - new: Kannada Sans Serif Font - new: Khmer Sans Serif Font - new: Lao Sans Serif Font - new: Malayalam Sans Serif Font - new: Myanmar Sans Serif Font - new: Oriya Sans Serif Font - new: Tamil Sans Serif Font - new: Telugu Sans Serif Font - new: Thai Sans Serif Font - new: Sans UI Font - new: Bengali Font - new: Devanagari Font - new: Gujarati Font - new: Kannada Font - new: Malayalam Font - new: Tamil Font - new: Telugu Font - fix generate-specfile.sh: - handle UI fonts, that do not start with Sans ot Serif - fix description of fonts, that do not start with Sans ot Serif - flag sans fonts only, that really deserve it OBS-URL: https://build.opensuse.org/request/show/461022 OBS-URL: https://build.opensuse.org/package/show/M17N:fonts/google-noto-fonts?expand=0&rev=30
2017-03-02 01:35:55 +00:00
if [ ! -z "$script" ]; then
summary=`echo "Noto $script ${serif_dsc}Font" | sed 's:\([a-z]\)\([A-Z]\):\1 \2:g'`
else
summary=`echo "Noto $serif Font" | sed 's:\([a-z]\)\([A-Z]\):\1 \2:g'`
fi
sed -i "s/@SUBPACKAGE_HEADERS@/%package -n $packagename\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
sed -i "s/@SUBPACKAGE_HEADERS@/Summary: $summary\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
sed -i "s;@SUBPACKAGE_HEADERS@;Group: System/X11/Fonts\n@SUBPACKAGE_HEADERS@;" $pkg_name.spec
sed -i "s/@SUBPACKAGE_HEADERS@/Requires: $pkg_name-doc\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
for i in $obsoletes ; do
sed -i "s/@SUBPACKAGE_HEADERS@/Obsoletes: $i\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
sed -i "s/@SUBPACKAGE_HEADERS@/Provides: $i\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
done
if [ "$script" == "CJK" ]; then
for i in $scalables ; do
sed -i "s/@SUBPACKAGE_HEADERS@/Provides: $i\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
done
sed -i "s/@SUBPACKAGE_HEADERS@/Provides: locale(zh_CN;zh_SG;zh_TW;zh_HK;zh_MO)\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
fi
sed -i "s/@SUBPACKAGE_HEADERS@/%reconfigure_fonts_prereq\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
sed -i "s/@SUBPACKAGE_HEADERS@/\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
sed -i "s/@SUBPACKAGE_HEADERS@/%description -n $packagename\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
sed -i "s/@SUBPACKAGE_HEADERS@/Noto's design goal is to achieve visual harmonization (e.g., compatible\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
sed -i "s/@SUBPACKAGE_HEADERS@/heights and stroke thicknesses) across languages. This package contains\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
Accepting request 461022 from home:frispete:fonts Here's a RFC SR The changelog isn't complete, but I haven't found a real changelog apart from git, and the zip doesn't tell, which git branch/tag/date it is generated from... I filed an issue because of this. I also noticed, that some fonts are gone: noto-sans-hans 20140716-1.4 noto-sans-hant 20140716-1.4 noto-sans-jp 20140716-1.4 noto-sans-kr 20140716-1.4 noto-sans-pahlavi 20140716-1.4 noto-sans-parthian 20140716-1.4 noto-sans-sumeroakkadiancuneiform 20140716-1.4 Don't know, if this is to be expected? The generate-specfile.sh had to be adjusted due to some new fonts. The serif variable naming/handling is questionable still.. Anyway, here it is: - update to version 20161025 - new: Mono Font - new: Naskh Arabic Font - new: Bengali Sans Serif Font - new: Devanagari Sans Serif Font - new: Gujarati Sans Serif Font - new: Gurmukhi Sans Serif Font - new: Kannada Sans Serif Font - new: Khmer Sans Serif Font - new: Lao Sans Serif Font - new: Malayalam Sans Serif Font - new: Myanmar Sans Serif Font - new: Oriya Sans Serif Font - new: Tamil Sans Serif Font - new: Telugu Sans Serif Font - new: Thai Sans Serif Font - new: Sans UI Font - new: Bengali Font - new: Devanagari Font - new: Gujarati Font - new: Kannada Font - new: Malayalam Font - new: Tamil Font - new: Telugu Font - fix generate-specfile.sh: - handle UI fonts, that do not start with Sans ot Serif - fix description of fonts, that do not start with Sans ot Serif - flag sans fonts only, that really deserve it OBS-URL: https://build.opensuse.org/request/show/461022 OBS-URL: https://build.opensuse.org/package/show/M17N:fonts/google-noto-fonts?expand=0&rev=30
2017-03-02 01:35:55 +00:00
if [ ! -z "$script" ]; then
sed -i "s/@SUBPACKAGE_HEADERS@/$script ${serif_dsc}font, $h.\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
else
sed -i "s/@SUBPACKAGE_HEADERS@/$serif font, $h.\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
fi
sed -i "s/@SUBPACKAGE_HEADERS@/\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
sed -i "s/@SUBPACKAGE_SCRIPTLETS@/%reconfigure_fonts_scriptlets -n $packagename\n\n@SUBPACKAGE_SCRIPTLETS@/" $pkg_name.spec
sed -i "s/@SUBPACKAGE_FILELISTS@/%files -n $packagename\n@SUBPACKAGE_FILELISTS@/" $pkg_name.spec
sed -i "s/@SUBPACKAGE_FILELISTS@/%defattr(0644,root,root,755)\n@SUBPACKAGE_FILELISTS@/" $pkg_name.spec
sed -i "s/@SUBPACKAGE_FILELISTS@/%dir %{_ttfontsdir}\n@SUBPACKAGE_FILELISTS@/" $pkg_name.spec
if [ $serif == "ColorEmoji" ]; then
sed -i "s:@SUBPACKAGE_FILELISTS@:%{_ttfontsdir}/Noto$serif$script$ui\*.?tf\n@SUBPACKAGE_FILELISTS@:" $pkg_name.spec
elif [ "$script" == "CJK" ]; then
sed -i "s:@SUBPACKAGE_FILELISTS@:%{_ttfontsdir}/Noto$serif$script$ui\*.ttc\n@SUBPACKAGE_FILELISTS@:" $pkg_name.spec
else
sed -i "s:@SUBPACKAGE_FILELISTS@:%{_ttfontsdir}/Noto$serif$script$ui-\*.?tf\n@SUBPACKAGE_FILELISTS@:" $pkg_name.spec
fi
sed -i "s/@SUBPACKAGE_FILELISTS@/\n@SUBPACKAGE_FILELISTS@/" $pkg_name.spec
done
done
sed -i 's/@SUBPACKAGE_HEADERS@//' $pkg_name.spec
sed -i 's/@SUBPACKAGE_SCRIPTLETS@//' $pkg_name.spec
sed -i 's/@SUBPACKAGE_FILELISTS@//' $pkg_name.spec
rm -r $pkg_name