aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Langille <dvl@FreeBSD.org>2022-10-12 13:47:00 +0000
committerDan Langille <dvl@FreeBSD.org>2022-10-12 13:49:13 +0000
commit375881c9d3d1550ceae3c7aee99c51e84dbf57ad (patch)
tree2639d88601b92c1665e720da9958a66141a8d960
parent44e01df41a2e8f6e2d689ec0d2d5281cfb0e3e0e (diff)
downloadports-375881c9d3d1550ceae3c7aee99c51e84dbf57ad.tar.gz
ports-375881c9d3d1550ceae3c7aee99c51e84dbf57ad.zip
security/acme.sh: Move cron example to EXAMPLESDIR
Instead of installing the sample crontab to etc/cron.d, install it to EXAMPLESDIR etc/cron.d/acme.sh will still be installed (if not present) but now contains no active lines and more complete instructions. Both the cron the newsyslog examples are only installed if the EXAMPLES config option is ON (default). Reported by: bapt
-rw-r--r--security/acme.sh/Makefile19
-rw-r--r--security/acme.sh/files/acme-crontab.in14
-rw-r--r--security/acme.sh/files/pkg-message.in21
-rw-r--r--security/acme.sh/pkg-plist5
4 files changed, 38 insertions, 21 deletions
diff --git a/security/acme.sh/Makefile b/security/acme.sh/Makefile
index 4805f9b9ffba..b58fcdbb2cc6 100644
--- a/security/acme.sh/Makefile
+++ b/security/acme.sh/Makefile
@@ -1,6 +1,6 @@
PORTNAME= acme.sh
PORTVERSION= 3.0.4
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MAINTAINER= dvl@FreeBSD.org
@@ -48,11 +48,19 @@ post-patch-IDN-on:
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/sbin/${PORTNAME}
- ${MKDIR} ${STAGEDIR}/var/db/acme/.acme.sh ${STAGEDIR}/var/db/acme/certs \
- ${STAGEDIR}${PREFIX}/etc/cron.d ${STAGEDIR}${PREFIX}/etc/newsyslog.d
+
+ ${MKDIR} ${STAGEDIR}/var/db/acme/.acme.sh \
+ ${STAGEDIR}/var/db/acme/certs \
+ ${STAGEDIR}${PREFIX}/etc/cron.d \
+ ${STAGEDIR}${PREFIX}/etc/newsyslog.d \
+ ${STAGEDIR}${EXAMPLESDIR}
+
${INSTALL_DATA} ${FILESDIR}/account.conf.sample ${STAGEDIR}/var/db/acme/.acme.sh
- ${INSTALL_DATA} ${WRKDIR}/acme-crontab ${STAGEDIR}${PREFIX}/etc/cron.d/acme.sh.sample
- ${INSTALL_DATA} ${FILESDIR}/acme-newsyslog ${STAGEDIR}${PREFIX}/etc/newsyslog.d/acme.sh.sample
+
+ # 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
do-install-DOCS-on:
${MKDIR} ${STAGEDIR}${DOCSDIR}
@@ -60,6 +68,7 @@ do-install-DOCS-on:
do-install-EXAMPLES-on:
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/deploy ${STAGEDIR}${EXAMPLESDIR}/dnsapi
+
( cd ${WRKSRC} && ${COPYTREE_BIN} deploy ${STAGEDIR}${EXAMPLESDIR} )
( cd ${WRKSRC} && ${COPYTREE_BIN} dnsapi ${STAGEDIR}${EXAMPLESDIR} )
( cd ${WRKSRC} && ${COPYTREE_BIN} notify ${STAGEDIR}${EXAMPLESDIR} )
diff --git a/security/acme.sh/files/acme-crontab.in b/security/acme.sh/files/acme-crontab.in
index 831e6c497cc3..ce8379bd2e76 100644
--- a/security/acme.sh/files/acme-crontab.in
+++ b/security/acme.sh/files/acme-crontab.in
@@ -1,7 +1,15 @@
+#
+# By default, all entries in this file are commented and inactive.
+# Please uncomment and customize as shown below.
+
# use /bin/sh to run commands, overriding the default set by cron
-SHELL=/bin/sh
+# uncomment, don't change the value
+#SHELL=/bin/sh
# mail any output to here, no matter whose crontab this is
-MAILTO=me@example.org
+# uncomment, set the addres
+#MAILTO=me@example.org
-xx yy * * * %%PREFIX%%/sbin/acme.sh --cron --home /var/db/acme/.acme.sh > /dev/null
+# uncomment, 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
diff --git a/security/acme.sh/files/pkg-message.in b/security/acme.sh/files/pkg-message.in
index d9ad093198f8..7668c66202a1 100644
--- a/security/acme.sh/files/pkg-message.in
+++ b/security/acme.sh/files/pkg-message.in
@@ -10,21 +10,20 @@ The script will also install ~acme/.acme.sh/account.conf.sample which has
sane defaults. Copy this to ~acme/.acme.sh/account.conf and edit contents
to suit.
-In the %%EXAMPLESDIR%% directory, you can find the dnsapi
-scripts which will be useful if you decide to use dns-01 challenges. Also
-included are the deploy scripts.
+If you have EXAMPLES on:
-A newsyslog.conf sample file is installed at
-%%PREFIX%%/etc/newsyslog.d/acme.sh - you must modify it by
-at least uncommenting the line.
+* In the %%EXAMPLESDIR%% directory, you can find the dnsapi
+ scripts which will be useful if you decide to use dns-01 challenges. Also
+ included are the deploy scripts.
-If you run `newsyslog -NC` it will create the required logfiles.
+* A newsyslog.conf sample file is installed at
+ %%PREFIX%%/etc/newsyslog.d/acme.sh - you must modify it by
+ at least uncommenting the line.
-Please edit %%PREFIX%%/etc/cron.d/acme.sh changing:
+* If you run `newsyslog -NC` it will create the required logfiles.
-* MAILTO - your email address
-* xx to the minute you want the cronjob to run
-* yy to the hour you want the cronjob to run
+* Please edit %%PREFIX%%/etc/cron.d/acme.sh - directions are provided in that
+ file.
EOM
}
]
diff --git a/security/acme.sh/pkg-plist b/security/acme.sh/pkg-plist
index bc87db4fe497..086403c8ccf6 100644
--- a/security/acme.sh/pkg-plist
+++ b/security/acme.sh/pkg-plist
@@ -1,5 +1,5 @@
-@sample etc/cron.d/acme.sh.sample
-@sample etc/newsyslog.d/acme.sh.sample
+%%PORTEXAMPLES%%@sample %%EXAMPLESDIR%%/acme.sh-cron.d etc/cron.d/acme.sh
+%%PORTEXAMPLES%%@sample etc/newsyslog.d/acme.sh.sample
sbin/acme.sh
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/deploy/README.md
%%PORTEXAMPLES%%%%EXAMPLESDIR%%/deploy/apache.sh
@@ -192,6 +192,7 @@ 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