pkgsrc-WIP-changes archive

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

jitsi-videobridge: 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 09:43:34 2023 +0100
Changeset:	76137710c61ee75c92fe5081bdc356cc1d829e34

Modified Files:
	jitsi-videobridge/Makefile
	jitsi-videobridge/PLIST
	jitsi-videobridge/distinfo
Added Files:
	jitsi-videobridge/files/sip-communicator.properties

Log Message:
jitsi-videobridge: build the package in offline mode

While there:

* register the package version with maven when building
* also install configuration files
* add a rule to generate the dependencies archive
* appease pkglint some more

This paves the way for jitsi-videobridge 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=76137710c61ee75c92fe5081bdc356cc1d829e34

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

diffstat:
 jitsi-videobridge/Makefile                         | 91 ++++++++++++++++------
 jitsi-videobridge/PLIST                            | 10 ++-
 jitsi-videobridge/distinfo                         |  4 +
 .../files/sip-communicator.properties              |  1 +
 4 files changed, 81 insertions(+), 25 deletions(-)

diffs:
diff --git a/jitsi-videobridge/Makefile b/jitsi-videobridge/Makefile
index a5d381554d..d8b391b3d9 100644
--- a/jitsi-videobridge/Makefile
+++ b/jitsi-videobridge/Makefile
@@ -1,5 +1,7 @@
 # $NetBSD$
 
+.include "../../wip/jitsi-meet/Makefile.common"
+
 GITHUB_PROJECT=	jitsi-videobridge
 PKGNAME=	${GITHUB_PROJECT}-${JITSI_MEET_VERSION}
 
@@ -7,52 +9,95 @@ HOMEPAGE=	https://github.com/jitsi/jitsi-videobridge/
 COMMENT=	WebRTC compatible video router or SFU
 
 DISTINFO_FILE=	${.CURDIR}/../../wip/jitsi-videobridge/distinfo
+DISTFILES=	${DEFAULT_DISTFILES}
+DISTFILES+=	jitsi-videobridge-java-deps-${JITSI_MEET_VERSION}.tar.gz
+SITES.jitsi-videobridge-java-deps-${JITSI_MEET_VERSION}.tar.gz= \
+		ftp://ftp.NetBSD.org/pub/NetBSD/misc/khorben/
 
-USE_TOOLS+=	bash:run unzip
-USE_JAVA2=	17
+USE_TOOLS+=	bash:run pax:build unzip
 
-REPLACE_BASH=	jvb/resources/jvb.sh
+USE_JAVA2=	17
 
 TOOL_DEPENDS+=	apache-maven-[0-9]*:../../devel/apache-maven
 
-WRKSRC=		${WRKDIR}/${GITHUB_PROJECT}-stable-${DISTNAME}
-
+MAVEN_FLAGS+=	-Duser.home=${FAKEHOMEDIR}
+MAVEN_FLAGS+=	-Dmaven.repo.local=${WRKDIR}/deps
+MAVEN_FLAGS+=	--offline
 MAVEN_FLAGS+=	-DskipTests
-MAVEN_FLAGS+=	-Djavax.net.ssl.trustStore=${WRKDIR}/keystore
-MAVEN_FLAGS+=	-Djavax.net.ssl.trustStorePassword=password
+MAVEN_FLAGS+=	-Dassembly.skipAssembly=false
+MVN=		mvn ${MAVEN_FLAGS}
 
-INSTALLATION_DIRS+=	bin
-INSTALLATION_DIRS+=	share
+REPLACE_BASH=	jvb/resources/jvb.sh
+REPLACE_BASH+=	resources/collect-dump-logs.sh
+REPLACE_BASH+=	resources/graceful_shutdown.sh
+
+EGDIR=			share/examples/jitsi-videobridge
+PKG_SYSCONFSUBDIR=	jitsi/videobridge
+CONF_FILES+=		${EGDIR}/jvb.conf \
+			${PKG_SYSCONFDIR}/jvb.conf
+CONF_FILES+=		${EGDIR}/logging.properties \
+			${PKG_SYSCONFDIR}/logging.properties
+CONF_FILES+=		${EGDIR}/sip-communicator.properties \
+			${PKG_SYSCONFDIR}/sip-communicator.properties
+CONF_FILES+=		${EGDIR}/videobridge.rc \
+			${PKG_SYSCONFDIR}/videobridge.rc
+
+WRKSRC=			${WRKDIR}/${GITHUB_PROJECT}-stable-${DISTNAME}
 
 SUBST_CLASSES+=		java
 SUBST_STAGE.java=	post-configure
 SUBST_FILES.java=	jvb/resources/jvb.sh
 SUBST_SED.java=		-e 's,^exec java,exec ${JAVA_BINPREFIX}-java,'
 
+SUBST_CLASSES+=		logging
+SUBST_STAGE.logging=	post-configure
+SUBST_FILES.logging=	jvb/resources/jvb.sh
+SUBST_SED.logging=	-e 's,$$SCRIPT_DIR/lib/logging\.properties,${PKG_SYSCONFDIR}/logging.properties,'
+
+SUBST_CLASSES+=		rc
+SUBST_STAGE.rc=		post-configure
+SUBST_FILES.rc=		jvb/resources/jvb.sh
+SUBST_SED.rc=		-e 's,$$SCRIPT_DIR/lib/videobridge\.rc,${PKG_SYSCONFDIR}/videobridge.rc,'
+
+MAKE_JOBS_SAFE=		no
+
+INSTALLATION_DIRS+=	bin
+INSTALLATION_DIRS+=	${EGDIR} share/jitsi-videobridge
+
+.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 jitsi-videobridge-java-deps-${JITSI_MEET_VERSION}.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="${JITSI_MEET_VERSION}"
 
 do-build:
-	cd ${WRKSRC} && \
-		mvn package ${MAVEN_FLAGS}
+	cd ${WRKSRC} && ${MVN} package
 
 do-install:
-	${RM} -rf ${DESTDIR}${PREFIX}/share/jitsi-videobridge-2.1-SNAPSHOT \
+	${RM} -rf ${DESTDIR}${PREFIX}/share/jitsi-videobridge-${JITSI_MEET_VERSION} \
 		${DESTDIR}${PREFIX}/share/jitsi-videobridge
 	cd ${DESTDIR}${PREFIX}/share && \
-		${UNZIP_CMD} ${WRKSRC}/jvb/target/jitsi-videobridge-2.1-SNAPSHOT-archive.zip
-	${MV} ${DESTDIR}${PREFIX}/share/jitsi-videobridge-2.1-SNAPSHOT \
+		${UNZIP_CMD} ${WRKSRC}/jvb/target/jitsi-videobridge-${JITSI_MEET_VERSION}-archive.zip
+	${MV} ${DESTDIR}${PREFIX}/share/jitsi-videobridge-${JITSI_MEET_VERSION} \
 		${DESTDIR}${PREFIX}/share/jitsi-videobridge
 	${LN} -sf ../share/jitsi-videobridge/jvb.sh \
 		${DESTDIR}${PREFIX}/bin/jvb
+	${INSTALL_DATA} ${WRKSRC}/jvb/src/main/resources/reference.conf \
+		${DESTDIR}${PREFIX}/${EGDIR}/jvb.conf
+	${INSTALL_DATA} ${WRKSRC}/jvb/lib/logging.properties \
+		${DESTDIR}${PREFIX}/${EGDIR}/logging.properties
+	${INSTALL_DATA} ${FILESDIR}/sip-communicator.properties \
+		${DESTDIR}${PREFIX}/${EGDIR}/sip-communicator.properties
+	${INSTALL_DATA} ${WRKSRC}/jvb/lib/videobridge.rc \
+		${DESTDIR}${PREFIX}/${EGDIR}/videobridge.rc
+	${INSTALL_SCRIPT} ${WRKSRC}/resources/collect-dump-logs.sh \
+		${DESTDIR}${PREFIX}/share/jitsi-videobridge/collect-dump-logs.sh
+	${INSTALL_SCRIPT} ${WRKSRC}/resources/graceful_shutdown.sh \
+		${DESTDIR}${PREFIX}/share/jitsi-videobridge/graceful_shutdown.sh
 
-.include "../../wip/jitsi-meet/Makefile.common"
 .include "../../mk/java-vm.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/jitsi-videobridge/PLIST b/jitsi-videobridge/PLIST
index 4981e2c2e2..bcda1394a0 100644
--- a/jitsi-videobridge/PLIST
+++ b/jitsi-videobridge/PLIST
@@ -1,5 +1,11 @@
 @comment $NetBSD$
 bin/jvb
+share/examples/jitsi-videobridge/jvb.conf
+share/examples/jitsi-videobridge/logging.properties
+share/examples/jitsi-videobridge/sip-communicator.properties
+share/examples/jitsi-videobridge/videobridge.rc
+share/jitsi-videobridge/collect-dump-logs.sh
+share/jitsi-videobridge/graceful_shutdown.sh
 share/jitsi-videobridge/jitsi-videobridge.jar
 share/jitsi-videobridge/jvb.bat
 share/jitsi-videobridge/jvb.sh
@@ -75,7 +81,7 @@ share/jitsi-videobridge/lib/jetty-xml-11.0.10.jar
 share/jitsi-videobridge/lib/jicoco-1.1-119-gc527d61.jar
 share/jitsi-videobridge/lib/jicoco-config-1.1-119-gc527d61.jar
 share/jitsi-videobridge/lib/jicoco-metrics-1.1-119-gc527d61.jar
-share/jitsi-videobridge/lib/jitsi-media-transform-2.1-SNAPSHOT.jar
+share/jitsi-videobridge/lib/jitsi-media-transform-${PKGVERSION}.jar
 share/jitsi-videobridge/lib/jitsi-metaconfig-1.0-9-g5e1b624.jar
 share/jitsi-videobridge/lib/jitsi-srtp-1.1-7-gd8d1435.jar
 share/jitsi-videobridge/lib/jitsi-utils-1.0-124-ge57838f.jar
@@ -103,7 +109,7 @@ share/jitsi-videobridge/lib/osgi-resource-locator-1.0.3.jar
 share/jitsi-videobridge/lib/pcap4j-core-1.8.2.jar
 share/jitsi-videobridge/lib/pcap4j-packetfactory-static-1.8.2.jar
 share/jitsi-videobridge/lib/reflections-0.9.11.jar
-share/jitsi-videobridge/lib/rtp-2.1-SNAPSHOT.jar
+share/jitsi-videobridge/lib/rtp-${PKGVERSION}.jar
 share/jitsi-videobridge/lib/sctp-1.0-9-g45bf9f2.jar
 share/jitsi-videobridge/lib/sdp-api-1.0.jar
 share/jitsi-videobridge/lib/sentry-5.3.0.jar
diff --git a/jitsi-videobridge/distinfo b/jitsi-videobridge/distinfo
index 3d1944ebb8..d7473aef68 100644
--- a/jitsi-videobridge/distinfo
+++ b/jitsi-videobridge/distinfo
@@ -3,3 +3,7 @@ $NetBSD$
 BLAKE2s (jitsi-videobridge/jitsi-meet_8138.tar.gz) = 23e125bae071dd96b8ef66429139e1a1cbefcdff7220f8a3aa0368c72f203640
 SHA512 (jitsi-videobridge/jitsi-meet_8138.tar.gz) = 75b617fa44701a40a8ec609f03130e939e9d9127b56b16412f51b5adf00597db3bac562bb8751261e9ce31a7c8b15283ab45bf0ece7337d26c65dd7be133f2a8
 Size (jitsi-videobridge/jitsi-meet_8138.tar.gz) = 62336666 bytes
+BLAKE2s (jitsi-videobridge/jitsi-videobridge-java-deps-2.0.8138.tar.gz) = b45b3aa0caff93aa80311b5210dbfae17e7f570550aee619d0158f4047326b33
+SHA512 (jitsi-videobridge/jitsi-videobridge-java-deps-2.0.8138.tar.gz) = ad1d31295171056815fcf67be1700716d558275fe6f0f7da187bcdb239a0cbf6f9b1ba2ca554f55e076ee9903c5c9ce540938a9cddc2e9cfcec214bd2ddefeb6
+Size (jitsi-videobridge/jitsi-videobridge-java-deps-2.0.8138.tar.gz) = 263397624 bytes
+SHA1 (patch-jvb_resources_jvb.sh) = 35a514a615d07f96357934ab901ca027f76bbcb8
diff --git a/jitsi-videobridge/files/sip-communicator.properties b/jitsi-videobridge/files/sip-communicator.properties
new file mode 100644
index 0000000000..893b43377a
--- /dev/null
+++ b/jitsi-videobridge/files/sip-communicator.properties
@@ -0,0 +1 @@
+org.ice4j.ice.harvest.DISABLE_AWS_HARVESTER=true


Home | Main Index | Thread Index | Old Index