summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 25f8ab085e3464941bc9cdd67a3ec4e5febfe61a (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# Maintainer: Brian Bidulock <bidulock@openss7.org>
# Contributor: S├ębastien Luttringer
pkgname=quagga-git
_pkgname=quagga
pkgver=1.2.4.r0.gddece197
pkgrel=1
pkgdesc='BGP/OSPF/ISIS/RIP/RIPNG routing daemon suite (FPM enabled) git version'
arch=('x86_64' 'i686')
url='http://www.quagga.net'
license=('GPL2')
provides=($_pkgname=${epoch:+$epoch:}${pkgver%%.r*}-${pkgrel})
conflicts=($_pkgname)
depends=('libcap' 'libnl' 'net-snmp' 'readline' 'ncurses' 'perl' 'c-ares')
makedepends=('git')
options=('!buildflags')
validpgpkeys=('C1B5C3ED3000F2BFCD66F3B76FE57CA8C1A4AEA6') # Quagga Release Signing Key
source=("$pkgname::git+https://github.com/Quagga/$_pkgname.git#tag=quagga-1.2.4"
        'quagga.sysusers'
        'quagga.tmpfiles'
        'babeld.service'
        'bgpd.service'
        'isisd.service'
        'ospf6d.service'
        'ospfd.service'
        'pimd.service'
        'ripd.service'
        'ripngd.service'
        'zebra.service')
sha512sums=('SKIP'
            '722ef24de4834ab80ebdace0de4aa50ea76d2d4ecc5c51092f1975fd08a9b187986058eeaa2242fe6f4a3967f08806cba8070f2e318bfc9193cb0e83b7464a43'
            '82938833f885985fdd3ecb2683e0b7dec853fbe1938f5778fcde0efb58dd329603f32b1e9ce53e6da8c1219c5ede74c0dbfbc98da150227cc6e1020a4e1ca556'
            'ed54cd975564709c2c17181883e0b72eca6f516034ca3761d4d117089884a3411438375dd5653db7e65357f7544c367c3ad11799b7e7a2875ba113d372e7dc63'
            '912215eaf757a2acb8fa55bac430805f98be0e9ed12b03a5eae71df8931bdf322d7ba26729bfc2d780de5399da1a43e9b5061ded0fbe1bfce8d8107fae9d4830'
            '9914897b89fb4c85eee86fdecc18497bc021e2343852d1b9d6148fdb1f1c0e5b2cd28c82626bf2b747af581eb859635aaa0f5e8147887d36c3070133de9668c0'
            'b13742656ef0071f4edb523a5d3a2b832960d463fc78a8f375484f5184284202e442156621c70655af02f00b8fecec720e441be60e35d07161de3610e53f998b'
            '4e5cc34d4534fb70bf6674244bffc7f789fc24450ab3614366f0a750450cdfa47aac09399d1a5c4e64faa98be46701f15b8db72897c34d1518e044d25a920837'
            '29cda79d9d4be2acf3fba5dcc4a692c4784b5b5674a6948138254b0ea54596891f26273f1a44307d8baccd23ed99754f96909f75132bd657459583f3f7ccc05d'
            'a630e11cf447ebf4a8a55849e61d0c75de60c79247fd80954085b39b22660e2ec34537f2f2d9ce15bfa0fc89bb2acd5e3f156f70dc63c9eb608fb2cee6b36ae3'
            '8e5608da659dd2da9b708dd1b140ba3c240679797f1a1ee82494db24996303448c664215bdeb2ce58ea801162b6918bddf72366df3546151cd930e6428a1f5d4'
            '68baa888e1c12706c28ee6a6176e9a37f0a05bd8b14e648746b987a03bacb1c801e246b9820cf59508290e9e5ba42954fe3aae3355dd325fcf54b25e119a6156')

pkgver() {
  cd $pkgname
  git describe --long --tags | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
}

prepare() {
  cd $pkgname
  # apply patch from the source array (should be a pacman feature)
  local filename
  for filename in "${source[@]}"; do
    if [[ "$filename" =~ \.patch$ ]]; then
      msg2 "Applying patch ${filename##*/}"
      patch -p1 -N -i "$srcdir/${filename##*/}"
    fi
  done
  :
  autoreconf -fiv
}

build() {
  cd $pkgname
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --sysconfdir=/etc/quagga \
    --localstatedir=/run/quagga \
    --enable-exampledir=/usr/share/doc/quagga/examples \
    --enable-vtysh \
    --enable-isis-topology \
    --enable-netlink \
    --enable-snmp \
    --enable-tcp-zebra \
    --enable-irdp \
    --enable-pcreposix \
    --enable-multipath=64 \
    --enable-user=quagga \
    --enable-group=quagga \
    --enable-configfile-mask=0640 \
    --enable-fpm \
    --enable-logfile-mask=0640
  make V=0
}

package() {
  # upstream install
  cd $pkgname
  make DESTDIR="$pkgdir" install

  # logrotate stuff
  install -D -m 644 redhat/$_pkgname.logrotate "$pkgdir/etc/logrotate.d/$_pkgname"
  sed -ri 's,/var/run/quagga,/run/quagga,g' "$pkgdir/etc/logrotate.d/$_pkgname"

  # systemd
  cd "$srcdir"
  install -d -m 755 "$pkgdir"/usr/lib/{systemd/system,tmpfiles.d,sysusers.d}
  for _d in zebra ripd ripngd bgpd ospfd ospf6d isisd babeld pimd; do
    install -D -m 644 $_d.service "$pkgdir/usr/lib/systemd/system/$_d.service"
  done
  install -D -m 644 $_pkgname.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/$_pkgname.conf"
  install -D -m 644 $_pkgname.sysusers "$pkgdir/usr/lib/sysusers.d/$_pkgname.conf"
}

# vim:set ts=2 sw=2 et: