You are not logged in.

#1 2018-12-19 06:22:06

tsmjay
Member
Registered: 2018-12-19
Posts: 5

PHP Custom Package

Hello,

I'm having problems creating a PHP package from source. I seem to be hitting a documented problem, but can't see what the official Arch package is doing to avoid it.

Here is my PKGBUILD:

pkgname=php
pkgver=7.2.5
pkgrel=1
epoch=
pkgdesc=''
arch=('x86_64')
url=""
license=('GPL')
groups=('')
depends=()
makedepends=()
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("$pkgname-$pkgver.tar.gz")
noextract=()
md5sums=('e9bede5ea2cbb2e3a2581d38316c9356')
validpgpkeys=()

build() {
	cd "$pkgname-$pkgver"
	./configure \
		--with-apxs2=/usr/local/bin/apxs \
		--prefix=/usr/local
	make
}

package() {
	cd "$pkgname-$pkgver"
	make INSTALL_ROOT="$pkgdir" install
}

This is the error that I get, when makepkg enters the package() stage:

==> Entering fakeroot environment...
==> Starting package()...
Installing PHP SAPI module:       apache2handler
/usr/local/share/httpd/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1/build/libtool' libphp7.la /home/test/packaging-test/php/pkg/php/usr/local/lib/httpd
/usr/share/apr-1/build/libtool --mode=install install libphp7.la /home/test/packaging-test/php/pkg/php/usr/local/lib/httpd/
libtool: install: install .libs/libphp7.so /home/test/packaging-test/php/pkg/php/usr/local/lib/httpd/libphp7.so
libtool: install: install .libs/libphp7.lai /home/test/packaging-test/php/pkg/php/usr/local/lib/httpd/libphp7.la
libtool: warning: remember to run 'libtool --finish /home/test/packaging-test/php/src/php-7.2.5/libs'
chmod 755 /home/test/packaging-test/php/pkg/php/usr/local/lib/httpd/libphp7.so
apxs:Error: Config file /home/test/packaging-test/php/pkg/php/usr/local/etc/httpd/httpd.conf not found.
make: *** [Makefile:149: install-sapi] Error 1
==> ERROR: A failure occurred in package().
    Aborting...
[test@arch php]$

Any help would be appreciated. The software versions are as follows:

Apache: 2.4.33
PHP: 7.2.5

Thanks.

Offline

#2 2018-12-19 14:46:02

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 20,761
Website

Re: PHP Custom Package

Please provide a PKGBUILD that would allow us to replicate the problem.  Get rid of all the empty variables, specify an actual source, and appropriately specify dependencies.

Also why are you using a /usr/local prefix?

EDIT: oops! I missed that this error was only in the package function not the build.  See below.

Last edited by Trilby (2018-12-19 15:06:19)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2018-12-19 15:00:54

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 2,696

Re: PHP Custom Package

Regardless of any other concern, the official php package uses this: https://git.archlinux.org/svntogit/pack … s/php#n211

So, we're not even using the Makefile when installing the apache stuff.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2018-12-20 06:01:03

tsmjay
Member
Registered: 2018-12-19
Posts: 5

Re: PHP Custom Package

Thanks for the insight.

I've found 2 workarounds for this:

1. edit the Makefile in the build() step and modify the SYSCONFDIR not to include the fakeroot path
2. copy the existing httpd.conf file into the package, so that makepkg is able to find it. It's then up to you if you want to delete it afterwards, or use it for something else.

Obviously the fix is to fix the upstream package!

Thanks.

Offline

#5 2018-12-20 14:30:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 20,761
Website

Re: PHP Custom Package

Or #3, do what is done in the repo package ... which seems simpler and is definitely less fragile.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB