# Contributor: Marti Raudsepp <marti@juffo.org>
# Maintainer: fauno <fauno@parabola.nu>

pkgname=networkmanager-openswan
_pkgname=NetworkManager-openswan
pkgver=1.0.8
pkgrel=1
pkgdesc="NetworkManager plugin for IPSec VPN tunnels"
arch=('i686' 'x86_64')
url="http://ftp.acc.umu.se/pub/GNOME/sources/NetworkManager-openswan/"
license=('GPL')
depends=('openswan' 'gtk3' 'networkmanager' 'libgnome-keyring' 'libnm-gtk' 'libsecret')
makedepends=('intltool')
source=(http://ftp.acc.umu.se/pub/GNOME/sources/$_pkgname/1.0/$_pkgname-$pkgver.tar.xz)

prepare() {
  cd "$srcdir/$_pkgname-$pkgver"
#  sed -e "s/gnome_keyring_memory_free/gcr_secure_memory_free/g" \
#      -e "s/gnome_keyring_memory_strdup/gcr_secure_memory_strdup/g" \
#      -e "s/gnome_keyring_find_itemsv_sync/secret_service_search_sync/g" \
#      -i auth-dialog/main.c
}

build() {
  cd "$srcdir/$_pkgname-$pkgver"

  ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib/networkmanager

  sed -e "s/-Werror//g" -i auth-dialog/Makefile
  sed -e "s/-Werror//g" -i src/Makefile
  make
}

package() {
  cd "$srcdir/$_pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
}
sha512sums=('66a3948493dd51def3d0afd57ccbb2e38a2f1b3c37df85b47059a0c06457093d574aed4165710080b9cfcc914e4459a60d6946170199dd3f75482c6350e9ed6a')
