From 22d770cda4318780111934a13e61a5f4bacdb69f Mon Sep 17 00:00:00 2001
From: bgme <i@bgme.me>
Date: Sat, 20 May 2023 01:18:52 +0800
Subject: [PATCH] fxi caddy-git

---
 repo/caddy-git/PKGBUILD | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/repo/caddy-git/PKGBUILD b/repo/caddy-git/PKGBUILD
index 6d3982c..13a33ab 100644
--- a/repo/caddy-git/PKGBUILD
+++ b/repo/caddy-git/PKGBUILD
@@ -8,6 +8,7 @@
 # Contributor: Akshay S Dinesh <asdofindia at gmail dot com>
 
 pkgname=caddy-git
+_pkgname=caddy
 pkgver=2.7.0.beta.1
 pkgrel=3
 pkgdesc='Fast web server with automatic HTTPS'
@@ -39,17 +40,17 @@ sha512sums=(
 )
 
 pkgver() {
-  cd "${pkgname}-git"
+  cd "${_pkgname}-git"
   git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-\([^-]*\)-\([^-]*\)$/.\1.\2/;s/-//'
 }
 
 prepare() {
-  pushd "${pkgname}-git"
+  pushd "${_pkgname}-git"
   _gitcommit=$(git rev-parse HEAD)
   popd
 
-  mkdir ${pkgname}
-  cd ${pkgname}
+  mkdir ${_pkgname}
+  cd ${_pkgname}
   cp ../main.go .
   go mod init caddy
   sed -i -e '$a replace github.com/caddyserver/forwardproxy => ../forwardproxy' go.mod
@@ -62,7 +63,7 @@ prepare() {
 }
 
 build() {
-  cd ${pkgname}
+  cd ${_pkgname}
   export CGO_LDFLAGS="${LDFLAGS}"
   export CGO_CPPFLAGS="${CPPFLAGS}"
   export CGO_CFLAGS="${CFLAGS}"
@@ -79,14 +80,14 @@ build() {
 }
 
 check() {
-  cd "${pkgname}"
+  cd "${_pkgname}"
   ./caddy version
   ./caddy build-info
   ./caddy list-modules
 }
 
 package() {
-  cd "${pkgname}"
+  cd "${_pkgname}"
   install -Dm 755 caddy -t "${pkgdir}/usr/bin"
 
   install -Dm 644 "${srcdir}/caddy-dist/init/caddy.service" "${srcdir}/caddy-dist/init/caddy-api.service" -t "${pkgdir}/usr/lib/systemd/system"