-   Slackware (
-   -   PkgBuild & src2pkg upgrade (

gnashley 09-20-2006 05:11 AM

PkgBuild & src2pkg upgrade
A new release of PkgBuild is available. This fixes several typos and bugs and also adds new features.

Default settings for working directories have been changed to use /tmp. This should be safer for most folks.

pkgbuild now includes the installwatch libraries and places them in /usr/libexec/pkgbuild so pkgbuild can co-exist with installed versions of installwatch or checkinstall.

Please read the manpage or run 'src2pkg --help' to see what's new. The old documentation has been moved as it will need to be redone before getting to 1.0

New version 0.9.3 is available here.

tuxdev 09-20-2006 10:24 AM


I like the new doc positioning from /usr/doc/$NAME to /usr/doc/$NAME-$VERSION. I also like that it defaults to cleaning everything up, although it would be helpful to generate a mock database file. I'm a bit mystified why the stuff in /usr/doc doesn't show up in the DB file, but I think that is my lack of understanding the packaging system.

If you would like, I can make the PkgBuilds available to you that I've done so that you can put them up on your site somewhere. One of them is a Level2 GNOME app (I'm not sure of the exact level because I installed all of GNOME-COMPAT, but 2 sounds about right to me). The other is a gtk-1.2 app. Both are for working with Japanese.

gnashley 09-20-2006 01:09 PM

Thanks for your feedback. I haven't checked the functioning of the DB generation lately. Thanks for your e-mail of a few days ago which prompted me to put in a little time on PkgBuild.

I'd be glad to have your PkgBuild scripts -you can just e-mail them to me as attachments with a link to the sources you used. Then I'll add them to the collection.

You had asked about an auto-patch routine. The earliest versions of PkgBuild included this feature. But as you said, it's easier to insert a line for patches so they get applied correctly.

MannyNix 09-20-2006 10:09 PM

Nice, i'm enjoying pkgfiles on crux and abs on arch, great to have something like this on Slackware, i'm definitely gonna try it, thanks and good job

tuxdev 09-22-2006 10:04 AM

I want to make a script for a package that uses the scons build system, but PkgBuild doesn't support it yet builtin (and I don't understand the code well enough to put support in myself). Does PkgBuild support using special commands (not builtin) for ./configure, make, make install? That would be nice for binary release packages, and self-extracting-and-installing packages.

gnashley 09-23-2006 04:31 AM

CONFIG_COMMAND, INSTALL_COMMAND and INSTALL_RULE can all be set from within your script. Just put them before this line:
source /usr/libexec/pkgbuild/FUNCTIONS

Have a look in source /usr/libexec/pkgbuild/FUNCTIONS at lines 311 and 320 for 'configure', line 413 for 'make' and lines 468,468,494 for make install to see how they work inside.

These can all be set to anything you like. INSTALL_RULE is used mainly when you need to run several make rules -like 'make install' and 'make install_binProgs'. This can be written like this 'make install install_binProgs'. So you'd just set
INSTALL_RULE="install install_binProgs"

If the options available don't give you enough control, simply comment out the step in your PkgBuild script and write the code manually. Each PkgBuild step is designed to be pretty much independent and skipping one should not break the functionality of the others. Leaving out or changing the code for configure_source, compile_source or fake_install command is the most common customization of PkgBuild scripts.

Here's an example:



source /usr/share/Amigo/PkgBuild/FUNCTIONS ;

pre_process ;
find_source ;
make_dirs ;
unpack_source ;
fix_source_perms ;

# configure_source ;
# compile_source ;
# fake_install ;

cd $SRC_DIR && ./configure Linux
# cd $SRC_DIR && GCC295 make all
cd $SRC_DIR && GCC31 make all

mkdir -p $PKG_DIR/usr/bin
cp -a $SRC_DIR/iv/iv $PKG_DIR/usr/bin

mkdir -p $PKG_DIR/usr/share/$NAME-$VERSION
cp -a $SRC_DIR/iv/*.xpm $PKG_DIR/usr/share/$NAME-$VERSION

# mkdir -p $PKG_DIR/usr/man/man1
# cp -a $SRC_DIR/iv/iv.1.bz2 $PKG_DIR/usr/man/man1

fix_pkg_perms ;
strip_bins ;
create_docs ;
compress_man_pages ;
make_description ;
make_doinst ;
make_package ;
post_process ;
exit 0

This line could have been handled with CONFIG_COMMAND="./configure Linux":
cd $SRC_DIR && ./configure Linux

And this could have been done with MAKE_COMMAND="make all":
cd $SRC_DIR && GCC31 make all

All times are GMT -5. The time now is 12:13 PM.