summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b763af0253582ef3d459e8284e291331bf64fc81 (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
# $Id: PKGBUILD 136733 2015-07-12 16:54:22Z bluewind $
# Maintainer: Florian Pritz <flo@xinu.at>
# Contributor: St├ęphane Gaudreault <stephane@archlinux.org>
# x32 Maintainer: Fantix King <fantix.king at gmail.com>

_pkgbasename=krb5
pkgname=libx32-$_pkgbasename
pkgver=1.13.2
pkgrel=2.1
pkgdesc="The Kerberos network authentication system (x32 ABI)"
arch=('x86_64')
url="http://web.mit.edu/kerberos/"
license=('custom')
depends=('libx32-e2fsprogs' 'libx32-libldap' 'libx32-keyutils' "$_pkgbasename")
makedepends=('perl' 'gcc-multilib-x32' 'bison')
source=("http://web.mit.edu/kerberos/dist/${_pkgbasename}/1.13/${_pkgbasename}-${pkgver}-signed.tar"
        krb5-config_LDFLAGS.patch
        krb5-1.13.1-x32.patch)
sha1sums=('ea824badb2d600745dcbbdfe58ccb84cba8509f0'
          'f125824ed37f31e6fd2fdb6a437be8ff1c3700ab'
          '928c1367fd48e055fa4ffcad01fd70d1beea22af')
options=('!emptydirs')

prepare() {
   tar zxvf ${_pkgbasename}-${pkgver}.tar.gz
   cd "${srcdir}/${_pkgbasename}-${pkgver}"

   # cf https://bugs.gentoo.org/show_bug.cgi?id=448778
   patch -p1 -i "${srcdir}"/krb5-config_LDFLAGS.patch

   # x32
   patch -p1 -i "${srcdir}"/krb5-1.13.1-x32.patch
}

build() {
   cd "${srcdir}/${_pkgbasename}-${pkgver}/src"

   export CC="gcc -mx32"
   export CXX="g++ -mx32"
   export PKG_CONFIG_PATH="/usr/libx32/pkgconfig"
   export PYTHON="/usr/bin/python2-x32"

   export CFLAGS+=" -fPIC -fno-strict-aliasing -fstack-protector-all"
   export CPPFLAGS+=" -I/usr/include/et"
   ./configure --prefix=/usr \
               --sysconfdir=/etc \
               --localstatedir=/var/lib \
               --libdir=/usr/libx32 \
               --enable-shared \
               --with-system-et \
               --with-system-ss \
               --disable-rpath \
               --without-tcl \
               --enable-dns-for-realm \
               --with-ldap \
               --without-system-verto

   make
}

#check() {
   # We can't do this in the build directory.

   # only works if the hostname is set properly/resolves to something. whatever...
   #cd "${srcdir}/${_pkgbasename}-${pkgver}"
   #make -C src check
#}

package() {
   cd "${srcdir}/${_pkgbasename}-${pkgver}/src"
   make DESTDIR="${pkgdir}" install

   rm -rf "${pkgdir}"/usr/{include,share,bin,sbin}
   mkdir -p "$pkgdir/usr/share/licenses"
   ln -s $_pkgbasename "$pkgdir/usr/share/licenses/$pkgname"
}