summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ceaac47c7b0a0f0837657db3aca43d30527a224f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Maintainer: GI Jack <GI_Jack@hackermail.com>

# This is a packaged plugin for i2p. It assumes you are using the packaging of
# i2p as used with the arch i2p package in AUR. This package is to keep all
# software maintained by the system package manager, and to facilitate
# redistribution of botes as an arch package

_pluginame=i2pbote
pkgname=i2p-plugin-${_pluginame}
pkgver=0.4.8
pkgrel=3
pkgdesc="A distributed email client for I2P"
arch=('any')
url="http://bote.i2p/"
license=('GPLv3')
groups=('i2p-plugins')
depends=('i2p')
makedepends=('unzip' 'java-runtime-common')
provides=('i2pbotes')
# get this from http://bote.i2p/i2pbote.su3
source=("http://bote.i2p/i2pbote.su3")
noextract=("http://bote.i2p/i2pbote.su3")
install="${_pluginame}.install"
sha256sums=('64160287215e39b2a28ef37697f4c8bd8e1de872b0a46ef27e71a20409d21ef5')

_unpack_dir() {
  # use this to unpack the .war/.jar files. I2P does this automaticly on install
  # but it will not work otherwise
  local indir="$@"
  for file in $indir/*.pack;do
    unpack200 "$file" "${file%.pack}"
    rm "$file"
  done
}

prepare() {
  cd "${srcdir}"

  local outfile="${_pluginame}.zip"
  local infile="${_pluginame}.su3"

  #yeah, this is a regular zip file, but with some wierd shit added as a header.
  # nooo, they couldn't just use an index file like normal people.
  local -i headlength=70
  dd if="${infile}" bs=${headlength} skip=1 of="${outfile}"
  unzip -d i2p "$outfile"
}

package() {
  local base_dir="${pkgdir}/opt/i2p/.i2p/plugins/"
  cd "${srcdir}"
  mkdir -p "${base_dir}"
  cp -Ra "i2p" "${base_dir}/${_pluginame}"
  _unpack_dir "${base_dir}/${_pluginame}/lib"
  _unpack_dir "${base_dir}/${_pluginame}/console/webapps"
}