updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / samba4 / PKGBUILD
blobd4bdc0957154c33842cdb5203bd1f3e6a59b363b
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>
5 pkgname=samba4
6 pkgver=4.0.0A17
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!
10 _realver=4.0.0alpha17
11 pkgrel=2
12 pkgdesc="Alpha build of samba4."
13 arch=('i686' 'x86_64')
14 url="http://www.samba.org"
15 license=('GPL3')
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' 'pkg-config')
18 options=(!makeflags)
19 source=(http://us1.samba.org/samba/ftp/samba4/samba-${_realver}.tar.gz)    
20 md5sums=('307c03bbd03039b68333ebc9c83ccb1c')
21 _prefix="/opt/samba4"
23 build() {
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" \
30             source4/lib/tls/tls.c
32         # change to use python2
33         SAVEIFS=${IFS}
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|" \
44             ${PYTHON_CALLERS}
45         IFS=${SAVEIFS}
47         export PYTHON=/usr/bin/python2
49         cd ${srcdir}/samba-${_realver}/lib/tdb
50         ./configure --prefix=${_prefix}/samba
51         make
52         make DESTDIR="$pkgdir/" install
54         cd ${srcdir}/samba-${_realver}/lib/tevent
55         ./configure --prefix=${_prefix}/samba
56         make
57         make DESTDIR="$pkgdir/" install
59         cd ${srcdir}/samba-${_realver}/lib/ldb
60         ./configure --prefix=${_prefix}/samba
61         make
62         make DESTDIR="$pkgdir/" install
64         cd ${srcdir}/samba-${_realver}
65         ./configure --prefix=${_prefix}
66         make
69 package() {
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|"