X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@lists.alpinelinux.org Received: from mail.wtbts.no (mail.wtbts.no [213.234.126.131]) by lists.alpinelinux.org (Postfix) with ESMTP id 6258D1EB588 for ; Thu, 13 Jan 2011 14:41:20 +0000 (UTC) Received: from localhost (bsna.nor.wtbts.net [127.0.0.1]) by mail.wtbts.no (Postfix) with ESMTP id 55CCBAE4004; Thu, 13 Jan 2011 14:41:17 +0000 (UTC) X-Virus-Scanned: Yes Received: from mail.wtbts.no ([127.0.0.1]) by localhost (bsna.nor.wtbts.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9vcYQswr4LyF; Thu, 13 Jan 2011 14:41:15 +0000 (UTC) Received: from mail.ytre.org (extmail.nor.wtbts.net [10.65.72.14]) by mail.wtbts.no (Postfix) with ESMTP id 17358AE4001; Thu, 13 Jan 2011 14:41:15 +0000 (UTC) Received: from mail.ytre.org (localhost [127.0.0.1]) by mail.ytre.org (Postfix) with ESMTP id CB69A60A7FB44; Thu, 13 Jan 2011 14:41:14 +0000 (UTC) Received: from ncopa-desktop.nor.wtbts.net (unknown [10.65.65.1]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: ncopa@ytre.org) by mail.ytre.org (Postfix) with ESMTPSA id 3749960A7FB42; Thu, 13 Jan 2011 14:41:12 +0000 (UTC) Date: Thu, 13 Jan 2011 15:39:56 +0100 From: Natanael Copa To: Matt Smith Cc: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] [PATCH] main/php: improved APKBUILD, see changes Message-ID: <20110113153956.3a78b509@ncopa-desktop.nor.wtbts.net> In-Reply-To: <1294914908-14582-1-git-send-email-mcs@darkregion.net> References: <1294914908-14582-1-git-send-email-mcs@darkregion.net> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; x86_64-unknown-linux-gnu) X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP On Thu, 13 Jan 2011 04:35:08 -0600 Matt Smith wrote: > php-5.3.5-r2 changelog: > - Recreated php-cli subpackage and moved it out of the main php > package; > - Combined php-cli and php-pear in the build() function (one less > `make` to perform); > - Created php-common subpackage, currently containing php.ini; > - Converted the main php package into a metapackage, which currently > depends on php-common and php-cgi; > - Updated the dev() split function to include all the build dirs we > used, and then symlinked /usr/lib/php/build to build-cgi by default; > - Moved the phar command to the php-phar subpackage; > > Let me know what you think. perfect! Applied. some of the code is repetitive. Could go in a function so if you in the future needs to modify the sed line then you only need to do it one place. --- a/main/php/APKBUILD +++ b/main/php/APKBUILD @@ -86,7 +86,12 @@ prepare() { patch -p1 -i "${srcdir}"/suhosin-patch-${_suhosinver}.patch || return 1 } -build() { +_do_build() { + local cp_from="$1" + local cp_to="$2" + shift + shift + _phpconfig="--build=${CHOST:-i486-alpine-linux-uclibc} \ --prefix=/usr \ --sysconfdir=/etc/php \ @@ -167,58 +172,48 @@ build() { " # --with-enchant=shared,/usr \ # --with-tidy=shared \ + cp -a "$srcdir"/$cp_from "$srcdir"/$cp_to + cd "$srcdir"/$cp_to + ./configure ${_phpconfig} \ + "$@" \ + ${_phpextensions} \ + || return 1 + sed -ri "s/^(EXTRA_LDFLAGS[ ]*\=.*)/\1 -lpthread/" Makefile # see #183 + make || return 1 +} +build() { # cgi and fcgi - cp -a "$srcdir"/$pkgname-$pkgver "$srcdir"/$pkgname-cgi - cd "$srcdir"/$pkgname-cgi - ./configure ${_phpconfig} \ + _do_build $pkgname-$pkgver $pkgname-cgi \ --disable-cli \ --enable-cgi \ - ${_phpextensions} - sed -ri "s/^(EXTRA_LDFLAGS[ ]*\=.*)/\1 -lpthread/" Makefile # see #183 - make || return 1 + || return 1 # fpm - cp -a "$srcdir"/$pkgname-cgi "$srcdir"/$pkgname-fpm - cd "$srcdir"/$pkgname-fpm - ./configure ${_phpconfig} \ + _do_build $pkgname-cgi $pkgname-fpm \ --disable-cli \ --enable-fpm \ - ${_phpextensions} - sed -ri "s/^(EXTRA_LDFLAGS[ ]*\=.*)/\1 -lpthread/" Makefile # see #183 - make || return 1 + || return 1 # apache2 - cp -a "$srcdir"/$pkgname-cgi "$srcdir"/$pkgname-apache2 - cd "$srcdir"/$pkgname-apache2 - ./configure ${_phpconfig} \ + _do_build $pkgname-cgi $pkgname-apache2 \ --disable-cli \ --with-apxs2 \ - ${_phpextensions} - sed -ri "s/^(EXTRA_LDFLAGS[ ]*\=.*)/\1 -lpthread/" Makefile # see #183 - make || return 1 + || return 1 # embed - cp -a "$srcdir"/$pkgname-cgi "$srcdir"/$pkgname-embed - cd "$srcdir"/$pkgname-embed - ./configure ${_phpconfig} \ + _do_build $pkgname-cgi $pkgname-embed \ --disable-cli \ --enable-embed=shared \ - ${_phpextensions} - sed -ri "s/^(EXTRA_LDFLAGS[ ]*\=.*)/\1 -lpthread/" Makefile # see #183 - make || return 1 + || return 1 # cli and pear - cp -a "$srcdir"/$pkgname-cgi "$srcdir"/$pkgname-cli-pear - cd "$srcdir"/$pkgname-cli-pear - ./configure ${_phpconfig} \ + _do_build $pkgname-cgi $pkgname-cli-pear \ --disable-cgi \ --with-readline \ --enable-pcntl \ --with-pear \ - ${_phpextensions} - sed -ri "s/^(EXTRA_LDFLAGS[ ]*\=.*)/\1 -lpthread/" Makefile # see #183 - make || return 1 + || return 1 } package() { -nc --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---