1 # Maintainer: Jim Pryor <profjim@jimpryor.net>
2 # Warning: The chicken-* egg PKGBUILDS in AUR are auto-generated.
3 # Please report errors you notice so that I can tweak the generation script.
5 pkgname=chicken-byte-blob-stream
8 pkgdesc="Chicken Scheme Egg: Lazy byte blobs"
10 url="http://chicken.wiki.br/eggref/4/byte-blob-stream"
12 depends=('chicken>=4.5.0' 'chicken-srfi-41' 'chicken-byte-blob' )
13 options=(docs !libtool !emptydirs)
14 install="chicken.install"
15 source=("$pkgname-$pkgver.chunked::http://chicken.kitten-technologies.co.uk/henrietta.cgi?name=byte-blob-stream&version=$pkgver"
16 "$pkgname-$pkgver.html::http://chicken.wiki.br/eggref/4/byte-blob-stream.html")
17 md5sums=('91581290ad73fc8e9fe28c4d501bdb96' '16660698d7b2d6182de0734f13961c6c')
20 # unchunk the blob that was downloaded from henrietta
22 mkdir -p "byte-blob-stream-$pkgver"
23 cat "$pkgname-$pkgver.chunked" | while :; do
24 while read -r bar ver endbar fname len; do
25 [[ -n "$ver" ]] && break
27 [[ "$endbar" = "|#" ]] || fname="$ver" len="$endbar"
28 [[ -z "$fname" ]] && break
29 fname="${fname:1:${#fname}-2}" # delete quotes around fname
30 if [[ "${fname: -1}" == / ]]; then
31 mkdir -p "byte-blob-stream-$pkgver/$fname"
32 elif [[ "$len" -eq 0 ]]; then
33 touch "byte-blob-stream-$pkgver/$fname"
35 dd iflag=fullblock of="byte-blob-stream-$pkgver/$fname" ibs="$len" count=1 2>/dev/null
40 cd "$srcdir/byte-blob-stream-$pkgver"
41 cp ../$pkgname-$pkgver.html byte-blob-stream.html
44 mkdir -p "$pkgdir/usr/lib/chicken/5" "$pkgdir/usr/share/chicken/byte-blob-stream"
46 chicken-install -p "$pkgdir/usr"
48 install -Dm644 "byte-blob-stream.html" "$pkgdir/usr/share/doc/$pkgname/byte-blob-stream.html"