7036217 move zlib to userland
authorPetr Sumbera <petr.sumbera@oracle.com>
Thu, 14 Apr 2011 12:41:18 -0700
changeset 184 037c654f48d9
parent 183 587c9cdd9ea2
child 185 773dda89f186
7036217 move zlib to userland
components/meta-packages/history/SUNWzlib.p5m
components/zlib/Makefile
components/zlib/llib-lz
components/zlib/mapfile
components/zlib/patches/destdir.patch
components/zlib/patches/manpage.patch
components/zlib/zlib.3.sunman
components/zlib/zlib.license
components/zlib/zlib.p5m
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/meta-packages/history/SUNWzlib.p5m	Thu Apr 14 12:41:18 2011 -0700
@@ -0,0 +1,28 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+set name=pkg.fmri value=pkg:/[email protected],5.11-0.133
+set name=pkg.renamed value=true
+
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+
+depend fmri=library/[email protected] type=require
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/zlib/Makefile	Thu Apr 14 12:41:18 2011 -0700
@@ -0,0 +1,76 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+
+include ../../make-rules/shared-macros.mk
+
+COMPONENT_NAME=		zlib
+COMPONENT_VERSION=	1.2.3
+COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
+COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
+COMPONENT_ARCHIVE_HASH=	sha1:60faeaaf250642db5c0ea36cd6dcc9f99c8f3902
+COMPONENT_ARCHIVE_URL=	http://downloads.sourceforge.net/project/libpng/zlib/$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
+
+include ../../make-rules/prep.mk
+include ../../make-rules/configure.mk
+include ../../make-rules/ips.mk
+include ../../make-rules/lint-libraries.mk
+
+# Zlib won't build without cloning. We need also to get rid of default
+# Makefile and get our own version of zlib.h to avoid interactions
+# between 32 and 64 bit builds.
+COMPONENT_PRE_CONFIGURE_ACTION = ( \
+	$(CLONEY) $(SOURCE_DIR) $(@D); \
+	$(RM) $(@D)/Makefile $(@D)/zconf.h; \
+	$(CP) $(SOURCE_DIR)/zconf.h $(@D) )
+
+CFLAGS += $(CC_PIC) 
+
+# We need to reset configure options here because zlib is confused with
+# CC and CFLAGS definitions as configure parameters.
+CONFIGURE_OPTIONS	=  --shared
+CONFIGURE_OPTIONS	+= --prefix=/usr
+CONFIGURE_OPTIONS	+= $(CONFIGURE_OPTIONS.$(BITS))
+CONFIGURE_OPTIONS.64	+= --libdir=/usr/lib/$(MACH64)
+
+CONFIGURE_ENV += CC="$(CC)"
+CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
+CONFIGURE_ENV += LDSHARED="$(CC) $(CFLAGS) -G"
+
+# This LDSHARED definitions is forced to get all required options plus
+# mapfile for result linking. While the one used with configure is just
+# to allow Zlib detect capability of creating shared libraries.
+COMPONENT_BUILD_ARGS = LDSHARED="$(CC) $(CFLAGS) -G -h libz.so.1 $(LD_OPTIONS_SO) -M ../../mapfile -L."
+
+COMPONENT_TEST_TARGETS = test
+
+build:		$(BUILD_32_and_64)
+
+install:	$(INSTALL_32_and_64)
+
+test:		$(TEST_32_and_64)
+
+BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)
+
+include ../../make-rules/depend.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/zlib/llib-lz	Thu Apr 14 12:41:18 2011 -0700
@@ -0,0 +1,100 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ */
+
+/* LINTLIBRARY */
+/* PROTOLIB1 */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <zlib.h>
+
+const char *zlibVersion(void);
+int deflateInit_(z_streamp strm, int level, const char *version,
+    int stream_size);
+int deflateInit2_(z_streamp strm, int  level, int  method, int windowBits,
+    int memLevel, int strategy, const char *version, int stream_size);
+int deflate(z_streamp strm, int flush);
+int deflateSetDictionary(z_streamp strm, const Bytef *dictionary,
+    uInt dictLength);
+int deflateCopy(z_streamp dest, z_streamp source);
+int deflateReset(z_streamp strm);
+int deflateParams(z_streamp strm, int level, int strategy);
+int deflateEnd(z_streamp strm);
+int deflateTune(z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain);
+uLong deflateBound(z_streamp strm, uLong sourceLen);
+int deflatePrime(z_streamp strm, int bits, int value);
+int deflateSetHeader(z_streamp strm, gz_headerp head);
+int inflateCopy(z_streamp dest, z_streamp source);
+int inflatePrime(z_streamp strm, int bits, int value);
+int inflateGetHeader(z_streamp strm, gz_headerp head);
+int inflateBack(z_streamp strm, in_func in, void FAR *in_desc, out_func out, void FAR *out_desc);
+int inflateBackEnd(z_streamp strm);
+int inflateInit_(z_streamp strm, const char *version, int stream_size);
+int inflateInit2_(z_streamp strm, int  windowBits, const char *version,
+    int stream_size);
+int inflateBackInit_(z_streamp strm, int windowBits, unsigned char FAR *window,
+    const char *version, int stream_size);
+int inflate(z_streamp strm, int flush);
+int inflateSetDictionary(z_streamp strm, const Bytef *dictionary,
+    uInt dictLength);
+int inflateSync(z_streamp strm);
+int inflateReset(z_streamp strm);
+int inflateEnd(z_streamp strm);
+int compress(Bytef *dest, uLongf *destLen, const Bytef *source,
+    uLong sourceLen);
+int compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
+    uLong sourceLen, int level);
+uLong compressBound(uLong sourceLen);
+int uncompress(Bytef *dest, uLongf *destLen, const Bytef *source,
+    uLong sourceLen);
+gzFile gzopen(const char *path, const char *mode);
+gzFile gzdopen(int fd, const char *mode);
+int gzsetparams(gzFile file, int level, int strategy);
+int gzread(gzFile file, voidp buf, unsigned len);
+int gzwrite(gzFile file, voidpc buf, unsigned len);
+int gzprintf(gzFile file, const char *format, ...);
+int gzputs(gzFile file, const char *s);
+char *gzgets(gzFile file, char *buf, int len);
+int gzungetc(int c, gzFile file);
+int gzputc(gzFile file, int c);
+int gzgetc(gzFile file);
+int gzflush(gzFile file, int flush);
+z_off_t gzseek(gzFile file, z_off_t offset, int whence);
+int gzrewind(gzFile file);
+z_off_t gztell(gzFile file);
+int gzeof(gzFile file);
+int gzclose(gzFile file);
+int gzdirect(gzFile file);
+void gzclearerr(gzFile file);
+const char *gzerror(gzFile file, int *errnum);
+uLong adler32(uLong adler, const Bytef *buf, uInt len);
+uLong adler32_combine(uLong adler1, uLong adler2, z_off_t len2);
+uLong crc32(uLong crc, const Bytef *buf, uInt len);
+uLong crc32_combine(uLong crc1, uLong crc2, z_off_t len2);
+const char *zError(int err);
+uLong zlibCompileFlags(void);
+int inflateSyncPoint(z_streamp z);
+const uLongf *get_crc_table(void);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/zlib/mapfile	Thu Apr 14 12:41:18 2011 -0700
@@ -0,0 +1,111 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# MAPFILE HEADER START
+#
+# WARNING:  STOP NOW.  DO NOT MODIFY THIS FILE.
+# Object versioning must comply with the rules detailed in
+#
+#	usr/src/lib/README.mapfiles
+#
+# You should not be making modifications here until you've read the most current
+# copy of that file. If you need help, contact a gatekeeper for guidance.
+#
+# MAPFILE HEADER END
+#
+# Note that the source above actually lives in the ON tree.
+#
+# Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# public interfaces in libz
+#
+$mapfile_version 2
+
+SYMBOL_VERSION SUNW_1.2 {
+    global:
+	deflateTune ;
+	deflateBound ;
+	deflatePrime ;
+	deflateSetHeader ;
+	inflateCopy ;
+	inflatePrime ;
+	inflateGetHeader ;
+	inflateBack ;
+	inflateBackEnd ;
+	zlibCompileFlags ;
+	compressBound ;
+	gzungetc ;
+	gzdirect ;
+	gzclearerr ;
+	adler32_combine ;
+	crc32_combine ;
+} SUNW_1.1;
+
+SYMBOL_VERSION SUNW_1.1 {
+    global:
+	zlibVersion ;
+	deflateInit_ ;
+	deflateInit2_ ;
+	deflate ;
+	deflateSetDictionary ;
+	deflateCopy ;
+	deflateReset ;
+	deflateParams ;
+	deflateEnd ;
+	inflateInit_ ;
+	inflateInit2_ ;
+	inflate ;
+	inflateSetDictionary ;
+	inflateSync ;
+	inflateReset ;
+	inflateEnd ;
+	compress ;
+	compress2 ;
+	uncompress ;
+	gzopen ;
+	gzdopen ;
+	gzsetparams ;
+	gzread ;
+	gzwrite ;
+	gzprintf ;
+	gzputs ;
+	gzgets ;
+	gzputc ;
+	gzgetc ;
+	gzflush ;
+	gzseek ;
+	gzrewind ;
+	gztell ;
+	gzeof ;
+	gzclose ;
+	gzerror ;
+	adler32 ;
+	crc32 ;
+	zError ;
+	inflateSyncPoint ;
+	get_crc_table ;
+};
+
+SYMBOL_VERSION SUNWprivate {
+    global:
+	inflateBackInit_ ;
+    local: *;
+};
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/zlib/patches/destdir.patch	Thu Apr 14 12:41:18 2011 -0700
@@ -0,0 +1,38 @@
+--- zlib-1.2.3/Makefile.in.orig
++++ zlib-1.2.3/Makefile.in
+@@ -90,23 +90,23 @@
+ 	$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
+ 
+ install: $(LIBS)
+-	-@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi
+-	-@if [ ! -d $(includedir)  ]; then mkdir -p $(includedir); fi
+-	-@if [ ! -d $(libdir)      ]; then mkdir -p $(libdir); fi
+-	-@if [ ! -d $(man3dir)     ]; then mkdir -p $(man3dir); fi
+-	cp zlib.h zconf.h $(includedir)
+-	chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
+-	cp $(LIBS) $(libdir)
+-	cd $(libdir); chmod 755 $(LIBS)
+-	-@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
+-	cd $(libdir); if test -f $(SHAREDLIBV); then \
++	-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
++	-@if [ ! -d $(DESTDIR)$(includedir)  ]; then mkdir -p $(DESTDIR)$(includedir); fi
++	-@if [ ! -d $(DESTDIR)$(libdir)      ]; then mkdir -p $(DESTDIR)$(libdir); fi
++	-@if [ ! -d $(DESTDIR)$(man3dir)     ]; then mkdir -p $(DESTDIR)$(man3dir); fi
++	cp zlib.h zconf.h $(DESTDIR)$(includedir)
++	chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
++	cp $(LIBS) $(DESTDIR)$(libdir)
++	cd $(DESTDIR)$(libdir); chmod 755 $(LIBS)
++	-@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
++	cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \
+ 	  rm -f $(SHAREDLIB) $(SHAREDLIBM); \
+ 	  ln -s $(SHAREDLIBV) $(SHAREDLIB); \
+ 	  ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
+ 	  (ldconfig || true)  >/dev/null 2>&1; \
+ 	fi
+-	cp zlib.3 $(man3dir)
+-	chmod 644 $(man3dir)/zlib.3
++	cp zlib.3 $(DESTDIR)$(man3dir)
++	chmod 644 $(DESTDIR)$(man3dir)/zlib.3
+ # The ranlib in install is needed on NeXTSTEP which checks file times
+ # ldconfig is for Linux
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/zlib/patches/manpage.patch	Thu Apr 14 12:41:18 2011 -0700
@@ -0,0 +1,20 @@
+--- zlib-1.2.3/zlib.3.orig
++++ zlib-1.2.3/zlib.3
+@@ -1,6 +1,6 @@
+-.TH ZLIB 3 "18 July 2005"
++.TH LIBZ 3 "18 July 2005"
+ .SH NAME
+-zlib \- compression/decompression library
++libz \- compression/decompression library
+ .SH SYNOPSIS
+ [see
+ .I zlib.h
+@@ -7,7 +7,7 @@
+ for full description]
+ .SH DESCRIPTION
+ The
+-.I zlib
++.I libz (zlib)
+ library is a general purpose data compression library.
+ The code is thread safe.
+ It provides in-memory compression and decompression functions,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/zlib/zlib.3.sunman	Thu Apr 14 12:41:18 2011 -0700
@@ -0,0 +1,1 @@
+.so man3/libz.3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/zlib/zlib.license	Thu Apr 14 12:41:18 2011 -0700
@@ -0,0 +1,22 @@
+
+(C) 1995-2002 Jean-loup Gailly and Mark Adler
+
+This software is provided 'as-is', without any express or implied
+warranty.  In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+   claim that you wrote the original software. If you use this software
+   in a product, an acknowledgment in the product documentation would be
+   appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+   misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+Jean-loup Gailly        Mark Adler
[email protected]          [email protected]
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/zlib/zlib.p5m	Thu Apr 14 12:41:18 2011 -0700
@@ -0,0 +1,72 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+
+<transform file path=usr.*/man/.+ -> default mangler.man.stability committed>
+set name=pkg.fmri \
+    value=pkg:/library/zlib@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
+set name=pkg.summary value="The Zip compression library"
+set name=info.classification \
+    value=org.opensolaris.category.2008:System/Libraries
+set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
+set name=info.upstream_url value="http://www.zlib.net"
+set name=opensolaris.arc_url \
+    value=http://arc.opensolaris.org/caselog/PSARC/2006/537
+set name=info.source_url value=$(COMPONENT_ARCHIVE_URL)
+
+dir path=lib
+dir path=lib/$(MACH64)
+dir path=usr
+dir path=usr/include
+dir path=usr/lib
+dir path=usr/lib/$(MACH64)
+dir path=usr/share
+dir path=usr/share/man
+dir path=usr/share/man/man3
+
+file usr/lib/libz.so.1 path=lib/libz.so.1
+file usr/lib/llib-lz.ln path=lib/llib-lz.ln
+file usr/lib/$(MACH64)/libz.so.1 path=lib/$(MACH64)/libz.so.1
+file usr/lib/$(MACH64)/llib-lz.ln path=lib/$(MACH64)/llib-lz.ln
+file path=usr/include/zconf.h
+file path=usr/include/zlib.h
+file path=usr/lib/llib-lz
+file usr/share/man/man3/zlib.3 path=usr/share/man/man3/libz.3
+file zlib.3.sunman path=usr/share/man/man3/zlib.3
+
+link path=lib/$(MACH64)/libz.so target=libz.so.1
+link path=lib/libz.so target=libz.so.1
+link path=usr/lib/$(MACH64)/libz.so target=libz.so.1
+link path=usr/lib/$(MACH64)/libz.so.1 target=../../../lib/$(MACH64)/libz.so.1
+link path=usr/lib/$(MACH64)/llib-lz.ln target=../../../lib/$(MACH64)/llib-lz.ln
+link path=usr/lib/libz.so target=./libz.so.1
+link path=usr/lib/libz.so.1 target=../../lib/libz.so.1
+link path=usr/lib/llib-lz.ln target=../../lib/llib-lz.ln
+
+license zlib.license license="zlib license"
+
+legacy pkg=SUNWzlib \
+    name="The Zip compression library" \
+    desc="The Zip compression library"
+legacy pkg=SUNWzlibr \
+    name="The Zip compression library (Root)" \
+    desc="The Zip compression library (Root)"