From 947a049195183934ba5dffc131f9512fe253f4db Mon Sep 17 00:00:00 2001 From: root Date: Wed, 5 Dec 2012 02:18:51 -0800 Subject: Wed Dec 5 02:17:39 PST 2012 --- pcr/samba4/PKGBUILD | 93 +++++++++++++++++++++++++++++++++++++++++++++++++ pcr/samba4/samba4.confd | 5 +++ pcr/samba4/samba4.rc | 50 ++++++++++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 pcr/samba4/PKGBUILD create mode 100644 pcr/samba4/samba4.confd create mode 100644 pcr/samba4/samba4.rc (limited to 'pcr/samba4') diff --git a/pcr/samba4/PKGBUILD b/pcr/samba4/PKGBUILD new file mode 100644 index 000000000..09c55781d --- /dev/null +++ b/pcr/samba4/PKGBUILD @@ -0,0 +1,93 @@ +# Maintainer: Michael Hansen +# Contributor: Marco A Rojas +# Contributor: Netanel Shine +# Contributor: ngoonee +# Contributor: Adam Russell +# Contributor: Dhananjay Sathe +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 +} diff --git a/pcr/samba4/samba4.confd b/pcr/samba4/samba4.confd new file mode 100644 index 000000000..3c29c49cf --- /dev/null +++ b/pcr/samba4/samba4.confd @@ -0,0 +1,5 @@ +# +# Additional parameters to be passed to Samba4 +# + +SAMBA4_ARGS="" diff --git a/pcr/samba4/samba4.rc b/pcr/samba4/samba4.rc new file mode 100644 index 000000000..73d09fe30 --- /dev/null +++ b/pcr/samba4/samba4.rc @@ -0,0 +1,50 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +[ -f /etc/conf.d/samba4 ] && . /etc/conf.d/samba4 + +function call_samba4() { + /opt/samba4/sbin/samba -D $SAMBA4_ARGS +} + +case "$1" in + start) + stat_busy "Starting Samba4 Server" + if [ ! -x /opt/samba4/var ] ; then + install -m755 -d /opt/samba4/var + fi + if [ ! -x /opt/samba4/var/run ] ; then + install -m755 -d /opt/samba4/var/run + fi + PID=`pidof -o %PPID /opt/samba4/sbin/samba` + [ -z "$PID" ] && call_samba4 + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon samba4 + stat_done + fi + ;; + stop) + stat_busy "Stopping Samba4 Server" + PID=`pidof -o %PPID /opt/samba4/sbin/samba` + [ -z "$PID" ] || kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm /opt/samba4/var/run/samba.pid &> /dev/null + rm_daemon samba4 + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 -- cgit v1.2.3-54-g00ecf