aboutsummaryrefslogtreecommitdiff
path: root/sysutils/etc_os-release/Makefile
blob: 6cc437783458dea257496188b842ecea43f03454 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
PORTNAME=	etc_os-release
PORTVERSION=	0.1
PORTREVISION=	3
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

.if exists(/bin/freebsd-version)
VERSION!=	freebsd-version -u
.else
VERSION!=	uname -r
.endif
VERSION_ID=	${VERSION:C/^([0-9\.]+).*/\1/}

CONTENTS=	'NAME=FreeBSD\0'$\
		'VERSION=${VERSION}\0'$\
		'VERSION_ID=${VERSION_ID}\0'$\
		'ID=freebsd\0'$\
		'ANSI_COLOR="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'

.include <bsd.port.pre.mk>
# FreeBSD base gained /etc/os-release in r354922, which
# corresponds to __FreeBSD_version 1300060
.if ${OSVERSION} >= 1300060
IGNORE=		/etc/os-release is present in base
.endif

do-install:
	${MKDIR} ${STAGEDIR}${PREFIX}/etc
	${ECHO} -e ${CONTENTS} | ${XARGS} -0 -n 1 >> ${STAGEDIR}${PREFIX}/${PLIST_FILES}

.include <bsd.port.post.mk>