Early work on making bsd.port.mk like kmod
"David W. Chapman Jr." <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.audit |
|---|---|
| Message-ID | <[email protected]> |
This is my first attempt any any type of shell scripting or bsd.port.mk work so take that into consideration when you review. This is just the early phase of making bsd.port.mk like kmod ports and does not have anything fancy, its more for concept right now. I would like to see if anyone agrees with the approach I'm taking right now and suggestions are welcome. -- David W. Chapman Jr. [email protected] Raintree Network Services, Inc. <www.inethouston.net> [email protected] FreeBSD Committer <www.FreeBSD.org>
bsd.port.mk.patch
(text/plain, 1.3 KB)
Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.414
diff -u -r1.414 bsd.port.mk
--- bsd.port.mk 13 Jun 2002 18:20:40 -0000 1.414
+++ bsd.port.mk 17 Jun 2002 19:58:05 -0000
@@ -527,6 +527,9 @@
# when you noticed the distfile you just fetched has
# a different checksum and you intend to verify if
# the port still works with it.
+# Not sure where this should go, so here is a good start
+# USE_KMOD - Port uses kernel sources to build.
+# KMOD_DIR - Directory for kmod files to be installed to.
# Start of pre-makefile section.
.if !defined(AFTERPORTMK)
@@ -781,6 +784,17 @@
#RESTRICTED= "Contains cryptography."
.endif
+.if defined(USE_KMOD)
+.if !exists(/usr/src/sys/Makefile)
+BROKEN= "Kernel source files required"
+.endif
+.if ${OSVERSION} >= 500000
+KMOD_DIR?= /boot/kernel
+.else
+KMOD_DIR?= /modules
+.endif
+.endif
+
.if defined(EMACS_PORT_NAME)
.include "${PORTSDIR}/Mk/bsd.emacs.mk"
.endif
@@ -3310,6 +3324,9 @@
@>${TMPPLIST}
@for man in ${__MANPAGES}; do \
${ECHO_CMD} $${man} >> ${TMPPLIST}; \
+ done
+ @for kmod in ${INSTALL_KMOD}; do \
+ ${ECHO_CMD} @unexec ${RM} ${KMOD_DIR}/`${BASENAME} $$kmod` >> ${TMPPLIST}; \
done
.for _PREFIX in ${PREFIX}
.if ${_TMLINKS:M${_PREFIX}*}x != x