diff options
author | Tilman Blumenbach | 2015-08-13 20:08:52 +0200 |
---|---|---|
committer | Tilman Blumenbach | 2015-08-13 20:08:52 +0200 |
commit | 0019030d9812e0c845e66716fa6f383aca9c53d2 (patch) | |
tree | b09e055e02d5e8036b318ea4e2ae57e7258c76f0 | |
parent | a8faca55f3d97564abc58e8a784bca8bb1d71150 (diff) | |
download | aur-0019030d9812e0c845e66716fa6f383aca9c53d2.tar.gz |
Download newest data file from author's website.
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 46 |
2 files changed, 37 insertions, 16 deletions
@@ -1,14 +1,13 @@ pkgbase = fortune-mod-bofh-excuses pkgdesc = BOFH excuses fortune cookie files - pkgver = 1.2 - pkgrel = 2 + pkgver = 20121125.190600 + pkgrel = 1 url = http://www.cs.wisc.edu/~ballard/bofh/ arch = any groups = fortune-mods license = Public domain + makedepends = curl depends = fortune-mod - source = http://ftp.debian.org/debian/pool/main/f/fortunes-bofh-excuses/fortunes-bofh-excuses_1.2.orig.tar.gz - md5sums = 54742a9f82d49721e3f64280e916c604 pkgname = fortune-mod-bofh-excuses @@ -1,32 +1,54 @@ +# Maintainer: Tblue <tilman (at) ax86 (dot) net> # Contributor: lanrat -# Contributor: Tblue <tilman (at) ax86 (dot) net> pkgname='fortune-mod-bofh-excuses' -pkgver=1.2 -pkgrel=2 +pkgver=20121125.190600 +pkgrel=1 pkgdesc='BOFH excuses fortune cookie files' arch=('any') url='http://www.cs.wisc.edu/~ballard/bofh/' depends=('fortune-mod') +makedepends=('curl') groups=('fortune-mods') license=('Public domain') -source=("http://ftp.debian.org/debian/pool/main/f/fortunes-bofh-excuses/fortunes-bofh-excuses_${pkgver}.orig.tar.gz") + +_dlurl='http://pages.cs.wisc.edu/~ballard/bofh/excuses' + +pkgver() +{ + # Make a HTTP HEAD request and use the Last-Modified header of the data file + # to generate the pkgver. Thanks to djmattyg007 for the idea (and the hint that + # the Debian package I used previously is somewhat outdated by now :-)! + + msg2 "Determining data file's time of last modification..." + local lastmod=$(curl -fL -I "${_dlurl}" | tac | sed -n '/^Last-modified:[[:space:]]*/I { s///p; q }') + + if [ -z "$lastmod" ]; then + error "Could not determine time of last modification, see above for possible errors." + fi + + date -ud "${lastmod}" '+%Y%m%d.%H%M%S' +} + +prepare() +{ + msg2 "Downloading data file..." + curl -fL -o "${srcdir}/bofh-excuses.raw" "${_dlurl}" +} build() { - cd "${srcdir}/fortunes-bofh-excuses-${pkgver}" + cd "${srcdir}" + awk '{ printf "BOFH excuse #%d:\n\n%s\n%%\n", FNR, $0 }' \ + bofh-excuses.raw > bofh-excuses strfile ./bofh-excuses } package() { - cd "${srcdir}/fortunes-bofh-excuses-${pkgver}" + cd "${srcdir}" - install -D -m644 "${srcdir}/fortunes-bofh-excuses-${pkgver}/bofh-excuses" \ - "${pkgdir}/usr/share/fortune/bofh-excuses" - install -D -m644 "${srcdir}/fortunes-bofh-excuses-${pkgver}/bofh-excuses.dat" \ - "${pkgdir}/usr/share/fortune/bofh-excuses.dat" + install -D -m644 bofh-excuses "${pkgdir}/usr/share/fortune/bofh-excuses" + install -D -m644 bofh-excuses.dat "${pkgdir}/usr/share/fortune/bofh-excuses.dat" } - -md5sums=('54742a9f82d49721e3f64280e916c604') |