On 2026/02/18 08:33, Chaz Kettleson wrote:
> > > > > > > > 3.) Replaces template values with those suitable for OpenBSD 
> > > > > > > > and set
> > > > > > > > with with HMDM_ variables

I didn't get round to looking at the various versions of this after
the first one until now, originally there were a few which is not
ideal but just about ok, but I see this has grown to a huge extent,
please could you use the standard method of patching the file to make
these changes rather than a bunch of sed substitutions?

For those which need a make variable, you can patch to ${VAR_NAME},
set SUBST_VARS= VAR_NAME [...], and use ${SUBST_CMD} -c to copy while
substituting.

: HMDM_SQL_HOST=                localhost
: HMDM_SQL_PORT=                5432
: HMDM_SQL_BASE=                hmdm
: HMDM_SQL_USER=                hmdm_user
: HMDM_SQL_PASS=
: HMDM_BASE_DIRECTORY=  /var/tomcat/work/hmdm-server
: HMDM_PROTOCOL=                http
: HMDM_BASE_DOMAIN=     localhost
: HMDM_BASE_PATH=
: HMDM_PORT=            8080
: HMDM_BASE_HOST=               ${HMDM_BASE_DOMAIN}:${HMDM_PORT}
: HMDM_INSTALL_FLAG_FILE=       ${HMDM_BASE_DIRECTORY}/hmdm-server_install_flag
: HMDM_APK_VERSION=     6.30
: HMDM_APK=             hmdm-${HMDM_APK_VERSION}-os.apk
: HMDM_ADMIN_EMAIL= 
: HMDM_SMTP_HOST=
: HMDM_SMTP_PORT=
: HMDM_SMTP_SSL=                0
: HMDM_SMTP_STARTTLS=   0
: HMDM_SMTP_USERNAME=
: HMDM_SMTP_PASSWORD=
: HMDM_SMTP_FROM=
: HMDM_LANGUAGE=                en
: 
: do-install:
:       ${INSTALL_DATA_DIR} ${PREFIX}/share/hmdm-server/
:       ${INSTALL_DATA} ${DISTDIR}/hmdm-${V}-os.war \
:               ${PREFIX}/share/hmdm-server/ROOT.war
:       ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/hmdm-server
:       cat ${WRKSRC}/install/context_template.xml | sed "\
:               s|_SQL_HOST_|${HMDM_SQL_HOST}|g; \
:               s|_SQL_PORT_|${HMDM_SQL_PORT}|g; \
:               s|_SQL_BASE_|${HMDM_SQL_BASE}|g; \
:               s|_SQL_USER_|${HMDM_SQL_USER}|g; \
:               s|_SQL_PASS_|${HMDM_SQL_PASS}|g; \
:               s|_BASE_DIRECTORY_|${HMDM_BASE_DIRECTORY}|g; \
:               s|_PROTOCOL_|${HMDM_PROTOCOL}|g; \
:               s|_BASE_HOST_|${HMDM_BASE_HOST}|g; \
:               s|_BASE_DOMAIN_|${HMDM_BASE_DOMAIN}|g; \
:               s|_BASE_PATH_|${HMDM_BASE_PATH}|g; \
:               s|_INSTALL_FLAG_|${HMDM_INSTALL_FLAG_FILE}|g; \
:               s|_SMTP_HOST_|${HMDM_SMTP_HOST}|g; \
:               s|_SMTP_PORT_|${HMDM_SMTP_PORT}|g; \
:               s|_SMTP_SSL_|${HMDM_SMTP_SSL}|g; \
:               s|_SMTP_STARTTLS_|${HMDM_SMTP_STARTTLS}|g; \
:               s|_SMTP_USERNAME_|${HMDM_SMTP_USERNAME}|g; \
:               s|_SMTP_PASSWORD_|${HMDM_SMTP_PASSWORD}|g; \
:               s|_SMTP_FROM_|${HMDM_SMTP_FROM}|g; \
:               s|_LANGUAGE_|${HMDM_LANGUAGE}|g;" \
:               > ${WRKDIR}/ROOT.xml
:       ${INSTALL_DATA} ${WRKDIR}/ROOT.xml \
:               ${PREFIX}/share/examples/hmdm-server/
:       cat ${WRKSRC}/install/sql/hmdm_init.${HMDM_LANGUAGE}.sql | sed "\
:               s|_HMDM_BASE_|${HMDM_BASE_DIRECTORY}|g; \
:               s|_HMDM_VERSION_|${HMDM_APK_VERSION}|g; \
:               s|_HMDM_APK_|${HMDM_APK}|g; \
:               s|_ADMIN_EMAIL_|${HMDM_ADMIN_EMAIL}|g;" \
:               > ${WRKDIR}/hmdm-server_init.en.sql
:       ${INSTALL_DATA} ${WRKDIR}/hmdm-server_init.en.sql \
:               ${PREFIX}/share/examples/hmdm-server/
:       cat ${WRKSRC}/install/log4j_template.xml | sed "\
:               s|_BASE_DIRECTORY_|${HMDM_BASE_DIRECTORY}|g" \
:               > ${WRKDIR}/log4j-hmdm-server.xml
:       ${INSTALL_DATA} ${WRKDIR}/log4j-hmdm-server.xml \
:               ${PREFIX}/share/examples/hmdm-server/
:       ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/hmdm-server/emails/
:               cd ${WRKSRC}/install/emails && \
:               pax -rw . ${PREFIX}/share/examples/hmdm-server/emails/

Reply via email to