1 # Contributor: Alessio 'alexwizard' Sergi <sergi.alessio@gmail.com>
3 pkgname=python-snippets-bzr
4 _realname=python-snippets
7 pkgdesc="Lots of Python snippets that can be used to help understand how to code in Python."
9 url="https://launchpad.net/python-snippets"
13 install=($_realname.install)
15 conflicts=($_realname)
17 _bzrtrunk=https://code.launchpad.net/~jonobacon/python-snippets/trunk
24 msg "Connecting to the server...."
26 if [ ! -d $_bzrmod/.bzr ]; then
27 bzr co $_bzrtrunk $_bzrmod
32 msg "Bazzar checktou done or server timeout"
33 msg "Starting build package"
34 rm -rf $_bzrmod-build || return 1
35 mkdir -p $pkgdir/usr/share/ || return 1
36 cp -r $_bzrmod $_bzrmod-build || return 1
37 cd $_bzrmod-build || return 1
39 # Replace python with python2
40 for file in $(find $srcdir/$_bzrmod-build -name '*.py' -print); do
41 sed -i 's_^#!.*/usr/bin/python_#!/usr/bin/python2_' $file
42 sed -i 's_^#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file
47 cp -R $_bzrmod-build $pkgdir/usr/share/$_realname