From 6201d0781de66328b2ff201a3433c70508580d1f Mon Sep 17 00:00:00 2001 From: mhei Date: Fri, 9 Dec 2011 20:07:59 +0000 Subject: [PATCH] [packages] php5: introduce infrastructure for pecl packages git-svn-id: svn://svn.openwrt.org/openwrt/packages@29492 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- lang/php5/Makefile | 8 ++++++++ lang/php5/pecl.mk | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 lang/php5/pecl.mk diff --git a/lang/php5/Makefile b/lang/php5/Makefile index 042b195e3..cb877d134 100644 --- a/lang/php5/Makefile +++ b/lang/php5/Makefile @@ -471,6 +471,14 @@ define Package/php5-fastcgi/install $(INSTALL_BIN) ./files/php5-fastcgi.init $(1)/etc/init.d/php5-fastcgi endef +define Build/InstallDev + make -C $(PKG_BUILD_DIR) install INSTALL_ROOT=$(PKG_BUILD_DIR)/staging + rm $(PKG_BUILD_DIR)/staging/usr/bin/php + $(CP) $(PKG_BUILD_DIR)/staging/* $(STAGING_DIR_HOST) + sed -i -e "s#prefix='/usr'#prefix='$(STAGING_DIR_HOST)/usr'#" $(STAGING_DIR_HOST)/usr/bin/phpize + sed -i -e "s#exec_prefix=\"\`eval echo /usr\`\"#exec_prefix='$(STAGING_DIR_HOST)/usr'#" $(STAGING_DIR_HOST)/usr/bin/phpize +endef + define BuildModule define Package/php5-mod-$(1) diff --git a/lang/php5/pecl.mk b/lang/php5/pecl.mk new file mode 100644 index 000000000..ec0f3e278 --- /dev/null +++ b/lang/php5/pecl.mk @@ -0,0 +1,40 @@ +# +# Copyright (C) 2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Package/php5-pecl/Default + SUBMENU:=PHP + SECTION:=lang + CATEGORY:=Languages + URL:=http://pecl.php.net/ + MAINTAINER:=Michael Heimpold + DEPENDS:=php5 +endef + +define Build/Configure + ( cd $(PKG_BUILD_DIR); $(STAGING_DIR_HOST)/usr/bin/phpize ) + $(Build/Configure/Default) +endef + +define PECLPackage + + define Package/php5-pecl-$(1) + $(call Package/php5-pecl/Default) + TITLE:=$(2) + + ifneq ($(3),) + DEPENDS+=$(3) + endif + endef + + define Package/php5-pecl-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/php + $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/ + $(INSTALL_DIR) $$(1)/etc/php5 + echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php5/$(subst -,_,$(1)).ini + endef + +endef