Table of Contents
About
bpkg is a utility that tries to simplify the process of trying out new programs from source. For 99% of packages this can be as simple as:
# bpkg http://www.rsnapshot.org/downloads/rsnapshot-1.2.1.tar.gz
bpkg will download, extract, configure, compile, install, generate a package in your system's native format, and finally integrate that package into your system's packaging system so that you can remove it cleanly.
It has auto-detection for Arch Linux, Slackware, Red Hat, Gentoo and SuSE (though not all packaging back-ends are complete).
bpkg is not intended as a replacement for normal packaging utilities.
NOTE: bpkg is NOT heavily tested and could do bad things to your system. Use at your own risk.
Help!
As of 08/06/05 only the Arch Linux, Gentoo and Slackware packaging backends are complete. If you would like to contribute, backends for RPM and DEB are needed. The relevant functions are packager_rpm() and packager_deb().
In addition, if you would like to add support for your distribution or release, add detection code in packager_auto() and, if required, another packager_<package-type>() function for your particular packaging mechanism.
Installation
If all goes well, all you have to do to install bpkg is type:
# make # make install
bpkg should auto-detect your packaging system and generate a package for itself.
You can also use make DESTDIR=/tmp/pkg install to install to a package root.
If auto-packaging fails you can use make install-raw to do a normal unmanaged installation.
Overview
bpkg uses heuristics to determine the most appropriate methods to extract, configure and compile. Each phase and the heuristics used are summarised below.
Extraction Heuristics
If the supplied package looks like a URL, bpkg will attempt to download the given URL.
If the resultant file is a .tar.bz2, .tar.gz or .tar.Z, bpkg will extract the tar ball and change into the first directory in the tar file.
Configure Heuristics
bpkg will automatically attempt to configure the package using any of the following mechanisms:
- autoconf via ./configure
- autoconf via ./autogen.sh
- Imakefile via xmkmf
- Python packages containing a setup.py (generates a stub Makefile)
- Perl packages containing a Makefile.PL
- If a Qt project file named <package>.pro exists, qmake will be run on it.
Installation
Once extraction, configuration and compilation are complete, bpkg then uses checkinstall to install the package into the filesystem, then copies the installed files into a temporary package root for packaging.
Packaging
Packagers are currently implemented for ArchLinux, SlackWare and Gentoo.
Stub packagers for RPM, Debian and Gentoo are in the script but incomplete as I do not have systems available to develop them on. User contributions are welcome.
Requirements
InstallWatch is required to track files installed to the filesystem.
Other requirements are bash, some sort of downloader (eg. wget or curl) if you want to be able to autodownload source. GNU Tar is required for auto-extraction.
In addition, the various packaging backends may have additional system specific requirements.
Usage
bpkg [<filename>] [<bpkg-options>] [<configure-options>]
<filename> will be automatically extracted before packaging continues. If not
given, packaging is performed from the current directory.
Any options not recognised by bpkg will be passed on to ./configure if the
package is autoconf based.
Available <bpkg-options> are:
--help
This help.
--detect-os
Display the O/S that bpkg thinks you are running.
--version
Show bpkg version.
--packager=arch|slackware|rpm|deb|gentoo|redhat|suse|auto
Generate packages using the specified packaging system. 'auto' is the
default.
--package=<name>-<version>
Override package name and version auto-detection. By default this is
obtained by extracting the package name and version from the package
source directory name.
--unique
Pass options to autoconf to install into configuration and data directories
unique to this package. (ie. --sysconfdir=/etc/<package>,
--localstatedir=/var/state/<package> and --datadir=/usr/share/<package>).
The base directories are used if this option is not given.
--skip-build
Do not perform the build phase of bpkg.
--build-with=<command>
Use the given command to build, rather than the default 'make'.
--install-with=<command>
Use the given command to install, rather than the default 'make install'.
--md5=<md5sum>
Verify that the source file has the given MD5 checksum.
For further information, including examples, visit http://swapoff.org/bpkg
Examples
Automatically download, extract, configure, compile and package rsnapshot.
# bpkg http://www.rsnapshot.org/downloads/rsnapshot-1.2.1.tar.gz
As above but for a local copy of the source tarball:
# bpkg rsnapshot-1.2.1.tar.gz
Configure, compile and package from an existing source directory:
# bpkg
Change Log
[328] by athomas on 23/04/06 23:45:34
Set MIME type for bpkg.
[59] by athomas on 16/02/06 23:04:04
- Test whether CPAN is configured before allowing cpan:// style URLs.
[58] by athomas on 16/02/06 22:23:46
- Added CPAN support: bpkg cpan://Some::Cool::Module
- Perl and Python packages automatically have perl- or python prepended to their name if they do not already.
- You can now specify the package description with --description=foo
- Attempt to extract Perl module version from Makefile.PL
- Added a build_post_<builder> phase. This is currently used by the Perl builder to copy the contents of the .packlist into the package root.
[57] by athomas on 19/12/05 19:52:46
- Always use Python distutils data if available and user has not explicitly specified package.
[56] by athomas on 17/12/05 08:35:41
- Refactored build section so it's cleaner.
- Fixed self-packaging so it should actually work if you don't already have installwatch installed.
- Added --build-with option.
- By using --skip-build and --install-with, bpkg effectively has the same functionality as checkinstall.
[55] by athomas on 31/10/05 21:26:52
- Tagged 0.4
Download
- http://swapoff.org/files/bpkg/bpkg-0.5.tar.gz be2fcc350a100ee70bd04b4e55c20e6e
- http://swapoff.org/files/bpkg/bpkg-0.4.tar.gz 5857afcc978e260e878bea13b746b4ae
- http://swapoff.org/files/bpkg/bpkg-0.3.tar.gz fbdd3bec0a28202ec47af80be51d794d
- http://swapoff.org/files/bpkg/bpkg-0.2.tar.gz f503caeb868f09911ab322e8e5d7f889
- http://swapoff.org/files/bpkg/bpkg-0.1.tar.gz 7f8a3fdbe55074154688fe7020df6ca4
