summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4dbbf0171e4d3c1c9a59f197b31fb6fe17e667c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Maintainer: Matthew Barichello <matthewjbarichello@gmail.com>

_pkgname=sslh
pkgname=$_pkgname-systemd-git
pkgver=1.20.r37.g3822352
pkgrel=1
pkgdesc="Network port multiplexer. Allows sharing of HTTP, SSL, SSH, OpenVPN, tinc, XMPP, etc. on the same port"
arch=('i686' 'x86_64')
url='http://www.rutschle.net/tech/sslh.shtml'
license=('GPL2')
depends=('libcap' 'libconfig' 'libwrap' 'systemd')
#makedepends=('git' 'pcre-static')
makedepends=('git')
provides=($_pkgname)
conflicts=($_pkgname)
backup=('etc/sslh/sslh.cfg')
source=($pkgname::'git+https://github.com/matthewacon/sslh'
        'sslh.cfg'
        'sslh.sysusers'
        'sslh@.service'
        'sslh-select@.service')
md5sums=('SKIP'
         'd5405c7ca7e1813e4d49a473e5834640'
         'f39544277a30595d4b7476b3f87ebbcf'
         '59d76639059db542a1ee975cccf8762c'
         'df50f93f12c4d50dce1b2fa5ec21fe85')

pkgver() {
  cd $pkgname
  git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

#prepare() {
#  cd $pkgname
#  sed -i 's|^\(ExecStart.*\) $DAEMON_OPTS|\1 -F/etc/sslh/sslh.cfg|' sslh\@.service
#}

build() {
  cd $pkgname
  make all
  make systemd-sslh-generator
}

package() {
  # Default config
  install -Dm644 sslh.cfg "$pkgdir/etc/sslh/sslh.cfg"

  # Systemd
  install -Dm644 sslh.sysusers "$pkgdir/usr/lib/sysusers.d/sslh.conf"
  install -Dm644 sslh\@.service "$pkgdir/usr/lib/systemd/system/sslh\@.service"
  install -Dm644 sslh-select\@.service "$pkgdir/usr/lib/systemd/system/sslh-select\@.service"

  cd $pkgname
  install -Dm644 scripts/etc.sysconfig.sslh "$pkgdir/etc/conf.d/sslh"

  # Executables
  install -Dm755 sslh-fork "$pkgdir/usr/bin/sslh-fork"
  install -Dm755 sslh-select "$pkgdir/usr/bin/sslh-select"
  ln -s sslh-fork "$pkgdir/usr/bin/sslh"
  install -Dm755 systemd-sslh-generator "$pkgdir/usr/lib/systemd/system-generators/systemd-sslh-generator" 

  # Manpage
  install -Dm644 sslh.8.gz "$pkgdir/usr/share/man/man8/sslh.8.gz"

  # Examples
  install -Dm644 basic.cfg "$pkgdir/usr/share/doc/$_pkgname/basic.cfg"
  install -Dm644 example.cfg "$pkgdir/usr/share/doc/$_pkgname/example.cfg"
 }