This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

PKGBUILD Samba4 A16

By: a guest on Jun 24th, 2011  |  syntax: Bash  |  size: 3.30 KB  |  views: 171  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer : Marco A Rojas <marquicus at gmail.com>
  2. # Maintainer : Netanel Shine <netanel at archlinux.org.il >
  3. # Maintainer: ngoonee <ngoonee.talk@gmail.com>
  4. # Contributor: Adam Russell <adamlr6+arch@gmail.com>
  5. pkgname=samba4
  6. pkgver=4.0.0A16
  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.0alpha16
  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')
  18. options=(!makeflags)
  19. source=(http://us1.samba.org/samba/ftp/samba4/samba-${_realver}.tar.gz)    
  20. md5sums=('66afcc4484e7e2b1962554aed3b9c2a7')
  21. _prefix="/opt/samba4"
  22.  
  23. build() {
  24.   # change to use python2
  25.   cd ${srcdir}/samba-${_realver}
  26.   sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  27.          -e "s|python-config|python2-config|" \
  28.          -e "s|bin/python|bin/python2|" \
  29.     $(find ${srcdir}/samba-${_realver} -name '*.py')
  30.   sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  31.     $(find ${srcdir}/samba-${_realver} -name 'wscript*')
  32.   sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  33.          -e "s|python-config|python2-config|" \
  34.          -e "s|bin/python|bin/python2|" \
  35.     $(find ${srcdir}/samba-${_realver} -name 'configure.ac')
  36.   sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  37.     $(find ${srcdir}/samba-${_realver} -name 'upgrade_from_s3')
  38. #  sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  39. #    $(find ${srcdir}/samba-${_realver} -name 'provision')
  40.   sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  41.          -e "s|python-config|python2-config|" \
  42.     $(find ${srcdir}/samba-${_realver}/buildtools -type f)
  43.   sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  44.          -e "s|python-config|python2-config|" \
  45.     $(find ${srcdir}/samba-${_realver}/source4/scripting -type f)
  46.  
  47.   # patch for server_id
  48.   #patch -p0 < ${srcdir}/../samba4.patch
  49.  
  50.   export PYTHON=/usr/bin/python2
  51.         cd ${srcdir}/samba-${_realver}/lib/tdb
  52.         ./configure --prefix=${_prefix}/samba
  53.         make
  54.         make DESTDIR="$pkgdir/" install
  55.  
  56.         cd ${srcdir}/samba-${_realver}/lib/tevent
  57.         ./configure --prefix=${_prefix}/samba
  58.         make
  59.         make DESTDIR="$pkgdir/" install
  60.  
  61.         cd ${srcdir}/samba-${_realver}/source4/lib/ldb
  62.         ./configure --prefix=${_prefix}/samba
  63.         make
  64.         make DESTDIR="$pkgdir/" install
  65.  
  66.         cd ${srcdir}/samba-${_realver}
  67.         ./configure --prefix=${_prefix}
  68.         make
  69.  
  70. }
  71.  
  72. package() {
  73.         _pyver=`python2 -c 'import sys; print(sys.version[:3])'`
  74.  
  75.         cd ${srcdir}/samba-${_realver}
  76.         make DESTDIR="$pkgdir/" install
  77.  
  78.         install -d ${pkgdir}/etc/ld.so.conf.d
  79.         echo "${_prefix}/samba/lib" > ${pkgdir}/etc/ld.so.conf.d/samba4.conf
  80.  
  81.         cd ${pkgdir}/${_prefix}/lib/
  82.         ln -s samba/libldb-samba4.so.0 libldb.so
  83.         ln -s samba/libldb-samba4.so.0 libldb.so.0
  84.  
  85.         find ${pkgdir}/${_prefix}/lib/python${_pyver}/site-packages/ -name '*.py' | \
  86.                 xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"
  87.         find ${pkgdir}/${_prefix}/bin ${pkgdir}/${_prefix}/sbin -type f -executable | \
  88.                 xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"
  89. }
clone this paste RAW Paste Data