From 5b401c4cca3774f046d8533f385d8541a91d2248 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Tue, 10 Oct 2017 15:29:50 +0200 Subject: [PATCH] Initial import (rhbz#1499676) --- .gitignore | 1 + README.md | 3 - ...-brotli-libraries-in-pkg-config-file.patch | 52 +++++++++++++++ sources | 1 + woff2.spec | 66 +++++++++++++++++++ 5 files changed, 120 insertions(+), 3 deletions(-) create mode 100644 .gitignore delete mode 100644 README.md create mode 100644 Require-specific-brotli-libraries-in-pkg-config-file.patch create mode 100644 sources create mode 100644 woff2.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..869a16e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/woff2-1.0.1.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index ad6324a..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# woff2 - -The woff2 package \ No newline at end of file diff --git a/Require-specific-brotli-libraries-in-pkg-config-file.patch b/Require-specific-brotli-libraries-in-pkg-config-file.patch new file mode 100644 index 0000000..be37818 --- /dev/null +++ b/Require-specific-brotli-libraries-in-pkg-config-file.patch @@ -0,0 +1,52 @@ +From 86040accb25e655a5c5617876eaf0878133af7c4 Mon Sep 17 00:00:00 2001 +From: Tomas Popela +Date: Mon, 9 Oct 2017 15:27:01 +0200 +Subject: [PATCH] Require specific brotli libraries in pkg-config files + +--- + CMakeLists.txt | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 61663bd..68d1c62 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -158,7 +158,7 @@ endfunction(generate_pkg_config_path) + function(generate_pkg_config output_file) + set (options) + set (oneValueArgs NAME DESCRIPTION URL VERSION PREFIX LIBDIR INCLUDEDIR) +- set (multiValueArgs DEPENDS_PRIVATE CFLAGS LIBRARIES) ++ set (multiValueArgs DEPENDS DEPENDS_PRIVATE CFLAGS LIBRARIES) + cmake_parse_arguments(GEN_PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + unset (options) + unset (oneValueArgs) +@@ -203,6 +203,10 @@ function(generate_pkg_config output_file) + file(APPEND "${output_file}" "Version: ${GEN_PKG_VERSION}\n") + endif() + ++ if(GEN_PKG_DEPENDS) ++ file(APPEND "${output_file}" "Requires: ${GEN_PKG_DEPENDS}\n") ++ endif() ++ + if(GEN_PKG_DEPENDS_PRIVATE) + file(APPEND "${output_file}" "Requires.private:") + foreach(lib ${GEN_PKG_DEPENDS_PRIVATE}) +@@ -242,6 +246,7 @@ generate_pkg_config ("${CMAKE_CURRENT_BINARY_DIR}/libwoff2dec.pc" + DESCRIPTION "WOFF2 decoder library" + URL "https://github.com/google/woff2" + VERSION "${WOFF2_VERSION}" ++ DEPENDS libbrotlidec + DEPENDS_PRIVATE libwoff2common + LIBRARIES woff2dec) + +@@ -250,6 +255,7 @@ generate_pkg_config ("${CMAKE_CURRENT_BINARY_DIR}/libwoff2enc.pc" + DESCRIPTION "WOFF2 encoder library" + URL "https://github.com/google/woff2" + VERSION "${WOFF2_VERSION}" ++ DEPENDS libbrotlienc + DEPENDS_PRIVATE libwoff2common + LIBRARIES woff2enc) + +-- +2.14.2 + diff --git a/sources b/sources new file mode 100644 index 0000000..71d34ae --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (woff2-1.0.1.tar.gz) = d3257164e004e3319001a6e7015050b894ecff751da01a1f2eea226f0730f142c6001b04a959af2e16546a63fab216706b32b0d543cade210ecd54fa70f6e55c diff --git a/woff2.spec b/woff2.spec new file mode 100644 index 0000000..c166d1e --- /dev/null +++ b/woff2.spec @@ -0,0 +1,66 @@ +Name: woff2 +Version: 1.0.1 +Release: 1%{?dist} +Summary: Web Open Font Format 2.0 library + +License: MIT +URL: https://github.com/google/woff2 +Source0: https://github.com/google/woff2/archive/v%{version}/%{name}-%{version}.tar.gz + +# https://github.com/google/woff2/pull/95 +Patch0: Require-specific-brotli-libraries-in-pkg-config-file.patch + +BuildRequires: cmake +BuildRequires: brotli-devel >= 1.0 + +%description +Web Open Font Format (WOFF) 2.0 is an update to the existing WOFF 1.0 with +improved compression that is achieved by using the Brotli algorithm. The primary +purpose of the WOFF2 format is to efficiently package fonts linked to Web +documents by means of CSS @font-face rules. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Development files and utils for %{name} + +%prep +%autosetup -n %{name}-%{version} + +%build +mkdir -p %{_target_platform} +pushd %{_target_platform} +%cmake .. \ + -DCMAKE_INSTALL_PREFIX="%{_prefix}" \ + -DCMAKE_INSTALL_LIBDIR="%{_libdir}" +popd + +make %{?_smp_mflags} -C %{_target_platform} + +%install +%make_install -C %{_target_platform} + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%license LICENSE +%{_libdir}/libwoff2common.so.* +%{_libdir}/libwoff2dec.so.* +%{_libdir}/libwoff2enc.so.* + +%files devel +%{_includedir}/woff2 +%{_libdir}/libwoff2common.so +%{_libdir}/libwoff2dec.so +%{_libdir}/libwoff2enc.so +%{_libdir}/pkgconfig/libwoff2common.pc +%{_libdir}/pkgconfig/libwoff2dec.pc +%{_libdir}/pkgconfig/libwoff2enc.pc + +%changelog +* Mon Oct 09 2017 Tomas Popela 1.0.1-1 +- Initial import (rhbz#1499676)