freebsd-ports/net/keycloak/Makefile
Stefan Eßer bcaf25a8c8 Fix CONFLICTS entries of multiple ports
There have been lots of missing CONFLICTS_INSTALL entries, either
because conflicting ports were added without updating existing ports,
due to name changes of generated packages, due to mis-understanding
the format and semantics of the conflicts entries, or just due to
typoes in package names.

This patch is the result of a comparison of all files contained in
the official packages with each other. This comparison was based on
packages built with default options and may therefore have missed
further conflicts with optionally installed files.

Where possible, version numbers in conflicts entries have been
generalized, some times taking advantage of the fact that a port
cannot conflict with itself (due to logic in bsd.port.mk that
supresses the pattern match result in that case).

A few ports that set the conflicts variables depending on complex
conditions (e.g. port options), have been left unmodified, despite
probably containing outdated package names.

These changes should only affect the installation of locally built
ports, not the package building with poudriere. They should give an
early indication of the install conflict in cases where currently
the pkg command aborts an installation when it detects that an
existing file would be overwritten,

Approved by:	portmgr (implicit)
2022-01-10 16:15:39 +01:00

141 lines
5.2 KiB
Makefile

PORTNAME= keycloak
PORTVERSION= 15.1.1
CATEGORIES= net java
MASTER_SITES= https://github.com/${PORTNAME}/${PORTNAME}/releases/download/${PORTVERSION}/
MAINTAINER= freebsd@rheinwolf.de
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
.if ${FLAVOR:U} == mysql
RUN_DEPENDS+= ${JAVAJARDIR}/mysql-connector-java.jar:databases/mysql-connector-java
PLIST_SUB+= MYSQL=""
.else
PLIST_SUB+= MYSQL="@comment "
.endif
.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
USE_JAVA= yes
JAVA_VERSION= 1.8+
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
VAR_DIR?= /var
LOG_DIR?= ${VAR_DIR}/log/${PORTNAME}
RUN_DIR?= ${VAR_DIR}/run/${PORTNAME}
NO_ARCH= yes
NO_BUILD= yes
SUB_LIST+= GROUP=${GROUP} \
LOG_DIR=${LOG_DIR} \
JAVA=${JAVA} \
PORTNAME=${PORTNAME} \
RUN_DIR=${RUN_DIR} \
USER=${USER}
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
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
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}${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
# 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>