From 8b23108fae70842097619fd45dda0e85c0a69460 Mon Sep 17 00:00:00 2001 From: Jing Zhang Date: Thu, 13 Apr 2023 14:22:31 +0800 Subject: [PATCH] Refact spec Signed-off-by: Jing Zhang --- bitmap-fonts.spec | 262 ++++++++++++++++++++++++---------------------- 1 file changed, 139 insertions(+), 123 deletions(-) diff --git a/bitmap-fonts.spec b/bitmap-fonts.spec index cee5373..4a287a6 100644 --- a/bitmap-fonts.spec +++ b/bitmap-fonts.spec @@ -1,186 +1,177 @@ -%define anolis_release 2 +%define anolis_release 3 %global fontname bitmap %global fontconf 66-%{fontname} -%global common_desc \ -The bitmap-fonts package provides a number of bitmap fonts selected\ -from the xorg package designed for use locations such as\ -terminals. Name: bitmap-fonts Version: 0.3 Epoch: 1 Release: %{anolis_release}%{?dist} +Summary: Selected set of %{fontname} fonts License: GPLv2 and MIT and Lucida -Source0: bitmap-fonts-%{version}.tar.bz2 +Source0: %{name}-%{version}.tar.bz2 Source1: fixfont-3.5.tar.bz2 Source2: LICENSE -Source3: 66-bitmap-console.conf -Source4: 66-bitmap-fangsongti.conf -Source5: 66-bitmap-fixed.conf -Source6: 66-bitmap-lucida-typewriter.conf +Source3: %{fontconf}-console.conf +Source4: %{fontconf}-fangsongti.conf +Source5: %{fontconf}-fixed.conf +Source6: %{fontconf}-lucida-typewriter.conf BuildArch: noarch -Summary: Selected set of bitmap fonts -BuildRequires: bdftopcf fonttosfnt -BuildRequires: fontpackages-devel -BuildRequires: python3 -BuildRequires: /usr/bin/ftdump -BuildRequires: make +BuildRequires: bdftopcf fonttosfnt python3 /usr/bin/ftdump make +BuildRequires: fontpackages-devel %description -%common_desc - -%package -n %{fontname}-fonts-compat -Summary: Compatibility files of bitmap-font families -Provides: bitmap-fonts = %{epoch}:%{version}-%{release} -Requires: %{fontname}-lucida-typewriter-fonts = %{epoch}:%{version}-%{release} -Requires: %{fontname}-fangsongti-fonts = %{epoch}:%{version}-%{release} -Requires: %{fontname}-console-fonts = %{epoch}:%{version}-%{release} -Requires: %{fontname}-fixed-fonts = %{epoch}:%{version}-%{release} -Requires: ucs-miscfixed-fonts -Obsoletes: bitmap-fonts < %{epoch}:%{version}-%{release} -Conflicts: %{fontname}-opentype-fonts-compat +The %{name} package provides a number of %{fontname} fonts selected +from the xorg package designed for use locations such as terminals. -%description -n %{fontname}-fonts-compat -%common_desc -Meta-package for installing all font families of bitmap. - -%files -n %{fontname}-fonts-compat - -%package -n %{fontname}-opentype-fonts-compat -Summary: Compatibility files of bitmap-font families (opentype version) -Requires: %{fontname}-lucida-typewriter-opentype-fonts = %{epoch}:%{version}-%{release} -Requires: %{fontname}-fangsongti-opentype-fonts = %{epoch}:%{version}-%{release} -Requires: %{fontname}-console-opentype-fonts = %{epoch}:%{version}-%{release} -Requires: %{fontname}-fixed-opentype-fonts = %{epoch}:%{version}-%{release} -Requires: ucs-miscfixed-opentype-fonts -Conflicts: %{fontname}-fonts-compat - -%description -n %{fontname}-opentype-fonts-compat -%common_desc -Meta-package for installing all font families of opentype bitmap. - -%files -n %{fontname}-opentype-fonts-compat - -%package -n bitmap-lucida-typewriter-fonts -Summary: Selected CJK bitmap fonts for Anaconda +%package -n %{fontname}-console-fonts +Summary: Selected set of %{fontname} fonts Requires: fontpackages-filesystem -Provides: %{name}-cjk = %{epoch}:%{version}-%{release} -License: Lucida -Conflicts: bitmap-lucida-typewriter-opentype-fonts - -%description -n bitmap-lucida-typewriter-fonts -%common_desc +License: GPLv2 +Conflicts: %{fontname}-console-opentype-fonts -%_font_pkg -n lucida-typewriter -f %{fontconf}-lucida-typewriter.conf lut*.pcf.gz -%doc LU_LEGALNOTICE +%description -n %{fontname}-console-fonts +The %{name} package provides a number of %{fontname} fonts selected +from the xorg package designed for use locations such as terminals. +Selected set of %{fontname} fonts. -%package -n bitmap-lucida-typewriter-opentype-fonts -Summary: Selected CJK bitmap fonts for Anaconda (opentype version) +%package -n %{fontname}-console-opentype-fonts +Summary: Selected set of %{fontname} fonts (opentype version) Requires: fontpackages-filesystem -License: Lucida -Conflicts: bitmap-lucida-typewriter-fonts - -%description -n bitmap-lucida-typewriter-opentype-fonts -%common_desc +License: GPLv2 +Conflicts: %{fontname}-console-fonts -%_font_pkg -n lucida-typewriter-opentype -f %{fontconf}-lucida-typewriter.conf lut*.otb -%doc LU_LEGALNOTICE +%description -n %{fontname}-console-opentype-fonts +The %{name} package provides a number of %{fontname} fonts selected +from the xorg package designed for use locations such as terminals. +Selected set of %{fontname} fonts (opentype version). -%package -n bitmap-fangsongti-fonts -Summary: Selected CJK bitmap fonts for Anaconda +%package -n %{fontname}-fangsongti-fonts +Summary: Selected CJK %{fontname} fonts for Anaconda Requires: fontpackages-filesystem -Provides: %{name}-cjk = %{epoch}:%{version}-%{release} +Provides: %{name}-cjk = %{EVR} License: MIT -Conflicts: bitmap-fangsongti-opentype-fonts +Conflicts: %{fontname}-fangsongti-opentype-fonts %description -n %{fontname}-fangsongti-fonts -bitmap-fonts-cjk package contains bitmap fonts used by Anaconda. They are -selected from the xorg packages, and the font encoding are converted from -native encoding to ISO10646. They are only intended to be used in Anaconda. +The %{name} package provides a number of %{fontname} fonts selected +from the xorg package designed for use locations such as terminals. +Selected CJK %{fontname} fonts for Anaconda. -%_font_pkg -n fangsongti -f %{fontconf}-fangsongti.conf fangsongti*.pcf.gz -%doc LICENSE - -%package -n bitmap-fangsongti-opentype-fonts -Summary: Selected CJK bitmap fonts for Anaconda (opentype version) +%package -n %{fontname}-fangsongti-opentype-fonts +Summary: Selected CJK %{fontname} fonts for Anaconda (opentype version) Requires: fontpackages-filesystem License: MIT -Conflicts: bitmap-fangsongti-fonts +Conflicts: %{fontname}-fangsongti-fonts %description -n %{fontname}-fangsongti-opentype-fonts -%common_desc - -%_font_pkg -n fangsongti-opentype -f %{fontconf}-fangsongti.conf fangsongti*.otb -%doc LICENSE +The %{name} package provides a number of %{fontname} fonts selected +from the xorg package designed for use locations such as terminals. +Selected CJK %{fontname} fonts for Anaconda (opentype version). -%package -n bitmap-console-fonts -Summary: Selected set of bitmap fonts +%package -n %{fontname}-fixed-fonts +Summary: Selected set of %{fontname} fonts Requires: fontpackages-filesystem License: GPLv2 -Conflicts: bitmap-console-opentype-fonts - -%description -n %{fontname}-console-fonts -%common_desc +Conflicts: %{fontname}-fixed-opentype-fonts -%_font_pkg -n console -f %{fontconf}-console.conf console8x16*.pcf.gz +%description -n %{fontname}-fixed-fonts +The %{name} package provides a number of %{fontname} fonts selected +from the xorg package designed for use locations such as terminals. +Selected set of %{fontname} fonts. -%package -n bitmap-console-opentype-fonts -Summary: Selected set of bitmap fonts (opentype version) +%package -n %{fontname}-fixed-opentype-fonts +Summary: Selected set of %{fontname} fonts (opentype version) Requires: fontpackages-filesystem License: GPLv2 -Conflicts: bitmap-console-fonts +Conflicts: %{fontname}-fixed-fonts -%description -n %{fontname}-console-opentype-fonts -%common_desc +%description -n %{fontname}-fixed-opentype-fonts +The %{name} package provides a number of %{fontname} fonts selected +from the xorg package designed for use locations such as terminals. +Selected set of %{fontname} fonts (opentype version). -%_font_pkg -n console-opentype -f %{fontconf}-console.conf console8x16*.otb +%package -n %{fontname}-fonts-compat +Summary: Compatibility files of %{name} families +Provides: %{name} = %{EVR} +Requires: %{fontname}-console-fonts = %{EVR} +Requires: %{fontname}-fangsongti-fonts = %{EVR} +Requires: %{fontname}-fixed-fonts = %{EVR} +Requires: %{fontname}-lucida-typewriter-fonts = %{EVR} +Requires: ucs-miscfixed-fonts +Obsoletes: %{name} < %{EVR} +Conflicts: %{fontname}-opentype-fonts-compat -%package -n bitmap-fixed-fonts -Summary: Selected set of bitmap fonts -Requires: fontpackages-filesystem -License: GPLv2 -Conflicts: bitmap-fixed-opentype-fonts +%description -n %{fontname}-fonts-compat +The %{name} package provides a number of %{fontname} fonts selected +from the xorg package designed for use locations such as terminals. +Meta-package for installing all font families of %{fontname}. -%description -n %{fontname}-fixed-fonts -%common_desc +%package -n %{fontname}-lucida-typewriter-fonts +Summary: Selected CJK %{fontname} fonts for Anaconda +Requires: fontpackages-filesystem +Provides: %{name}-cjk = %{EVR} +License: Lucida +Conflicts: %{fontname}-lucida-typewriter-opentype-fonts -%_font_pkg -n fixed -f %{fontconf}-fixed.conf console9*.pcf.gz +%description -n %{fontname}-lucida-typewriter-fonts +The %{name} package provides a number of %{fontname} fonts selected +from the xorg package designed for use locations such as terminals. +Selected CJK %{fontname} fonts for Anaconda. -%package -n bitmap-fixed-opentype-fonts -Summary: Selected set of bitmap fonts (opentype version) +%package -n %{fontname}-lucida-typewriter-opentype-fonts +Summary: Selected CJK %{fontname} fonts for Anaconda (opentype version) Requires: fontpackages-filesystem -License: GPLv2 -Conflicts: bitmap-fixed-fonts +License: Lucida +Conflicts: %{fontname}-lucida-typewriter-fonts -%description -n %{fontname}-fixed-opentype-fonts -%common_desc +%description -n %{fontname}-lucida-typewriter-opentype-fonts +The %{name} package provides a number of %{fontname} fonts selected +from the xorg package designed for use locations such as terminals. +Selected CJK %{fontname} fonts for Anaconda (opentype version). -%_font_pkg -n fixed-opentype -f %{fontconf}-fixed.conf console9*.otb +%package -n %{fontname}-opentype-fonts-compat +Summary: Compatibility files of %{name} families (opentype version) +Requires: %{fontname}-console-opentype-fonts = %{EVR} +Requires: %{fontname}-fangsongti-opentype-fonts = %{EVR} +Requires: %{fontname}-fixed-opentype-fonts = %{EVR} +Requires: %{fontname}-lucida-typewriter-opentype-fonts = %{EVR} +Requires: ucs-miscfixed-opentype-fonts +Conflicts: %{fontname}-fonts-compat +%description -n %{fontname}-opentype-fonts-compat +The %{name} package provides a number of %{fontname} fonts selected +from the xorg package designed for use locations such as terminals. +Meta-package for installing all font families of opentype %{fontname}. -%prep -%setup -q -a 1 -cp %{SOURCE2} . +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{EVR} +BuildArch: noarch +%description doc +The %{name}-doc package contains documentation files for %{name}. + +%prep +%autosetup -n %{name}-%{version} -a 1 +install -m 0644 -p %{SOURCE2} . %build %{nil} %install -rm -rf $RPM_BUILD_ROOT +rm -rf %{buildroot} -make install DESTDIR=$RPM_BUILD_ROOT +make install DESTDIR=%{buildroot} pushd fixfont-3.5 -make install DESTDIR=$RPM_BUILD_ROOT +make install DESTDIR=%{buildroot} popd -mv $RPM_BUILD_ROOT/usr/share/fonts/bitmap-fonts %{buildroot}%{_fontdir} +mv %{buildroot}/usr/share/fonts/%{name} %{buildroot}%{_fontdir} rm %{buildroot}%{_fontdir}/[0-9]*.pcf rm %{buildroot}%{_fontdir}/console8x8.pcf -rm README # Convert to OpenType Bitmap Font rm [0-9]*.bdf fixfont-3.5/[0-9]*.bdf @@ -194,7 +185,6 @@ pushd fixfont-3.5 for bdf in `ls *.bdf`; do fonttosfnt -b -c -g 2 -m 2 -o ${bdf%%bdf}otb $bdf; done -# For console9x15.otb fonttosfnt -b -c -g 2 -m 2 -o console9x15.otb console9x15.pcf install -m 0644 -p *.otb %{buildroot}%{_fontdir} @@ -205,7 +195,6 @@ gzip %{buildroot}%{_fontdir}/*.pcf install -m 0755 -d %{buildroot}%{_fontconfig_templatedir} \ %{buildroot}%{_fontconfig_confdir} -# Repeat for every font family install -m 0644 -p %{SOURCE3} \ %{buildroot}%{_fontconfig_templatedir}/%{fontconf}-console.conf @@ -227,8 +216,35 @@ for fconf in %{fontconf}-console.conf \ %{buildroot}%{_fontconfig_confdir}/$fconf done +%_font_pkg -n console -f %{fontconf}-console.conf console8x16*.pcf.gz + +%_font_pkg -n console-opentype -f %{fontconf}-console.conf console8x16*.otb + +%_font_pkg -n fangsongti -f %{fontconf}-fangsongti.conf fangsongti*.pcf.gz +%license LICENSE + +%_font_pkg -n fangsongti-opentype -f %{fontconf}-fangsongti.conf fangsongti*.otb +%license LICENSE + +%_font_pkg -n fixed-opentype -f %{fontconf}-fixed.conf console9*.otb + +%_font_pkg -n fixed -f %{fontconf}-fixed.conf console9*.pcf.gz + +%_font_pkg -n lucida-typewriter -f %{fontconf}-lucida-typewriter.conf lut*.pcf.gz + +%_font_pkg -n lucida-typewriter-opentype -f %{fontconf}-lucida-typewriter.conf lut*.otb + +%files -n %{fontname}-fonts-compat + +%files -n %{fontname}-opentype-fonts-compat + +%files doc +%doc LU_LEGALNOTICE README fixfont-3.5/README %changelog +* Wed Apr 12 2023 Jing Zhang - 1:0.3-3 +- Refact spec + * Tue Jul 26 2022 Chunmei Xu - 1:0.3-2 - fix version dependency -- Gitee