Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ad2bbf92e | ||
|
|
15c0d85eff | ||
|
|
c97ea7633e | ||
|
|
38a63f6961 |
6 changed files with 191 additions and 21 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
libs11n_zfstream-2004.12.02.tar.gz
|
||||
zfstream-autotools.tar.gz
|
||||
21
Makefile
21
Makefile
|
|
@ -1,21 +0,0 @@
|
|||
# Makefile for source rpm: zfstream
|
||||
# $Id$
|
||||
NAME := zfstream
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
ifeq ($(MAKEFILE_COMMON),)
|
||||
# attept a checkout
|
||||
define checkout-makefile-common
|
||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||
endif
|
||||
|
||||
include $(MAKEFILE_COMMON)
|
||||
2
sources
2
sources
|
|
@ -0,0 +1,2 @@
|
|||
906e46120012978a6715b425dd6db0a7 libs11n_zfstream-2004.12.02.tar.gz
|
||||
fb26ab3f2a3e0c3f41adf3d0068fa589 zfstream-autotools.tar.gz
|
||||
76
zfstream-zip.patch
Normal file
76
zfstream-zip.patch
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
--- src/zfstream.hpp.orig 2007-12-28 17:04:40.000000000 +0100
|
||||
+++ src/zfstream.hpp 2007-12-28 17:06:16.000000000 +0100
|
||||
@@ -45,7 +45,9 @@
|
||||
*/
|
||||
GZipCompression = ZLibCompression,
|
||||
/** BZipCompression means to use the zfstream::obzstream class for output streams. */
|
||||
- BZipCompression = 2
|
||||
+ BZipCompression = 2,
|
||||
+ /** ZipCompression means to use the zfstream::ozipstream class for output streams. */
|
||||
+ ZipCompression = 3
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -81,6 +83,7 @@
|
||||
- std::ifstream
|
||||
- zfstream::gzstream
|
||||
- zfstream::bzstream
|
||||
+ - zfstream::zipstream
|
||||
|
||||
It will return NULL if it cannot open filename, or a
|
||||
std::ifstream if it cannot figure out a decompression
|
||||
@@ -110,6 +113,7 @@
|
||||
|
||||
- zfstream::ogzstream
|
||||
- zfstream::obzstream
|
||||
+ - zfstream::ozipstream
|
||||
- std::ofstream
|
||||
|
||||
Note that this function only uses filename to pass to the
|
||||
--- src/zfstream.cpp.orig 2007-12-28 17:04:49.000000000 +0100
|
||||
+++ src/zfstream.cpp 2007-12-28 17:11:39.000000000 +0100
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#if HAVE_ZLIB
|
||||
# include "gzstream.hpp"
|
||||
+# include "zipstream.hpp"
|
||||
#endif
|
||||
#if HAVE_BZLIB
|
||||
# include "bzstream.hpp"
|
||||
@@ -33,6 +34,7 @@
|
||||
case( NoCompression ): return "NoCompression"; break;
|
||||
case( ZLibCompression ): return "ZLibCompression"; break;
|
||||
case( BZipCompression ): return "BZipCompression"; break;
|
||||
+ case( ZipCompression ): return "ZipCompression"; break;
|
||||
default: return ""; break;
|
||||
}
|
||||
}
|
||||
@@ -46,6 +48,7 @@
|
||||
#endif
|
||||
#if HAVE_ZLIB
|
||||
if( ZLibCompression == p ) return true;
|
||||
+ if( ZipCompression == p ) return true;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -107,6 +110,12 @@
|
||||
//COUT << "gzip!"<<std::endl;
|
||||
return new zfstream::igzstream( src.c_str() );
|
||||
}
|
||||
+ // zip=504b 0304 (dec: 80 75 3 4) ascii: PK\003\004
|
||||
+ if( 0x50 == buff[0] && 0x4b == buff[1] )
|
||||
+ {
|
||||
+ //COUT << "zip!"<<std::endl;
|
||||
+ return new zfstream::izipstream( src.c_str() );
|
||||
+ }
|
||||
#endif
|
||||
return new std::ifstream( src.c_str() );
|
||||
}
|
||||
@@ -121,6 +130,7 @@
|
||||
// REMINDER: when/if GZip/ZLib mean different things, this will break!
|
||||
// C++ won't let me put both in here when they have the same value.
|
||||
case ZLibCompression: return new zfstream::ogzstream( fname.c_str() );
|
||||
+ case ZipCompression: return new zfstream::ozipstream( fname.c_str() );
|
||||
#endif
|
||||
#if HAVE_BZLIB
|
||||
case BZipCompression: return new zfstream::obzstream( fname.c_str() );
|
||||
111
zfstream.spec
Normal file
111
zfstream.spec
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
%global vday 02
|
||||
%global vmonth 12
|
||||
%global vyear 2004
|
||||
|
||||
Name: zfstream
|
||||
Version: %{vyear}%{vmonth}%{vday}
|
||||
Release: 5%{?dist}
|
||||
Summary: Library for reading and writing compressed and non-compressed files
|
||||
|
||||
Group: System Environment/Libraries
|
||||
License: LGPLv2+
|
||||
URL: http://www.wanderinghorse.net/computing/%{name}/
|
||||
Source0: http://www.wanderinghorse.net/computing/%{name}/libs11n_%{name}-%{vyear}.%{vmonth}.%{vday}.tar.gz
|
||||
# I tried half a day to get the rather peculiar original build system working,
|
||||
# but I failed, so I decided to simply replace it by autotools.
|
||||
# This has the further advantage that it knows how to cross-compile,
|
||||
# as evidenced by the mingw32-zfstream package also under review.
|
||||
Source1: %{name}-autotools.tar.gz
|
||||
# The patch has been sent via private mail to the author. The author responded
|
||||
# that the patch had been integrated into his personal tree, but apparently
|
||||
# he has not gotten around to release a new version.
|
||||
Patch1: %{name}-zip.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildRequires: bzip2-devel
|
||||
BuildRequires: libtool
|
||||
BuildRequires: minizip-devel
|
||||
|
||||
%description
|
||||
zfstream is a small C++ library which provides an abstraction API for reading
|
||||
and writing compressed and non-compressed files using the same API. It supports
|
||||
libz and libbz2 compression schemes. The library is trivial to use and provides
|
||||
client applications with a unified interface for reading and writing files
|
||||
without having to know whether they are compressed or not.
|
||||
|
||||
%package devel
|
||||
Summary: Development files for %{name}
|
||||
Group: Development/Libraries
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: pkgconfig
|
||||
Requires: bzip2-devel
|
||||
Requires: zlib-devel
|
||||
|
||||
%description devel
|
||||
The %{name}-devel package contains libraries and header files for
|
||||
developing applications that use %{name}.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n libs11n_%{name}-%{vyear}.%{vmonth}.%{vday} -a 1
|
||||
%patch1 -p0 -b .zip
|
||||
aclocal
|
||||
autoconf
|
||||
autoheader
|
||||
libtoolize -f
|
||||
touch NEWS README AUTHORS
|
||||
automake -a -c
|
||||
|
||||
%build
|
||||
%configure --disable-static
|
||||
sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool
|
||||
make %{?_smp_mflags}
|
||||
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/*.so.*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%doc ChangeLog
|
||||
%{_includedir}/*
|
||||
%{_libdir}/*.so
|
||||
%{_libdir}/pkgconfig/%{name}.pc
|
||||
|
||||
%changelog
|
||||
* Fri May 1 2009 Thomas Sailer <t.sailer@alumni.ethz.ch> - 20041202-5
|
||||
- rebuild
|
||||
|
||||
* Fri May 1 2009 Thomas Sailer <t.sailer@alumni.ethz.ch> - 20041202-4
|
||||
- reformat description
|
||||
|
||||
* Thu Apr 30 2009 Thomas Sailer <t.sailer@alumni.ethz.ch> - 20041202-3
|
||||
- use %%{name} macro (more)
|
||||
- remove minizip from Source1
|
||||
- shortened summary
|
||||
- fix BR/R
|
||||
|
||||
* Tue Nov 4 2008 Thomas Sailer <t.sailer@alumni.ethz.ch> - 20041202-2
|
||||
- changed description
|
||||
- added unused-direct-shlib-dependency trick
|
||||
- add library dependences
|
||||
|
||||
* Thu Dec 27 2007 Thomas Sailer <t.sailer@alumni.ethz.ch> - 20041202-1
|
||||
- initial packaging
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue