Libremakepkg

Note: This article is incomplete and out of date.

Libremakepkg is an script which:

  1. Checks nonfree depends on PKGBUILD
  2. Bind mount ${SRCDEST} ${PKGDEST} ${SRCPKGDEST} ${WORKDIR}, and optionally copy etc/makepkg.conf etc/pacman.conf etc/mtab to the chroot (This steps is called buildenv in the script)
  3. Updates the chroot where you are building (option -u)
  4. Cleans the chroot so no package is configured automatically as an depends (option -c) and
  5. Finally it uses makechrootpkg to build the package.

The package will be put on ${PKGDEST}.

Note: $SRCDEST, PKGDEST, and SRCPKGDEST are set up on /etc/makepkg.conf

Usage

Note: Before using libremakepkg you will need to setup /etc/libretools.conf first. Follow instructions at the Package maintainer guide
Warning: libremakepkg from [libre] won't be functional if you haven't installed devtools. If you have the version from [libre-testing], devtools in unnecessary (and actually conflicts).
 # pacman -Sy devtools

Which are libremakepkg options?

Libremakepkg will always have an updated list of options which can be listed using:

$ libremakepkg -h

Building with libremakepkg

For building with libremakepkg you should cd to the dir where the PKGBUILD is and run

 $ cd /dir/with/PKGBUILD
 # libremakepkg [options] 

If no option is passed to libremakepkg it will buildenv and build the package without updating or cleaning. This is useful if a previous build failed and you changed the PKGBUILD so that it will work this time.

Why Buildenv?

buildenv is meant for fullpkg to be able to add packages to a local repo and install them too.

buildenv is no longer necessary with the version in [libre-testing].

How is the cleaning done?

makechrootpkg has a cleaning option which rsync from a "root" chroot to a "copy" chroot and uses the "copy" chroot to build. When we were working at the mips port we created a script that tracks dependencies and builds them (fullpkg). We found out that rsync cleaning was slow and ineficient. So we designed a new cleaning method that uses pacman and a list of packages in a clean system.

The cleaning method in libremakepkg:

  1. copy the list of packages to the chroot (/etc/libretools.d/cleansystem
  2. uses comm to compare packages installed on the system and in "cleansystem"
  3. removes all packages not in "cleansystem".

I'm having problems with libremakepkg

Report an issue to the bug tracker. Use [libretools] at the beggining of the title for the issue.