2013-10-29 11:15:39 +01:00
|
|
|
#!/bin/sh
|
|
|
|
pkg_name="google-noto-fonts"
|
2014-09-08 09:49:24 +02:00
|
|
|
|
|
|
|
for a in *.zip; do
|
|
|
|
mkdir -p $pkg_name
|
|
|
|
unzip -d $pkg_name $a
|
2013-10-29 11:15:39 +01:00
|
|
|
done
|
2014-09-08 09:49:24 +02:00
|
|
|
|
|
|
|
rm $pkg_name/LICENSE
|
|
|
|
|
2013-10-29 11:15:39 +01:00
|
|
|
cp -f $pkg_name.spec.in $pkg_name.spec
|
2014-09-08 09:49:24 +02:00
|
|
|
for h in hinted; do
|
|
|
|
ls $pkg_name/ | sed -e 's:Noto::' -e 's:-.*\..tf::' -e 's:\..tf::' | sort | uniq | while read font; do
|
2013-10-29 11:15:39 +01:00
|
|
|
serif=`echo $font | sed 's:\(Sans\|Serif\).*:\1:'`
|
|
|
|
ui=`(echo $font | grep -q UI) && echo UI`
|
|
|
|
script=`echo $font | sed "s:$serif\(.*\)$ui:\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
|
|
|
|
serif_dsc="Sans Serif"
|
|
|
|
fi
|
|
|
|
summary=`echo "Noto $script $serif_dsc Font" | sed 's:\([a-z]\)\([A-Z]\):\1 \2:'`
|
|
|
|
|
|
|
|
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/Font\n@SUBPACKAGE_HEADERS@;" $pkg_name.spec
|
|
|
|
sed -i "s/@SUBPACKAGE_HEADERS@/Requires: $pkg_name\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
|
|
|
|
sed -i "s/@SUBPACKAGE_HEADERS@/$script $serif_dsc font, $h.\n@SUBPACKAGE_HEADERS@/" $pkg_name.spec
|
|
|
|
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(-,root,root)\n@SUBPACKAGE_FILELISTS@/" $pkg_name.spec
|
2014-09-08 09:49:24 +02:00
|
|
|
sed -i "s:@SUBPACKAGE_FILELISTS@:%{_ttfontsdir}/Noto$serif$script$ui-\*.?tf\n@SUBPACKAGE_FILELISTS@:" $pkg_name.spec
|
2013-10-29 11:15:39 +01:00
|
|
|
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
|