# $Id: PKGBUILD 139606 2015-09-08 13:58:08Z tredaelli $
# Maintainer: Timothy Redaelli <timothy.redaelli@gmail.com>
# Contributor: Simon Perry <aur [at] sanxion [dot] net>
# Contributor: Bartlomiej Piotrowski <nospam@bpiotrowski.pl>
# Contributor: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: Jason Pierce <`echo 'moc tod liamg ta nosaj tod ecreip' | rev`>
# Contributor: Jeremy Cowgar <jeremy@cowgar.com>
# Contributor: Simon Perry <aur [at] sanxion [dot] net>

pkgname=dropbear
pkgver=2015.68
pkgrel=1
pkgdesc="Lightweight replacement for sshd"
arch=('i686' 'x86_64')
url="http://matt.ucc.asn.au/dropbear/dropbear.html"
license=('MIT')
depends=('zlib')
source=(http://matt.ucc.asn.au/$pkgname/releases/$pkgname-$pkgver.tar.bz2
        $pkgname.service)
sha256sums=('55ea7c1e904ffe4b1cdbe1addca8291a2533d7d285fd22ac33608e9502a62446'
            '1920dc2d9a1dd86b3137ae4348196f9b95142d6eee484ee536bc7dfed7f0def0')

prepare() {
  sed -i 's|usr/libexec/sftp|usr/lib/ssh/sftp|' $pkgname-$pkgver/options.h
}

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr --bindir=/usr/bin --sbindir=/usr/bin
  make
}

package() {
  cd $pkgname-$pkgver

  make install DESTDIR="${pkgdir}/"

  # Configuration files
  install -d "${pkgdir}/etc/$pkgname"
  install -D -m644 "${srcdir}/$pkgname.service" "${pkgdir}/usr/lib/systemd/system/$pkgname.service"

  # License file
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
}

