summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/etc_os-release/Makefile34
-rw-r--r--sysutils/etc_os-release/pkg-descr4
3 files changed, 39 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 5d87229ed633..7db0cbe3801c 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -301,6 +301,7 @@
SUBDIR += env4801
SUBDIR += envconsul
SUBDIR += epazote
+ SUBDIR += etc_os-release
SUBDIR += etcmerge
SUBDIR += etcupdate
SUBDIR += eventlog
diff --git a/sysutils/etc_os-release/Makefile b/sysutils/etc_os-release/Makefile
new file mode 100644
index 000000000000..780fe78859f5
--- /dev/null
+++ b/sysutils/etc_os-release/Makefile
@@ -0,0 +1,34 @@
+# $FreeBSD$
+
+PORTNAME= etc_os-release
+PORTVERSION= 0.1
+CATEGORIES= sysutils kde gnome
+MASTER_SITES= #
+DISTFILES= #
+EXTRACT_ONLY= #
+
+MAINTAINER= tcberner@FreeBSD.org
+COMMENT= Operating system identification file
+
+NO_BUILD= yes
+
+PLIST_FILES= etc/os-release
+
+VERSION!= freebsd-version -u
+VERSION_ID= ${VERSION:C/^([0-9\.]+).*/\1/}
+
+CONTENTS= 'NAME=FreeBSD\0'$\
+ 'VERSION=${VERSION}\0'$\
+ 'ID=${VERSION_ID}\0'$\
+ 'VERSION_ID=freebsd\0'$\
+ 'ANSI_COLIR="0;31"\0'$\
+ 'PRETTY_NAME="FreeBSD ${VERSION}"\0'$\
+ 'CPE_NAME=cpe:/o:freebsd:freebsd:${VERSION_ID}\0'$\
+ 'HOME_URL=https://freebsd.org/\0'$\
+ 'BUG_REPORT_URL=https://bugs.freebsd.org'
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/etc
+ ${ECHO} -e ${CONTENTS} | ${XARGS} -0 -n 1 >> ${STAGEDIR}${PREFIX}/${PLIST_FILES}
+
+.include <bsd.port.mk>
diff --git a/sysutils/etc_os-release/pkg-descr b/sysutils/etc_os-release/pkg-descr
new file mode 100644
index 000000000000..a548182f0c0b
--- /dev/null
+++ b/sysutils/etc_os-release/pkg-descr
@@ -0,0 +1,4 @@
+This package installs /usr/local/etc/os-release file which contains version and
+other information about installed operating system.
+
+WWW: https://www.freedesktop.org/software/systemd/man/os-release.html