summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0aa441214b29320f58b7cfa82633675d24d3030d (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
# Maintainer: solsTiCe d'Hiver <solstice.dhiver@gmail.com>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Manuel Hüsers <manuel.huesers@uni-ol.de>
# Contributor: vigo <vigo.the.unholy.carpathian@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: judd <jvinet@zeroflux.org>

pkgname=libwrap
pkgver=7.6.32
pkgrel=1
pkgdesc='Monitors and Controls incoming TCP connections'
arch=(x86_64)
url="http://ftp.porcupine.org/pub/security/index.html"
license=(BSD)
depends=( glibc libnsl)
provides=(tcp_wrappers-libs)
conflicts=(tcp_wrappers-libs)
source=(
  http://ftp.porcupine.org/pub/security/tcp_wrappers_${pkgver%.*}.tar.gz
  http://http.debian.net/debian/pool/main/t/tcp-wrappers/tcp-wrappers_${pkgver%.*}.q-${pkgver##*.}.debian.tar.xz
  tcp-wrappers-redhat-bug11881.patch
  hosts.allow
  hosts.deny
)

sha256sums=('9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d'
            'deec7966808407ddcb11581380c7253c348bd8780da6c9ee17fa9e7a729539fe'
            '2e527e54c1ea208de10a206c667f751e54651eb77c973271d213e3459d690403'
            'c1b19035a14ba552e8795ec3d7171e688592c9317f2eb14373320315435565e3'
            '969414f0a161e95fbe4cfe32df7c657a2793734d09416c00fa1116c5c0a9924f')
prepare() {
  cd tcp_wrappers_${pkgver%.*}
  find $srcdir -type f -exec chmod +w {} \;

  for patch in $(cat ../debian/patches/series); do
    patch -Np1 -i ../debian/patches/${patch}
  done
  patch -Np1 -i ../tcp-wrappers-redhat-bug11881.patch

  sed -i '/^config-check/ i\
cflags: config-check\
' Makefile
}

build() {
  cd tcp_wrappers_${pkgver%.*}

  # first run of make fails but second succeeds!???
  # if you read this, please help me find a better fix than to run twice make
  make \
    COPTS="$CFLAGS" \
    LDOPTS="$LDFLAGS" \
    REAL_DAEMON_DIR=/usr/bin \
    STYLE='-DPROCESS_OPTIONS' \
    linux || make \
    COPTS="$CFLAGS" \
    LDOPTS="$LDFLAGS" \
    REAL_DAEMON_DIR=/usr/bin \
    STYLE='-DPROCESS_OPTIONS' \
    linux
}

package() {

  cd tcp_wrappers_${pkgver%.*}

  install -Dm 644 tcpd.h -t "${pkgdir}"/usr/include/
  install -Dm 644 shared/libwrap.so.0.${pkgver%.*} -t "${pkgdir}"/usr/lib/
  ln -s libwrap.so.0.${pkgver%.*} "${pkgdir}"/usr/lib/libwrap.so.0
  ln -s libwrap.so.0 "${pkgdir}"/usr/lib/libwrap.so

  install -Dm 644 DISCLAIMER -t "${pkgdir}"/usr/share/licenses/libwrap/
}


# vim: ts=2 sw=2 et: