diff --git a/chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch b/chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch index 6efc554..2de748b 100644 --- a/chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch +++ b/chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch @@ -1,13 +1,14 @@ -From 11f50f16714a584c482b6f7b469fb7edd611f869 Mon Sep 17 00:00:00 2001 +From be20aa9e5992f371fa0f73be16bb1b145192a428 Mon Sep 17 00:00:00 2001 From: Jed Wing Date: Wed, 27 May 2009 18:25:42 -0700 -Subject: [PATCH 1/4] Patch to fix integer types problem by Goswin von Brederlow. +Subject: [PATCH 1/2] Patch to fix integer types problem by Goswin von + Brederlow. This came from Goswin von Brederlow via Kartik Mistry, the maintainer of the Debian package of chmlib. --- - src/chm_lib.c | 30 +++++++++++++----------------- - 1 files changed, 13 insertions(+), 17 deletions(-) + src/chm_lib.c | 30 +++++++++++++----------------- + 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/chm_lib.c b/src/chm_lib.c index 6c6736c..ffd213c 100644 @@ -68,5 +69,5 @@ index 6c6736c..ffd213c 100644 /* GCC */ -- -1.7.2.1 +1.8.3.1 diff --git a/chmlib-0002-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch b/chmlib-0002-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch new file mode 100644 index 0000000..bcd4a0f --- /dev/null +++ b/chmlib-0002-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch @@ -0,0 +1,40 @@ +From 5998ff5105a9cd3f684519927e2ac78d3b6a3c30 Mon Sep 17 00:00:00 2001 +From: Jed Wing +Date: Wed, 27 May 2009 18:41:10 -0700 +Subject: [PATCH 2/2] Fix for extract_chmLib confusing empty files with + directories. + +Patch from Paul Wise via Kartik Mistry, the maintainer of the +Debian chmlib package. +--- + src/extract_chmLib.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/extract_chmLib.c b/src/extract_chmLib.c +index 078cc35..478c892 100644 +--- a/src/extract_chmLib.c ++++ b/src/extract_chmLib.c +@@ -102,6 +102,7 @@ int _extract_callback(struct chmFile *h, + struct chmUnitInfo *ui, + void *context) + { ++ LONGUINT64 ui_path_len; + char buffer[32768]; + struct extract_context *ctx = (struct extract_context *)context; + char *i; +@@ -119,7 +120,11 @@ int _extract_callback(struct chmFile *h, + if (snprintf(buffer, sizeof(buffer), "%s%s", ctx->base_path, ui->path) > 1024) + return CHM_ENUMERATOR_FAILURE; + +- if (ui->length != 0) ++ /* Get the length of the path */ ++ ui_path_len = strlen(ui->path)-1; ++ ++ /* Distinguish between files and dirs */ ++ if (ui->path[ui_path_len] != '/' ) + { + FILE *fout; + LONGINT64 len, remain=ui->length; +-- +1.8.3.1 + diff --git a/chmlib-0003-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch b/chmlib-0003-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch deleted file mode 100644 index 3bc4466..0000000 --- a/chmlib-0003-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 9b479b4f3bbb08e8ab340d6ad626f3549b51d929 Mon Sep 17 00:00:00 2001 -From: Jed Wing -Date: Wed, 27 May 2009 18:41:10 -0700 -Subject: [PATCH 3/4] Fix for extract_chmLib confusing empty files with directories. - -Patch from Paul Wise via Kartik Mistry, the maintainer of the -Debian chmlib package. ---- - src/extract_chmLib.c | 7 ++++++- - 1 files changed, 6 insertions(+), 1 deletions(-) - -diff --git a/src/extract_chmLib.c b/src/extract_chmLib.c -index 078cc35..478c892 100644 ---- a/src/extract_chmLib.c -+++ b/src/extract_chmLib.c -@@ -102,6 +102,7 @@ int _extract_callback(struct chmFile *h, - struct chmUnitInfo *ui, - void *context) - { -+ LONGUINT64 ui_path_len; - char buffer[32768]; - struct extract_context *ctx = (struct extract_context *)context; - char *i; -@@ -119,7 +120,11 @@ int _extract_callback(struct chmFile *h, - if (snprintf(buffer, sizeof(buffer), "%s%s", ctx->base_path, ui->path) > 1024) - return CHM_ENUMERATOR_FAILURE; - -- if (ui->length != 0) -+ /* Get the length of the path */ -+ ui_path_len = strlen(ui->path)-1; -+ -+ /* Distinguish between files and dirs */ -+ if (ui->path[ui_path_len] != '/' ) - { - FILE *fout; - LONGINT64 len, remain=ui->length; --- -1.7.2.1 - diff --git a/chmlib.spec b/chmlib.spec index 84b3f7d..4c9d29c 100644 --- a/chmlib.spec +++ b/chmlib.spec @@ -5,10 +5,18 @@ Release: 8%{?dist} License: LGPLv2+ Group: Development/Libraries Url: http://www.jedrea.com/chmlib/ +%if 0%{?el7}%{?fedora} +VCS: https://github.com/jedwing/CHMLib.git +%endif Source0: http://www.jedrea.com/chmlib/%{name}-%{version}.tar.bz2 +# backported from upstream Patch1: chmlib-0001-Patch-to-fix-integer-types-problem-by-Goswin-von-Bre.patch -Patch3: chmlib-0003-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch -Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +# backported from upstream +Patch2: chmlib-0002-Fix-for-extract_chmLib-confusing-empty-files-with-di.patch +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool + %description CHMLIB is a library for dealing with ITSS/CHM format files. Right now, it is @@ -17,39 +25,43 @@ I've come across. Due to the fairly well-designed indexing built into this particular file format, even a small library is able to gain reasonably good performance indexing into ITSS archives. + %package devel Summary: Library for dealing with ITSS/CHM format files - development files Group: Development/Libraries -Requires: %{name} = %{version}-%{release} +Requires: %{name}%{?_isa} = %{version}-%{release} + %description devel Files needed for developing apps using chmlib. + %prep %setup -q %patch1 -p1 -b .types -%patch3 -p1 -b .files_dirs +%patch2 -p1 -b .files_dirs +rm -f libtool +mv configure.in configure.ac +autoreconf -ivf + %build %configure --enable-examples --disable-static -sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool -sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} + %install -rm -rf %{buildroot} make DESTDIR=%{buildroot} install rm -f %{buildroot}/%{_libdir}/*.la + %post -p /sbin/ldconfig + %postun -p /sbin/ldconfig -%clean -rm -rf %{buildroot} %files -%defattr(-,root,root,-) %{_bindir}/chm_http %{_bindir}/enum_chmLib %{_bindir}/enumdir_chmLib @@ -58,12 +70,17 @@ rm -rf %{buildroot} %{_libdir}/libchm.so.* %doc README AUTHORS COPYING NEWS + %files devel -%defattr(-,root,root,-) %{_includedir}/* %{_libdir}/libchm.so + %changelog +* Sat Aug 31 2013 Peter Lemenkov - 0.40-9 +- Spec-file cleanup +- Remove pre-EL6/FC6 stuff (no longer builds on EL5) + * Sat Aug 03 2013 Fedora Release Engineering - 0.40-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild