components/pam_pkcs11/Makefile
author John Beck <John.Beck@Oracle.COM>
Fri, 21 Apr 2017 13:14:17 -0700
branchs11u3-sru
changeset 7934 2b9fc4cafd1f
parent 7455 cefc5b17cc4b
permissions -rw-r--r--
25933097 thunderbird/Makefile must drop library/desktop/gdk-pixbuf from REQUIRED_PACKAGES

#
# 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, 2016, Oracle and/or its affiliates. All rights reserved.
#
include ../../make-rules/shared-macros.mk

COMPONENT_NAME=		pam_pkcs11
COMPONENT_VERSION=	0.6.8
COMPONENT_PROJECT_URL=	https://sourceforge.net/projects/opensc/
COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
COMPONENT_ARCHIVE_HASH=	\
    sha256:9d942e542ef35d0e1f990d9ff5bf9df0af84c828ed081add2eb1b4d84f0efbda
COMPONENT_ARCHIVE_URL=	$(COMPONENT_PROJECT_URL)files/$(COMPONENT_NAME)/$(COMPONENT_ARCHIVE)
COMPONENT_BUGDB=	library/pam-pkcs11

TPNO=			28155

include $(WS_MAKE_RULES)/prep.mk
include $(WS_MAKE_RULES)/configure.mk
include $(WS_MAKE_RULES)/ips.mk

# Force regeneration of ancient autoconf scripts to fix 64-bit build detection
# and due to patches to autoconf and automake files.
COMPONENT_PREP_ACTION += (cd $(@D); autoreconf -fiv)

# Enable ASLR for this component
ASLR_MODE = $(ASLR_ENABLE)

# We build two different variants of pam_pkcs11 for our users. 
VARIANT_OPENLDAP =       $(BUILD_DIR)/openldap
VARIANT_MOZILLALDAP =    $(BUILD_DIR)/mozillaldap

VARIANTS = $(VARIANT_OPENLDAP) $(VARIANT_MOZILLALDAP)

BUILD_32 = $(VARIANTS:%=%/$(MACH32)/.built)
BUILD_64 = $(VARIANTS:%=%/$(MACH64)/.built)
BUILD_32_and_64 = $(BUILD_32) $(BUILD_64)

$(VARIANT_OPENLDAP)/$(MACH64)/.configured: BITS=64
$(VARIANT_MOZILLALDAP)/$(MACH64)/.configured:  BITS=64

# Configure options for mozillaldap variant
$(VARIANT_MOZILLALDAP)/%/.configured: \
    CONFIGURE_OPTIONS += --enable-openldap=no
$(VARIANT_MOZILLALDAP)/%/.configured: \
    CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS) -DMODULE_ISA_FIX"

# Configure options for openldap variant
$(VARIANT_OPENLDAP)/%/.configured: \
    CONFIGURE_OPTIONS += --enable-openldap=yes
$(VARIANT_OPENLDAP)/%/.configured: \
    CONFIGURE_OPTIONS += \
    CFLAGS="$(CFLAGS) -I/usr/include/openldap -DMODULE_ISA_FIX"

# Common configure options
CONFIGURE_BINDIR.32= $(USRLIBDIR)/pam_pkcs11
CONFIGURE_BINDIR.64= $(USRLIBDIR64)/pam_pkcs11

CONFIGURE_OPTIONS += --localstatedir=/var
CONFIGURE_OPTIONS += --with-confdir=/etc/security/pam_pkcs11
CONFIGURE_OPTIONS += --docdir=/etc/security/pam_pkcs11
CONFIGURE_OPTIONS += OPENSSL_LIBS="-lssl -lcrypto -lsocket"
CONFIGURE_OPTIONS += --with-pcsclite=yes
CONFIGURE_OPTIONS += PCSC_CFLAGS="-I/usr/include/PCSC"
CONFIGURE_OPTIONS += PCSC_LIBS="-lpcsclite"

# We install only the MozillaLDAP variant. We will cherry-pick binaries built
# against OpenLDAP out of the build directory to avoid re-installing
# everything.
INSTALL_32 = $(VARIANT_MOZILLALDAP)/$(MACH32)/.installed
INSTALL_64 = $(VARIANT_MOZILLALDAP)/$(MACH64)/.installed
INSTALL_32_and_64 = $(INSTALL_32) $(INSTALL_64)

# common targets
configure:	$(CONFIGURE_32_and_64)

build:		$(BUILD_32_and_64)

install:	$(INSTALL_32_and_64)

test:		$(NO_TESTS)

REQUIRED_PACKAGES += library/openldap
REQUIRED_PACKAGES += library/security/openssl
REQUIRED_PACKAGES += library/security/pcsc/pcsclite
REQUIRED_PACKAGES += shell/bash
REQUIRED_PACKAGES += system/library
REQUIRED_PACKAGES += system/linker