diff --git a/.gitignore b/.gitignore index e69de29..b11df10 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +zlib-1.2.3.tar.gz +/zlib-1.2.5.tar.gz diff --git a/mingw32-zlib-1.2.5-autotools.patch b/mingw32-zlib-1.2.5-autotools.patch new file mode 100644 index 0000000..9a3b9f4 --- /dev/null +++ b/mingw32-zlib-1.2.5-autotools.patch @@ -0,0 +1,106 @@ +diff -urN zlib-1.2.3.orig/Makefile.am zlib-1.2.3.kasal/Makefile.am +--- zlib-1.2.3.orig/Makefile.am 1970-01-01 01:00:00.000000000 +0100 ++++ zlib-1.2.3.kasal/Makefile.am 2009-03-17 17:58:36.000000000 +0100 +@@ -0,0 +1,70 @@ ++ACLOCAL_AMFLAGS = -I m4 --install ++ ++lib_LTLIBRARIES = libz.la ++ ++libz_la_SOURCES = \ ++ adler32.c \ ++ compress.c \ ++ crc32.c \ ++ crc32.h \ ++ gzclose.c \ ++ gzlib.c \ ++ gzread.c \ ++ gzwrite.c \ ++ uncompr.c \ ++ deflate.c \ ++ deflate.h \ ++ trees.c \ ++ trees.h \ ++ zutil.c \ ++ zutil.h \ ++ inflate.c \ ++ inflate.h \ ++ infback.c \ ++ inftrees.c \ ++ inftrees.h \ ++ inffast.c \ ++ inffast.h \ ++ infflate.h ++ ++# Use -version-number to match the file name used before autoconfiscation. ++libz_la_LDFLAGS = -version-number 1:2:5 -no-undefined ++ ++include_HEADERS = zlib.h ++nodist_include_HEADERS = zconf.h ++ ++dist_man_MANS = zlib.3 ++ ++## libminizip: ++ ++lib_LTLIBRARIES += libminizip.la ++ ++libminizip_la_SOURCES = \ ++ contrib/minizip/ioapi.c \ ++ contrib/minizip/mztools.c \ ++ contrib/minizip/unzip.c \ ++ contrib/minizip/zip.c ++ ++# do not build the static version of libminizip ++libminizip_la_CFLAGS = -shared ++libminizip_la_LDFLAGS = -version-info 1:0:0 -no-undefined ++libminizip_la_LIBADD = libz.la ++ ++minizip_includedir = $(includedir)/minizip ++minizip_include_HEADERS = \ ++ contrib/minizip/crypt.h \ ++ contrib/minizip/ioapi.h \ ++ contrib/minizip/mztools.h \ ++ contrib/minizip/unzip.h \ ++ contrib/minizip/zip.h ++ ++pkgconfigdir = $(libdir)/pkgconfig ++pkgconfig_DATA = minizip.pc ++ ++EXTRA_PROGRAMS = miniunzip minizip ++ ++miniunzip_SOURCES = contrib/minizip/miniunz.c ++miniunzip_LDADD = libminizip.la ++ ++minizip_SOURCES = contrib/minizip/minizip.c ++minizip_LDADD = libminizip.la +diff -urN zlib-1.2.3.orig/configure.ac zlib-1.2.3.kasal/configure.ac +--- zlib-1.2.3.orig/configure.ac 1970-01-01 01:00:00.000000000 +0100 ++++ zlib-1.2.3.kasal/configure.ac 2009-03-17 17:28:41.000000000 +0100 +@@ -0,0 +1,13 @@ ++# -*- Autoconf -*- ++# Process this file with autoconf to produce a configure script. ++ ++AC_INIT([zlib], [1.2.5], [bugzilla.redhat.com]) ++AC_CONFIG_SRCDIR([minigzip.c]) ++AC_CONFIG_MACRO_DIR([m4]) ++AM_INIT_AUTOMAKE([foreign]) ++LT_INIT ++ ++AC_SUBST([HAVE_UNISTD_H], [0]) ++AC_CHECK_HEADER([unistd.h], [HAVE_UNISTD_H=1], []) ++AC_CONFIG_FILES([Makefile minizip.pc zconf.h:zconf.h.in]) ++AC_OUTPUT +diff -urN zlib-1.2.3.orig/minizip.pc.in zlib-1.2.3.kasal/minizip.pc.in +--- zlib-1.2.3.orig/minizip.pc.in 1970-01-01 01:00:00.000000000 +0100 ++++ zlib-1.2.3.kasal/minizip.pc.in 2009-01-07 15:49:34.000000000 +0100 +@@ -0,0 +1,11 @@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@/minizip ++ ++Name: minizip ++Description: Minizip zip file manipulation library ++Requires: ++Version: @PACKAGE_VERSION@ ++Libs: -L${libdir} -lminizip -lz ++Cflags: -I${includedir} diff --git a/mingw32-zlib.spec b/mingw32-zlib.spec new file mode 100644 index 0000000..771caa4 --- /dev/null +++ b/mingw32-zlib.spec @@ -0,0 +1,206 @@ +%global __strip %{_mingw32_strip} +%global __objdump %{_mingw32_objdump} +%define __debug_install_post %{_mingw32_debug_install_post} + +Name: mingw32-zlib +Version: 1.2.5 +Release: 8%{?dist} +Summary: MinGW Windows zlib compression library + +License: zlib +Group: Development/Libraries +URL: http://www.zlib.net/ +Source0: http://www.zlib.net/zlib-%{version}.tar.gz +# Replace the zlib build system with an autotools based one +Patch3: mingw32-zlib-1.2.5-autotools.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=591317 +Patch4: zlib-1.2.5-gentoo.patch +# The .def file contains an empty LIBRARY line which isn't valid +Patch5: zlib-1.2.5-use-correct-def-file.patch + +BuildArch: noarch + +BuildRequires: mingw32-filesystem +BuildRequires: mingw32-gcc +BuildRequires: mingw32-binutils +BuildRequires: perl +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool + + +%description +MinGW Windows zlib compression library. + +%package static +Summary: Static libraries for mingw32-zlib development. +Group: Development/Libraries +Requires: mingw32-zlib = %{version}-%{release} + +%description static +The mingw32-zlib-static package contains static library for mingw32-zlib development. + +%package -n mingw32-minizip +Summary: Minizip manipulates files from a .zip archive +Group: Development/Libraries +Requires: mingw32-zlib = %{version}-%{release} + +%description -n mingw32-minizip +MinGW Minizip manipulates files from a .zip archive. + + +%{?_mingw32_debug_package} + + +%prep +%setup -q -n zlib-%{version} +%patch5 -p1 -b .def +cd .. +cp -a zlib-%{version} x +mv x zlib-%{version} +cd zlib-%{version} +%patch3 -p1 -b .atools +%patch4 -p1 -b .g +# patch cannot create an empty dir +mkdir m4 +iconv -f windows-1252 -t utf-8 ChangeLog.tmp + +%build +pushd x +CC=%{_mingw32_cc} \ +CFLAGS="%{_mingw32_cflags}" \ +RANLIB=%{_mingw32_ranlib} \ +./configure --prefix=%{_mingw32_prefix} + +make -f win32/Makefile.gcc \ + CFLAGS="%{_mingw32_cflags}" \ + CC=%{_mingw32_cc} \ + AR=%{_mingw32_ar} \ + RC=%{_mingw32_windres} \ + DLLWRAP=%{_mingw32_dllwrap} \ + STRIP=%{_mingw32_strip} \ + all +popd + +autoreconf --install; +%{_mingw32_configure} +make %{?_smp_mflags} libz.la +perl -i -pe 's,libz-1.dll,zlib1.dll,' .libs/libz.lai +rm -f libz.dll.a +cp x/libzdll.a libz.dll.a +cp x/zlib1.dll . +rm -f .libs/libz.dll.a +cp x/libzdll.a .libs/libz.dll.a +cp x/zlib1.dll .libs/ +make %{?_smp_mflags} + + +%install +make install DESTDIR=$RPM_BUILD_ROOT + +rm -rf $RPM_BUILD_ROOT/%{_mingw32_mandir} + +rm -f $RPM_BUILD_ROOT/%{_mingw32_bindir}/libz-1.dll +rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/*.la +install x/zlib1.dll $RPM_BUILD_ROOT/%{_mingw32_bindir}/ +install -m 644 x/zlib.pc $RPM_BUILD_ROOT%{_mingw32_libdir}/pkgconfig/ + + +%files +%{_mingw32_includedir}/zconf.h +%{_mingw32_includedir}/zlib.h +%{_mingw32_libdir}/libz.dll.a +%{_mingw32_bindir}/zlib1.dll +%{_mingw32_libdir}/pkgconfig/zlib.pc + + +%files static +%{_mingw32_libdir}/libz.a + + +%files -n mingw32-minizip +%{_mingw32_libdir}/libminizip.dll.a +%{_mingw32_bindir}/libminizip-1.dll +%dir %{_mingw32_includedir}/minizip +%{_mingw32_includedir}/minizip/*.h +%{_mingw32_libdir}/pkgconfig/minizip.pc + + +%changelog +* Mon Feb 27 2012 Kalev Lember - 1.2.5-8 +- Remove the .la files +- Spec clean up + +* Mon Feb 27 2012 Erik van Pienbroek - 1.2.5-7 +- Rebuild against the mingw-w64 toolchain +- Use the correct RPM macros +- Fix FTBFS against the latest binutils caused by the use of an invalid .def file + +* Fri Feb 17 2012 David Tardon - 1.2.5-6 +- fix dlname in libz.la + +* Fri Jan 13 2012 Fedora Release Engineering - 1.2.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue May 10 2011 Kalev Lember - 1.2.5-4 +- Use the built .pc file instead of manually generating it + +* Tue Apr 26 2011 Kalev Lember - 1.2.5-3 +- Install zlib pkgconfig file + +* Tue Feb 08 2011 Fedora Release Engineering - 1.2.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sun Sep 12 2010 Erik van Pienbroek - 1.2.5-1 +- Update to 1.2.5 +- Use %%global instead of %%define +- Automatically generate debuginfo subpackage +- Use correct %%defattr tag +- Merged the changes from the native Fedora package + +* Sat Jul 25 2009 Fedora Release Engineering - 1.2.3-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Jun 12 2009 Richard W.M. Jones - 1.2.3-18 +- Cannot copy current directory into itself, so fix the copy command + which creates 'x' subdirectory. + +* Thu May 1 2009 Thomas Sailer - 1.2.3-17 +- BR autoconf, automake, libtool + +* Thu Apr 30 2009 Thomas Sailer - 1.2.3-16 +- use autotools build system from native package + +* Mon Mar 3 2009 W. Pilorz - 1.2.3-15 +- Add static subpackage. + +* Wed Feb 25 2009 Fedora Release Engineering - 1.2.3-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Fri Feb 20 2009 Richard W.M. Jones - 1.2.3-13 +- Rebuild for mingw32-gcc 4.4 + +* Mon Jan 19 2009 Richard W.M. Jones - 1.2.3-12 +- Force rebuild to test maintenance account. + +* Thu Dec 18 2008 Richard W.M. Jones - 1.2.3-11 +- Pass correct CFLAGS to build. + +* Thu Oct 16 2008 Richard W.M. Jones - 1.2.3-10 +- Consider native patches. + +* Wed Sep 24 2008 Richard W.M. Jones - 1.2.3-9 +- Rename mingw -> mingw32. + +* Sun Sep 21 2008 Richard W.M. Jones - 1.2.3-8 +- Remove manpage. + +* Wed Sep 10 2008 Richard W.M. Jones - 1.2.3-7 +- Remove static library. + +* Fri Sep 5 2008 Richard W.M. Jones - 1.2.3-5 +- Fix misnamed file: zlibdll.a -> zlib.dll.a +- Explicitly provide mingw(zlib1.dll). + +* Thu Sep 4 2008 Richard W.M. Jones - 1.2.3-3 +- Initial RPM release, largely based on earlier work from several sources. diff --git a/sources b/sources index e69de29..c00fef0 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +c735eab2d659a96e5a594c9e8541ad63 zlib-1.2.5.tar.gz diff --git a/zlib-1.2.5-gentoo.patch b/zlib-1.2.5-gentoo.patch new file mode 100644 index 0000000..82c7f39 --- /dev/null +++ b/zlib-1.2.5-gentoo.patch @@ -0,0 +1,12 @@ +diff -up zlib-1.2.5/zlib.h.pom zlib-1.2.5/zlib.h +--- zlib-1.2.5/zlib.h.pom 2010-04-20 06:12:48.000000000 +0200 ++++ zlib-1.2.5/zlib.h 2010-06-16 13:08:59.000000000 +0200 +@@ -1578,7 +1578,7 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF( + # define gzoffset gzoffset64 + # define adler32_combine adler32_combine64 + # define crc32_combine crc32_combine64 +-# ifdef _LARGEFILE64_SOURCE ++# ifndef _LARGEFILE64_SOURCE + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); + ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); diff --git a/zlib-1.2.5-use-correct-def-file.patch b/zlib-1.2.5-use-correct-def-file.patch new file mode 100644 index 0000000..42cb76e --- /dev/null +++ b/zlib-1.2.5-use-correct-def-file.patch @@ -0,0 +1,8 @@ +--- zlib-1.2.5/win32/zlib.def.orig 2012-02-26 16:19:28.608868501 +0100 ++++ zlib-1.2.5/win32/zlib.def 2012-02-26 16:19:34.156864592 +0100 +@@ -1,4 +1,4 @@ +-LIBRARY ++LIBRARY zlib1.dll + ; zlib data compression library + + EXPORTS