Skip to content

Commit

Permalink
Add PHP 7.3 mongodb extension
Browse files Browse the repository at this point in the history
  • Loading branch information
pyhalov committed May 6, 2019
1 parent 30fb450 commit a0a465c
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 0 deletions.
79 changes: 79 additions & 0 deletions components/web/php/php-7_3-ext-mongodb/Makefile
@@ -0,0 +1,79 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL)". You may
# only use this file in accordance with the terms of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright (c) 2019 Alexander Pyhalov
#

include ../../../../make-rules/shared-macros.mk

COMPONENT_NAME= php-7.3-ext-mongodb
COMPONENT_VERSION= 1.5.3
COMPONENT_PROJECT_URL= http://pecl.php.net/package/mongodb
COMPONENT_SUMMARY= MongoDB driver for PHP
COMPONENT_SRC= mongodb-$(COMPONENT_VERSION)
COMPONENT_ARCHIVE= $(COMPONENT_NAME)-$(COMPONENT_VERSION).tgz
COMPONENT_ARCHIVE_HASH= sha256:8def2c74aa28e64839dee4b878bc92ad9164a45d84f55b519ac92f338ff8e1ba
COMPONENT_ARCHIVE_URL= http://pecl.php.net/get/$(COMPONENT_SRC).tgz
COMPONENT_FMRI= web/php-73/extension/php-mongodb
COMPONENT_CLASSIFICATION= Development/PHP
COMPONENT_LICENSE= Apache v2.0
COMPONENT_LICENSE_FILE= LICENSE

include $(WS_TOP)/make-rules/prep.mk
include $(WS_TOP)/make-rules/configure.mk
include $(WS_TOP)/make-rules/ips.mk

CLEAN_PATHS += package.xml package2.xml

PHP_PREFIX=/usr/php/7.3
PHP_SYSCONFDIR=/etc/php/7.3
PHP_DATADIR=/var/php/7.3

# Configure Options
CONFIGURE_OPTIONS = --prefix=$(PHP_PREFIX)
CONFIGURE_OPTIONS += --bindir=$(PHP_PREFIX)/bin
CONFIGURE_OPTIONS += --sbindir=$(PHP_PREFIX)/bin
CONFIGURE_OPTIONS += --libdir=$(PHP_PREFIX)/lib/$(MACH64)
CONFIGURE_OPTIONS += --libexecdir=$(PHP_PREFIX)/libexec
CONFIGURE_OPTIONS += --includedir=$(PHP_PREFIX)/include
CONFIGURE_OPTIONS += --sysconfdir=$(PHP_SYSCONFDIR)
CONFIGURE_OPTIONS += --datadir=$(PHP_DATADIR)
CONFIGURE_OPTIONS += --mandir=$(PHP_PREFIX)/share/man
CONFIGURE_OPTIONS += --localstatedir=$(PHP_DATADIR)

CONFIGURE_OPTIONS.64 += --build=x86_64-pc-solaris2.10
CONFIGURE_OPTIONS += --with-php-config=$(PHP_PREFIX)/bin/php-config

# Requires saslv2
CONFIGURE_OPTIONS += --with-mongodb-sasl=no

CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(BITS))

CFLAGS += -I/usr/include -I$(PHP_PREFIX)/include
CPPFLAG += $(CFLAGS)
LDFLAGS += -L$(PHP_PREFIX)/lib -R$(PHP_PREFIX)/lib

CONFIGURE_SCRIPT = $(@D)/configure

COMPONENT_PRE_CONFIGURE_ACTION = cp -R $(SOURCE_DIR)/* $(@D) ; cd $(@D) ; $(PHP_PREFIX)/bin/phpize
COMPONENT_INSTALL_ARGS += INSTALL_ROOT=$(PROTO_DIR)

build: $(BUILD_64)

install: $(INSTALL_64)

REQUIRED_PACKAGES += developer/icu

# Auto-generated dependencies
REQUIRED_PACKAGES += library/icu
REQUIRED_PACKAGES += library/security/openssl
REQUIRED_PACKAGES += library/zlib
REQUIRED_PACKAGES += system/library
@@ -0,0 +1,25 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2018 <contributor>
#

set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY)"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)

license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'

file path=usr/php/7.3/extensions/mongodb.so
2 changes: 2 additions & 0 deletions components/web/php/php-7_3-ext-mongodb/mongodb.ini
@@ -0,0 +1,2 @@
[mongodb]
extension=mongodb.so
30 changes: 30 additions & 0 deletions components/web/php/php-7_3-ext-mongodb/php73-ext-mongodb.p5m
@@ -0,0 +1,30 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2019 Alexander Pyhalov
#

set name=pkg.fmri value=pkg:/$(COMPONENT_FMRI)@$(IPS_COMPONENT_VERSION),$(BUILD_VERSION)
set name=pkg.summary value="$(COMPONENT_SUMMARY)"
set name=info.classification value="$(COMPONENT_CLASSIFICATION)"
set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
set name=org.opensolaris.consolidation value=$(CONSOLIDATION)

license $(COMPONENT_LICENSE_FILE) license='$(COMPONENT_LICENSE)'

<transform file path=usr/php/7.3/extensions/.*\.so -> \
add pkg.linted.userland.action001.2 true>

file mongodb.ini path=etc/php/7.3/conf.d/mongodb.ini preserve=true mode=0644

file path=usr/php/7.3/extensions/mongodb.so

0 comments on commit a0a465c

Please sign in to comment.