1 # Created by: Eugene Grosbein <eugen@FreeBSD.org>
9 MAINTAINER= eugen@FreeBSD.org
10 COMMENT= CPU microcode update utility for x86
13 LICENSE_FILE= ${WRKSRC}/LICENSE
15 # The license of Intel's microcode binary files prohibits redistribution,
16 # so they are no part of this port to not restrict packaging and redistribution
17 # of the port itself. These binaries ought be downloaded and installed
18 # separately from this package by default. There are non-default port options
19 # and "make install-microcodes" command to download and install
20 # the whole bunch of microcode binaries.
22 USE_RC_SUBR= ${PORTNAME}
24 ONLY_FOR_ARCHS= amd64 i386
25 ONLY_FOR_ARCHS_REASON= specific to x86 processors
27 SUB_FILES= pkg-message
28 SUB_LIST= CPM_DIR=${CPM_DIR} INTEL_DIR=${INTEL_DIR}
31 GH_ACCOUNT= kernschmelze
32 GH_PROJECT= ${PORTNAME}
35 PLIST_FILES= sbin/${PORTNAME} man/man8/${PORTNAME}.8.gz
39 CPM_PROJECT= CPUMicrocodes
42 OPTIONS_DEFINE= CPM INTEL
43 CPM_DESC= Download platomav/CPUMicrocodes collection
44 CPM_GH_ACCOUNT= ${CPM_ACCOUNT}:cpm
45 CPM_GH_PROJECT= ${CPM_PROJECT}:cpm
46 CPM_GH_TAGNAME= ${CPM_TAGNAME}:cpm
47 CPM_DIR= ${WRKDIR}/${CPM_PROJECT}-${CPM_TAGNAME}
48 CPM_DATADIR= ${DATADIR}/CPUMicrocodes/secondary/Intel
50 INTEL_PACK= microcode-20180807.tgz
51 INTEL_DESC= Download Intel microcode pack ${INTEL_PACK}
52 INTEL_MASTER_SITES= https://downloadmirror.intel.com/28039/eng/:intel
53 INTEL_DISTFILES= ${INTEL_PACK}:intel
54 INTEL_DIR= ${WRKDIR}/intel-ucode
55 INTEL_DATADIR= ${DATADIR}/CPUMicrocodes/primary/Intel
58 ${REINPLACE_CMD} -e "s,/usr/local/share/cpupdate,${DATADIR},g" ${WRKSRC}/cpupdate.h
61 ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/sbin
62 ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${STAGEDIR}${MANPREFIX}/man/man8
64 .include <bsd.port.options.mk>
67 .if ${PORT_OPTIONS:MINTEL}
68 ${RM} -rf ${INTEL_DATADIR}
69 ${MKDIR} ${INTEL_DATADIR}
70 (cd ${INTEL_DIR} && ${COPYTREE_SHARE} . ${INTEL_DATADIR})
71 (cd ${INTEL_DIR}-with-caveats && ${COPYTREE_SHARE} . ${INTEL_DATADIR})
73 .if ${PORT_OPTIONS:MCPM}
74 ${RM} -rf ${CPM_DATADIR}
75 ${MKDIR} ${CPM_DATADIR}
76 cpupdate -IC -S ${CPM_DIR}/Intel -T ${CPM_DATADIR}
79 .if ${PORT_OPTIONS:M${_o}}
81 @${ECHO} '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
82 @${ECHO} NOTE: you have to manually remove the directory
83 @${ECHO} ${${_o}_DATADIR}
84 @${ECHO} after deinstallation of ${PORTNAME}.
85 @${ECHO} '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
89 .include <bsd.port.mk>