# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: George Rawlinson <george@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Georg Grabler (STiAT) <ggrabler@gmail.com>

pkgname=proxytunnel
pkgver=1.10.20210604
pkgrel=1
pkgdesc="Creates tunnels through HTTP(S) proxies for any TCP based protocol"
arch=('x86_64')
url="https://github.com/proxytunnel/proxytunnel"
license=('GPL')
depends=('glibc' 'openssl')
makedepends=('asciidoc' 'xmlto')
source=("$url/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
b2sums=('f8e70bd81a541bd3ecf0ed09fedc57396531aeec460eaff125046700d1a9c69f110590a5b81f650fdaba0c5938dd401a2937ee7347a4e33a3b89ac36bb915a7c')

prepare() {
  cd "$pkgname-$pkgver"
  # append -DOPENSSL11 to CFLAGS via SSL-specific OPTFLAGS: See ptstream.c
  sed -i '/^OPTFLAGS += -DUSE_SSL$/ s/$/ -DOPENSSL11/' Makefile
  # fixup modes otherwise strip fails
  sed -i 's|555|755|g' Makefile
}

build() {
  cd "$pkgname-$pkgver"
  CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
  make prefix=/usr
}

package() {
  cd "$pkgname-$pkgver"
  make prefix=/usr DESTDIR="$pkgdir" install
}

# vim: ts=2 sw=2 et:
