[packages/otsanitizer] - new, ots packaged under otsanitizer.spec, because of name conflict - added system-libs patch to us

qboosh qboosh at pld-linux.org
Tue Mar 13 21:43:16 CET 2018


commit edfd8b3ad2a57718b9e38cdd78898ea22fa91d15
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue Mar 13 21:45:48 2018 +0100

    - new, ots packaged under otsanitizer.spec, because of name conflict
    - added system-libs patch to use system woff2,brotli,lz4,zlib and change static libots library to shared libotsanitizer

 ots-system-libs.patch | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++
 otsanitizer.spec      | 136 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 281 insertions(+)
---
diff --git a/otsanitizer.spec b/otsanitizer.spec
new file mode 100644
index 0000000..97da060
--- /dev/null
+++ b/otsanitizer.spec
@@ -0,0 +1,136 @@
+# Upstream name is "ots", but this package name is already occupied by Open Text Summarizer project.
+# Library is renamed (from upstream libots.a to libotsanitizer.*) to avoid conflict with ots package.
+#
+# Conditional build:
+%bcond_without	static_libs	# static library
+%bcond_without	tests		# unit and fuzz testing
+#
+Summary:	OpenType Sanitizer
+Summary(pl.UTF-8):	OpenType Sanitizer - narzędzie poprawiające fonty OpenType
+Name:		otsanitizer
+Version:	6.1.1
+Release:	1
+License:	BSD
+Group:		Libraries
+#Source0Download: https://github.com/khaledhosny/ots/releases
+Source0:	https://github.com/khaledhosny/ots/releases/download/v%{version}/ots-%{version}.tar.gz
+# Source0-md5:	8b6653d7fe0a72f67466d23690e33141
+Patch0:		ots-system-libs.patch
+URL:		https://github.com/khaledhosny/ots
+BuildRequires:	autoconf >= 2.50
+BuildRequires:	automake >= 1:1.11
+BuildRequires:	freetype-devel >= 2
+BuildRequires:	libstdc++-devel >= 6:4.7
+BuildRequires:	libtool >= 2:2
+BuildRequires:	lz4-devel
+BuildRequires:	pkgconfig >= 1:0.20
+BuildRequires:	woff2-devel
+BuildRequires:	zlib-devel
+%if %{with tests}
+BuildRequires:	gtest-devel
+BuildRequires:	libasan-devel
+BuildRequires:	libubsan-devel
+%endif
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+The OpenType Sanitizer (OTS) parses and serializes OpenType files
+(OTF, TTF) and WOFF and WOFF2 font files, validating them and
+sanitizing them as it goes.
+
+%description -l pl.UTF-8
+OpenType Sanitizer (OTS) analizuje i serializuje pliki fontów OpenType
+(OTF, TTF) oraz WOFF/WOFF2, sprawdzając ich poprawność i naprawiając
+niektóre błędy.
+
+%package devel
+Summary:	Header files for OpenType Sanitizer library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki OpenType Sanitizer
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	freetype-devel >= 2
+Requires:	lz4-devel
+Requires:	woff2-devel
+Requires:	zlib-devel
+
+%description devel
+Header files for OpenType Sanitizer library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki OpenType Sanitizer.
+
+%package static
+Summary:	Static OpenType Sanitizer library
+Summary(pl.UTF-8):	Statyczna biblioteka OpenType Sanitizer
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static OpenType Sanitizer library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka OpenType Sanitizer.
+
+%prep
+%setup -q -n ots-%{version}
+%patch0 -p1
+
+# extend blacklist by PLD supplied fonts known to cause test failures
+cat >>tests/BLACKLIST.txt <<EOF
+# LiTE package; cmap: Bad cmap subtable; Failed to parse table
+whiterabbit.ttf
+EOF
+
+%build
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+%if %{without tests}
+	ax_cv_check_cflags___fsanitize_address=no \
+	ax_cv_check_cflags___fsanitize_undefined=no \
+%endif
+	--disable-silent-rules \
+	%{!?with_static_libs:--disable-static}
+%{__make}
+
+%if %{with tests}
+%{__make} check
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE README docs/{DesignDoc,HowToFix}.md
+%attr(755,root,root) %{_bindir}/ots-idempotent
+%attr(755,root,root) %{_bindir}/ots-perf
+%attr(755,root,root) %{_bindir}/ots-sanitize
+%attr(755,root,root) %{_bindir}/ots-side-by-side
+%attr(755,root,root) %{_bindir}/ots-validator-checker
+%attr(755,root,root) %{_libdir}/libotsanitizer.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libotsanitizer.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libotsanitizer.so
+%{_libdir}/libotsanitizer.la
+%{_includedir}/ots
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libotsanitizer.a
+%endif
diff --git a/ots-system-libs.patch b/ots-system-libs.patch
new file mode 100644
index 0000000..68833a9
--- /dev/null
+++ b/ots-system-libs.patch
@@ -0,0 +1,145 @@
+--- ots-6.1.1/configure.ac.orig	2017-10-16 18:55:24.000000000 +0200
++++ ots-6.1.1/configure.ac	2018-03-13 21:01:59.367447508 +0100
+@@ -16,8 +16,9 @@
+ AC_OBJEXT
+ AC_PROG_CC
+ AC_PROG_CXX
+-AC_PROG_RANLIB
++LT_INIT
+ PKG_PROG_PKG_CONFIG([0.20])
++PKG_CHECK_MODULES(OTS, [libwoff2dec zlib])
+ 
+ AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])
+ 
+@@ -41,6 +42,7 @@
+ 	AS_HELP_STRING([--enable-graphite=@<:@yes/no@:>@],
+                        [Sanitize Graphite tables @<:@default=yes@:>@]))
+ AS_IF([test "x$enable_graphite" != "xno"], [
++	PKG_CHECK_MODULES(LZ4, [liblz4])
+ 	AC_DEFINE(OTS_GRAPHITE, 1, [Sanitize Graphite tables])
+ ])
+ AM_CONDITIONAL(OTS_GRAPHITE, [test "x$enable_graphite" != "xno"])
+--- ots-6.1.1/Makefile.am.orig	2017-10-16 18:55:24.000000000 +0200
++++ ots-6.1.1/Makefile.am	2018-03-13 21:06:15.540777916 +0100
+@@ -50,17 +50,13 @@
+ TESTS += tests/test_fuzzed_fonts.sh
+ endif
+ 
+-lib_LIBRARIES = \
+-  libots.a \
+-  libbrotli.a \
+-  libwoff2.a \
+-  libz.a \
++lib_LTLIBRARIES = \
++  libotsanitizer.la \
+   $(NULL)
+ 
++libotsanitizer_la_LIBADD = $(OTS_LIBS)
+ if OTS_GRAPHITE
+-lib_LIBRARIES += \
+-  liblz4.a \
+-  $(NULL)
++libotsanitizer_la_LIBADD += $(LZ4_LIBS)
+ endif
+ 
+ check_PROGRAMS = \
+@@ -68,12 +64,8 @@
+   layout_common_table_test \
+   $(NULL)
+ 
+-check_LIBRARIES = \
+-  libgtest.a \
+-  $(NULL)
+-
+ 
+-libots_a_SOURCES = \
++libotsanitizer_la_SOURCES = \
+   src/cff.cc \
+   src/cff.h \
+   src/cff_type2_charstring.cc \
+@@ -137,7 +129,7 @@
+   $(NULL)
+ 
+ if OTS_GRAPHITE
+-libots_a_SOURCES += \
++libotsanitizer_la_SOURCES += \
+   src/feat.cc \
+   src/feat.h \
+   src/glat.cc \
+@@ -154,15 +146,13 @@
+   $(NULL)
+ endif
+ 
+-libots_a_CPPFLAGS = \
++libotsanitizer_la_CPPFLAGS = \
+   -I$(top_srcdir)/include \
+-  -I$(top_srcdir)/third_party/woff2/include \
+-  -I$(top_srcdir)/third_party/zlib \
+   $(NULL)
+ 
+ if OTS_GRAPHITE
+-libots_a_CPPFLAGS += \
+-  -I$(top_srcdir)/third_party/lz4/lib \
++libotsanitizer_la_CPPFLAGS += \
++  $(LZ4_CFLAGS) \
+   $(NULL)
+ endif
+ 
+@@ -368,7 +358,6 @@
+ 
+ cff_type2_charstring_test_CPPFLAGS = \
+   -I$(top_srcdir)/src \
+-  $(GTEST_CPPFLAGS) \
+   $(AM_CPPFLAGS) \
+   $(NULL)
+ 
+@@ -377,20 +366,18 @@
+   $(NULL)
+ 
+ cff_type2_charstring_test_LDADD = \
+-  libgtest.a \
++  -lgtest \
+   $(LDADD) \
+   $(PTHREAD_LIBS) \
+   $(NULL)
+ 
+ 
+ layout_common_table_test_SOURCES = \
+-  third_party/googletest/googletest/src/gtest_main.cc \
+   tests/layout_common_table_test.cc \
+   $(NULL)
+ 
+ layout_common_table_test_CPPFLAGS = \
+   -I$(top_srcdir)/src \
+-  $(GTEST_CPPFLAGS) \
+   $(AM_CPPFLAGS) \
+   $(NULL)
+ 
+@@ -399,7 +386,7 @@
+   $(NULL)
+ 
+ layout_common_table_test_LDADD = \
+-  libgtest.a \
++  -lgtest -lgtest_main \
+   $(LDADD) \
+   $(PTHREAD_LIBS) \
+   $(NULL)
+@@ -468,17 +455,8 @@
+   $(NULL)
+ 
+ LDADD = \
+-  libots.a \
+-  libwoff2.a \
+-  libbrotli.a \
+-  libz.a \
+-  $(NULL)
+-
+-if OTS_GRAPHITE
+-LDADD += \
+-  liblz4.a \
++  libotsanitizer.la \
+   $(NULL)
+-endif
+ 
+ if HAVE_WIN32
+ LDADD += -lgdi32
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/otsanitizer.git/commitdiff/edfd8b3ad2a57718b9e38cdd78898ea22fa91d15



More information about the pld-cvs-commit mailing list