summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Druzenko <vvd@FreeBSD.org>2025-08-28 17:19:49 +0300
committerVladimir Druzenko <vvd@FreeBSD.org>2025-08-28 17:28:36 +0300
commit647f9b37f934eb4ba1fffd964a8cbf456916d837 (patch)
tree0196c937f2f0eda6a562cd77f4d694b806c939d4
parentdns/dns-blackhole: Add new port (diff)
sysutils/alloy: Improve port
- Remove git from BUILD_DEPENDS - build fine without it. - Remove go version 1.24 - it's default version in ports. - Remove GH_PROJECT=alloy - it's default value. - Parametrize "alloy" with "${PORTNAME}" in multiple places. - Replace "v${PORTVERSION}" with "${GH_TAGNAME}" - suits better. - Remove unnecessary ";" and "/" at end of commands. - Fix warnings from portclippy and portlint. PR: 289140 Approved by: Zach Leslie <zach.leslie@grafana.com> (maintainer)
-rw-r--r--sysutils/alloy/Makefile26
1 files changed, 11 insertions, 15 deletions
diff --git a/sysutils/alloy/Makefile b/sysutils/alloy/Makefile
index 66d21ba374ea..970e6662e812 100644
--- a/sysutils/alloy/Makefile
+++ b/sysutils/alloy/Makefile
@@ -1,7 +1,6 @@
PORTNAME= alloy
+DISTVERSIONPREFIX= v
DISTVERSION= 1.10.2
-DISTVERSIONPREFIX=v
-PORTREVISION= 0
CATEGORIES= sysutils
MAINTAINER= zach.leslie@grafana.com
@@ -10,34 +9,31 @@ WWW= https://github.com/grafana/alloy
LICENSE= MIT
-BUILD_DEPENDS= git:devel/git
-
-USES= go:1.24,modules
+USES= go:modules
USE_GITHUB= yes
GH_ACCOUNT= grafana
-GH_PROJECT= alloy
-USE_RC_SUBR= alloy
+USE_RC_SUBR= ${PORTNAME}
GO_MODULE= github.com/${GH_ACCOUNT}/${GH_PROJECT}
GO_PKGNAME= github.com/${GH_ACCOUNT}/${GH_PROJECT}
GO_TARGET= github.com/${GH_ACCOUNT}/${GH_PROJECT}
-GO_BUILDFLAGS= -ldflags='-X github.com/grafana/alloy/internal/build.Version=v${PORTVERSION}'
+GO_BUILDFLAGS= -ldflags='-X github.com/grafana/alloy/internal/build.Version=${GH_TAGNAME}'
post-fetch:
- @${ECHO_MSG} "===> Fetching ${GO_MODNAME}/syntax dependency";
+ @${ECHO_MSG} "===> Fetching ${GO_MODNAME}/syntax dependency"
(cd ${DISTDIR}/${DIST_SUBDIR}; [ -e syntax/go.mod ] || (\
- ${MKDIR} syntax/; \
- ${TAR} -xzf ${DISTNAME}${EXTRACT_SUFX} ${PORTNAME}-${PORTVERSION}/syntax/go.mod; \
- ${CP} ${PORTNAME}-${PORTVERSION}/syntax/go.mod syntax/go.mod))
+ ${MKDIR} syntax; \
+ ${TAR} -xzf ${DISTNAME}${EXTRACT_SUFX} ${PORTNAME}-${DISTVERSION}/syntax/go.mod; \
+ ${CP} ${PORTNAME}-${DISTVERSION}/syntax/go.mod syntax/go.mod))
post-extract:
- ${CP} -r ${WRKDIR}/${PORTNAME}-${PORTVERSION}/syntax ${GO_WRKSRC}/syntax;
+ ${CP} -r ${WRKDIR}/${PORTNAME}-${DISTVERSION}/syntax ${GO_WRKSRC}
do-install:
- ${INSTALL_PROGRAM} ${WRKDIR}/bin/alloy ${STAGEDIR}${PREFIX}/bin/alloy
+ ${INSTALL_PROGRAM} ${WRKDIR}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/example-config.alloy ${STAGEDIR}${PREFIX}/etc/alloy.flow.sample
- ${MKDIR} ${STAGEDIR}/var/alloy
+ ${MKDIR} ${STAGEDIR}/var/${PORTNAME}
.include <bsd.port.mk>