aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Langille <dvl@FreeBSD.org>2023-04-01 13:53:56 +0000
committerDan Langille <dvl@FreeBSD.org>2023-04-01 13:55:35 +0000
commit34da3d71612d361f431f3fd73dc3c2a3d3268726 (patch)
tree523d6ecea4aafe92432d38680a27b7ce262460aa
parentbe55fa5e4e89fed09f1391e7319f5d4bf9abbb07 (diff)
downloadports-34da3d71612d361f431f3fd73dc3c2a3d3268726.tar.gz
ports-34da3d71612d361f431f3fd73dc3c2a3d3268726.zip
security/acme.sh: Fix up some install issues
Don't install cronjob to /usr/local/etc/cron.d/ There is no concept of sample files in this directory. Everything is active. Instead, install to /usr/local/share/examples/acme.sh and let the user copy it over. In the cronjob itself, specify the acme user. This was previously omitted and the job would not run. Install the sample newsyslog file to /usr/local/etc/newsyslog.conf.d - this was installing to /usr/local/etc/newsyslog.d/acme.sh Add an update cluse to pkg-message mentioning the newsyslog issue. None of these changes should break existing installs.
-rw-r--r--security/acme.sh/Makefile11
-rw-r--r--security/acme.sh/files/acme-crontab.in9
-rw-r--r--security/acme.sh/files/pkg-message.in20
-rw-r--r--security/acme.sh/pkg-plist5
4 files changed, 28 insertions, 17 deletions
diff --git a/security/acme.sh/Makefile b/security/acme.sh/Makefile
index 70ece1374805..a19716147194 100644
--- a/security/acme.sh/Makefile
+++ b/security/acme.sh/Makefile
@@ -1,6 +1,7 @@
PORTNAME= acme.sh
-DISTVERSIONPREFIX= v
PORTVERSION= 3.0.5
+DISTVERSIONPREFIX= v
+PORTREVISION= 1
CATEGORIES= security
MAINTAINER= dvl@FreeBSD.org
@@ -39,6 +40,8 @@ PORTDOCS= README.md
SUB_FILES= acme-crontab pkg-message
+SUB_LIST= ACME_USER=acme
+
post-patch-EXAMPLES-on:
${REINPLACE_CMD} -e 's|sed -i "|sed -i bak "|' ${WRKSRC}/dnsapi/dns_nsd.sh
@@ -51,16 +54,14 @@ do-install:
${MKDIR} ${STAGEDIR}/var/db/acme/.acme.sh \
${STAGEDIR}/var/db/acme/certs \
- ${STAGEDIR}${PREFIX}/etc/cron.d \
- ${STAGEDIR}${PREFIX}/etc/newsyslog.d \
+ ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d \
${STAGEDIR}${EXAMPLESDIR}
${INSTALL_DATA} ${FILESDIR}/account.conf.sample ${STAGEDIR}/var/db/acme/.acme.sh
- # install the sample file; pkg-plist will install to etc/cron.d for us
${INSTALL_DATA} ${WRKDIR}/acme-crontab ${STAGEDIR}${EXAMPLESDIR}/acme.sh-cron.d
- ${INSTALL_DATA} ${FILESDIR}/acme-newsyslog ${STAGEDIR}${PREFIX}/etc/newsyslog.d/acme.sh.sample
+ ${INSTALL_DATA} ${FILESDIR}/acme-newsyslog ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/acme.sh.conf.sample
do-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
diff --git a/security/acme.sh/files/acme-crontab.in b/security/acme.sh/files/acme-crontab.in
index ce8379bd2e76..ffde51de652f 100644
--- a/security/acme.sh/files/acme-crontab.in
+++ b/security/acme.sh/files/acme-crontab.in
@@ -1,15 +1,12 @@
#
-# By default, all entries in this file are commented and inactive.
-# Please uncomment and customize as shown below.
+# This file should be copied to /usr/local/etc/cron.d/acme
# use /bin/sh to run commands, overriding the default set by cron
-# uncomment, don't change the value
#SHELL=/bin/sh
# mail any output to here, no matter whose crontab this is
-# uncomment, set the addres
#MAILTO=me@example.org
-# uncomment, set mm and hh to the time (e.g. hh:mm) of day you want the
+# set mm and hh to the time (e.g. hh:mm) of day you want the
# cronjob to run
-#mm hh * * * %%PREFIX%%/sbin/acme.sh --cron --home /var/db/acme/.acme.sh > /dev/null
+mm hh * * * %%ACME_USER%% %%PREFIX%%/sbin/acme.sh --cron --home /var/db/acme/.acme.sh > /dev/null
diff --git a/security/acme.sh/files/pkg-message.in b/security/acme.sh/files/pkg-message.in
index 7668c66202a1..1d272e070567 100644
--- a/security/acme.sh/files/pkg-message.in
+++ b/security/acme.sh/files/pkg-message.in
@@ -17,13 +17,27 @@ If you have EXAMPLES on:
included are the deploy scripts.
* A newsyslog.conf sample file is installed at
- %%PREFIX%%/etc/newsyslog.d/acme.sh - you must modify it by
+ %%PREFIX%%/etc/newsyslog.conf.d/acme.sh.conf - you must modify it by
at least uncommenting the line.
* If you run `newsyslog -NC` it will create the required logfiles.
-* Please edit %%PREFIX%%/etc/cron.d/acme.sh - directions are provided in that
- file.
+* Please review %%EXAMPLESDIR%%/acme.sh-cron.d - instructions are
+ contained in that file.
+EOM
+}
+{ type: upgrade
+ message: <<EOM
+In versions < 3.0.5_1, sample newsyslog files were installed to
+
+ %%PREFIX%%/etc/newsyslog.d/acme.sh
+
+Now they are installed to:
+
+ %%PREFIX%%/etc/newsyslog.conf.d/acme.sh.conf
+
+You may wish to delete the old files/directory and edit the new files to
+enable the log rotation. Instructions contained within.
EOM
}
]
diff --git a/security/acme.sh/pkg-plist b/security/acme.sh/pkg-plist
index 28b4aaf901e6..531475acc35f 100644
--- a/security/acme.sh/pkg-plist
+++ b/security/acme.sh/pkg-plist
@@ -1,5 +1,5 @@
-%%PORTEXAMPLES%%@sample %%EXAMPLESDIR%%/acme.sh-cron.d etc/cron.d/acme.sh
-%%PORTEXAMPLES%%@sample etc/newsyslog.d/acme.sh.sample
+%%PORTEXAMPLES%% %%EXAMPLESDIR%%/acme.sh-cron.d
+%%PORTEXAMPLES%%@sample etc/newsyslog.conf.d/acme.sh.conf.sample
sbin/acme.sh
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/deploy/README.md
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/deploy/apache.sh
@@ -202,7 +202,6 @@ sbin/acme.sh
%%PORTEXAMPLES%%/var/db/acme/.acme.sh/deploy
%%PORTEXAMPLES%%/var/db/acme/.acme.sh/dnsapi
%%PORTEXAMPLES%%/var/db/acme/.acme.sh/notify
-@dir etc/cron.d
@dir(acme,acme,0750) /var/db/acme/.acme.sh
@dir(acme,acme,0750) /var/db/acme/certs
@dir(acme,acme,0750) /var/db/acme