summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a0d83845aebf759cb0ddc3bd87f14d266cee6251 (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
# Contributor: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: Jaroslaw Swierczynski <swiergot@juvepoland.com>
# Contributor: eliott <eliott@cactuswax.net>

pkgname=tripwire-git
pkgver=r74.acf7bd3
pkgrel=1
pkgdesc="An intrusion detection system"
arch=('i686' 'x86_64')
url="http://sourceforge.net/projects/tripwire/"
license=('GPL')
depends=('openssl')
optdepends=('lynis')
makedepends=('git' 'automake')
provides=('tripwire')
#replaces=('tripwire')
backup=('etc/tripwire/twpol.txt' 'etc/tripwire/twcfg.txt')
install=$pkgname.install
#options=('!makeflags')
source=('tripwire-open-source::git://github.com/Tripwire/tripwire-open-source.git#branch=master' twpol.txt twcfg.txt)
sha256sums=('SKIP'
            '4da49a185fee570e0a7bdc7acaadc0d2bf7f4c488057e93e60b2a2819807cd9d'
            '3aaa567f7a0a4efce3ac127344a9b795c5494c9d011e27a7d454d632ba3d533d')

build() {
  cd ${srcdir}/tripwire-open-source

#build package
#  CFLAGS="$CFLAGS -fno-strict-aliasing" CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" \
    autoreconf --force --install
    ${srcdir}/tripwire-open-source/autogen.sh
    ./configure --sysconfdir=/etc/tripwire
  make -j4
}

pkgver() {
 cd ${srcdir}/tripwire-open-source
  ( set -o pipefail
    git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}
package () {
  cd ${srcdir}/tripwire-open-source

  # This package doesn't have a typical make install, so we do it by hand.
 
#create var/lib directories
  install -d ${pkgdir}/var/lib
  install -d -m700 ${pkgdir}/var/lib/tripwire
  install -d -m700 ${pkgdir}/var/lib/tripwire/report

#install binaries
  install -d ${pkgdir}/usr/bin
  install -m755 bin/siggen ${pkgdir}/usr/bin/
  install -m755 bin/tripwire ${pkgdir}/usr/bin/
  install -m755 bin/twadmin ${pkgdir}/usr/bin/
  install -m755 bin/twprint ${pkgdir}/usr/bin/

#copy install files for use by user after install, and fix a path
  install -d ${pkgdir}/usr/share/$pkgname
  install -m755 installer/install.sh ${pkgdir}/usr/share/$pkgname/
  install -m644 installer/install.cfg ${pkgdir}/usr/share/$pkgname/
  sed -i 's#./install/install.cfg#./install.cfg#' ${pkgdir}/usr/share/$pkgname/install.sh

#install man pages - FS#13766 fixed
  install -d ${pkgdir}/usr/share/man/{man4,man5,man8}
  install -m644 man/man4/*.4 ${pkgdir}/usr/share/man/man4/
  install -m644 man/man5/*.5 ${pkgdir}/usr/share/man/man5/
  install -m644 man/man8/*.8 ${pkgdir}/usr/share/man/man8/

#install configuration files
  mkdir ${pkgdir}/etc
  mkdir ${pkgdir}/etc/tripwire
  install -d ${pkgdir}/etc/$pkgname
  install -m644 ${srcdir}/twpol.txt ${pkgdir}/etc/tripwire/twpol.txt
  install -m644 ${srcdir}/twcfg.txt ${pkgdir}/etc/tripwire/twcfg.txt
}