Changeset View
Standalone View
head/security/teleport/Makefile
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= teleport | PORTNAME= teleport | ||||
DISTVERSIONPREFIX= v | DISTVERSIONPREFIX= v | ||||
DISTVERSION= 2.5.7 | DISTVERSION= 2.6.6 | ||||
CATEGORIES= security | CATEGORIES= security | ||||
MAINTAINER= seanc@FreeBSD.org | MAINTAINER= seanc@FreeBSD.org | ||||
COMMENT= Gravitational Telport SSH | COMMENT= Gravitational Telport SSH | ||||
LICENSE= APACHE20 | LICENSE= APACHE20 | ||||
ONLY_FOR_ARCHS= amd64 | NOT_FOR_ARCHS= i386 | ||||
mat: Please add ONLY_FOR_ARCHS_REASON to explain. | |||||
NOT_FOR_ARCHS_REASON= Uses 64bit types | |||||
BUILD_DEPENDS= ${LOCALBASE}/bin/go:lang/go \ | BUILD_DEPENDS= go:lang/go \ | ||||
${LOCALBASE}/bin/zip:archivers/zip | zip:archivers/zip | ||||
Done Inline ActionsRemove ${LOCALBASE}/bin/. mat: Remove `${LOCALBASE}/bin/`. | |||||
Done Inline ActionsI looked for a way to see if there is a test to verify that a version of go is greater than a given version. If a user only has go1.4 in their path then the build will fail, whereas using ${LOCALBASE}/bin implies someone is keeping current with their ports maintenance. I've made the adjustment, but that's why I used ${LOCALBASE}/bin. seanc: I looked for a way to see if there is a test to verify that a version of `go` is greater than a… | |||||
Done Inline ActionsI don't understand. If you remove ${LOCALBASE}/bin/ as I asked, the framework will look for a binary named go in PATH. If a user has a go14 binary, well, it will not be used, as it is not called go. Please remove ${LOCALBASE}/bin/. mat: I don't understand. If you remove `${LOCALBASE}/bin/` as I asked, the framework will look for… | |||||
Not Done Inline ActionsI understand. My comment is with regards to common development patterns where ~/go/bin/go may not be the latest and greatest and may not meet the build requirements. It's common to use PATH=$GOPATH/bin:$PATH which means a user's local go would be used. I was trying to guard against that particular outcome. I fixed it in the patch but was explaining why I used ${LOCALBASE}/bin/go vs just go. seanc: I understand. My comment is with regards to common development patterns where `~/go/bin/go`… | |||||
USES= compiler gmake | USES= compiler gmake | ||||
USE_GITHUB= yes | USE_GITHUB= yes | ||||
GH_ACCOUNT= gravitational | GH_ACCOUNT= gravitational | ||||
GH_TAG_COMMIT= b3f4ecb | GH_TAG_COMMIT= b3f4ecb | ||||
Done Inline ActionsRemove, default. mat: Remove, default. | |||||
USE_RC_SUBR= teleport | USE_RC_SUBR= teleport | ||||
SUB_FILES= pkg-message | SUB_FILES= pkg-message | ||||
PLIST_FILES= bin/teleport \ | PLIST_FILES= bin/teleport \ | ||||
bin/tctl \ | bin/tctl \ | ||||
bin/tsh \ | bin/tsh \ | ||||
etc/teleport.yaml.sample | "@sample etc/teleport.yaml.sample" | ||||
Done Inline ActionsUse @sample? mat: Use `@sample`? | |||||
# Extra assets are stored in the binary and must not be inadvertently removed | |||||
STRIP= | STRIP= | ||||
Done Inline ActionsWhy? mat: Why? | |||||
Done Inline ActionsThe teleport binary includes extra UI elements appended to the binary that is removed when the binary is stripped. seanc: The `teleport` binary includes extra UI elements appended to the binary that is removed when… | |||||
Done Inline ActionsThen please add a comment before the STRIP variable saying so. mat: Then please add a comment before the STRIP variable saying so. | |||||
GO_TELEPORT_SRC_DIR= src/github.com/gravitational/teleport | GO_TELEPORT_SRC_DIR= src/github.com/gravitational/teleport | ||||
PRE_GOPATH_DIR= ${PORTNAME}-${DISTVERSION}${DISTVERSIONSUFFIX} | PRE_GOPATH_DIR= ${PORTNAME}-${DISTVERSION}${DISTVERSIONSUFFIX} | ||||
post-extract: | post-extract: | ||||
@${MKDIR} ${WRKDIR}/${GO_TELEPORT_SRC_DIR} | @${MKDIR} ${WRKDIR}/${GO_TELEPORT_SRC_DIR} | ||||
@${CP} -rp ${WRKDIR}/${PRE_GOPATH_DIR}/vendor/* ${WRKDIR}/src/ | @${CP} -rp ${WRKDIR}/${PRE_GOPATH_DIR}/vendor/* ${WRKDIR}/src/ | ||||
@${CP} -rp ${WRKDIR}/${PRE_GOPATH_DIR}/* ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/ | @${CP} -rp ${WRKDIR}/${PRE_GOPATH_DIR}/* ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/ | ||||
post-patch: | post-patch: | ||||
@${REINPLACE_CMD} -e "s|%%GH_TAG_COMMIT%%|${GH_TAG_COMMIT}|g" \ | @${REINPLACE_CMD} -e 's|^GITREF=.*|GITREF=${GH_TAG_COMMIT}|' \ | ||||
Done Inline ActionsIt would probably be easier to simply do something like: 's|^GITREF=.*|GITREF=${GH_TAG_COMMIT}|' and remove the patch. mat: It would probably be easier to simply do something like:
```
's|^GITREF=. | |||||
${WRKDIR}/${GO_TELEPORT_SRC_DIR}/version.mk | ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/version.mk | ||||
@${FIND} ${WRKDIR} -type f -exec ${SED} -i '' -e 's|\/var\/lib|/var/db|g' {} \; | |||||
@${FIND} ${WRKDIR} -type f -exec ${SED} -i '' -e 's|\/usr\/bin\/hostname|/bin/hostname|g' {} \; | |||||
matUnsubmitted Not Done Inline ActionsPlease use -exec ... + instead of -exec ... ;, also, fold the two sed commands into one line. It will make it run one or two sed commands instead of twice the number of files there are in WRKDIR. mat: Please use `-exec ... +` instead of `-exec ... ;`, also, fold the two sed commands into one… | |||||
do-build: | do-build: | ||||
@cd ${WRKDIR}/${GO_TELEPORT_SRC_DIR} && \ | @cd ${WRKDIR}/${GO_TELEPORT_SRC_DIR} && \ | ||||
${SETENV} ${MAKE_ENV} ${BUILD_ENV} \ | ${SETENV} ${MAKE_ENV} ${BUILD_ENV} \ | ||||
CGO_ENABLED=1 GOPATH=${WRKDIR} \ | CGO_ENABLED=1 GOPATH=${WRKDIR} \ | ||||
${GMAKE} -s full | ${GMAKE} full | ||||
Done Inline ActionsRemove -s, builds must not be silent. mat: Remove `-s`, builds must not be silent. | |||||
do-install: | do-install: | ||||
${WRKDIR}/${GO_TELEPORT_SRC_DIR}/build/teleport configure > ${STAGEDIR}${PREFIX}/etc/teleport.yaml.sample | ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/build/teleport configure > ${STAGEDIR}${PREFIX}/etc/teleport.yaml.sample | ||||
@${SED} -i '' -e "s|nodename: .*|nodename: |g" ${STAGEDIR}${PREFIX}/etc/teleport.yaml.sample | |||||
@${SED} -i '' -e "s|cluster-join-token||g" ${STAGEDIR}${PREFIX}/etc/teleport.yaml.sample | |||||
matUnsubmitted Not Done Inline Actionsrun sed only once. mat: run sed only once. | |||||
${INSTALL_PROGRAM} ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/build/teleport ${STAGEDIR}${PREFIX}/bin | ${INSTALL_PROGRAM} ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/build/teleport ${STAGEDIR}${PREFIX}/bin | ||||
${INSTALL_PROGRAM} ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/build/tsh ${STAGEDIR}${PREFIX}/bin | ${INSTALL_PROGRAM} ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/build/tsh ${STAGEDIR}${PREFIX}/bin | ||||
${INSTALL_PROGRAM} ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/build/tctl ${STAGEDIR}${PREFIX}/bin | ${INSTALL_PROGRAM} ${WRKDIR}/${GO_TELEPORT_SRC_DIR}/build/tctl ${STAGEDIR}${PREFIX}/bin | ||||
.include <bsd.port.pre.mk> | .include <bsd.port.pre.mk> | ||||
# golang assumes that if clang is in use, it is called "clang" and not "cc". If | # golang assumes that if clang is in use, it is called "clang" and not "cc". If | ||||
# it's called "cc", go fails. | # it's called "cc", go fails. | ||||
.if ${COMPILER_TYPE} == clang | .if ${COMPILER_TYPE} == clang | ||||
BUILD_ENV= CC=clang | BUILD_ENV= CC=clang | ||||
.endif | .endif | ||||
.include <bsd.port.post.mk> | .include <bsd.port.post.mk> |
Please add ONLY_FOR_ARCHS_REASON to explain.