2000-04-03 15:28:30 +00:00
|
|
|
# New ports collection makefile for: rtc
|
|
|
|
# Date created: 28 March 2000
|
|
|
|
# Whom: Akinori MUSHA aka knu <knu@idaemons.org>
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
2000-04-12 04:56:17 +00:00
|
|
|
PORTNAME= rtc
|
2000-09-22 11:08:22 +00:00
|
|
|
PORTVERSION= 2000.09.22
|
2000-04-03 15:28:30 +00:00
|
|
|
CATEGORIES= emulators linux
|
|
|
|
MASTER_SITES= # none
|
|
|
|
DISTFILES= # none
|
|
|
|
|
|
|
|
MAINTAINER= freebsd-emulation@FreeBSD.org
|
|
|
|
|
|
|
|
WRKSRC= ${WRKDIR}/files
|
|
|
|
|
|
|
|
LINUX_DIR= /compat/linux
|
|
|
|
KMODDIR= ${PREFIX}/modules
|
|
|
|
|
|
|
|
CDEV_MAJOR= 202
|
2000-04-14 20:13:55 +00:00
|
|
|
DEVDIR= ${LINUX_DIR}/dev
|
2000-04-03 15:28:30 +00:00
|
|
|
|
|
|
|
STARTUP= rtc.sh
|
|
|
|
MAKE_ARGS= KMODDIR="${KMODDIR}" CDEV_MAJOR="${CDEV_MAJOR}"
|
2000-04-14 20:13:55 +00:00
|
|
|
PLIST_SUB= DEVDIR="${DEVDIR}" CDEV_MAJOR="${CDEV_MAJOR}" RTC_H_DIR="${RTC_H_DIR}"
|
2000-04-03 15:28:30 +00:00
|
|
|
|
2000-09-22 11:08:22 +00:00
|
|
|
SRC_BASE?= /usr/src
|
|
|
|
|
2000-04-03 15:28:30 +00:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
|
|
|
.if ${OSVERSION} < 400013
|
|
|
|
BROKEN= "Systems prior to 400013 is out of support"
|
|
|
|
.endif
|
|
|
|
|
2000-09-22 11:08:22 +00:00
|
|
|
.if !exists(${SRC_BASE}/sys/Makefile)
|
2000-04-03 15:28:30 +00:00
|
|
|
BROKEN= "Kernel source files required"
|
|
|
|
.endif
|
|
|
|
|
|
|
|
do-fetch:
|
|
|
|
@${ECHO} "I don't fetch anything..."
|
|
|
|
|
|
|
|
do-extract:
|
|
|
|
@${MKDIR} ${WRKSRC}
|
|
|
|
@${SED} -e 's,@@PREFIX@@,${PREFIX},' \
|
|
|
|
${FILESDIR}/${STARTUP} > ${WRKDIR}/${STARTUP}
|
|
|
|
@cd ${FILESDIR} && ${CP} Makefile *.[ch] ${WRKSRC}/
|
|
|
|
|
2000-08-24 14:51:20 +00:00
|
|
|
post-patch:
|
2000-09-22 11:08:22 +00:00
|
|
|
.if !exists(${SRC_BASE}/sys/compat/linux/linux_ioctl.h)
|
2000-08-24 14:51:20 +00:00
|
|
|
${PERL} -i -pe 's,compat(/linux/linux_ioctl\.h),i386$$1,' \
|
|
|
|
${WRKSRC}/rtc_linux.c
|
|
|
|
.endif
|
2000-09-22 11:08:22 +00:00
|
|
|
@if ! grep -w dev2unit ${SRC_BASE}/sys/kern/kern_conf.c >/dev/null; \
|
|
|
|
then \
|
|
|
|
${ECHO} "dev2unit() not found in sys/kern/kern_conf.c. Using lminor() instead."; \
|
|
|
|
${PERL} -i -pe 's,dev2unit,lminor,' ${WRKSRC}/rtc.c; \
|
|
|
|
fi
|
2000-08-24 14:51:20 +00:00
|
|
|
|
2000-04-03 15:28:30 +00:00
|
|
|
pre-install:
|
|
|
|
${MKDIR} ${KMODDIR}
|
2000-04-14 20:13:55 +00:00
|
|
|
${MKDIR} ${DEVDIR}
|
2000-04-03 15:28:30 +00:00
|
|
|
|
|
|
|
post-install:
|
2000-04-14 20:13:55 +00:00
|
|
|
${RM} -f ${DEVDIR}/rtc
|
|
|
|
mknod ${DEVDIR}/rtc c ${CDEV_MAJOR} 0
|
2000-04-03 15:28:30 +00:00
|
|
|
${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>
|