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

Untitled

By: a guest on Aug 10th, 2011  |  syntax: None  |  size: 3.08 KB  |  views: 201  |  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. # We use the 'A' to fake out pacman's version comparators.  Samba chooses
  2. # to append 'a','b',etc to their subsequent releases, which pamcan
  3. # misconstrues as alpha, beta, etc.  Bad samba!
  4. _realver=4.0.0alpha16
  5. pkgrel=2
  6. pkgdesc="Alpha build of samba4."
  7. arch=('i686' 'x86_64')
  8. url="http://www.samba.org"
  9. license=('GPL3')
  10. depends=('db>=4.7' 'popt' 'libcups' 'acl' 'libldap' 'libcap>=2.16' 'pam' 'fam' 'gnutls>=2.4.1' 'talloc' 'tdb')
  11. makedepends=('python2' 'docbook-xsl')
  12. conflicts=('ldb')
  13. options=(!makeflags)
  14. source=(http://us1.samba.org/samba/ftp/samba4/samba-${_realver}.tar.gz)    
  15. md5sums=('66afcc4484e7e2b1962554aed3b9c2a7')
  16. _prefix="/opt/samba4"
  17.  
  18. build() {
  19.   # change to use python2
  20.   cd ${srcdir}/samba-${_realver}
  21.   sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  22.          -e "s|python-config|python2-config|" \
  23.          -e "s|bin/python|bin/python2|" \
  24.     $(find ${srcdir}/samba-${_realver} -name '*.py')
  25.   sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  26.     $(find ${srcdir}/samba-${_realver} -name 'wscript*')
  27.   sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  28.          -e "s|python-config|python2-config|" \
  29.          -e "s|bin/python|bin/python2|" \
  30.     $(find ${srcdir}/samba-${_realver} -name 'configure.ac')
  31.   sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  32.     $(find ${srcdir}/samba-${_realver} -name 'upgrade_from_s3')
  33. #  sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  34. #    $(find ${srcdir}/samba-${_realver} -name 'provision')
  35.   sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  36.          -e "s|python-config|python2-config|" \
  37.     $(find ${srcdir}/samba-${_realver}/buildtools -type f)
  38.   sed -i -e "s|/usr/bin/env python$|/usr/bin/env python2|" \
  39.          -e "s|python-config|python2-config|" \
  40.     $(find ${srcdir}/samba-${_realver}/source4/scripting -type f)
  41.  
  42.   # patch for server_id
  43.   #patch -p0 < ${srcdir}/../samba4.patch
  44.  
  45.   export PYTHON=/usr/bin/python2
  46.         cd ${srcdir}/samba-${_realver}/lib/tdb
  47.         ./configure --prefix=${_prefix}/samba
  48.         make
  49.         make DESTDIR="$pkgdir/" install
  50.  
  51.         cd ${srcdir}/samba-${_realver}/lib/tevent
  52.         ./configure --prefix=${_prefix}/samba
  53.         make
  54.         make DESTDIR="$pkgdir/" install
  55.  
  56.         cd ${srcdir}/samba-${_realver}/source4/lib/ldb
  57.         ./configure --prefix=${_prefix}/samba
  58.         make
  59.         make DESTDIR="$pkgdir/" install
  60.  
  61.         cd ${srcdir}/samba-${_realver}
  62.         ./configure --prefix=${_prefix}
  63.         make
  64.  
  65. }
  66.  
  67. package() {
  68.         _pyver=`python2 -c 'import sys; print(sys.version[:3])'`
  69.  
  70.         cd ${srcdir}/samba-${_realver}
  71.         make DESTDIR="$pkgdir/" install
  72.  
  73.         install -d ${pkgdir}/etc/ld.so.conf.d
  74.         echo "${_prefix}/samba/lib" > ${pkgdir}/etc/ld.so.conf.d/samba4.conf
  75.  
  76.         cd ${pkgdir}/${_prefix}/lib/
  77.         ln -s samba/libldb-samba4.so.0 libldb.so
  78.         ln -s samba/libldb-samba4.so.0 libldb.so.0
  79.  
  80.         find ${pkgdir}/${_prefix}/lib/python${_pyver}/site-packages/ -name '*.py' | \
  81.                 xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"
  82.         find ${pkgdir}/${_prefix}/bin ${pkgdir}/${_prefix}/sbin -type f -executable | \
  83.                 xargs sed -i "s|#!/usr/bin/env python$|#!/usr/bin/env python2|"
  84. }
clone this paste RAW Paste Data