Skip to content

Instantly share code, notes, and snippets.

@markzz

markzz/PKGBUILD

Created May 11, 2020
Embed
What would you like to do?
PKGBUILD for apt
# Maintainer: Moses Narrow <moe_narrow@use.startmail.com>
# Contributor: Felix Golatofski <contact@xdfr.de>
# Contributor: Mark Weiman <mark.weiman@markzz.com>
# Contributor: Johannes Dewender arch at JonnyJD dot net
# Contributor: Tony Lambiris <tony@critialstack.com>
pkgbase=apt
pkgname=('apt' 'apt-docs')
pkgver=2.1.1
pkgrel=1
arch=('i686' 'x86_64')
url="http://packages.debian.org"
license=('GPL2')
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")
source=("git+https://salsa.debian.org/apt-team/apt.git#tag=${pkgver}"
"https://github.com/mquinson/po4a/releases/download/v0.57/po4a-0.57.tar.gz")
sha256sums=('SKIP'
'bb55ec2b419ec7eefb0f13752fb08bc2701e6689467b6e1994bb5d9ae711cd97')
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 \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_INSTALL_LIBDIR="lib" \
-DCMAKE_INSTALL_LIBEXECDIR="lib" \
-DDOCBOOK_XSL="/usr/share/xml/docbook/${DOCBOOK_XSL_VER}"
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:
@markzz

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
You can’t perform that action at this time.