summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d6684a8361d90ea62a5943efe8ca252de57a62b3 (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
58
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=ufw-git
pkgver=r1862.g97af0c9
pkgrel=1
pkgdesc="Uncomplicated firewall"
arch=('any')
url="https://launchpad.net/ufw"
license=('GPL3')
depends=('python' 'iptables')
makedepends=('git')
provides=('ufw')
conflicts=('ufw')
backup=('etc/default/ufw'
        'etc/ufw/after.rules'
        'etc/ufw/after6.rules'
        'etc/ufw/before.rules'
        'etc/ufw/before6.rules'
        'etc/ufw/sysctl.conf'
        'etc/ufw/ufw.conf'
        'etc/ufw/user.rules'
        'etc/ufw/user.rules'
        'etc/ufw/user6.rules')
source=("git+https://git.launchpad.net/ufw"
        "ufw.service::https://raw.githubusercontent.com/archlinux/svntogit-community/packages/ufw/trunk/service")
sha256sums=('SKIP'
            'SKIP')


prepare() {
  cd "ufw"

  # FS#28769 - move from /lib to /usr/lib
  sed -i -e 's|/lib|/usr/lib|' \
         -e 's|sbin|bin|g' "setup.py"

  # FS#35458, FS#54110 - correct iptables location
  sed -i -e 's|sbin|bin|g' "setup.py"
  sed -i -e 's|sbin|bin|g' "src/util.py"
}

pkgver() {
  cd "ufw"

  _rev=$(git rev-list --count --all)
  _hash=$(git rev-parse --short HEAD)
  printf "r%s.g%s" "$_rev" "$_hash"
}

package() {
  cd "ufw"

  python "setup.py" install \
    --optimize 1 \
    --root "$pkgdir"

  install -Dm644 "$srcdir/ufw.service" -t "$pkgdir/usr/lib/systemd/system"
}