Skip to content

Instantly share code, notes, and snippets.

@raspi
Last active January 10, 2020 18:50
Show Gist options
  • Save raspi/dd620005f77f5e8e41e818b4db916350 to your computer and use it in GitHub Desktop.
Save raspi/dd620005f77f5e8e41e818b4db916350 to your computer and use it in GitHub Desktop.
# Maintainer: Pekka Järvinen
# FreeBSD's pkg git (source) version
# Intended use is for building FreeBSD binary packages on Arch Linux with:
# % pkg create --format txz --root-dir $(PWD) --manifest manifest.sh
pkgname=freebsd-pkg-git
pkgver=1
pkgrel=1
pkgdesc="FreeBSD pkg from source (for building FreeBSD packages on Linux)"
url="https://github.com/freebsd/pkg"
license=('BSD')
arch=('any')
md5sums=('SKIP')
source=("gitsource::git+https://github.com/freebsd/pkg.git")
depends=('sudo')
makedepends=('autoconf' 'automake' 'binutils' 'fakeroot' 'gcc' 'make' 'git')
# FreeBSD devs use subversion so tags/branches are not reliable from git
# Use date and hash instead
pkgver() {
cd "gitsource"
printf "r%s.%s" "$(git --no-pager log -1 --format="%ad" --date=format:'%Y%m%d%H%M%S')" "$(git rev-parse --short HEAD)"
}
build() {
cd "gitsource"
./autogen.sh
./configure --prefix=/usr
make
}
package() {
cd "gitsource"
pushd src && sudo make etcdir=/etc sbindir=/usr/bin install && popd
pushd docs && sudo make install && popd
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment