aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Seaman <matthew@FreeBSD.org>2023-04-18 06:36:55 +0000
committerMatthew Seaman <matthew@FreeBSD.org>2023-04-18 06:38:58 +0000
commitb5613f6f4f42d9fe4b28704055698b9038b93e81 (patch)
tree3da804d9763f5d1e3e5b9dd1d5418e739ac16e84
parentf4b250c8208603364ed052b3f19ca216be1ff4da (diff)
downloadports-b5613f6f4f42d9fe4b28704055698b9038b93e81.tar.gz
ports-b5613f6f4f42d9fe4b28704055698b9038b93e81.zip
sysutils/dynamic_motd: -- new port
dynamic_motd is a drop-in replacement for generating messages of the day on FreeBSD 13.0 or later. During system startup, the file /var/run/motd is replaced with a fifo whose content is generated by a user-configurable shell script that is executed on each login. All other aspects of motd(5) are preserved. PR: 267107 Reported by: Steven Stallion
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/dynamic_motd/Makefile19
-rw-r--r--sysutils/dynamic_motd/distinfo3
-rw-r--r--sysutils/dynamic_motd/pkg-descr5
-rw-r--r--sysutils/dynamic_motd/pkg-message23
-rw-r--r--sysutils/dynamic_motd/pkg-plist7
6 files changed, 58 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 34461c48677d..407a5ef30cf8 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -339,6 +339,7 @@
SUBDIR += dwatch-gource
SUBDIR += dwatch-json
SUBDIR += dwatch-pwsnoop
+ SUBDIR += dynamic_motd
SUBDIR += e2fsprogs
SUBDIR += e2fsprogs-core
SUBDIR += e2tools
diff --git a/sysutils/dynamic_motd/Makefile b/sysutils/dynamic_motd/Makefile
new file mode 100644
index 000000000000..56cdae0f78b1
--- /dev/null
+++ b/sysutils/dynamic_motd/Makefile
@@ -0,0 +1,19 @@
+PORTNAME= dynamic_motd
+DISTVERSIONPREFIX= v
+DISTVERSION= 1.3
+CATEGORIES= sysutils
+
+MAINTAINER= sstallion@gmail.com
+COMMENT= Dynamic /var/run/motd
+WWW= https://github.com/sstallion/dynamic_motd
+
+LICENSE= BSD2CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+IGNORE_FreeBSD_12= requires FreeBSD 13.0 or later
+
+NO_ARCH= yes
+USE_GITHUB= yes
+GH_ACCOUNT= sstallion
+
+.include <bsd.port.mk>
diff --git a/sysutils/dynamic_motd/distinfo b/sysutils/dynamic_motd/distinfo
new file mode 100644
index 000000000000..7b32f8fb36e6
--- /dev/null
+++ b/sysutils/dynamic_motd/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1681758637
+SHA256 (sstallion-dynamic_motd-v1.3_GH0.tar.gz) = 4f000c16f881ac15761b3c878c4845f0cb4f67a6de5172b2562384ac88143505
+SIZE (sstallion-dynamic_motd-v1.3_GH0.tar.gz) = 192602
diff --git a/sysutils/dynamic_motd/pkg-descr b/sysutils/dynamic_motd/pkg-descr
new file mode 100644
index 000000000000..b069d418c114
--- /dev/null
+++ b/sysutils/dynamic_motd/pkg-descr
@@ -0,0 +1,5 @@
+dynamic_motd is a drop-in replacement for generating messages of the day on
+FreeBSD 13.0 or later. During system startup, the file /var/run/motd is
+replaced with a fifo whose content is generated by a user-configurable shell
+script that is executed on each login. All other aspects of motd(5) are
+preserved.
diff --git a/sysutils/dynamic_motd/pkg-message b/sysutils/dynamic_motd/pkg-message
new file mode 100644
index 000000000000..21c84f031db5
--- /dev/null
+++ b/sysutils/dynamic_motd/pkg-message
@@ -0,0 +1,23 @@
+[
+{ type: install
+ message: <<EOM
+The ${PREFIX}/etc/rc.motd script is responsible for generating content for
+/var/run/motd on each login. A sample script is provided in
+${PREFIX}/etc/rc.motd.sample that emulates the default motd(5) behavior.
+More extensive examples can be found in ${PREFIX}/share/examples/dynamic_motd.
+
+To enable the dynamic_motd service, update_motd should be disabled in
+/etc/rc.conf as it is no longer needed at system startup:
+
+ # sysrc update_motd="NO"
+
+The dynamic_motd service can then be enabled by issuing:
+
+ # sysrc dynamic_motd="YES"
+ # service dynamic_motd start
+
+Note: ${PREFIX}/etc/rc.motd can be updated without restarting the
+dynamic_motd service; changes are automatically picked up on next login.
+EOM
+}
+]
diff --git a/sysutils/dynamic_motd/pkg-plist b/sysutils/dynamic_motd/pkg-plist
new file mode 100644
index 000000000000..93596d11fe54
--- /dev/null
+++ b/sysutils/dynamic_motd/pkg-plist
@@ -0,0 +1,7 @@
+etc/rc.d/dynamic_motd
+@sample etc/rc.motd.sample
+libexec/dynamic_motd
+share/doc/dynamic_motd/CONTRIBUTING.md
+share/doc/dynamic_motd/README.md
+share/examples/dynamic_motd/motd.subr
+share/examples/dynamic_motd/rc.motd