From 4960d4c6c190885b20f56ce9ee1ad2ad92b87021 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Wed, 28 May 2014 12:54:42 +0200 Subject: [PATCH] initial import --- .gitignore | 1 + ...fix-license-headers-for-gdb-printers.patch | 203 ++++++++++++++++++ ...-type-sizes-for-CPPUNIT_ASSERT_EQUAL.patch | 103 +++++++++ librevenge.spec | 94 ++++++++ sources | 1 + 5 files changed, 402 insertions(+) create mode 100644 0001-fix-license-headers-for-gdb-printers.patch create mode 100644 0001-fix-type-sizes-for-CPPUNIT_ASSERT_EQUAL.patch create mode 100644 librevenge.spec diff --git a/.gitignore b/.gitignore index e69de29..9a4e5dc 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/librevenge-0.0.0.tar.xz diff --git a/0001-fix-license-headers-for-gdb-printers.patch b/0001-fix-license-headers-for-gdb-printers.patch new file mode 100644 index 0000000..4685f61 --- /dev/null +++ b/0001-fix-license-headers-for-gdb-printers.patch @@ -0,0 +1,203 @@ +From 27adcd8bdba57db50b2e718054563c76f99aebfa Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Sat, 24 May 2014 00:24:46 +0200 +Subject: [PATCH] fix license headers for gdb printers + +--- + data/gdb/auto-load/librevenge-stream.py.in | 28 ++++++++++++---------------- + data/gdb/auto-load/librevenge.py.in | 28 ++++++++++++---------------- + data/gdb/librevenge/util/compatibility.py | 25 ++++++++++--------------- + data/gdb/librevenge/util/printing.py | 25 ++++++++++--------------- + data/gdb/librevenge/v0_0/streams.py | 5 ----- + data/gdb/librevenge/v0_0/types.py | 5 ----- + 6 files changed, 44 insertions(+), 72 deletions(-) + +diff --git a/data/gdb/auto-load/librevenge-stream.py.in b/data/gdb/auto-load/librevenge-stream.py.in +index d4dbc09..de4a9d2 100644 +--- a/data/gdb/auto-load/librevenge-stream.py.in ++++ b/data/gdb/auto-load/librevenge-stream.py.in +@@ -1,22 +1,18 @@ +-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +-# Auto-load of all the printers. +-# +-# Copyright (C) 2012 Red Hat, Inc., David Tardon +-# +-# This file is part of boost-gdb-printers. ++# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- ++# librevenge ++# Version: MPL 2.0 / LGPLv2.1+ + # +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 3 of the License, or +-# (at your option) any later version. ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. + # +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. ++# Alternatively, the contents of this file may be used under the terms ++# of the GNU Lesser General Public License Version 2.1 or later ++# (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are ++# applicable instead of those above. + # +-# You should have received a copy of the GNU General Public License +-# along with this program. If not, see . ++ ++# Auto-load of all the printers. + + import sys + +diff --git a/data/gdb/auto-load/librevenge.py.in b/data/gdb/auto-load/librevenge.py.in +index 6e7eb50..af4dba2 100644 +--- a/data/gdb/auto-load/librevenge.py.in ++++ b/data/gdb/auto-load/librevenge.py.in +@@ -1,22 +1,18 @@ +-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +-# Auto-load of all the printers. +-# +-# Copyright (C) 2012 Red Hat, Inc., David Tardon +-# +-# This file is part of boost-gdb-printers. ++# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- ++# librevenge ++# Version: MPL 2.0 / LGPLv2.1+ + # +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 3 of the License, or +-# (at your option) any later version. ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. + # +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. ++# Alternatively, the contents of this file may be used under the terms ++# of the GNU Lesser General Public License Version 2.1 or later ++# (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are ++# applicable instead of those above. + # +-# You should have received a copy of the GNU General Public License +-# along with this program. If not, see . ++ ++# Auto-load of all the printers. + + import sys + +diff --git a/data/gdb/librevenge/util/compatibility.py b/data/gdb/librevenge/util/compatibility.py +index 788d2f5..240874f 100644 +--- a/data/gdb/librevenge/util/compatibility.py ++++ b/data/gdb/librevenge/util/compatibility.py +@@ -1,23 +1,18 @@ + # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +-# Compatibility with older versions of GDB. +-# +-# Copyright (C) 2012 Red Hat, Inc., David Tardon ++# librevenge ++# Version: MPL 2.0 / LGPLv2.1+ + # +-# This file is part of boost-gdb-printers. ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. + # +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 3 of the License, or +-# (at your option) any later version. ++# Alternatively, the contents of this file may be used under the terms ++# of the GNU Lesser General Public License Version 2.1 or later ++# (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are ++# applicable instead of those above. + # +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program. If not, see . + ++# Compatibility with older versions of GDB. + + import gdb + +diff --git a/data/gdb/librevenge/util/printing.py b/data/gdb/librevenge/util/printing.py +index 28e6779..6187d21 100644 +--- a/data/gdb/librevenge/util/printing.py ++++ b/data/gdb/librevenge/util/printing.py +@@ -1,23 +1,18 @@ + # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +-# Printer interface adaptor. +-# +-# Copyright (C) 2012 Red Hat, Inc., David Tardon ++# librevenge ++# Version: MPL 2.0 / LGPLv2.1+ + # +-# This file is part of boost-gdb-printers. ++# This Source Code Form is subject to the terms of the Mozilla Public ++# License, v. 2.0. If a copy of the MPL was not distributed with this ++# file, You can obtain one at http://mozilla.org/MPL/2.0/. + # +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 3 of the License, or +-# (at your option) any later version. ++# Alternatively, the contents of this file may be used under the terms ++# of the GNU Lesser General Public License Version 2.1 or later ++# (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are ++# applicable instead of those above. + # +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program. If not, see . + ++# Printer interface adaptor. + + from collections import Mapping + import gdb +diff --git a/data/gdb/librevenge/v0_0/streams.py b/data/gdb/librevenge/v0_0/streams.py +index 7a60a33..7ea3753 100644 +--- a/data/gdb/librevenge/v0_0/streams.py ++++ b/data/gdb/librevenge/v0_0/streams.py +@@ -6,11 +6,6 @@ + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # +-# Major Contributor(s): +-# Copyright (C) 2014 David Tardon (dtardon@redhat.com) +-# +-# For minor contributions see the git repository. +-# + # Alternatively, the contents of this file may be used under the terms + # of the GNU Lesser General Public License Version 2.1 or later + # (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are +diff --git a/data/gdb/librevenge/v0_0/types.py b/data/gdb/librevenge/v0_0/types.py +index 3a49d45..4075aa2 100644 +--- a/data/gdb/librevenge/v0_0/types.py ++++ b/data/gdb/librevenge/v0_0/types.py +@@ -6,11 +6,6 @@ + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # +-# Major Contributor(s): +-# Copyright (C) 2014 David Tardon (dtardon@redhat.com) +-# +-# For minor contributions see the git repository. +-# + # Alternatively, the contents of this file may be used under the terms + # of the GNU Lesser General Public License Version 2.1 or later + # (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are +-- +1.9.0 + diff --git a/0001-fix-type-sizes-for-CPPUNIT_ASSERT_EQUAL.patch b/0001-fix-type-sizes-for-CPPUNIT_ASSERT_EQUAL.patch new file mode 100644 index 0000000..1638db0 --- /dev/null +++ b/0001-fix-type-sizes-for-CPPUNIT_ASSERT_EQUAL.patch @@ -0,0 +1,103 @@ +From 0952de614e7cdb101478bbdbfa48fee5f1f70a5b Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Fri, 23 May 2014 22:36:59 +0200 +Subject: [PATCH] fix type sizes for CPPUNIT_ASSERT_EQUAL + +--- + src/test/RVNGBinaryDataTest.cpp | 10 +++++----- + src/test/RVNGStringTest.cpp | 10 +++++----- + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/src/test/RVNGBinaryDataTest.cpp b/src/test/RVNGBinaryDataTest.cpp +index 13b5e9c..7b10a92 100644 +--- a/src/test/RVNGBinaryDataTest.cpp ++++ b/src/test/RVNGBinaryDataTest.cpp +@@ -101,19 +101,19 @@ void RVNGBinaryDataTest::testConstruction() + const unsigned char input[] = "hello world"; + const size_t len = RVNG_NUM_ELEMENTS(input); + RVNGBinaryData data(input, len); +- CPPUNIT_ASSERT_EQUAL(len, data.size()); ++ CPPUNIT_ASSERT_EQUAL(static_cast(len), data.size()); + CPPUNIT_ASSERT(!data.empty()); + CPPUNIT_ASSERT(equal(input, input + len, data.getDataBuffer())); + + { + // copy construction + RVNGBinaryData copy(data); +- CPPUNIT_ASSERT_EQUAL(len, copy.size()); ++ CPPUNIT_ASSERT_EQUAL(static_cast(len), copy.size()); + CPPUNIT_ASSERT(equal(input, input + len, copy.getDataBuffer())); + } + // COW: destruction of a copy does not touch the original + // this should be tested under valgrind +- CPPUNIT_ASSERT_EQUAL(len, data.size()); ++ CPPUNIT_ASSERT_EQUAL(static_cast(len), data.size()); + CPPUNIT_ASSERT(equal(input, input + len, data.getDataBuffer())); + + // assignment +@@ -121,7 +121,7 @@ void RVNGBinaryDataTest::testConstruction() + CPPUNIT_ASSERT_EQUAL(0ul, assign.size()); + CPPUNIT_ASSERT(assign.empty()); + assign = data; +- CPPUNIT_ASSERT_EQUAL(len, assign.size()); ++ CPPUNIT_ASSERT_EQUAL(static_cast(len), assign.size()); + CPPUNIT_ASSERT(!assign.empty()); + CPPUNIT_ASSERT(equal(input, input + len, assign.getDataBuffer())); + +@@ -148,7 +148,7 @@ void RVNGBinaryDataTest::testAppend() + CPPUNIT_ASSERT_EQUAL(static_cast('h'), data.getDataBuffer()[0]); + + data2.append(input + 1, len - 1); +- CPPUNIT_ASSERT_EQUAL(len, data2.size()); ++ CPPUNIT_ASSERT_EQUAL(static_cast(len), data2.size()); + CPPUNIT_ASSERT(equal(input, input + len, data2.getDataBuffer())); + // again, the original is unchanged + CPPUNIT_ASSERT_EQUAL(1ul, data.size()); +diff --git a/src/test/RVNGStringTest.cpp b/src/test/RVNGStringTest.cpp +index abaa8a5..5f99027 100644 +--- a/src/test/RVNGStringTest.cpp ++++ b/src/test/RVNGStringTest.cpp +@@ -118,27 +118,27 @@ void RVNGStringTest::testConstruction() + const char input[] = "hello world"; + const size_t len = RVNG_NUM_ELEMENTS(input) - 1; + RVNGString str(input); +- CPPUNIT_ASSERT_EQUAL(len, str.size()); ++ CPPUNIT_ASSERT_EQUAL(static_cast(len), str.size()); + CPPUNIT_ASSERT_EQUAL(int(len), str.len()); + CPPUNIT_ASSERT(equal(input, input + len, str.cstr())); + + // copy construction + RVNGString copy(str); +- CPPUNIT_ASSERT_EQUAL(len, copy.size()); ++ CPPUNIT_ASSERT_EQUAL(static_cast(len), copy.size()); + CPPUNIT_ASSERT_EQUAL(int(len), copy.len()); + CPPUNIT_ASSERT(equal(input, input + len, copy.cstr())); + + // assignment + RVNGString assign; + assign = str; +- CPPUNIT_ASSERT_EQUAL(len, assign.size()); ++ CPPUNIT_ASSERT_EQUAL(static_cast(len), assign.size()); + CPPUNIT_ASSERT_EQUAL(int(len), assign.len()); + CPPUNIT_ASSERT(equal(input, input + len, assign.cstr())); + + // assignment from C string + RVNGString assign2; + assign2 = input; +- CPPUNIT_ASSERT_EQUAL(len, assign.size()); ++ CPPUNIT_ASSERT_EQUAL(static_cast(len), assign.size()); + CPPUNIT_ASSERT_EQUAL(int(len), assign.len()); + CPPUNIT_ASSERT(equal(input, input + len, assign.cstr())); + } +@@ -164,7 +164,7 @@ void RVNGStringTest::testAppend() + + // appending a C string + str2.append(input + 1); +- CPPUNIT_ASSERT_EQUAL(len, str2.size()); ++ CPPUNIT_ASSERT_EQUAL(static_cast(len), str2.size()); + CPPUNIT_ASSERT_EQUAL(int(len), str2.len()); + CPPUNIT_ASSERT(equal(input, input + len, str2.cstr())); + } +-- +1.9.0 + diff --git a/librevenge.spec b/librevenge.spec new file mode 100644 index 0000000..18b6690 --- /dev/null +++ b/librevenge.spec @@ -0,0 +1,94 @@ +%global apiversion 0.0 + +Name: librevenge +Version: 0.0.0 +Release: 2%{?dist} +Summary: A base library for writing document import filters + +# src/lib/RVNGOLEStream.{h,cpp} are BSD +License: (LGPLv2+ or MPLv2.0) and BSD +URL: http://sourceforge.net/p/libwpd/wiki/librevenge/ +Source: http://downloads.sourceforge.net/libwpd/%{name}-%{version}.tar.xz + +BuildRequires: boost-devel +BuildRequires: doxygen +BuildRequires: pkgconfig(cppunit) +BuildRequires: pkgconfig(zlib) + +Patch0: 0001-fix-type-sizes-for-CPPUNIT_ASSERT_EQUAL.patch +Patch1: 0001-fix-license-headers-for-gdb-printers.patch + +%description +%{name} is a base library for writing document import filters. It has +interfaces for text documents, vector graphics, spreadsheets and +presentations. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%package doc +Summary: Documentation of %{name} API +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + +%prep +%autosetup -p1 + +%build +%configure --disable-silent-rules --disable-static --disable-werror --enable-pretty-printers +sed -i \ + -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ + -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \ + libtool +make %{?_smp_mflags} + +%install +make install DESTDIR=%{buildroot} +rm -f %{buildroot}/%{_libdir}/*.la +# we install API docs directly from build +rm -rf %{buildroot}/%{_docdir}/%{name} + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%check +export LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} +make %{?_smp_mflags} check + +%files +%doc COPYING.* README NEWS +%{_libdir}/%{name}-%{apiversion}.so.* +%{_libdir}/%{name}-generators-%{apiversion}.so.* +%{_libdir}/%{name}-stream-%{apiversion}.so.* + +%files devel +%doc ChangeLog +%{_includedir}/%{name}-%{apiversion} +%{_libdir}/%{name}-%{apiversion}.so +%{_libdir}/%{name}-generators-%{apiversion}.so +%{_libdir}/%{name}-stream-%{apiversion}.so +%{_libdir}/pkgconfig/%{name}-%{apiversion}.pc +%{_libdir}/pkgconfig/%{name}-generators-%{apiversion}.pc +%{_libdir}/pkgconfig/%{name}-stream-%{apiversion}.pc +%{_datadir}/gdb/auto-load%{_libdir}/%{name}-%{apiversion}.py* +%{_datadir}/gdb/auto-load%{_libdir}/%{name}-stream-%{apiversion}.py* +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/python + +%files doc +%doc COPYING.* +%doc docs/doxygen/html + +%changelog +* Tue May 27 2014 David Tardon - 0.0.0-2 +- remove extra dirs from filelist + +* Fri May 23 2014 David Tardon - 0.0.0-1 +- initial import diff --git a/sources b/sources index e69de29..851f39e 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +a3b3228f347646208813b664cbe332d0 librevenge-0.0.0.tar.xz