Skip to content

Instantly share code, notes, and snippets.



Created May 11, 2020
What would you like to do?
PKGBUILD for apt
# Maintainer: Moses Narrow <>
# Contributor: Felix Golatofski <>
# Contributor: Mark Weiman <>
# Contributor: Johannes Dewender arch at JonnyJD dot net
# Contributor: Tony Lambiris <>
pkgname=('apt' 'apt-docs')
arch=('i686' 'x86_64')
makedepends=('cmake' 'dpkg' 'docbook-xsl' 'doxygen' 'git' 'gtest' 'w3m' 'triehash'
'perl-text-wrapi18n' 'perl-locale-gettext' 'perl-yaml-tiny'
'perl-term-readkey' 'perl-sgmls' 'perl-module-build' 'perl-unicode-linebreak')
provides=('libapt-inst' 'libapt-pkg' 'libapt-pkg-dev' "apt-utils")
build() {
# arch linux's po4a is too new to build apt, so build an older version
# will likely be good to use system po4a when it's updated in sid
msg2 "Building po4a 0.57..."
cd "$srcdir/po4a-0.57"
perl Build.PL installdirs=vendor create_packlist=0
LC_ALL=en_US.UTF-8 perl Build
alias po4a="$srcdir/po4a-0.57/po4a"
msg2 "Building apt..."
cd "$srcdir/$pkgname"
# docbook xsl is stored with the version on Arch
DOCBOOK_XSL_VER=`ls -d /usr/share/xml/docbook/xsl-stylesheets-* | xargs basename`
cmake -B build \
sed -i -e "s|stylesheet/docbook-xsl|$DOCBOOK_XSL_VER=t|" build/doc/*.xsl
sed -i -e "s|stylesheet/nwalsh|$DOCBOOK_XSL_VER=|" build/doc/*.xsl
make -C build all
package_apt() {
depends=('gnupg' 'curl' 'xz')
pkgdesc="Command-line package manager used on Debian-based systems"
cd "$srcdir/$pkgbase"
make -C build DESTDIR="${pkgdir}" install
rm -rf "${pkgdir}/usr/share/docs"
package_apt-docs() {
pkgdesc="Documentation for apt"
cd "$srcdir/$pkgbase"
make -C build DESTDIR="${pkgdir}" install
rm -rf "${pkgdir}"/etc
rm -rf "${pkgdir}"/var
rm -rf "${pkgdir}"/usr/{bin,include,lib}
rm -rf "${pkgdir}"/usr/share/{bash-completion,locale,man}
# vim:set ts=2 sw=2 et:

This comment has been minimized.

Copy link
Owner Author

@markzz markzz commented May 11, 2020

Just a note, I will fix this later, but since this doesn't build in a clean chroot because of the alias, it's likely another sed line needs to be introduced so that the correct po4a is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment