summaryrefslogtreecommitdiff
path: root/pcr/pacman2pacman/PKGBUILD
blob: 24e3937f91770bfd24ac9ad6be9d55f78e2f13cf (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
# Maintainer: Joseph Graham <joseph@xylon.me.uk>

pkgname=pacman2pacman
pkgver=20170615.1
pkgdesc="A plugin for pacman to download packages by bittorrent and seed them back up"
url="https://wiki.parabolagnulinux.org/Pacman2pacman"
license=('GPL')

options=(emptydirs)
install=$pkgname.install

pkgrel=1
arch=(any)
depends=(transmission-cli)
source=("https://repo.parabola.nu/other/$pkgname/$pkgname-$pkgver.tar.gz")
md5sums=('3d9f562c4c759415f89f2475f097d453')

_gitver='commit=9d0566603bfc9de4efc325e0ea1d01263f9b64ab'
mksource=("$pkgname-$pkgver::git://git.parabola.nu/pacman2pacman.git/#$_gitver")
mkmd5sums=('SKIP')

package() {
  cd $pkgname-$pkgver

  mkdir -p "${pkgdir}/srv/pacman2pacman/torrents"

  mkdir -p "${pkgdir}/srv/pacman2pacman/dbcache"

  chown -R transmission "${pkgdir}/srv/pacman2pacman/"

  mkdir -p "${pkgdir}/usr/bin"

  cp pacman2pacman-get "${pkgdir}/usr/bin"

  chmod +x "${pkgdir}/usr/bin/pacman2pacman-get"

  for dir in translations/*
  do
      if [[ -d "${dir}" ]]
      then
          mkdir -p "${pkgdir}/usr/share/locale/${dir#*/}/LC_MESSAGES/"
          msgfmt -o "${pkgdir}/usr/share/locale/${dir#*/}/LC_MESSAGES/pacman2pacman-get.mo" "${dir}/pacman2pacman-get.po"
      fi
  done
}