Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Oct 2022 13:49:16 GMT
From:      Dan Langille <dvl@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 375881c9d3d1 - main - security/acme.sh: Move cron example to EXAMPLESDIR
Message-ID:  <202210121349.29CDnGwa081863@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dvl:

URL: https://cgit.FreeBSD.org/ports/commit/?id=375881c9d3d1550ceae3c7aee99c51e84dbf57ad

commit 375881c9d3d1550ceae3c7aee99c51e84dbf57ad
Author:     Dan Langille <dvl@FreeBSD.org>
AuthorDate: 2022-10-12 13:47:00 +0000
Commit:     Dan Langille <dvl@FreeBSD.org>
CommitDate: 2022-10-12 13:49:13 +0000

    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
---
 security/acme.sh/Makefile              | 19 ++++++++++++++-----
 security/acme.sh/files/acme-crontab.in | 14 +++++++++++---
 security/acme.sh/files/pkg-message.in  | 21 ++++++++++-----------
 security/acme.sh/pkg-plist             |  5 +++--
 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202210121349.29CDnGwa081863>