%global fontname paktype-tehreer

Name:          paktype-tehreer-fonts
Version:       4.1
Release:       11
Summary:       Free font for Arabic
License:       GPLv2 with exceptions
URL:           https://sourceforge.net/projects/paktype/
Source0:       https://sourceforge.net/projects/paktype/files/PakType-Release-2019-03-11.tar.gz
Source1:       67-paktype-tehreer.conf
BuildArch:     noarch
BuildRequires: fontpackages-devel
Requires:      fontpackages-filesystem
Obsoletes:     paktype-fonts-common < %{version}i-%{release}

%description
A collection of Unicode based open source OpenType fonts supporting Arabic Script
under the terms of the GNU General Public License as published by the Free Software Foundation.

%prep
%autosetup -c -p1
mv PakTypeTehreer.ttf PakType_Tehreer.ttf
mv License\ files/PakType\ Tehreer\ License.txt PakType_Tehreer_License.txt
mv Features/PakType\ Tehreer\ Features.pdf PakType_Tehreer_Features.pdf

sed -i 's/\r//' PakType_Tehreer_License.txt
chmod a-x PakType_Tehreer.ttf PakType_Tehreer_License.txt PakType_Tehreer_Features.pdf

%install
install -m0755 -d $RPM_BUILD_ROOT%{_fontdir}
install -m0644 -p PakType_Tehreer.ttf $RPM_BUILD_ROOT%{_fontdir}
install -m0755 -d %{buildroot}%{_fontconfig_templatedir} %{buildroot}%{_fontconfig_confdir}
install -m0644 -p %{SOURCE1} %{buildroot}%{_fontconfig_templatedir}/67-paktype-tehreer.conf
ln -s %{_fontconfig_templatedir}/67-paktype-tehreer.conf %{buildroot}%{_fontconfig_confdir}/67-paktype-tehreer.conf

%_font_pkg -f 67-paktype-tehreer.conf PakType_Tehreer.ttf

%doc PakType_Tehreer_License.txt PakType_Tehreer_Features.pdf

%changelog
* Fri Feb 14 2020 lingsheng <lingsheng@huawei.com> - 4.1-11
- Package init
