Update sysutils/filelight to version 20.04.0
[dports.git] / sysutils / cpupdate / Makefile
1 # Created by: Eugene Grosbein <eugen@FreeBSD.org>
2 # $FreeBSD$
3
4 PORTNAME=       cpupdate
5 DISTVERSION=    g20180513
6 PORTREVISION=   1
7 CATEGORIES=     sysutils
8
9 MAINTAINER=     eugen@FreeBSD.org
10 COMMENT=        CPU microcode update utility for x86
11
12 LICENSE=        BSD2CLAUSE
13 LICENSE_FILE=   ${WRKSRC}/LICENSE
14 #
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.
21
22 USE_RC_SUBR=    ${PORTNAME}
23
24 ONLY_FOR_ARCHS=         amd64 i386
25 ONLY_FOR_ARCHS_REASON=  specific to x86 processors
26
27 SUB_FILES=      pkg-message
28 SUB_LIST=       CPM_DIR=${CPM_DIR} INTEL_DIR=${INTEL_DIR}
29
30 USE_GITHUB=     yes
31 GH_ACCOUNT=     kernschmelze
32 GH_PROJECT=     ${PORTNAME}
33 GH_TAGNAME=     48e42d5
34
35 PLIST_FILES=    sbin/${PORTNAME} man/man8/${PORTNAME}.8.gz
36
37 # MCE DB r127
38 CPM_ACCOUNT=    platomav
39 CPM_PROJECT=    CPUMicrocodes
40 CPM_TAGNAME=    557a90c
41
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
49
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
56
57 post-patch:
58         ${REINPLACE_CMD} -e "s,/usr/local/share/cpupdate,${DATADIR},g" ${WRKSRC}/cpupdate.h
59
60 do-install:
61         ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/sbin
62         ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${STAGEDIR}${MANPREFIX}/man/man8
63
64 .include <bsd.port.options.mk>
65
66 install-microcodes:
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})
72 .endif
73 .if ${PORT_OPTIONS:MCPM}
74         ${RM} -rf ${CPM_DATADIR}
75         ${MKDIR} ${CPM_DATADIR}
76         cpupdate -IC -S ${CPM_DIR}/Intel -T ${CPM_DATADIR}
77 .endif
78 .for _o in INTEL CPM
79 .if ${PORT_OPTIONS:M${_o}}
80         @${ECHO} ''
81         @${ECHO} '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
82         @${ECHO} NOTE: you have to manually remove the directory
83         @${ECHO} ${${_o}_DATADIR}
84         @${ECHO} after deinstallation of ${PORTNAME}.
85         @${ECHO} '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
86 .endif
87 .endfor
88
89 .include <bsd.port.mk>