summaryrefslogtreecommitdiffstats
path: root/abs/core/heimdal/PKGBUILD
blob: 4c79af63b652f4ba22f30b76fa3cd031edf51e1d (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
# $Id: PKGBUILD 3738 2008-06-30 20:03:06Z andyrtr $
# Maintainer: Jan de Groot <jgc@archlinux.org>

#
### Attention: build it 2 times - it links against itself! ###
#   ^ better remove old pkg before ;)

pkgname=heimdal
pkgver=1.2
pkgrel=1
pkgdesc="Heimdal Kerberos V5 libraries"
arch=(i686 x86_64)
url="http://www.pdc.kth.se/heimdal/"
license=('custom')
depends=('db>=4.7' 'openssl' 'e2fsprogs')
options=('!libtool' '!emptydirs')
backup=(etc/krb5.conf)
source=(http://www.h5l.org/dist/src/heimdal-$pkgver.tar.gz \
	002_all_heimdal-no_libedit.patch \
	003_all_heimdal-fPIC.patch \
	004_all_heimdal-rxapps.patch \
	#006_all_heimdal-suid_fix.patch \
	heimdal-kdc.rc \
	kadmind.rc \
	kpasswd.rc)
md5sums=('8d6b690069acd2ae8ada1315174f52f9'
         '1199c4a4a38e9c2b2c0a99bd5781767a'
         '3d0262aa218e1611500de735d3581e28'
         '0fe81cb1e33b2a2e60edaf47dfdfe4de'
         #'30372b1581e4d49a76688e450fd42443'
         'e59650992b9541a30dfce727a194f6e0'
         '1f2f86a67bbfddb7af581d35fdca9627'
         'f8f1eca95b9d3f2b4ebf2417b71b81cf')

build() {
  [ -e /usr/lib/libasn1.so ] && echo "## remove old heimdal pkg first ##" && return 1

  cd ${srcdir}/heimdal-${pkgver}
  patch -Np0 -i ${srcdir}/002_all_heimdal-no_libedit.patch || return 1
  patch -Np0 -i ${srcdir}/003_all_heimdal-fPIC.patch || return 1
  patch -Np0 -i ${srcdir}/004_all_heimdal-rxapps.patch || return 1
#  patch -Np0 -i ${srcdir}/006_all_heimdal-suid_fix.patch || return 1
  
#  libtoolize -f -c || return 1
#  aclocal -I cf || return 1  
#  autoheader || return 1
#  automake -a || return 1
#  autoconf || return 1
#  libtoolize -f -c || return 1

#  autoreconf || return 1
#  libtoolize -f -c || return 1

  sed -i -e 's|var/heimdal|var/lib/heimdal|g' configure.in configure \
	doc/setup.texi doc/heimdal.info kadmin/kadmind.8 kdc/kdc.8 \
	lib/hdb/hdb.h lib/krb5/krb5.conf.5 lib/krb5/krb5.conf.cat5

  ./configure --prefix=/usr --enable-shared=yes --without-x \
	--sysconfdir=/etc  --mandir=/usr/man \
	--datadir=/var/lib/heimdal \
	--localstatedir=/var/lib/heimdal \
	--with-openssl=/usr \
	--with-readline-lib=/usr/lib \
	--with-readline-include=/usr/include/readline \
	--libexecdir=/usr/sbin --with-berkeley-db \
	--disable-krb4
	
  make || return 1
  make DESTDIR=${pkgdir} install || return 1

  for i in telnetd ftpd rshd; do
    mv ${pkgdir}/usr/man/man8/${i}.8 ${pkgdir}/usr/man/man8/k${i}.8
    mv ${pkgdir}/usr/sbin/${i} ${pkgdir}/usr/sbin/k${i}
  done
  
  for i in rcp rsh telnet ftp su login; do
    if [ -f ${pkgdir}/usr/man/man1/${i}.1 ]; then
      mv ${pkgdir}/usr/man/man1/${i}.1 ${pkgdir}/usr/man/man1/k${i}.1
    fi
    mv ${pkgdir}/usr/bin/${i} ${pkgdir}/usr/bin/k${i}
  done
  rm -rf ${pkgdir}/usr/man/cat{1,3,5,8}
  
  #Arch could be a KDC too
  mkdir -p ${pkgdir}/etc/rc.d
  install -m644 ${srcdir}/heimdal-${pkgver}/krb5.conf ${pkgdir}/etc
  for i in heimdal-kdc kadmind kpasswd; do
    install -m755 ${srcdir}/${i}.rc ${pkgdir}/etc/rc.d/${i}
  done

  #Remove some conflicts 
  rm ${pkgdir}/usr/man/man5/ftpusers.5*
  rm ${pkgdir}/usr/man/man5/login.access.5*
  # and some more
  rm ${pkgdir}/usr/bin/mk_cmds
  rm ${pkgdir}/usr/include/ss/ss.h
  rm ${pkgdir}/usr/lib/libss.a
  rm ${pkgdir}/usr/lib/libss.so

  # install the license
  install -D -m644 ${srcdir}/${pkgname}-${pkgver}/LICENSE \
  	${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}