[libcss] initial import
David Tardon
dtardon at fedoraproject.org
Fri Jan 10 14:20:04 UTC 2014
commit f16688e113f7f285cd4bc98a60898251dcb8b0ff
Author: David Tardon <dtardon at redhat.com>
Date: Fri Jan 10 15:03:46 2014 +0100
initial import
.gitignore | 1 +
0001-print-size_t-values-in-a-portable-way.patch | 54 ++++++++++++++++
libcss.spec | 75 ++++++++++++++++++++++
sources | 1 +
4 files changed, 131 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..4ba014a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/libcss-0.2.0-src.tar.gz
diff --git a/0001-print-size_t-values-in-a-portable-way.patch b/0001-print-size_t-values-in-a-portable-way.patch
new file mode 100644
index 0000000..e548217
--- /dev/null
+++ b/0001-print-size_t-values-in-a-portable-way.patch
@@ -0,0 +1,54 @@
+From a3f019aa770145f65cb6f75e400a9ab2449cd514 Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon at redhat.com>
+Date: Mon, 6 Jan 2014 21:44:34 +0100
+Subject: [PATCH] print size_t values in a portable way
+
+---
+ test/parse-auto.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/test/parse-auto.c b/test/parse-auto.c
+index 2bbe61e..93ab536 100644
+--- a/test/parse-auto.c
++++ b/test/parse-auto.c
+@@ -1,6 +1,7 @@
+ #include <ctype.h>
+ #include <inttypes.h>
+ #include <stdbool.h>
++#include <stdint.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -340,12 +341,14 @@ static void report_fail(const uint8_t *data, size_t datalen, exp_entry *e)
+
+ printf(" Expected entry:\n");
+ printf(" entry type:%d name:%s\n", e->type, e->name);
+- printf(" bytecode len:%ld used:%ld\n", e->bclen, e->bcused);
++ printf(" bytecode len:%" PRIuMAX " used:%" PRIuMAX "\n",
++ (uintmax_t) e->bclen, (uintmax_t) e->bcused);
+ printf(" bytecode ");
+ for (bcoff = 0; bcoff < e->bcused; bcoff++) {
+ printf("%.2x ", ((uint8_t *) e->bytecode)[bcoff]);
+ }
+- printf("\n string table len:%ld used %ld\n", e->stlen, e->stused);
++ printf("\n string table len:%" PRIuMAX " used %" PRIuMAX "\n",
++ (uintmax_t) e->stlen, (uintmax_t) e->stused);
+ /*
+ struct stentry {
+ size_t off;
+@@ -513,9 +516,9 @@ bool validate_rule_selector(css_rule_selector *s, exp_entry *e)
+
+ if ((s->style->used * sizeof(css_code_t)) != e->bcused) {
+ printf("FAIL Bytecode lengths differ\n"
+- " Got length %ld, Expected %u\n",
+- (s->style->used * sizeof(css_code_t)),
+- (int) e->bcused);
++ " Got length %" PRIuMAX ", Expected %" PRIuMAX "\n",
++ (uintmax_t) (s->style->used * sizeof(css_code_t)),
++ (uintmax_t) e->bcused);
+ return true;
+ }
+
+--
+1.8.4.2
+
diff --git a/libcss.spec b/libcss.spec
new file mode 100644
index 0000000..524fc88
--- /dev/null
+++ b/libcss.spec
@@ -0,0 +1,75 @@
+Name: libcss
+Version: 0.2.0
+Release: 2%{?dist}
+Summary: A CSS parser and selection engine
+
+Group: System Environment/Libraries
+License: MIT
+URL: http://www.netsurf-browser.org/projects/libcss/
+Source: http://download.netsurf-browser.org/libs/releases/%{name}-%{version}-src.tar.gz
+
+BuildRequires: check-devel
+BuildRequires: libparserutils-devel
+BuildRequires: libwapcaplet-devel
+BuildRequires: netsurf-buildsystem
+
+Patch0: 0001-print-size_t-values-in-a-portable-way.patch
+
+%description
+LibCSS is a CSS (Cascading Style Sheet) parser and selection engine,
+written in C. It was developed as part of the NetSurf project. For
+further details, see README.
+
+Features:
+* Parses CSS, good and bad
+* Simple C API
+* Low memory usage
+* Fast selection engine
+* Portable
+
+%package devel
+Summary: Development files for %{name}
+Group: Development/Libraries
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description devel
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
+
+%global make_vars COMPONENT_TYPE=lib-shared PREFIX=%{_prefix} Q=
+%global build_envvars CFLAGS='%{optflags}' LDFLAGS="$RPM_LD_FLAGS"
+
+%prep
+%setup -q -n %{name}-%{version}
+%patch0 -p1
+
+sed -i -e s@/lib/@/%{_lib}/@ -e s@/lib:@/%{_lib}:@ Makefile %{name}.pc.in
+
+%build
+%{build_envvars} make %{?_smp_mflags} %{make_vars}
+
+%install
+make install DESTDIR=%{buildroot} %{make_vars}
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%check
+%{build_envvars} make %{?_smp_mflags} test %{make_vars}
+
+%files
+%doc COPYING README
+%{_libdir}/%{name}.so.*
+
+%files devel
+%doc docs/*
+%{_includedir}/%{name}
+%{_libdir}/%{name}.so
+%{_libdir}/pkgconfig/%{name}.pc
+
+%changelog
+* Wed Jan 08 2014 David Tardon <dtardon at redhat.com> - 0.2.0-2
+- build with correct flags
+
+* Wed Dec 25 2013 David Tardon <dtardon at redhat.com> - 0.2.0-1
+- initial import
diff --git a/sources b/sources
index e69de29..559fca1 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+e61700e0dce2a122d65b85dba04c4b40 libcss-0.2.0-src.tar.gz
More information about the scm-commits
mailing list