updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / openvswitch-git / PKGBUILD
blob96da8b94e4e308361eccc921991f8038cddb8011
1 pkgname="openvswitch-git"
2 _pkgname="openvswitch"
3 pkgver=20120109
4 pkgrel=1
5 pkgdesc="A multilayer virtual switch"
6 arch=("i686" "x86_64")
7 url='http://openvswitch.org/'
8 license=('Apache')
9 depends=('dkms')
10 conflicts=('openvswitch')
11 install="$pkgname.install"
12 source=( dkms.conf openvswitch-git.init)
13 _gitroot="git://openvswitch.org/openvswitch"
14 _gitname="openvswitch"
16 build() {
17   cd "$srcdir"
18   msg "Connecting to GIT server...."
20   if [[ -d "$_gitname" ]]; then
21     cd "$_gitname" && git pull origin
22     msg "The local files are updated."
23   else
24     git clone "$_gitroot" "$_gitname"
25   fi
27   msg "GIT checkout done or server timeout"
28   msg "Starting build..."
30   rm -rf "$srcdir/$_gitname-build"
31   git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
32   cd "$srcdir/$_gitname-build"
34   autoreconf -v -i
35   patch -p0 -i "$startdir/configure-python2.patch"
36   ./configure --with-python=python2 --prefix=/usr --localstatedir=/var
38   make
41 package() {
42   cd "$srcdir/$_gitname-build"
44   make DESTDIR="$pkgdir" install
46   install -d "$pkgdir/usr/src" \
47     "$pkgdir/etc/rc.d" "$pkgdir/etc/$_pkgname" \
48     "$pkgdir/var/run/$_pkgname" "$pkgdir/usr/share/$_pkgname"
49   cp -a "$srcdir/$_gitname-build" "$pkgdir/usr/src/$_pkgname-$pkgver"
50   install -t "$pkgdir/usr/src/$_pkgname-$pkgver/" "$startdir/dkms.conf"
51   install -m 744 "$srcdir/$pkgname.init" "$pkgdir/etc/rc.d/$_pkgname"
52   install -t "$pkgdir/usr/share/$_pkgname/" "$srcdir/$_gitname-build/vswitchd/vswitch.ovsschema"
53   sed -e "s;@version@;$pkgver;g" -i $pkgdir/usr/src/$_pkgname-$pkgver/dkms.conf
55   # This line replaces references to $pkgdir with /usr/src/openvswitch
56   sed -e "s;$srcdir/;/usr/src/openvswitch/;g" -i $(grep -riIs "$srcdir/" $pkgdir | awk -F':' '{print $1}' | sort | uniq)
59 sha384sums=('ffddc01eb366a2aa2beab977b695cc40429c1d74f22a539f6d0be2a7c88d9909050cdad0ca5d6495af0bf517c6efd12d'
60             'bd156dd589c3797267607f19c4d0f26b164d816c70fd1ba473c1b144d87c261a66a02811334cf90f7ac0889afc4d26d9')
62 # vim:set ts=2 sw=2 et: