summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 32670d8f6d897f6d16f943b8567a44bfd9d6d2f5 (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
# Maintainer: GreyXor <greyxor@protonmail.com>

pkgname='polarproxy-bin'
pkgver=1.0.0
pkgrel=1
pkgdesc='Transparent TLS and SSL inspection proxy primarily designed for incident responders and malware researchers to intercept, decrypt, and re-encrypt TLS encrypted traffic from malware while saving it in a PCAP file.'
arch=('x86_64')
url='https://www.netresec.com/?page=PolarProxy'
license=('GPL2')
depends=('glibc' 'gcc-libs' 'zlib' 'lttng-ust2.12')
source=("$pkgname.tar.gz::https://www.netresec.com/?download=PolarProxy"
"polarproxy_icon.png"
"polarproxy.desktop"
)
b2sums=('9014142e0fb4ba96f1647f1e2208d03541a84fe8b69369fb17e8aa4adfa19d30d1784d42708c26dba28e38f812686e2f7cd202c067719fa1d3bc6e9c8e1b9898'
        'd16df3c5469813bd5600bc8d56302c31e2e45ff0b6be582a3b12b28c9cfe64ac687aff8c4fdf49f6d09081b09242dd5df9ca1e88b345ccabf08f744094f5a4ea'
        'e805d3513b453b5f7be9e02c06426956bcf63928bdb983efafff6c62a5801a37039428c87665f8c63db84df0d3e837773b5d646695f39d79959f9e2821afca92')

pkgver() {
	# Calculate the version from filename
	echo $(curl -sI https://www.netresec.com/\?download\=PolarProxy | grep -o -E 'filename=.*$' | sed -e 's/filename=//' | grep -oP '\d+-\d+-\d+' | sed 's/-/./g')
}

package() {
	install -d "${pkgdir}/opt/${pkgname%-bin}"
	install -d "${pkgdir}/usr/share/applications"
	install -d "${pkgdir}/usr/share/icons"
  install -d "${pkgdir}/etc/systemd/system/"
  install -dm755 "${pkgdir}"/usr/bin/

	install -m644 "polarproxy_icon.png" "${pkgdir}/usr/share/icons/${pkgname%-bin}.png"
	install -m644 "polarproxy.desktop" "${pkgdir}/usr/share/applications"
  ln -s /opt/${pkgname%-bin}/PolarProxy "${pkgdir}"/usr/bin/polarproxy


	install -m644 "${srcdir}/PolarProxy.service" "${pkgdir}/etc/systemd/system/"
  cp -r "${srcdir}/"* "${pkgdir}/opt/${pkgname%-bin}"
  chmod +x "${pkgdir}/opt/${pkgname%-bin}"/PolarProxy

  rm -rf "${pkgdir}/opt/${pkgname%-bin}"/polarproxy-bin.tar.gz
  rm -rf "${pkgdir}/opt/${pkgname%-bin}"/polarproxy.desktop
  rm -rf "${pkgdir}/opt/${pkgname%-bin}"/polarproxy_icon.png
}