55 lines
2.1 KiB
Bash
55 lines
2.1 KiB
Bash
# Maintainer : Christian Rebischke <chris.rebischke@archlinux.org>
|
|
|
|
pkgname=traefik
|
|
pkgver=2.4.13
|
|
pkgrel=1
|
|
pkgdesc="Modern reverse proxy written in Go"
|
|
arch=('x86_64')
|
|
url="https://containo.us/traefik/"
|
|
license=('MIT')
|
|
makedepends=('go' 'go-bindata-hashicorp' 'patch')
|
|
depends=('glibc')
|
|
backup=('etc/traefik/traefik.toml'
|
|
'etc/traefik/traefik.yaml'
|
|
'etc/traefik/traefik.yml')
|
|
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/containous/traefik/releases/download/v${pkgver}/traefik-v${pkgver}.src.tar.gz"
|
|
'traefik.service'
|
|
'traefik.sysusers')
|
|
noextract=("${pkgname}-${pkgver}.tar.gz")
|
|
sha512sums=('e703e752e82be8568f0efa1f0dfc1bc39a00b6bb301cb9205860776f6ba2d04dfae9d82819747039c58d8c6634a7ce0561d5d5c6c7dfd3b5417ae6b606d08197'
|
|
'25ab1113bb69936c443fe49d5d3da7d39171fc82e8fa06f46ed4e2dfcaa89685d50ca50b58c32215852d79e5c8d4736a287c15b75420c78a853c51502cb2641a'
|
|
'5fecfed5df77bf28c2c976ebaebedb030904d41509e740821140a4889bda20327f416e78f8d19b0ee78c8bc422d1907ce05ef3562e4d3e36ddfbdbea5e860b2a')
|
|
|
|
prepare() {
|
|
mkdir "${srcdir}/${pkgname}-${pkgver}"
|
|
tar xfvz "${srcdir}/${pkgname}-${pkgver}.tar.gz" -C "${srcdir}/${pkgname}-${pkgver}"
|
|
}
|
|
|
|
build() {
|
|
export CGO_CPPFLAGS="${CPPFLAGS}"
|
|
export CGO_CFLAGS="${CFLAGS}"
|
|
export CGO_CXXFLAGS="${CXXFLAGS}"
|
|
export CGO_LDFLAGS="${LDFLAGS}"
|
|
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
|
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
|
go generate
|
|
cd cmd/traefik
|
|
go build -ldflags="-linkmode=external"
|
|
}
|
|
|
|
check() {
|
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
|
go test ./...
|
|
}
|
|
|
|
package() {
|
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
|
install -Dm755 cmd/traefik/"${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
|
|
install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
|
install -Dm644 "${srcdir}/traefik.service" "${pkgdir}/usr/lib/systemd/system/traefik.service"
|
|
install -Dm644 "${srcdir}/traefik.sysusers" "${pkgdir}/usr/lib/sysusers.d/traefik.conf"
|
|
# create empty acme.json file, otherwise the service file will fail
|
|
mkdir -p "${pkgdir}/etc/traefik/"
|
|
touch "${pkgdir}/etc/traefik/acme.json"
|
|
}
|