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
| # Maintainer: Adam Russell <adamlr6+arch@gmail.com>
# Contributor: Marco A Rojas <marquicus at gmail.com>
# Contributor: Netanel Shine <netanel at archlinux.org.il >
# Contributor: ngoonee <ngoonee.talk@gmail.com>
# Contributor: Dhananjay Sathe <dhananjaysathe@gmail.com>
pkgname=samba4
pkgver=4.0.0A20
# We use the 'A' to fake out pacman's version comparators. Samba chooses
# to append 'a','b',etc to their subsequent releases, which pamcan
# misconstrues as alpha, beta, etc. Bad samba!
_realver=4.0.0alpha20
pkgrel=2
pkgdesc="Alpha build of samba4."
arch=('i686' 'x86_64')
url="http://www.samba.org"
license=('GPL3')
depends=('db>=4.7' 'popt' 'libcups' 'acl' 'libldap' 'libcap>=2.16' 'pam' 'fam' 'gnutls>=2.4.1' 'talloc' 'tdb')
makedepends=('python2' 'docbook-xsl' 'pkg-config')
options=(!makeflags)
source=(http://us1.samba.org/samba/ftp/samba4/samba-${_realver}.tar.gz)
md5sums=('26d59821133d81040589c15d9c0da92f')
_prefix="/opt/samba4"
build() {
cd ${srcdir}/samba-${_realver}
# fix some gnutls errors
sed -i -e "s/gnutls_transport_set_lowat(tlss->tls_session, 0);//g" \
source4/lib/tls/tls_tstream.c
sed -i -e "s/gnutls_transport_set_lowat(tls->session, 0);//g" \
source4/lib/tls/tls.c
# change to use python2
SAVEIFS=${IFS}
IFS=$(echo -en "\n\b")
PYTHON_CALLERS="$(find ${srcdir}/samba-${_realver} -name '*.py')
$(find ${srcdir}/samba-${_realver} -name 'wscript*')
$(find ${srcdir}/samba-${_realver} -name 'configure.ac')
$(find ${srcdir}/samba-${_realver} -name 'upgrade_from_s3')
$(find ${srcdir}/samba-${_realver}/buildtools -type f)
$(find ${srcdir}/samba-${_realver}/source4/scripting -type f)"
sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
-e "s|python-config|python2-config|" \
-e "s|bin/python|bin/python2|" \
${PYTHON_CALLERS}
IFS=${SAVEIFS}
export PYTHON=/usr/bin/python2
cd ${srcdir}/samba-${_realver}/lib/tdb
./configure --prefix=${_prefix}/samba
make
make DESTDIR="$pkgdir/" install
cd ${srcdir}/samba-${_realver}/lib/tevent
./configure --prefix=${_prefix}/samba
make
make DESTDIR="$pkgdir/" install
cd ${srcdir}/samba-${_realver}/lib/ldb
./configure --prefix=${_prefix}/samba --disable-tdb2
make
make DESTDIR="$pkgdir/" install
cd ${srcdir}/samba-${_realver}
./configure --prefix=${_prefix} --disable-tdb2
make
}
package() {
_pyver=`python2 -c 'import sys; print(sys.version[:3])'`
cd ${srcdir}/samba-${_realver}
make DESTDIR="$pkgdir/" install
install -d ${pkgdir}/etc/ld.so.conf.d
echo "${_prefix}/samba/lib" > ${pkgdir}/etc/ld.so.conf.d/samba4.conf
cd ${pkgdir}/${_prefix}/lib/
ln -s samba/libldb-samba4.so.0 libldb.so
ln -s samba/libldb-samba4.so.0 libldb.so.0
find ${pkgdir}/${_prefix}/lib/python${_pyver}/site-packages/ -name '*.py' | \
xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"
find ${pkgdir}/${_prefix}/bin ${pkgdir}/${_prefix}/sbin -type f -executable | \
xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"
# Make admin scripts look in the right place for the samba python module
for script in sbin/provision sbin/samba_spnupdate bin/samba-tool sbin/upgradeprovision sbin/samba_dnsupdate
do
sed -i "/^sys\.path\.insert/ a\
sys.path.insert(0, '${_prefix}/lib/python${_pyver}/site-packages')" \
${pkgdir}/${_prefix}/${script}
done
}
|