1 # Maintainer: Adam Russell <adamlr6+arch@gmail.com>
2 # Contributor: Marco A Rojas <marquicus at gmail.com>
3 # Contributor: Netanel Shine <netanel at archlinux.org.il >
4 # Contributor: ngoonee <ngoonee.talk@gmail.com>
7 # We use the 'A' to fake out pacman's version comparators. Samba chooses
8 # to append 'a','b',etc to their subsequent releases, which pamcan
9 # misconstrues as alpha, beta, etc. Bad samba!
12 pkgdesc="Alpha build of samba4."
13 arch=('i686' 'x86_64')
14 url="http://www.samba.org"
16 depends=('db>=4.7' 'popt' 'libcups' 'acl' 'libldap' 'libcap>=2.16' 'pam' 'fam' 'gnutls>=2.4.1' 'talloc' 'tdb')
17 makedepends=('python2' 'docbook-xsl')
19 source=(http://us1.samba.org/samba/ftp/samba4/samba-${_realver}.tar.gz)
20 md5sums=('66afcc4484e7e2b1962554aed3b9c2a7')
24 cd ${srcdir}/samba-${_realver}
26 # fix some gnutls errors
27 sed -i -e "s/gnutls_transport_set_lowat(tlss->tls_session, 0);//g" \
28 source4/lib/tls/tls_tstream.c
29 sed -i -e "s/gnutls_transport_set_lowat(tls->session, 0);//g" \
32 # change to use python2
34 IFS=$(echo -en "\n\b")
35 PYTHON_CALLERS="$(find ${srcdir}/samba-${_realver} -name '*.py')
36 $(find ${srcdir}/samba-${_realver} -name 'wscript*')
37 $(find ${srcdir}/samba-${_realver} -name 'configure.ac')
38 $(find ${srcdir}/samba-${_realver} -name 'upgrade_from_s3')
39 $(find ${srcdir}/samba-${_realver}/buildtools -type f)
40 $(find ${srcdir}/samba-${_realver}/source4/scripting -type f)"
41 sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
42 -e "s|python-config|python2-config|" \
43 -e "s|bin/python|bin/python2|" \
47 export PYTHON=/usr/bin/python2
49 cd ${srcdir}/samba-${_realver}/lib/tdb
50 ./configure --prefix=${_prefix}/samba
52 make DESTDIR="$pkgdir/" install
54 cd ${srcdir}/samba-${_realver}/lib/tevent
55 ./configure --prefix=${_prefix}/samba
57 make DESTDIR="$pkgdir/" install
59 cd ${srcdir}/samba-${_realver}/source4/lib/ldb
60 ./configure --prefix=${_prefix}/samba
62 make DESTDIR="$pkgdir/" install
64 cd ${srcdir}/samba-${_realver}
65 ./configure --prefix=${_prefix}
70 _pyver=`python2 -c 'import sys; print(sys.version[:3])'`
72 cd ${srcdir}/samba-${_realver}
73 make DESTDIR="$pkgdir/" install
75 install -d ${pkgdir}/etc/ld.so.conf.d
76 echo "${_prefix}/samba/lib" > ${pkgdir}/etc/ld.so.conf.d/samba4.conf
78 cd ${pkgdir}/${_prefix}/lib/
79 ln -s samba/libldb-samba4.so.0 libldb.so
80 ln -s samba/libldb-samba4.so.0 libldb.so.0
82 find ${pkgdir}/${_prefix}/lib/python${_pyver}/site-packages/ -name '*.py' | \
83 xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"
84 find ${pkgdir}/${_prefix}/bin ${pkgdir}/${_prefix}/sbin -type f -executable | \
85 xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"