From 684b7c8ea761070c04b038f462f07a8c304a0c0b Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Thu, 11 Feb 2016 12:15:58 +0530 Subject: [PATCH 01/11] initial build for epel7 --- .cvsignore | 0 .gitignore | 1 + Makefile | 21 --------------------- sources | 1 + woff.spec | 40 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 21 deletions(-) delete mode 100644 .cvsignore create mode 100644 .gitignore delete mode 100644 Makefile create mode 100644 woff.spec diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index e69de29..0000000 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4cb94f3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/woff-code-latest.zip diff --git a/Makefile b/Makefile deleted file mode 100644 index d3a5fc0..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: woff -# $Id$ -NAME := woff -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/sources b/sources index e69de29..a3fd9e8 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +1dcdbc9a7f48086185740c185d822279 woff-code-latest.zip diff --git a/woff.spec b/woff.spec new file mode 100644 index 0000000..25314c3 --- /dev/null +++ b/woff.spec @@ -0,0 +1,40 @@ +Name: woff +Version: 0.20091126 +Release: 3%{?dist} +Summary: Encoding and Decoding for Web Open Font Format(Woff) + +License: GPLv2+ or LGPLv2+ or MPLv1.1 +URL: http://people.mozilla.com/~jkew/woff/ +Source0: http://people.mozilla.com/~jkew/woff/woff-code-latest.zip +BuildRequires: zlib-devel + +%description +Encoding and Decoding for Web Open Font Format(Woff) + +%prep +%setup -q -c + +%build +make CFLAGS="${RPM_OPT_FLAGS}" %{?_smp_mflags} + + +%install +mkdir -m 755 -p $RPM_BUILD_ROOT/%{_bindir} +install -m755 sfnt2woff woff2sfnt $RPM_BUILD_ROOT/%{_bindir}/ + +%files +%doc +%{_bindir}/sfnt2woff +%{_bindir}/woff2sfnt + +%changelog +* Thu Feb 11 2016 Parag Nemade - 0.20091126-3 +- Clean the spec file + +* Sun Nov 29 2009 Parag Nemade - 0.20091126-2.fc12 +- Added BR:zlib-devel + +* Fri Nov 27 2009 Parag Nemade - 0.20091126-1.fc12 +- Initial specfile for Fedora + + From d4dac0481d655846c8166c8e29c0a8ae24926dbc Mon Sep 17 00:00:00 2001 From: Parag Nemade Date: Mon, 19 Feb 2018 12:25:00 +0530 Subject: [PATCH 02/11] Add BuildRequires: gcc as per packaging guidelines --- woff.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/woff.spec b/woff.spec index 25314c3..8c73bf2 100644 --- a/woff.spec +++ b/woff.spec @@ -1,18 +1,19 @@ Name: woff Version: 0.20091126 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Encoding and Decoding for Web Open Font Format(Woff) License: GPLv2+ or LGPLv2+ or MPLv1.1 URL: http://people.mozilla.com/~jkew/woff/ Source0: http://people.mozilla.com/~jkew/woff/woff-code-latest.zip BuildRequires: zlib-devel +BuildRequires: gcc %description Encoding and Decoding for Web Open Font Format(Woff) %prep -%setup -q -c +%autosetup -c %build make CFLAGS="${RPM_OPT_FLAGS}" %{?_smp_mflags} @@ -28,6 +29,9 @@ install -m755 sfnt2woff woff2sfnt $RPM_BUILD_ROOT/%{_bindir}/ %{_bindir}/woff2sfnt %changelog +* Mon Feb 19 2018 Parag Nemade - 0.20091126-4 +- Add BuildRequires: gcc as per packaging guidelines + * Thu Feb 11 2016 Parag Nemade - 0.20091126-3 - Clean the spec file From 256bc2506f43995af2e87248bcfb1e39c3c40db4 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sat, 9 Jan 2021 01:00:31 +0000 Subject: [PATCH 03/11] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- woff.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/woff.spec b/woff.spec index 8c73bf2..bb701ce 100644 --- a/woff.spec +++ b/woff.spec @@ -6,6 +6,7 @@ Summary: Encoding and Decoding for Web Open Font Format(Woff) License: GPLv2+ or LGPLv2+ or MPLv1.1 URL: http://people.mozilla.com/~jkew/woff/ Source0: http://people.mozilla.com/~jkew/woff/woff-code-latest.zip +BuildRequires: make BuildRequires: zlib-devel BuildRequires: gcc From 49bf8c60e7ce77afb539acc21b3399f3c6fc2ef3 Mon Sep 17 00:00:00 2001 From: Benson Muite Date: Sun, 5 Jun 2022 13:25:15 +0000 Subject: [PATCH 04/11] Update URL to working one Follows discussion at https://bugzilla.redhat.com/show_bug.cgi?id=2091282 --- woff.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/woff.spec b/woff.spec index bb701ce..74ca010 100644 --- a/woff.spec +++ b/woff.spec @@ -1,11 +1,11 @@ Name: woff Version: 0.20091126 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Encoding and Decoding for Web Open Font Format(Woff) License: GPLv2+ or LGPLv2+ or MPLv1.1 -URL: http://people.mozilla.com/~jkew/woff/ -Source0: http://people.mozilla.com/~jkew/woff/woff-code-latest.zip +URL: https://web.archive.org/web/20170630235618/https://people-mozilla.org/~jkew/woff/ +Source0: %{url}/woff-code-latest.zip BuildRequires: make BuildRequires: zlib-devel BuildRequires: gcc @@ -30,6 +30,9 @@ install -m755 sfnt2woff woff2sfnt $RPM_BUILD_ROOT/%{_bindir}/ %{_bindir}/woff2sfnt %changelog +* Sun Jun 05 2022 Benson Muite - 0.20091126-5 +- Source URL update + * Mon Feb 19 2018 Parag Nemade - 0.20091126-4 - Add BuildRequires: gcc as per packaging guidelines From bba8710d1099061a1a519a8b03eda461853fe4ad Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 28 Nov 2022 22:39:24 -0500 Subject: [PATCH 05/11] Clarify URL/Source situation - Do not claim to have a working source archive URL --- woff.spec | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/woff.spec b/woff.spec index 74ca010..d3d5e40 100644 --- a/woff.spec +++ b/woff.spec @@ -1,11 +1,20 @@ Name: woff Version: 0.20091126 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Encoding and Decoding for Web Open Font Format(Woff) License: GPLv2+ or LGPLv2+ or MPLv1.1 -URL: https://web.archive.org/web/20170630235618/https://people-mozilla.org/~jkew/woff/ -Source0: %{url}/woff-code-latest.zip +# Note that the URL http://people.mozilla.org/~jkew/woff/, where the original +# WOFF reference implementation sources were published, is no longer available. +# A copy of that page can be found at +# https://web.archive.org/web/20170630235618/https://people-mozilla.org/~jkew/woff/, +# and the sources are mirrored at https://github.com/TheJessieKirk/sfnt2woff. +%global original_url https://people-mozilla.org/~jkew/woff/ +# The URL is no longer active, so we reference an archived copy: +URL: https://web.archive.org/web/20170630235618/%{original_url} +# There is no longer a working URL for this archive. +Source0: %{original_url}/woff-code-latest.zip + BuildRequires: make BuildRequires: zlib-devel BuildRequires: gcc @@ -30,6 +39,10 @@ install -m755 sfnt2woff woff2sfnt $RPM_BUILD_ROOT/%{_bindir}/ %{_bindir}/woff2sfnt %changelog +* Tue Nov 29 2022 Benjamin A. Beasley - 0.20091126-6 +- Clarify URL/Source situation, and do not claim to have a working source + archive URL + * Sun Jun 05 2022 Benson Muite - 0.20091126-5 - Source URL update From 9eb6855387daa4ef34866b689b7d450d707aba77 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 28 Nov 2022 22:46:00 -0500 Subject: [PATCH 06/11] General tidying of spec file - Use modern macros - Install HTML format description as documentation --- woff.spec | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/woff.spec b/woff.spec index d3d5e40..7d06df0 100644 --- a/woff.spec +++ b/woff.spec @@ -15,33 +15,41 @@ URL: https://web.archive.org/web/20170630235618/%{original_url} # There is no longer a working URL for this archive. Source0: %{original_url}/woff-code-latest.zip -BuildRequires: make -BuildRequires: zlib-devel +BuildRequires: make BuildRequires: gcc +BuildRequires: zlib-devel + %description Encoding and Decoding for Web Open Font Format(Woff) %prep %autosetup -c + %build -make CFLAGS="${RPM_OPT_FLAGS}" %{?_smp_mflags} +%set_build_flags +%make_build CFLAGS="${CFLAGS}" %install -mkdir -m 755 -p $RPM_BUILD_ROOT/%{_bindir} -install -m755 sfnt2woff woff2sfnt $RPM_BUILD_ROOT/%{_bindir}/ +# The Makefile has no install target. +install -d '%{buildroot}%{_bindir}' +install -t '%{buildroot}%{_bindir}' -p sfnt2woff woff2sfnt + %files -%doc +%doc woff-2009-10-03.html %{_bindir}/sfnt2woff %{_bindir}/woff2sfnt + %changelog * Tue Nov 29 2022 Benjamin A. Beasley - 0.20091126-6 - Clarify URL/Source situation, and do not claim to have a working source archive URL +- General tidying of spec file; use modern macros and install HTML format + description as documentation * Sun Jun 05 2022 Benson Muite - 0.20091126-5 - Source URL update From 41cdeeca94dc5d9abff22f3785676e26e8c8b428 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 28 Nov 2022 22:48:57 -0500 Subject: [PATCH 07/11] Add hand-written man pages --- sfnt2woff.1 | 35 +++++++++++++++++++++++++++++++++++ woff.spec | 8 ++++++++ woff2sfnt.1 | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 sfnt2woff.1 create mode 100644 woff2sfnt.1 diff --git a/sfnt2woff.1 b/sfnt2woff.1 new file mode 100644 index 0000000..87cecb6 --- /dev/null +++ b/sfnt2woff.1 @@ -0,0 +1,35 @@ +.TH sfnt2woff "1" "November 2020" sfnt2woff\-zopfli "User Commands" +.SH NAME +sfnt2woff \- package OpenType +.I otffile +as WOFF, creating +.IR otffile .woff +.SH SYNOPSIS +sfnt2woff +.RB [ \-v +.IR maj . min ] +.RB [ \-m +.IR metadata.xml ] +.RB [ \-p +.IR private.dat ] +.I otffile +.SH DESCRIPTION +.PP +Packages OpenType +.I otffile +as WOFF, creating +.IR otffile .woff. +.SH OPTIONS +.TP +\fB\-v\fR \fImaj\fR.\fImin +set font version number (major and minor, both integers) +.TP +\fB\-m\fR \fImetadata.xml +include metadata from +.I metadata.xml +(not validated) +.TP +\fB\-p\fR \fIprivate.dat +include private data block +.SH "SEE ALSO" +.BR woff2sfnt (1) diff --git a/woff.spec b/woff.spec index 7d06df0..bbe96ca 100644 --- a/woff.spec +++ b/woff.spec @@ -14,6 +14,9 @@ License: GPLv2+ or LGPLv2+ or MPLv1.1 URL: https://web.archive.org/web/20170630235618/%{original_url} # There is no longer a working URL for this archive. Source0: %{original_url}/woff-code-latest.zip +# Hand-written for Fedora in groff_man(7) format based on --help output +Source1: sfnt2woff.1 +Source2: woff2sfnt.1 BuildRequires: make BuildRequires: gcc @@ -36,12 +39,16 @@ Encoding and Decoding for Web Open Font Format(Woff) # The Makefile has no install target. install -d '%{buildroot}%{_bindir}' install -t '%{buildroot}%{_bindir}' -p sfnt2woff woff2sfnt +install -d '%{buildroot}%{_mandir}/man1' +install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 '%{SOURCE1}' '%{SOURCE2}' %files %doc woff-2009-10-03.html %{_bindir}/sfnt2woff %{_bindir}/woff2sfnt +%{_mandir}/man1/sfnt2woff.1* +%{_mandir}/man1/woff2sfnt.1* %changelog @@ -50,6 +57,7 @@ install -t '%{buildroot}%{_bindir}' -p sfnt2woff woff2sfnt archive URL - General tidying of spec file; use modern macros and install HTML format description as documentation +- Add hand-written man pages * Sun Jun 05 2022 Benson Muite - 0.20091126-5 - Source URL update diff --git a/woff2sfnt.1 b/woff2sfnt.1 new file mode 100644 index 0000000..77bdb67 --- /dev/null +++ b/woff2sfnt.1 @@ -0,0 +1,33 @@ +.TH woff2sfnt "1" "November 2020" woff2sfnt "User Commands" +.SH NAME +woff2sfnt \- decode WOFF file +.IR woff , +writing OpenType data to +.B stdout +.SH SYNOPSIS +woff2sfnt +.RB [ \-v \ |\ \-m \ |\ \-p ] +.I woff +.SH DESCRIPTION +.PP +Decodes WOFF file +.IR woff , +writing OpenType data to +.BR stdout . +.SH OPTIONS +.TP +.B \-v +write font version to +.B stdout +.TP +.B \-m +write WOFF metadata block to +.B stdout +.TP +.B \-p +write private data block to +.B stdout +.SH NOTES +Only one of \fB\-v\fR, \fB\-m\fR, \fB\-p\fR may be used at a time. +.SH "SEE ALSO" +.BR sfnt2woff (1) From 34b89472a5b40f7a0b6f27bd5624fbb7554fc1e1 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 29 Nov 2022 10:10:56 -0500 Subject: [PATCH 08/11] Patch a possible double-free bug --- possible-double-free.patch | 11 +++++++++++ woff.spec | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 possible-double-free.patch diff --git a/possible-double-free.patch b/possible-double-free.patch new file mode 100644 index 0000000..09a5660 --- /dev/null +++ b/possible-double-free.patch @@ -0,0 +1,11 @@ +diff -Naur a/woff.c b/woff.c +--- a/woff.c 2009-09-25 09:54:13.000000000 -0400 ++++ b/woff.c 2022-11-29 10:09:15.091798523 -0500 +@@ -354,6 +354,7 @@ + newHeader->privLen = 0; + + free(tableOrder); ++ tableOrder = 0; + + if ((status & eWOFF_warn_checksum_mismatch) != 0) { + /* The original font had checksum errors, so we now decode our WOFF data diff --git a/woff.spec b/woff.spec index bbe96ca..8499a65 100644 --- a/woff.spec +++ b/woff.spec @@ -18,6 +18,11 @@ Source0: %{original_url}/woff-code-latest.zip Source1: sfnt2woff.1 Source2: woff2sfnt.1 +# It’s possible that tableOrder could be freed twice if a failure occurs. Set +# the pointer null after freeing it to prevent this. There is no current +# upstream to which this could be reported. +Patch: possible-double-free.patch + BuildRequires: make BuildRequires: gcc @@ -27,7 +32,7 @@ BuildRequires: zlib-devel Encoding and Decoding for Web Open Font Format(Woff) %prep -%autosetup -c +%autosetup -c -p1 %build From 06a07c7c168d6bdf95c99431822819e627eb7c27 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 29 Nov 2022 22:08:28 -0500 Subject: [PATCH 09/11] Convert to rpmautospec --- changelog | 21 +++++++++++++++++++++ woff.spec | 26 ++------------------------ 2 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 changelog diff --git a/changelog b/changelog new file mode 100644 index 0000000..ed7996d --- /dev/null +++ b/changelog @@ -0,0 +1,21 @@ +* Tue Nov 29 2022 Benjamin A. Beasley - 0.20091126-6 +- Clarify URL/Source situation, and do not claim to have a working source + archive URL +- General tidying of spec file; use modern macros and install HTML format + description as documentation +- Add hand-written man pages + +* Sun Jun 05 2022 Benson Muite - 0.20091126-5 +- Source URL update + +* Mon Feb 19 2018 Parag Nemade - 0.20091126-4 +- Add BuildRequires: gcc as per packaging guidelines + +* Thu Feb 11 2016 Parag Nemade - 0.20091126-3 +- Clean the spec file + +* Sun Nov 29 2009 Parag Nemade - 0.20091126-2.fc12 +- Added BR:zlib-devel + +* Fri Nov 27 2009 Parag Nemade - 0.20091126-1.fc12 +- Initial specfile for Fedora diff --git a/woff.spec b/woff.spec index 8499a65..186bdb6 100644 --- a/woff.spec +++ b/woff.spec @@ -1,6 +1,6 @@ Name: woff Version: 0.20091126 -Release: 6%{?dist} +Release: %autorelease Summary: Encoding and Decoding for Web Open Font Format(Woff) License: GPLv2+ or LGPLv2+ or MPLv1.1 @@ -57,26 +57,4 @@ install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 '%{SOURCE1}' '%{SOURCE2}' %changelog -* Tue Nov 29 2022 Benjamin A. Beasley - 0.20091126-6 -- Clarify URL/Source situation, and do not claim to have a working source - archive URL -- General tidying of spec file; use modern macros and install HTML format - description as documentation -- Add hand-written man pages - -* Sun Jun 05 2022 Benson Muite - 0.20091126-5 -- Source URL update - -* Mon Feb 19 2018 Parag Nemade - 0.20091126-4 -- Add BuildRequires: gcc as per packaging guidelines - -* Thu Feb 11 2016 Parag Nemade - 0.20091126-3 -- Clean the spec file - -* Sun Nov 29 2009 Parag Nemade - 0.20091126-2.fc12 -- Added BR:zlib-devel - -* Fri Nov 27 2009 Parag Nemade - 0.20091126-1.fc12 -- Initial specfile for Fedora - - +%autochangelog From 06e3ee9c2d4d37f1e3b8cf0f36797218b50cfc99 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 29 Nov 2022 10:20:43 -0500 Subject: [PATCH 10/11] Update License to SPDX --- woff.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/woff.spec b/woff.spec index 186bdb6..0dfdef5 100644 --- a/woff.spec +++ b/woff.spec @@ -3,7 +3,7 @@ Version: 0.20091126 Release: %autorelease Summary: Encoding and Decoding for Web Open Font Format(Woff) -License: GPLv2+ or LGPLv2+ or MPLv1.1 +License: MPL-1.0 OR GPL-2.0-or-later OR LGPL-2.0-or-later # Note that the URL http://people.mozilla.org/~jkew/woff/, where the original # WOFF reference implementation sources were published, is no longer available. # A copy of that page can be found at From dcfb5516a569d10a20199b0bbb5e66636852747c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 29 Nov 2022 10:23:24 -0500 Subject: [PATCH 11/11] Improved summary and description --- woff.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/woff.spec b/woff.spec index 0dfdef5..e213f93 100644 --- a/woff.spec +++ b/woff.spec @@ -1,7 +1,7 @@ Name: woff Version: 0.20091126 Release: %autorelease -Summary: Encoding and Decoding for Web Open Font Format(Woff) +Summary: Encoding and decoding for Web Open Font Format (WOFF) License: MPL-1.0 OR GPL-2.0-or-later OR LGPL-2.0-or-later # Note that the URL http://people.mozilla.org/~jkew/woff/, where the original @@ -29,7 +29,8 @@ BuildRequires: gcc BuildRequires: zlib-devel %description -Encoding and Decoding for Web Open Font Format(Woff) +Provides the sfnt2woff and woff2sfnt command-line tools for encoding and +decoding Web Open Font Format (WOFF) files. %prep %autosetup -c -p1