traefik/PKGBUILD

56 lines
2.1 KiB
Bash
Raw Normal View History

2019-12-13 20:38:53 +00:00
# Maintainer : Christian Rebischke <chris.rebischke@archlinux.org>
pkgname=traefik
2023-05-06 19:36:02 +00:00
pkgver=2.9.10
2020-08-05 20:44:22 +00:00
pkgrel=1
2020-02-22 13:31:05 +00:00
pkgdesc="Modern reverse proxy written in Go"
2019-12-13 20:38:53 +00:00
arch=('x86_64')
2022-06-11 17:21:38 +00:00
url="https://github.com/traefik/traefik"
2019-12-13 20:38:53 +00:00
license=('MIT')
2020-09-02 16:12:26 +00:00
makedepends=('go' 'go-bindata-hashicorp' 'patch')
2019-12-13 20:38:53 +00:00
depends=('glibc')
backup=('etc/traefik/traefik.toml'
2020-06-27 16:11:59 +00:00
'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"
2020-06-27 16:11:59 +00:00
'traefik.service'
2020-10-17 12:39:34 +00:00
'traefik.sysusers')
noextract=("${pkgname}-${pkgver}.tar.gz")
2023-05-06 19:36:02 +00:00
sha512sums=('8c2230a611eaaed53d9e7df917d717178aabee8492dce5d363eb3f481a3df15f3ab38d59393eb06dd592a1cb95cbfdd90b9eb6231e22c156a1effa9dce3beba3'
2020-06-27 16:11:59 +00:00
'25ab1113bb69936c443fe49d5d3da7d39171fc82e8fa06f46ed4e2dfcaa89685d50ca50b58c32215852d79e5c8d4736a287c15b75420c78a853c51502cb2641a'
2020-10-17 12:39:34 +00:00
'5fecfed5df77bf28c2c976ebaebedb030904d41509e740821140a4889bda20327f416e78f8d19b0ee78c8bc422d1907ce05ef3562e4d3e36ddfbdbea5e860b2a')
2022-01-29 02:43:30 +00:00
options=('!lto')
prepare() {
mkdir "${srcdir}/${pkgname}-${pkgver}"
tar xfvz "${srcdir}/${pkgname}-${pkgver}.tar.gz" -C "${srcdir}/${pkgname}-${pkgver}"
}
2019-12-13 20:38:53 +00:00
build() {
2020-06-27 16:11:59 +00:00
export CGO_CPPFLAGS="${CPPFLAGS}"
2021-12-25 11:04:29 +00:00
export CGO_CFLAGS="${CFLAGS//lto/no-lto}"
export CGO_CXXFLAGS="${CXXFLAGS//lto/no-lto}"
2020-06-27 16:11:59 +00:00
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
cd "${srcdir}/${pkgname}-${pkgver}"
2019-12-13 20:38:53 +00:00
go generate
cd cmd/traefik
2021-02-06 19:31:42 +00:00
go build -ldflags="-linkmode=external"
2019-12-13 20:38:53 +00:00
}
2020-02-22 13:31:05 +00:00
check() {
cd "${srcdir}/${pkgname}-${pkgver}"
2020-02-22 13:31:05 +00:00
go test ./...
}
2019-12-13 20:38:53 +00:00
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
2019-12-13 20:38:53 +00:00
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"
2020-06-27 16:11:59 +00:00
# create empty acme.json file, otherwise the service file will fail
mkdir -p "${pkgdir}/etc/traefik/"
touch "${pkgdir}/etc/traefik/acme.json"
2019-12-13 20:38:53 +00:00
}