summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 82dff22fa5e26adfb4252b85739a6bb236023652 (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
# Maintainer: TH Campbell (dysphoria) <thcampbell (at) protonmail (dot) com>
# Contributor: Steven Allen <steven@stebalien.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Jamie Nguyen <jamie AT tomoyolinux.co.uk>

pkgname=tomoyo-tools
_file=70710
_basever=2.6.0
_timestamp=20200229
pkgver=${_basever}.${_timestamp}
pkgrel=1
pkgdesc='TOMOYO Linux 2.6.x userspace tools for Linux kernel 5.1 and later'
arch=('x86_64')
url='https://tomoyo.osdn.jp'
license=('GPL')
depends=('ncurses>=6.0')
optdepends=('linux: TOMOYO Linux enabled kernel')
conflicts=('linux-lts-tomoyo')

install=tomoyo-tools.install
source=(
        "https://jaist.dl.osdn.jp/tomoyo/${_file}/${pkgname}-${_basever}-${_timestamp}.tar.gz"{,.asc}
        'tomoyo-tools.install'
        'tomoyo-auditd.service'
       )
sha256sums=('a9a8300a96076de025904d5761348be49a3ba1baedfd9c032e9ebb51e7c925c9'
            'SKIP'
            'b5a1b4508f7c0430f73d0977ad496fae686679201c8779843b56c308d295ab21'
            'faf16938762902a73e50fdaa82d17c0fe13ef3c305508b55fa2cc64bacf998dd')
validpgpkeys=(
              '43C83369623D7AD3A96C2FC7425F128D0C64F52A' # Tetsuo Handa
             )

prepare() {
        cd "${srcdir}/${pkgname}"
        sed -i \
                -e 's|usr/sbin|usr/bin|g' \
                -e 's|sbin|usr/bin|g' \
                usr_lib_tomoyo/init_policy.c
}

build() {
        cd "${srcdir}/${pkgname}"
        make USRSBINDIR=/usr/bin SBINDIR=/usr/bin
}

package() {
        cd "${srcdir}/${pkgname}"

        _unitdir="$(pkg-config --variable=systemdsystemunitdir systemd)"

        make USRSBINDIR=/usr/bin SBINDIR=/usr/bin INSTALLDIR="${pkgdir}" install
        install -Dm644 "${srcdir}/tomoyo-auditd.service" \
                "${pkgdir}/${_unitdir}/tomoyo-auditd.service"
}