pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

jigasi: build the package in offline mode



Module Name:	pkgsrc-wip
Committed By:	Pierre Pronchery <khorben%defora.org@localhost>
Pushed By:	khorben
Date:		Tue Jan 3 14:34:32 2023 +0100
Changeset:	9db7a6d3afb825aa71d1ff90dc460148c73c6fdb

Modified Files:
	jigasi/Makefile
	jigasi/PLIST
	jigasi/distinfo

Log Message:
jigasi: build the package in offline mode

While there:

* register the package version with maven when building
* add a rule to generate the dependencies archive
* include a couple more helper scripts

This paves the way for jigasi to be included in pkgsrc proper.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=9db7a6d3afb825aa71d1ff90dc460148c73c6fdb

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 jigasi/Makefile | 78 ++++++++++++++++++++++++++++++++++++---------------------
 jigasi/PLIST    |  3 +++
 jigasi/distinfo |  9 ++++---
 3 files changed, 59 insertions(+), 31 deletions(-)

diffs:
diff --git a/jigasi/Makefile b/jigasi/Makefile
index 3949d602a8..bd215eed9b 100644
--- a/jigasi/Makefile
+++ b/jigasi/Makefile
@@ -12,41 +12,57 @@ HOMEPAGE=	https://github.com/jitsi/jigasi/
 COMMENT=	Allows regular SIP clients to join Jitsi Meet conferences
 LICENSE=	apache-2.0
 
-USE_TOOLS+=	bash
-USE_TOOLS+=	pax:run
-USE_JAVA2=	8
+DIST_SUBDIR=	${GITHUB_PROJECT}
+DISTFILES=	${DEFAULT_DISTFILES}
+DISTFILES+=	jigasi-java-deps-${PKGVERSION_NOREV}.tar.gz
+SITES.jigasi-java-deps-${PKGVERSION_NOREV}.tar.gz= \
+		ftp://ftp.NetBSD.org/pub/NetBSD/misc/khorben/
 
-REPLACE_BASH=	jigasi.sh
+USE_TOOLS+=	bash:run pax:build
+
+USE_JAVA2=	8
 
 TOOL_DEPENDS+=	apache-maven-[0-9]*:../../devel/apache-maven
 
-MAVEN_FLAGS+=	-Djavax.net.ssl.trustStore=${WRKDIR}/keystore
-MAVEN_FLAGS+=	-Djavax.net.ssl.trustStorePassword=password
+MAVEN_FLAGS+=	-Duser.home=${FAKEHOMEDIR}
+MAVEN_FLAGS+=	-Dmaven.repo.local=${WRKDIR}/deps
+MAVEN_FLAGS+=	--offline
+MAVEN_FLAGS+=	-DskipTests
+MVN=		mvn ${MAVEN_FLAGS}
+
+REPLACE_BASH=	jigasi.sh
+REPLACE_BASH+=	script/collect-dump-logs.sh
+REPLACE_BASH+=	script/graceful_shutdown.sh
+
+EGDIR=			share/examples/${GITHUB_PROJECT}
+PKG_SYSCONFSUBDIR=	jitsi/${GITHUB_PROJECT}
+CONF_FILES=		${EGDIR}/callstats-java-sdk.properties \
+			${PKG_SYSCONFDIR}/callstats-java-sdk.properties
+CONF_FILES+=		${EGDIR}/log4j2.xml ${PKG_SYSCONFDIR}/log4j2.xml
+CONF_FILES+=		${EGDIR}/logging.properties \
+			${PKG_SYSCONFDIR}/logging.properties
+CONF_FILES+=		${EGDIR}/sip-communicator.properties \
+			${PKG_SYSCONFDIR}/sip-communicator.properties
 
 SUBST_CLASSES+=		java
 SUBST_STAGE.java=	post-configure
 SUBST_FILES.java=	jigasi.sh
 SUBST_SED.java=		-e 's,exec java,exec ${JAVA_BINPREFIX}-java,'
 
-EGDIR=		share/examples/${PKGBASE}
-PKG_SYSCONFSUBDIR= jitsi/${PKGBASE}
-CONF_FILES=	${EGDIR}/callstats-java-sdk.properties \
-		${PKG_SYSCONFDIR}/callstats-java-sdk.properties
-CONF_FILES+=	${EGDIR}/log4j2.xml ${PKG_SYSCONFDIR}/log4j2.xml
-CONF_FILES+=	${EGDIR}/sip-communicator.properties \
-		${PKG_SYSCONFDIR}/sip-communicator.properties
+INSTALLATION_DIRS=	bin
+INSTALLATION_DIRS+=	${EGDIR}
+INSTALLATION_DIRS+=	share/${GITHUB_PROJECT}/lib
+INSTALLATION_DIRS+=	share/doc/${GITHUB_PROJECT}
 
-INSTALLATION_DIRS=	bin share/${PKGBASE}/lib ${EGDIR} share/doc/${PKGBASE}
+.PHONY: create-deps-file
+create-deps-file: build
+	#XXX disable offline mode for maven before using this rule
+	cd ${WRKSRC} && ${MVN} validate
+	cd ${WRKDIR} && \
+		${PAX} -wz -f jigasi-java-deps-${PKGVERSION_NOREV}.tar.gz deps
 
 do-configure:
-	#XXX this assumes trusted CA certificates are in /etc/openssl/certs
-	cd ${WRKSRC} && \
-		for cert in /etc/openssl/certs/*.0; do \
-			/usr/pkg/java/openjdk11/bin/keytool -importcert \
-					-keystore ${WRKDIR}/keystore \
-					-noprompt -trustcacerts \
-					-storepass password -file "$$cert" \
-					-alias $$(basename "$$cert"); done
+	cd ${WRKSRC} && ${MVN} versions:set -DnewVersion="${PKGVERSION_NOREV}"
 
 do-build:
 	cd ${WRKSRC} && \
@@ -54,16 +70,22 @@ do-build:
 
 do-install:
 	cd ${WRKSRC} && \
-		${PAX} -rw lib ${DESTDIR}${PREFIX}/share/${PKGBASE}
-	${INSTALL_DATA} ${WRKSRC}/target/jigasi-1.1-SNAPSHOT.jar \
-		${DESTDIR}${PREFIX}/share/${PKGBASE}/lib/jigasi.jar
+		${PAX} -rw lib ${DESTDIR}${PREFIX}/share/${GITHUB_PROJECT}
+	${INSTALL_DATA} ${WRKSRC}/target/jigasi-${PKGVERSION_NOREV}.jar \
+		${DESTDIR}${PREFIX}/share/${GITHUB_PROJECT}/lib/jigasi.jar
+	${INSTALL_DATA} ${WRKSRC}/lib/logging.properties \
+		${DESTDIR}${PREFIX}/${EGDIR}/logging.properties
+	${INSTALL_SCRIPT} ${WRKSRC}/script/collect-dump-logs.sh \
+		${DESTDIR}${PREFIX}/share/${GITHUB_PROJECT}/collect-dump-logs.sh
+	${INSTALL_SCRIPT} ${WRKSRC}/script/graceful_shutdown.sh \
+		${DESTDIR}${PREFIX}/share/${GITHUB_PROJECT}/graceful_shutdown.sh
 	${INSTALL_DATA} ${WRKSRC}/README.md \
-		${DESTDIR}${PREFIX}/share/doc/${PKGBASE}/README.md
+		${DESTDIR}${PREFIX}/share/doc/${GITHUB_PROJECT}/README.md
 	cd ${WRKSRC}/jigasi-home && \
 		${PAX} -rw * ${DESTDIR}${PREFIX}/${EGDIR}
 	${INSTALL_SCRIPT} ${WRKSRC}/jigasi.sh \
-		${DESTDIR}${PREFIX}/share/${PKGBASE}/jigasi.sh
-	${LN} -sf ../share/${PKGBASE}/jigasi.sh \
+		${DESTDIR}${PREFIX}/share/${GITHUB_PROJECT}/jigasi.sh
+	${LN} -sf ../share/${GITHUB_PROJECT}/jigasi.sh \
 		${DESTDIR}${PREFIX}/bin/jigasi
 
 CHECK_RELRO_SKIP+=	share/jigasi/lib/native/linux/libhwaddressretriever.so
diff --git a/jigasi/PLIST b/jigasi/PLIST
index f86957c648..6ba8ad0698 100644
--- a/jigasi/PLIST
+++ b/jigasi/PLIST
@@ -3,7 +3,10 @@ bin/jigasi
 share/doc/jigasi/README.md
 share/examples/jigasi/callstats-java-sdk.properties
 share/examples/jigasi/log4j2.xml
+share/examples/jigasi/logging.properties
 share/examples/jigasi/sip-communicator.properties
+share/jigasi/collect-dump-logs.sh
+share/jigasi/graceful_shutdown.sh
 share/jigasi/jigasi.sh
 share/jigasi/lib/jigasi.jar
 share/jigasi/lib/logging.properties
diff --git a/jigasi/distinfo b/jigasi/distinfo
index d525a456b5..59a2f0cb0f 100644
--- a/jigasi/distinfo
+++ b/jigasi/distinfo
@@ -1,5 +1,8 @@
 $NetBSD$
 
-BLAKE2s (jigasi-1.1.tar.gz) = 5d97bade3cabf9db6b33da38064ad473415d0db2147d3ed22ec4ffad0d5acb32
-SHA512 (jigasi-1.1.tar.gz) = 26e22bbf033c9127687b2ff349c700e4e81c22e25a0feea94b22b9c6466d725eadb8142c4daf4a64c33860f2a4c606c3a364d9d048d94725100fbde6362e82ef
-Size (jigasi-1.1.tar.gz) = 278449 bytes
+BLAKE2s (jigasi/jigasi-1.1.tar.gz) = 5d97bade3cabf9db6b33da38064ad473415d0db2147d3ed22ec4ffad0d5acb32
+SHA512 (jigasi/jigasi-1.1.tar.gz) = 26e22bbf033c9127687b2ff349c700e4e81c22e25a0feea94b22b9c6466d725eadb8142c4daf4a64c33860f2a4c606c3a364d9d048d94725100fbde6362e82ef
+Size (jigasi/jigasi-1.1.tar.gz) = 278449 bytes
+BLAKE2s (jigasi/jigasi-java-deps-1.1.tar.gz) = dafa64d0ec62e74d8306fe7ca86a2204c9791dfd155452f8f129da4baa5c4e15
+SHA512 (jigasi/jigasi-java-deps-1.1.tar.gz) = 3db64ce903989fdc2be3440efecc423bf5578e8305ea5a6d572dcb47a4b3e6b99afc5fe7a03b550d07a667bc3e233d656ac4177a954eaa12cc26784e4c45e523
+Size (jigasi/jigasi-java-deps-1.1.tar.gz) = 91802308 bytes


Home | Main Index | Thread Index | Old Index