blob: 09c55781d685730a8dbabfee73606403571b4e44 (
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
|
# Maintainer: Michael Hansen <zrax0111 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: Adam Russell <adamlr6+arch@gmail.com>
# Contributor: Dhananjay Sathe <dhananjaysathe@gmail.com>
pkgname=samba4
pkgver=4.0.0rc5
pkgrel=1
pkgdesc="Samba 4.0 Release Candidate"
arch=('i686' 'x86_64')
url="http://www.samba.org"
license=('GPL3')
depends=('db>=4.7' 'popt' 'libcups' 'acl' 'libldap' 'libcap>=2.16' 'pam' 'gamin' 'gnutls>=2.4.1' 'talloc' 'tdb')
makedepends=('python2' 'docbook-xsl' 'pkg-config')
options=(!makeflags)
source=(http://us1.samba.org/samba/ftp/rc/samba-${pkgver}.tar.gz
samba4.rc samba4.confd)
md5sums=('24d4b715a46c5f111b08b87975a27b1e'
'01deaef9cd21dff7586a7221d1a6d300'
'e1b2671dc1d1371a3628235a818debab')
_prefix="/opt/samba4"
build() {
cd ${srcdir}/samba-${pkgver}
# change to use python2
SAVEIFS=${IFS}
IFS=$(echo -en "\n\b")
PYTHON_CALLERS="$(find ${srcdir}/samba-${pkgver} -name '*.py')
$(find ${srcdir}/samba-${pkgver} -name 'wscript*')
$(find ${srcdir}/samba-${pkgver} -name 'configure.ac')
$(find ${srcdir}/samba-${pkgver} -name 'upgrade_from_s3')
$(find ${srcdir}/samba-${pkgver}/buildtools -type f)
$(find ${srcdir}/samba-${pkgver}/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-${pkgver}/lib/tdb
./configure --prefix=${_prefix}/samba
make
make DESTDIR="$pkgdir/" install
cd ${srcdir}/samba-${pkgver}/lib/tevent
./configure --prefix=${_prefix}/samba
make
make DESTDIR="$pkgdir/" install
cd ${srcdir}/samba-${pkgver}/lib/ldb
./configure --prefix=${_prefix}/samba
make
make DESTDIR="$pkgdir/" install
cd ${srcdir}/samba-${pkgver}
./configure --prefix=${_prefix}
make
}
package() {
_pyver=`python2 -c 'import sys; print(sys.version[:3])'`
cd ${srcdir}/samba-${pkgver}
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/samba_dnsupdate sbin/samba_kcc sbin/samba_spnupdate \
sbin/samba_upgradeprovision sbin/samba_upgradedns bin/samba-tool
do
sed -i "/^sys\.path\.insert/ a\
sys.path.insert(0, '${_prefix}/lib/python${_pyver}/site-packages')" \
${pkgdir}/${_prefix}/${script}
done
install -D -m755 ${srcdir}/samba4.rc ${pkgdir}/etc/rc.d/samba4
install -D -m644 ${srcdir}/samba4.confd ${pkgdir}/etc/conf.d/samba4
}
|