#
# 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) 2016, Oracle and/or its affiliates. All rights reserved.
#
include ../../make-rules/shared-macros.mk
COMPONENT_NAME= libpki
COMPONENT_VERSION= 0.8.9
# Version 0.8.9 of libpki has not been released, yet. There is no source
# tarball for it. In Solaris 12, Userland consolidation has infrastructure
# to fetch sources based on a specified git commit hash. Such infrastructure
# is not present in Solaris 11.3. So we take the latest tarball 0.8.8
# and apply few patches on top of it to get the same sources as in s12.
COMPONENT_PROJECT_URL= https://www.openca.org/projects/libpki/
COMPONENT_SRC= $(COMPONENT_NAME)-0.8.8
COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
COMPONENT_ARCHIVE_HASH= \
sha256:0a3907650d0b4cf958adb7955789a2c080fc60709a7fddda0262c385ba0e3465
COMPONENT_ARCHIVE_URL= \
http://downloads.sourceforge.net/project/openca/$(COMPONENT_NAME)/releases/v0.8.8/sources/$(COMPONENT_ARCHIVE)
COMPONENT_BUGDB= library/smartcard
TPNO= 26905
include $(WS_MAKE_RULES)/prep.mk
include $(WS_MAKE_RULES)/configure.mk
include $(WS_MAKE_RULES)/ips.mk
PKG_PROTO_DIRS += $(COMPONENT_SRC)/docs
# Need to include the path below because not all headers are available in
# $(BUILD_DIR)/src/libpki.
CFLAGS += -I$(COMPONENT_DIR)/$(COMPONENT_SRC)/src
OPENLDAP_VARIANT = $(BUILD_DIR)/$(MACH64)-openldap
MOZILLALDAP_VARIANT = $(BUILD_DIR)/$(MACH64)-mozillaldap
VARIANTS = $(OPENLDAP_VARIANT) $(MOZILLALDAP_VARIANT)
$(VARIANTS:%=%/.configured): BITS=64
BUILD_64 = $(VARIANTS:%=%/.built)
# Only install the OpenLDAP variant. We will cherry-pick libpki built against
# Mozilla LDAP out of the build directory to avoid re-installing everything.
INSTALL_64 = $(OPENLDAP_VARIANT)/.installed
TEST_64 = $(OPENLDAP_VARIANT)/.tested
# configure.in and Makefile.am patches need configure script recreation.
COMPONENT_PREP_ACTION += (cd $(@D); autoreconf);
# This is necessary because 'gmake install' tries to install some files under
# /usr/bin without it.
CONFIGURE_ENV += DESTDIR="$(PROTO_DIR)"
COMPONENT_INSTALL_ARGS += DESTDIR="$(PROTO_DIR)"
CONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin
CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
CONFIGURE_OPTIONS += --with-libdir=$(USRLIBDIR64)
CONFIGURE_OPTIONS += --with-lib-prefix=$(USRLIBDIR64)
# We build two variants: against OpenLDAP and against Mozilla LDAP libraries.
$(OPENLDAP_VARIANT)/.configured: CONFIGURE_OPTIONS += --enable-openldap=yes
$(MOZILLALDAP_VARIANT)/.configured: CONFIGURE_OPTIONS += --enable-openldap=no
COMPONENT_PRE_TEST_ACTION = files/setup_test.sh $(@D) $(COMPONENT_SRC)
# common targets
configure: $(CONFIGURE_64)
build: $(BUILD_64)
install: $(INSTALL_64) $(MOZILLALDAP_VARIANT)/.built
test: $(TEST_64)
REQUIRED_PACKAGES += library/libxml2
REQUIRED_PACKAGES += library/openldap
REQUIRED_PACKAGES += library/security/openssl
REQUIRED_PACKAGES += library/security/openssl/openssl-fips-140
REQUIRED_PACKAGES += shell/ksh93
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/linker