Name:          dejavu-fonts
Version:       2.37
Release:       3
Summary:       DejaVu fonts
License:       Bitstream Vera and Public Domain
URL:           http://%{name}.org/
Source0:       https://sourceforge.net/projects/dejavu/files/dejavu/%{version}/%{name}-%{version}.tar.bz2
Source1:       dejavu.metainfo.xml
Source2:       dejavu-sans.metainfo.xml
Source3:       dejavu-sans-mono.metainfo.xml
Source4:       dejavu-serif.metainfo.xml
BuildArch:     noarch
BuildRequires: fontforge >= 20080429 perl(Font::TTF) unicode-ucd fontpackages-devel
Requires:      fontpackages-filesystem
Provides:      %{name}-common dejavu-sans-fonts dejavu-serif-fonts dejavu-sans-mono-fonts
Obsoletes:     %{name}-common dejavu-sans-fonts dejavu-serif-fonts dejavu-sans-mono-fonts
Provides:      dejavu-lgc-sans-fonts dejavu-lgc-serif-fonts dejavu-lgc-sans-mono-fonts
Obsoletes:     dejavu-lgc-sans-fonts dejavu-lgc-serif-fonts dejavu-lgc-sans-mono-fonts
Obsoletes:     %{name}-lgc-compat < 2.29-3 %{name}-sans < 2.28-2 %{name}-serif < 2.28-2 %{name}-doc < 2.26-6 %{name}-compat < 2.29-3
Obsoletes:     %{name}-sans-mono < 2.28-2 %{name}-lgc-sans < 2.28-2 %{name}-lgc-serif < 2.28-2 %{name}-lgc-sans-mono < 2.28-2

%description
The DejaVu fonts are a font family based on the Vera Fonts.
Its purpose is to provide a wider range of characters while maintaining the original look
and feel through the process of collaborative development, under a Free license.

%prep
%autosetup -n %{name}-%{version} -p1

%build
%make_build VERSION=%{version} FC-LANG="" BLOCKS=%{_datadir}/unicode/ucd/Blocks.txt \
            UNICODEDATA=%{_datadir}/unicode/ucd/UnicodeData.txt
bzip2 -9 build/status.txt

%check
make check

%install
rm -fr %{buildroot}
install -m 0755 -d %{buildroot}%{_fontdir}
install -m 0755 -d %{buildroot}%{_datadir}/fonts/dejavu
install -m 0644 -p build/*.ttf %{buildroot}%{_datadir}/fonts/dejavu
install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} %{buildroot}%{_fontconfig_confdir}

cd fontconfig
for fontconf in *conf ; do
  install -m 0644 -p $fontconf %{buildroot}%{_fontconfig_templatedir}
  ln -s %{_fontconfig_templatedir}/$fontconf %{buildroot}%{_fontconfig_confdir}/$fontconf
done

install -Dm 0644 -p %{SOURCE1} %{buildroot}%{_datadir}/appdata/dejavu.metainfo.xml
install -Dm 0644 -p %{SOURCE2} %{buildroot}%{_datadir}/appdata/dejavu-sans.metainfo.xml
install -Dm 0644 -p %{SOURCE3} %{buildroot}%{_datadir}/appdata/dejavu-sans-mono.metainfo.xml
install -Dm 0644 -p %{SOURCE4} %{buildroot}%{_datadir}/appdata/dejavu-serif.metainfo.xml

%files
%{_fontconfig_templatedir}/*-dejavu-*.conf
%{_fontconfig_confdir}/*-dejavu-*.conf
%{_datadir}/fonts/dejavu/DejaVu*.ttf
%{_datadir}/appdata/*.metainfo.xml
%doc AUTHORS BUGS LICENSE NEWS README.md
%doc build/unicover.txt build/status.txt.bz2

%changelog
* Thu Aug 1 2024 zhangpan <zhangpan103@h-partners.com> - 2.37-3
- repair SOURCE file loss

* Wed Oct 26 2022 zhouwenpei <zhouwenpei1@h-partners.com> - 2.37-2
- Rebuild for next release

* Tue Feb 2 2021 yanglu <yanglu60@huawei.com> - 2.37-1
- update to 2.37

* Wed Jan 8 2020 chenzhenyu <chenzhenyu13@huawei.com> - 2.35-8
- change %files

* Wed Nov 27 2019 chenzhenyu <chenzhenyu13@huawei.com> - 2.35-8
- Package init
