components/bzip2/Makefile
author Craig Mohrman <Craig.Mohrman@oracle.com>
Fri, 04 Feb 2011 16:39:42 -0800
changeset 73 ab86dc591780
parent 61 7684fe2a9eb5
child 75 1f81099246e8
permissions -rw-r--r--
7017417 missing variant for which binary in package manifest

#
# 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=		bzip2
COMPONENT_VERSION=	1.0.6
IPS_PKG_NAME=		compress/bzip2
COMPONENT_DESCRIPTION=	"The bzip compression utility"
COMPONENT_CLASSIFICATION="Applications/System Utilities"
COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_PROJECT_URL=	http://www.bzip.org
COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
COMPONENT_ARCHIVE_HASH=	sha1:3f89f861209ce81a6bab1fd1998c0ef311712002
COMPONENT_ARCHIVE_URL=	http://www.bzip.org/1.0.6/$(COMPONENT_ARCHIVE)

include ../../make-rules/prep.mk
include ../../make-rules/justmake.mk
include ../../make-rules/ips.mk

LIBNAME=	bz2
LINTOUT=	lint.out
LINTFLAGS=	-nsvx -I. $(BITS32)
LINTFLAGS64=	-nsvx -I. $(BITS64)


CFLAGS += -KPIC -D_FILE_OFFSET_BITS=64
CFLAGS += $(XREGSFLAG)

COMPONENT_BUILD_ENV += CC="$(CC)"
COMPONENT_BUILD_TARGETS += CC="$(CC)"
COMPONENT_BUILD_TARGETS += CFLAGS="$(CFLAGS)"
COMPONENT_INSTALL_TARGETS += PREFIX=$(PROTOUSRDIR)

COMPONENT_PRE_BUILD_ACTION= \
	(cd $(@D) ; \
	    cp ../../oldapi.c . )

COMPONENT_POST_BUILD_ACTION= \
	(cd $(@D) ; \
	    $(LINT) -o $(LIBNAME) ../../llib-lbz2 > $(LINTOUT) 2>&1)


# common targets
build:		$(BUILD_32) $(BUILD_64)

MAN1FILES= bunzip2.1 bzcat.1 bzdiff.1 bzgrep.1 \
    bzip2.1 bzip2recover.1 bzmore.1
MAN3FILES=libbz2.3

PROTOMAN1FILES=$(MAN1FILES:%=$(PROTOUSRSHAREMAN1DIR)/%)
PROTOMAN3FILES=$(MAN3FILES:%=$(PROTOUSRSHAREMAN3DIR)/%)
PROTODIRS= $(PROTOUSRSHAREMAN1DIR) $(PROTOUSRSHAREMAN3DIR)

$(PROTOUSRSHAREMAN1DIR) $(PROTOUSRSHAREMAN3DIR):
	$(INS.dir)

$(PROTOUSRSHAREMAN1DIR)/% $(PROTOUSRSHAREMAN3DIR)/%:    manpages/%
	$(INS.file)


install:	build $(INSTALL_32) $(PROTODIRS) $(PROTOMAN3FILES) $(PROTOMAN1FILES)
	$(INSTALL) $(BUILD_DIR_32)/libbz2.so.1 $(PROTOUSRLIBDIR)
	cd $(PROTOUSRLIBDIR); rm -f libbz2.so; ln -s libbz2.so.1 libbz2.so
	$(INSTALL) llib-lbz2 $(PROTOUSRLIBDIR)
	$(INSTALL) $(BUILD_DIR_32)/llib-lbz2.ln $(PROTOUSRLIBDIR)
	$(MKDIR) $(PROTOUSRLIBDIR64)
	$(INSTALL) $(BUILD_DIR_64)/libbz2.so.1 $(PROTOUSRLIBDIR64)
	cd $(PROTOUSRLIBDIR64); rm -f libbz2.so; ln -s libbz2.so.1 libbz2.so
	$(INSTALL) $(BUILD_DIR_64)/llib-lbz2.ln $(PROTOUSRLIBDIR64)

# build does this always
test: 

BUILD_PKG_DEPENDENCIES =	$(BUILD_TOOLS)

include ../../make-rules/depend.mk