net/keycloak: Upgrade to 19.0.1

ChangeLog: https://www.keycloak.org/2022/07/keycloak-1901-released

PR:	265072
Reported by:	yonas.yanfa@gmail.com (maintainer)
This commit is contained in:
Fernando Apesteguía 2022-08-15 18:52:45 +02:00
parent e264b577bb
commit 6ea017569f
5 changed files with 536 additions and 3139 deletions

View File

@ -5,6 +5,15 @@ they are unavoidable.
You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.
20220815:
AFFECTS: users of net/keycloak
AUTHOR: fernape@FreeBSD.org
The flavors -mysql and -postgres were removed, the necessary configuration
for those database backends was rolled into the base release by upstream.
The configuration files changed completely, so they need to be rebuilt from
scratch.
20220807:
AFFECTS: users of news/inn
AUTHOR: kbowling@FreeBSD.org

View File

@ -1,5 +1,5 @@
PORTNAME= keycloak
PORTVERSION= 15.1.1
PORTVERSION= 19.0.1
CATEGORIES= net java
MASTER_SITES= https://github.com/${PORTNAME}/${PORTNAME}/releases/download/${PORTVERSION}/
@ -9,38 +9,24 @@ COMMENT= Identity and access management solution
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
FLAVORS= default mysql postgres
FLAVOR?= ${FLAVORS:[1]}
mysql_PKGNAMESUFFIX= -mysql
postgres_PKGNAMESUFFIX= -postgres
RUN_DEPENDS= bash>0:shells/bash
.if ${FLAVOR:U} == mysql
RUN_DEPENDS+= ${JAVAJARDIR}/mysql-connector-java.jar:databases/mysql-connector-java
PLIST_SUB+= MYSQL=""
.else
PLIST_SUB+= MYSQL="@comment "
.endif
USES= cpe shebangfix
.if ${FLAVOR:U} == postgres
RUN_DEPENDS+= ${JAVAJARDIR}/postgresql.jar:databases/postgresql-jdbc
PLIST_SUB+= POSTGRES=""
.else
PLIST_SUB+= POSTGRES="@comment "
.endif
USES= cpe
CPE_VENDOR= redhat
SHEBANG_FILES= bin/kc.sh \
bin/kcadm.sh \
bin/kcreg.sh
USE_JAVA= yes
JAVA_VERSION= 1.8+
JAVA_VERSION= 11+
JAVA_OS= native
JAVA_VENDOR= openjdk oracle
JAVA_RUN= yes
USE_RC_SUBR= keycloak
CONFLICTS_INSTALL= keycloak keycloak-mysql keycloak-postgresql # bin/kcadm bin/kcreg
USER= www
GROUP= www
@ -60,82 +46,33 @@ SUB_LIST+= GROUP=${GROUP} \
OPTIONS_DEFINE= DOCS EXAMPLES
CONFIG_FILES= bin/.jbossclirc \
bin/add-user.properties \
bin/domain.conf \
bin/jboss-cli-logging.properties \
bin/jboss-cli.xml bin/product.conf \
bin/standalone.conf \
domain/configuration/application-roles.properties \
domain/configuration/application-users.properties \
domain/configuration/default-server-logging.properties \
domain/configuration/domain.xml \
domain/configuration/host-master.xml \
domain/configuration/host-slave.xml \
domain/configuration/host.xml \
domain/configuration/logging.properties \
domain/configuration/mgmt-groups.properties \
domain/configuration/mgmt-users.properties \
modules/layers.conf \
standalone/configuration/application-roles.properties \
standalone/configuration/application-users.properties \
standalone/configuration/logging.properties \
standalone/configuration/mgmt-groups.properties \
standalone/configuration/mgmt-users.properties \
standalone/configuration/standalone-ha.xml \
standalone/configuration/standalone.xml
CONFIG_FILES= conf/cache-ispn.xml \
conf/keycloak.conf \
lib/quarkus/build-system.properties
post-patch:
.for f in ${CONFIG_FILES}
${MV} ${WRKSRC}/${f} ${WRKSRC}/${f}.sample
.endfor
${RM} -r ${WRKSRC}/modules/system/layers/base/org/apache/activemq/artemis/journal/main/lib/linux-i686
${RM} -r ${WRKSRC}/modules/system/layers/base/org/apache/activemq/artemis/journal/main/lib/linux-x86_64
${RM} -r ${WRKSRC}/modules/system/layers/base/org/wildfly/openssl/main/lib
${RM} ${WRKSRC}/bin/kc.bat
${RM} ${WRKSRC}/bin/kcadm.bat
${RM} ${WRKSRC}/bin/kcreg.bat
do-install:
${MKDIR} ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/bin
${MKDIR} ${STAGEDIR}${DOCSDIR}
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
${MKDIR} ${STAGEDIR}${LOG_DIR}/domain
${MKDIR} ${STAGEDIR}${LOG_DIR}/standalone
${MKDIR} ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/data
${MKDIR} ${STAGEDIR}${LOG_DIR}
${MKDIR} ${STAGEDIR}${RUN_DIR}
# Install files in bin
${INSTALL_SCRIPT} ${WRKSRC}/bin/*.sh ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/bin
.for f in .jbossclirc.sample add-user.properties.sample domain.conf.sample jboss-cli-logging.properties.sample jboss-cli.xml.sample \
launcher.jar migrate-domain-clustered.cli migrate-domain-standalone.cli migrate-standalone-ha.cli migrate-standalone.cli \
product.conf.sample standalone.conf.sample wildfly-elytron-tool.jar
${INSTALL_DATA} ${WRKSRC}/bin/${f} ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/bin
.endfor
${INSTALL_DATA} ${WRKSRC}/jboss-modules.jar ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}
(cd ${WRKSRC}/bin && ${COPYTREE_SHARE} client ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/bin)
# Install jar files, configuration and everything else
(cd ${WRKSRC} && ${COPYTREE_SHARE} "domain modules standalone themes welcome-content" ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME})
(cd ${WRKSRC}/docs/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})
.for d in licenses-keycloak schema
(cd ${WRKSRC}/docs/${d} && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/${d})
.endfor
(cd ${WRKSRC} && ${COPYTREE_SHARE} "conf lib providers themes" ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME})
# Create links for kc* binaries
${LN} -sf ../share/java/${PORTNAME}/bin/kcadm.sh ${STAGEDIR}${PREFIX}/bin/kcadm
${LN} -sf ../share/java/${PORTNAME}/bin/kcreg.sh ${STAGEDIR}${PREFIX}/bin/kcreg
# Create links for log directories
${LN} -sf ../../../../../..${LOG_DIR}/domain ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/domain/log
${LN} -sf ../../../../../..${LOG_DIR}/standalone ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/standalone/log
.if ${FLAVOR:U} == mysql
@${MKDIR} ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/modules/system/layers/keycloak/com/mysql/main
${CP} ${FILESDIR}/mysql-module.xml ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/modules/system/layers/keycloak/com/mysql/main/module.xml
${LN} -sf ${JAVAJARDIR}/mysql-connector-java.jar ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/modules/system/layers/keycloak/com/mysql/main/mysql-connector-java.jar
.endif
.if ${FLAVOR:U} == postgres
@${MKDIR} ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/modules/system/layers/keycloak/org/postgresql/main
${CP} ${FILESDIR}/postgresql-module.xml ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/modules/system/layers/keycloak/org/postgresql/main/module.xml
${LN} -sf ${JAVAJARDIR}/postgresql.jar ${STAGEDIR}${JAVASHAREDIR}/${PORTNAME}/modules/system/layers/keycloak/org/postgresql/main/postgresql.jar
.endif
.include <bsd.port.mk>

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1639736757
SHA256 (keycloak-15.1.1.tar.gz) = 44fbe5f5d1dda87ff0292f238220c23df6fda4ba234ffafe8102c646e74043f0
SIZE (keycloak-15.1.1.tar.gz) = 263053207
TIMESTAMP = 1660553913
SHA256 (keycloak-19.0.1.tar.gz) = b1e9f89a6d02b9bf43848a970c69d94fb7e75c75fc8ebe2f69a1b7d2e0739733
SIZE (keycloak-19.0.1.tar.gz) = 171578620

View File

@ -1,5 +1,7 @@
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: %%PORTNAME%%
# REQUIRE: NETWORKING SERVERS
# KEYWORD: shutdown
@ -9,10 +11,6 @@
#
# %%PORTNAME%%_enable (bool): Set it to YES to enable keycloak on startup.
# Default: NO
# %%PORTNAME%%_host_config (string): Choose the host config if running in domain mode (host-master, host-slave).
# Default: host-master
# %%PORTNAME%%_mode (string): Choose the desired operating mode (standalone, standalone-ha, domain).
# Default: standalone
# %%PORTNAME%%_user (string): User account to run with.
# Default: www
# %%PORTNAME%%_flags (string): Additional flags for the startup script.
@ -27,8 +25,6 @@ desc="Identity and access management solution"
load_rc_config $name
: ${%%PORTNAME%%_enable:=NO}
: ${%%PORTNAME%%_host_config:="host-master"}
: ${%%PORTNAME%%_mode:=standalone}
: ${%%PORTNAME%%_user:=%%USER%%}
: ${%%PORTNAME%%_group:=%%GROUP%%}
: ${%%PORTNAME%%_flags:=""}
@ -42,18 +38,6 @@ stop_cmd="%%PORTNAME%%_stop"
%%PORTNAME%%_start()
{
local %%PORTNAME%%_startscript
if [ ${%%PORTNAME%%_mode} = "domain" ]; then
%%PORTNAME%%_flags="--host-config=${%%PORTNAME%%_host_config} ${%%PORTNAME%%_flags}"
%%PORTNAME%%_startscript=domain.sh
elif [ ${%%PORTNAME%%_mode} = "standalone-ha" ]; then
%%PORTNAME%%_flags="--server-config=standalone-ha.xml ${%%PORTNAME%%_flags}"
%%PORTNAME%%_startscript=standalone.sh
else
%%PORTNAME%%_startscript=standalone.sh
fi
if [ ! -d "%%LOG_DIR%%" ]; then
install -d -o ${%%PORTNAME%%_user} %%LOG_DIR%%
fi
@ -62,12 +46,10 @@ stop_cmd="%%PORTNAME%%_stop"
fi
chown -R ${%%PORTNAME%%_user} %%LOG_DIR%%
chown -R ${%%PORTNAME%%_user} %%JAVASHAREDIR%%/%%PORTNAME%%/domain
chown -R ${%%PORTNAME%%_user} %%JAVASHAREDIR%%/%%PORTNAME%%/standalone
echo "Starting %%PORTNAME%%."
${command} ${command_args} \
%%JAVASHAREDIR%%/%%PORTNAME%%/bin/${%%PORTNAME%%_startscript} \
%%JAVASHAREDIR%%/%%PORTNAME%%/bin/kc.sh start \
${%%PORTNAME%%_flags}
}
@ -83,8 +65,7 @@ stop_cmd="%%PORTNAME%%_stop"
kill -TERM ${pid_daemon}
fi
pid_child=$(pgrep -U ${%%PORTNAME%%_user} -f %%JAVASHAREDIR%%/%%PORTNAME%%/jboss-modules.jar)
pid_child=$(pgrep -U ${%%PORTNAME%%_user} -f %%JAVASHAREDIR%%/%%PORTNAME%%/)
if [ ! -z "${pid_child}" ]; then
kill -TERM ${pid_child}
fi

File diff suppressed because it is too large Load Diff