summaryrefslogtreecommitdiffstats
path: root/emulators/rtc/Makefile
blob: e69104f14505125160434723da6e20d7ab83318c (plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# New ports collection makefile for:	rtc
# Date created:		28 March 2000
# Whom:			Akinori MUSHA aka knu <knu@idaemons.org>
#
# $FreeBSD$
#

PORTNAME=	rtc
PORTVERSION=	2004.02.24.1
PORTREVISION=	6
CATEGORIES=	emulators linux
MASTER_SITES=	# none
DISTFILES=	# none

MAINTAINER=	freebsd-emulation@FreeBSD.org
COMMENT=	Kernel module which provides /dev/rtc device support

WRKSRC=		${WRKDIR}/files

NO_FETCH=	yes
USE_LINUX=	yes	# because of ${DEVDIR}

KMODDIR=	${PREFIX}/modules

CDEV_MAJOR=	202
DEVDIR=		${LINUXBASE}/dev

STARTUP=	rtc.sh
MAKE_ARGS=	KMODDIR="${KMODDIR}" CDEV_MAJOR="${CDEV_MAJOR}"
PLIST_SUB=	DEVDIR="${DEVDIR}" CDEV_MAJOR="${CDEV_MAJOR}" RTC_H_DIR="${RTC_H_DIR}"

SRC_BASE?=	/usr/src

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 400013
IGNORE=		needs a system more recent than 400013
.endif

.if !exists(${SRC_BASE}/sys/Makefile)
IGNORE=		needs kernel source files
.endif

do-extract:
	@${MKDIR} ${WRKSRC}
	@${SED}	-e 's,@@PREFIX@@,${PREFIX},' \
		${FILESDIR}/${STARTUP} > ${WRKDIR}/${STARTUP}
	@cd ${FILESDIR} && ${CP} Makefile *.[ch] ${WRKSRC}/

pre-install:
	${MKDIR} ${KMODDIR}

post-install:
	${RM} -f ${DEVDIR}/rtc
	-mknod /dev/rtc c ${CDEV_MAJOR} 0
	${INSTALL_DATA} ${WRKSRC}/rtc.h ${PREFIX}/include/
	${MKDIR} ${PREFIX}/share/examples/rtc
	${INSTALL_DATA} ${WRKSRC}/test.c ${PREFIX}/share/examples/rtc/
	@${ECHO} "Installing ${PREFIX}/etc/rc.d/${STARTUP} startup file.";
	${INSTALL_SCRIPT} ${WRKDIR}/${STARTUP} ${PREFIX}/etc/rc.d/

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud