apply go guidelines + fix #66662
This commit is contained in:
parent
17ad04f583
commit
ecb0bce1af
14
PKGBUILD
14
PKGBUILD
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
pkgname=traefik
|
pkgname=traefik
|
||||||
pkgver=2.2.1
|
pkgver=2.2.1
|
||||||
pkgrel=1
|
pkgrel=2
|
||||||
pkgdesc="Modern reverse proxy written in Go"
|
pkgdesc="Modern reverse proxy written in Go"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
url="https://containo.us/traefik/"
|
url="https://containo.us/traefik/"
|
||||||
@ -17,7 +17,7 @@ source=("${pkgname}-${pkgver}.tar.gz::https://github.com/containous/traefik/rele
|
|||||||
'traefik.sysusers')
|
'traefik.sysusers')
|
||||||
noextract=("${pkgname}-${pkgver}.tar.gz")
|
noextract=("${pkgname}-${pkgver}.tar.gz")
|
||||||
sha512sums=('f23a58632cbef5c3326b464f9c85f59f2d29ed799d392da544f66c40113e3f08b504c35867479603c697c4ee660401ae2ac4596288bcb9de348ddbe597dea45c'
|
sha512sums=('f23a58632cbef5c3326b464f9c85f59f2d29ed799d392da544f66c40113e3f08b504c35867479603c697c4ee660401ae2ac4596288bcb9de348ddbe597dea45c'
|
||||||
'474dc8274d160bf46a46edf8855378331521b108a767345fb8cb201f23576ceadbee81560d15cf98cac3a978eb24b49f951524da828ffda720797f7ab38bd49c'
|
'25ab1113bb69936c443fe49d5d3da7d39171fc82e8fa06f46ed4e2dfcaa89685d50ca50b58c32215852d79e5c8d4736a287c15b75420c78a853c51502cb2641a'
|
||||||
'5fecfed5df77bf28c2c976ebaebedb030904d41509e740821140a4889bda20327f416e78f8d19b0ee78c8bc422d1907ce05ef3562e4d3e36ddfbdbea5e860b2a')
|
'5fecfed5df77bf28c2c976ebaebedb030904d41509e740821140a4889bda20327f416e78f8d19b0ee78c8bc422d1907ce05ef3562e4d3e36ddfbdbea5e860b2a')
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
@ -26,10 +26,15 @@ prepare() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
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}"
|
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||||
go generate
|
go generate
|
||||||
cd cmd/traefik
|
cd cmd/traefik
|
||||||
go build -trimpath -ldflags "-extldflags ${LDFLAGS}"
|
go build
|
||||||
}
|
}
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
@ -43,4 +48,7 @@ package() {
|
|||||||
install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
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.service" "${pkgdir}/usr/lib/systemd/system/traefik.service"
|
||||||
install -Dm644 "${srcdir}/traefik.sysusers" "${pkgdir}/usr/lib/sysusers.d/traefik.conf"
|
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"
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ Description=Traefik
|
|||||||
Documentation=https://docs.traefik.io
|
Documentation=https://docs.traefik.io
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
AssertFileIsExecutable=/usr/bin/traefik
|
AssertFileIsExecutable=/usr/bin/traefik
|
||||||
AssertPathExists=/etc/traefik/traefik.toml
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
# Run traefik as its own user (create new user with: useradd -r -s /bin/false -U -M traefik)
|
# Run traefik as its own user (create new user with: useradd -r -s /bin/false -U -M traefik)
|
||||||
@ -12,7 +11,7 @@ AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|||||||
|
|
||||||
# configure service behavior
|
# configure service behavior
|
||||||
Type=notify
|
Type=notify
|
||||||
ExecStart=/usr/bin/traefik --configFile=/etc/traefik/traefik.toml
|
ExecStart=/usr/bin/traefik
|
||||||
Restart=always
|
Restart=always
|
||||||
WatchdogSec=1s
|
WatchdogSec=1s
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user