Search code examples
phpcompilationpackagedebianprefix

Recompile dotdeb php with different prefix


Achivements:

  • Having 2+ versions (5.3, 5.4, 5.5) of PHP on 1 server installed via aptitude

  • Runninng php as fastcgi - this is working well, tested with 2 versions of php on 1 server

  • Using dotdeb version of php

  • Having own repository with php (because of repeatable build of server) - tested and working well

Building PHP from dotdeb:

I have a simple script to download latest version from dotdeb and create new package, which is working perfectly and I would like to modify it:

#!/bin/bash
cd /tmp

PACKAGE=php5
VERSION=`apt-cache show ${PACKAGE} | grep 'Version:' | head -1 | awk -F" |-" '{print $2}'` || exit 1

apt-get update || exit 1
apt-get build-dep ${PACKAGE} || exit 1
apt-get source ${PACKAGE} || exit 1

cd ${PACKAGE}-${VERSION} || exit 1

dch -n "Rebuilt with different package name and paths."

dpkg-buildpackage -b -rfakeroot || exit 1

If I run this script just like this, everything is working fine and right .deb packages are producted.

What I need:

  • Modify script to rename package from php5 to php53/php54/php55 to avoid conflicts in repository

  • Change path where new package is going to be installed to avoid conflicts with other versions of php ... something like /usr/local/php53/..., /usr/local/php54/

Test 1 - changing the name of package

sed -e 's/php5/php54/g' -i debian/control

Packaged was compiled correctly, I hope. The only issue are failing php unit tests, which scares me.

You can see a part of output: http://pastebin.com/4zUqxx4z

Test 2 - adding prefix

--- debian/rules      2013-08-17 22:06:17.502911115 +0000
+++ debian/rules       2013-08-17 22:05:44.000000000 +0000
@@ -103,6 +103,7 @@

 COMMON_CONFIG=--build=$(DEB_BUILD_GNU_TYPE) \
                --host=$(DEB_HOST_GNU_TYPE) \
+               --prefix=/usr/local/php54 \
                --sysconfdir=/etc \
                --localstatedir=/var \
                --mandir=/usr/share/man \

Will output: http://pastebin.com/q2pXUnkF ... basicaly, PEAR instalation can't find some files.


Solution

  • The solution is update whole debian/rules, rename files in debian directory related to each package and update debian/control.

    There is nothing needed to be updated out of debian directory.

    Unfortunately, changing php5 to php54 in every file (or filename) in debian doesn't work :\