[pacman-dev] My first splitted package

Pierre Schmitz pierre at archlinux.de
Sun Jan 18 08:40:00 EST 2009


Am Samstag 17 Januar 2009 13:56:30 schrieb Pierre Schmitz:
> The next one I'll try is php. It should be more complex but there won't be
> strange dependencies between sub packages.

OK, I have created a splitted php package now. Maybe I don't get it, but I 
think php has some of the worst build systems ever. :-)

To sum things up, I have to say I really like the current implementation. It's 
really clean and even if you do not split the package a separate package 
function has a lot of advantages.

I have also use makepkg -R a lot; added and removed sub packages and all went 
fine.

So, what I have learnt from packageing PHP?

1)
I have to use configure;make;make install several times. That's why I asked 
for build_pkg1.. functions. But thinking about it several build functions 
might be really problematic; especially if you want to repackage and call 
order of those functions is important. The solution is to use "out of source 
tree builds". This way you could do different things for each sub package.

2)
Future versions of namcap should do some more tests like:
	* Are all deps of sub packages are defined as makedeps?
	* Do we have package functions for all pkgnames and vise versa?

3)
$pkgname seems to allways point to the first entry of the pkgname array.  See 
the following test case:

pkgname=(test1 test2)
pkgver=1
pkgrel=1

build() {
        echo -n should be empty:
        echo $pkgname
}

package_test1() {
        echo -n should be test1:
        echo $pkgname
}

package_test2() {
        echo -n should be test2:
        echo $pkgname
}

This allway echos test1 which is not really expected.

So back to PHP. The main problem was that PHP itself is quite modular,but the 
build system is not. So I had to do several hack to get everything build 
within one PKGBUILD. Anyway: Once this is done we get a clean solution and 
don't have to abuse optdepends.

The result are the following packages:

3,9M php-5.2.8-1-x86_64.pkg.tar.gz                                                       
2,4M php-apache-5.2.8-1-x86_64.pkg.tar.gz                                                
2,2M php-cgi-5.2.8-1-x86_64.pkg.tar.gz                                                   
 28K php-curl-5.2.8-1-x86_64.pkg.tar.gz                                                  
112K php-gd-5.2.8-1-x86_64.pkg.tar.gz                                                    
 20K php-gmp-5.2.8-1-x86_64.pkg.tar.gz                                                   
 20K php-ldap-5.2.8-1-x86_64.pkg.tar.gz                                                  
 16K php-mcrypt-5.2.8-1-x86_64.pkg.tar.gz                                                
8,0K php-mhash-5.2.8-1-x86_64.pkg.tar.gz                                                 
 84K php-mysql-5.2.8-1-x86_64.pkg.tar.gz                                                 
 44K php-odbc-5.2.8-1-x86_64.pkg.tar.gz                                                  
336K php-pear-5.2.8-1-x86_64.pkg.tar.gz                                                  
 60K php-pgsql-5.2.8-1-x86_64.pkg.tar.gz                                                 
 12K php-pspell-5.2.8-1-x86_64.pkg.tar.gz                                                
 12K php-snmp-5.2.8-1-x86_64.pkg.tar.gz                                                  
200K php-sqlite-5.2.8-1-x86_64.pkg.tar.gz                                                
 20K php-tidy-5.2.8-1-x86_64.pkg.tar.gz                                                  
 16K php-xsl-5.2.8-1-x86_64.pkg.tar.gz         

In my first attepmt I had nearly everything as a sub package which was a bit 
extreme. So I finally decided to split only to avoid unneeded dependencies. 
E.g. there is no need to install postgres if you don't use it.

This also makes it possible to add some less used features/modules without 
worring about increasing dependencies for others.

I have attached the (quite long) PKGBUILD. 

Greetings,

Pierre

-- 

Pierre Schmitz


Clemens-August-Straße 76
53115 Bonn

Telefon		0228 9716608
Mobil		0160 95269831
Jabber		pierre at jabber.archlinux.de
WWW		http://www.archlinux.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: php-5.2.8-1.src.tar.gz
Type: application/x-compressed-tar
Size: 19564 bytes
Desc: not available
URL: <http://archlinux.org/pipermail/pacman-dev/attachments/20090118/dc683405/attachment-0001.bin>


More information about the pacman-dev mailing list