Changeset View
Standalone View
databases/couchdb2/Makefile
# Created by: Dave Cottlehuber <dch@FreeBSD.org> | # Created by: Dave Cottlehuber <dch@FreeBSD.org> | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= couchdb2 | PORTNAME= couchdb2 | ||||
DISTVERSION= 2.2.0 | DISTVERSION= 2.2.0 | ||||
CATEGORIES= databases | CATEGORIES= databases | ||||
MASTER_SITES= APACHE/couchdb/source/${DISTVERSION} | MASTER_SITES= APACHE/couchdb/source/${DISTVERSION} | ||||
DISTNAME= apache-couchdb-${DISTVERSION} | DISTNAME= apache-couchdb-${DISTVERSION} | ||||
MAINTAINER= dch@FreeBSD.org | MAINTAINER= dch@FreeBSD.org | ||||
COMMENT= JSON document database with HTTP API and scalable multi-master sync | COMMENT= JSON document database with HTTP API and scalable multi-master sync | ||||
LICENSE= APACHE20 BSD3CLAUSE ISCL WTFPL OFL11 | LICENSE= APACHE20 BSD3CLAUSE ISCL WTFPL OFL11 | ||||
LICENSE_COMB= multi | LICENSE_COMB= multi | ||||
BUILD_DEPENDS= ${LOCALBASE}/bin/rebar:devel/rebar | BUILD_DEPENDS= ${LOCALBASE}/bin/rebar:devel/rebar | ||||
mat: There is no `rebar` in the base system, so remove `${LOCALBASE}/bin/`. | |||||
LIB_DEPENDS= libicudata.so:devel/icu \ | LIB_DEPENDS= libicudata.so:devel/icu \ | ||||
libmozjs185.so:lang/spidermonkey185 | libmozjs185.so:lang/spidermonkey185 | ||||
USES= cpe gmake libtool ncurses python:run shebangfix | |||||
USE_RC_SUBR= couchdb2 | |||||
USERS= couchdb | USERS= couchdb | ||||
GROUPS= couchdb | GROUPS= couchdb | ||||
Done Inline ActionsUSES and USE_x block needs to move up to conform to Order of Variables in Port Makefiles in PH. jrm: `USES and USE_x` block needs to move up to conform to `Order of Variables in Port Makefiles` in… | |||||
Done Inline ActionsMy interpretation of Chapter 15 of the PH, and specifically Start this section with defining USES, and then possible USE_x. Keep related variables close together. For example, if using USE_GITHUB, always put the GH_* variables right after it. is USES= cpe gmake libtool ncurses python:run shebangfix CPE_VENDOR= apache SHEBANG_FILES= rel/overlay/bin/couchup USE_RC_SUBR= couchdb2 but, to me, this is all small potatoes. @mat probably wrote that chapter, so maybe he can clarify. jrm: My interpretation of Chapter 15 of the PH, and specifically `Start this section with defining… | |||||
Done Inline ActionsYeah, does not really matter. You can also add blank lines to let it breath a bit and be more readable. mat: Yeah, does not really matter. You can also add blank lines to let it breath a bit and be more… | |||||
Done Inline Actionslatest portlint doesn't like this; I've done this instead: USES= USE_RC_SUBR= CPE_VENDOR= SHEBANG_FILES= dch: latest portlint doesn't like this; I've done this instead:
```
USES=
USE_RC_SUBR=
CPE_VENDOR=… | |||||
USES= cpe gmake libtool ncurses python:run shebangfix | |||||
SHEBANG_FILES= rel/overlay/bin/couchup | SHEBANG_FILES= rel/overlay/bin/couchup | ||||
DBDIR?= /var/db/${PORTNAME} | DBDIR?= /var/db/${PORTNAME} | ||||
LOGFILE?= /var/log/${PORTNAME}/couch.log | LOGFILE?= /var/log/${PORTNAME}/couch.log | ||||
Done Inline ActionsThese belong in the The Rest of the Variables block according to the PH. jrm: These belong in the `The Rest of the Variables` block according to the PH. | |||||
Done Inline ActionsNo need for couchdb2 here. mat: No need for couchdb2 here. | |||||
APPDIR= ${LOCALBASE}/libexec/${PORTNAME} | APPDIR= ${LOCALBASE}/libexec/${PORTNAME} | ||||
RELDIR= ${APPDIR}/releases/${DISTVERSION} | RELDIR= ${APPDIR}/releases/${DISTVERSION} | ||||
Done Inline ActionsI think this qualifies under Keep related variables close together. For example, if using USE_GITHUB, always put the GH_* variables right after it. jrm: I think this qualifies under `Keep related variables close together. For example, if using… | |||||
USE_RC_SUBR= couchdb2 | |||||
SUB_FILES= pkg-message couchdb2 | SUB_FILES= pkg-message couchdb2 | ||||
SUB_LIST= PORTNAME=${PORTNAME} APPDIR=${APPDIR} RELDIR=${RELDIR} ERL_PATH=${ERL_PATH} | SUB_LIST= PORTNAME=${PORTNAME} APPDIR=${APPDIR} RELDIR=${RELDIR} ERL_PATH=${ERL_PATH} | ||||
Done Inline Actionsshouldn-t docs be enabled by a DOCS option? mat: shouldn-t docs be enabled by a DOCS option? | |||||
Done Inline ActionsI need to look a bit more into this, might be tomorrow. I'm not sure whether my current patch is actually doing what I expected it to. Am I correct that running make DOCS= ... and make DOCS=1 ... is sufficient to test these options? Or is there a better way? dch: I need to look a bit more into this, might be tomorrow. I'm not sure whether my current patch… | |||||
Done Inline ActionsI have no idea how that software works, or how to enable the building of the documentation in it, so I could not say how to hook it up in the port. mat: I have no idea how that software works, or how to enable the building of the documentation in… | |||||
PLIST_SUB= VERSION=${DISTVERSION} | PLIST_SUB= VERSION=${DISTVERSION} | ||||
CPE_VENDOR= apache | CPE_VENDOR= apache | ||||
HAS_CONFIGURE= yes | HAS_CONFIGURE= yes | ||||
CONFIGURE_ARGS= --skip-deps --user ${USERS} --disable-docs --disable-fauxton | CONFIGURE_ARGS= --skip-deps --user ${USERS} --disable-docs --disable-fauxton | ||||
ALL_TARGET= release | ALL_TARGET= release | ||||
OPTIONS_SUB= yes | OPTIONS_SUB= yes | ||||
OPTIONS_DEFAULT=OTP20 | OPTIONS_DEFAULT=OTP20 | ||||
matUnsubmitted Done Inline ActionsOPTIONS_DEFAULT should be first. mat: OPTIONS_DEFAULT should be first. | |||||
OPTIONS_SINGLE= ENV | OPTIONS_SINGLE= ENV | ||||
Done Inline ActionsWhy +=? mat: Why `+=`? | |||||
Done Inline ActionsI'd expected that OTP*_RUN_DEPENDS will have the OTP*_ part stripped, and then needs to be appended to the existing RUN_DEPENDS from earlier in the Makefile that includes the py-requests? dch: I'd expected that OTP*_RUN_DEPENDS will have the OTP*_ part stripped, and then needs to be… | |||||
Done Inline ActionsI am not sure what you are saying. You use += when you are appending to a variable. Here, the variable does not exist before, so you do not need to append to it. mat: I am not sure what you are saying. You use `+=` when you are appending to a variable. Here… | |||||
OPTIONS_SINGLE_ENV=OTP19 OTP20 | OPTIONS_SINGLE_ENV=OTP19 OTP20 | ||||
OTP19_DESC= Use Erlang OTP19 | OTP19_DESC= Use Erlang OTP19 | ||||
OTP19_BUILD_DEPENDS=${LOCALBASE}/lib/erlang19/bin/erlc:lang/erlang-runtime19 | OTP19_BUILD_DEPENDS=${LOCALBASE}/lib/erlang19/bin/erlc:lang/erlang-runtime19 | ||||
OTP19_RUN_DEPENDS=${LOCALBASE}/lib/erlang19/bin/erl:lang/erlang-runtime19 | OTP19_RUN_DEPENDS=${LOCALBASE}/lib/erlang19/bin/erl:lang/erlang-runtime19 | ||||
OTP19_MAKE_ENV= PATH=${LOCALBASE}/lib/erlang19/bin:${PATH} | OTP19_MAKE_ENV= PATH=${LOCALBASE}/lib/erlang19/bin:${PATH} | ||||
Done Inline ActionsWhy +=? mat: Why `+=`? | |||||
OTP19_VARS= ERL_PATH=${LOCALBASE}/lib/erlang19/bin/erl | OTP19_VARS= ERL_PATH=${LOCALBASE}/lib/erlang19/bin/erl | ||||
OTP20_DESC= Use Erlang OTP20 | OTP20_DESC= Use Erlang OTP20 | ||||
OTP20_BUILD_DEPENDS=${LOCALBASE}/lib/erlang20/bin/erlc:lang/erlang-runtime20 | OTP20_BUILD_DEPENDS=${LOCALBASE}/lib/erlang20/bin/erlc:lang/erlang-runtime20 | ||||
Done Inline ActionsI think this qualifies under Keep related variables close together. For example, if using USE_GITHUB, always put the GH_* variables right after it. jrm: I think this qualifies under `Keep related variables close together. For example, if using… | |||||
Done Inline ActionsNow I'm confused. Last diff I understood these all needed to be moved down to the bottom. Its awkward in phab to see where you want to move those back to - where would that end up? back below USES? Lets see if the next diff gets it right. dch: Now I'm confused. Last diff I understood these all needed to be moved down to the bottom. Its… | |||||
OTP20_RUN_DEPENDS=${LOCALBASE}/lib/erlang20/bin/erl:lang/erlang-runtime20 | OTP20_RUN_DEPENDS=${LOCALBASE}/lib/erlang20/bin/erl:lang/erlang-runtime20 | ||||
OTP20_MAKE_ENV= PATH=${LOCALBASE}/lib/erlang20/bin:${PATH} | OTP20_MAKE_ENV= PATH=${LOCALBASE}/lib/erlang20/bin:${PATH} | ||||
OTP20_VARS= ERL_PATH=${LOCALBASE}/lib/erlang20/bin/erl | OTP20_VARS= ERL_PATH=${LOCALBASE}/lib/erlang20/bin/erl | ||||
pre-configure: | pre-configure: | ||||
matUnsubmitted Done Inline ActionsThis should be post-patch. mat: This should be post-patch. | |||||
dchAuthorUnsubmitted Done Inline Actionsdone - but why is this better? dch: done - but why is this better? | |||||
matUnsubmitted Done Inline ActionsIt has nothing to do with better, it is semantically wrong. You are patching the file, which should always happen in the patch phase. The pre-configure target is in the configure phase, when you run commands to prepare the configuration, like re-generating a configure script, or whatever. mat: It has nothing to do with better, it is semantically wrong. You are **patching** the file… | |||||
@${REINPLACE_CMD} \ | @${REINPLACE_CMD} \ | ||||
-e 's,%%DATADIR%%,${DATADIR},g' \ | -e 's,%%DATADIR%%,${DATADIR},g' \ | ||||
-e 's,%%DBDIR%%,${DBDIR},g' \ | -e 's,%%DBDIR%%,${DBDIR},g' \ | ||||
-e 's,%%LOCALBASE%%,${LOCALBASE},g' \ | -e 's,%%LOCALBASE%%,${LOCALBASE},g' \ | ||||
-e 's,%%PORTNAME%%,${PORTNAME},g' \ | -e 's,%%PORTNAME%%,${PORTNAME},g' \ | ||||
-e 's,\$COUCHDB_USER,${USERS},g' \ | -e 's,\$COUCHDB_USER,${USERS},g' \ | ||||
-e 's,\$LOG_FILE,${LOGFILE},g' \ | -e 's,\$LOG_FILE,${LOGFILE},g' \ | ||||
${WRKSRC}/configure | ${WRKSRC}/configure | ||||
pre-install: | pre-install: | ||||
# relocate user-modifiable runtime configs to match hier(7) | # relocate user-modifiable runtime configs to match hier(7) | ||||
${MKDIR} ${STAGEDIR}/${ETCDIR} | ${MKDIR} ${STAGEDIR}/${ETCDIR} | ||||
matUnsubmitted Done Inline ActionsNo need for the / here. mat: No need for the `/` here. | |||||
dchAuthorUnsubmitted Done Inline ActionsBTW I've marked this as /done/ as the / is needed here, I assume its the final slash you referred to @mat ? make -V WRKDIR /tmp/usr/ports/databases/couchdb2/work ... make package ===> License APACHE20 BSD3CLAUSE ISCL WTFPL OFL11 accepted by the user ===> couchdb2-2.2.0 depends on file: /usr/local/sbin/pkg - found => apache-couchdb-2.2.0.tar.gz doesn't seem to exist in /usr/ports/distfiles/. => Attempting to fetch https://www.apache.org/dist/couchdb/source/2.2.0/apache-couchdb-2.2.0.tar.gz apache-couchdb-2.2.0.tar.gz 16 MB 1472 kBps 11s ===> Fetching all distfiles required by couchdb2-2.2.0 for building ===> Extracting for couchdb2-2.2.0 => SHA256 Checksum OK for apache-couchdb-2.2.0.tar.gz. ===> Patching for couchdb2-2.2.0 ===> Applying FreeBSD patches for couchdb2-2.2.0 sed: /tmp/usr/ports/databases/couchdb2/work/apache-couchdb-2.2.0configure: No such file or directory *** Error code 1 dch: BTW I've marked this as /done/ as the `/` is needed here, I assume its the final slash you… | |||||
${INSTALL_DATA} ${WRKSRC}/rel/couchdb/etc/local.ini \ | ${INSTALL_DATA} ${WRKSRC}/rel/couchdb/etc/local.ini \ | ||||
${STAGEDIR}/${ETCDIR}/local.ini.sample | ${STAGEDIR}/${ETCDIR}/local.ini.sample | ||||
${INSTALL_DATA} ${WRKSRC}/rel/couchdb/etc/vm.args \ | ${INSTALL_DATA} ${WRKSRC}/rel/couchdb/etc/vm.args \ | ||||
${STAGEDIR}${ETCDIR}/vm.args.sample | ${STAGEDIR}${ETCDIR}/vm.args.sample | ||||
${INSTALL_MAN} ${WRKSRC}/share/docs/man/apachecouchdb.1 \ | ${INSTALL_MAN} ${WRKSRC}/share/docs/man/apachecouchdb.1 \ | ||||
${STAGEDIR}${MANPREFIX}/man/man1 | ${STAGEDIR}${MANPREFIX}/man/man1 | ||||
# prune build artefacts and surplus headers | # prune build artefacts and surplus headers | ||||
${FIND} -E ${WRKSRC} -type f \ | ${FIND} -E ${WRKSRC} -type f \ | ||||
-regex '.*\.(a|buildinfo|c|cc|cmd|d|h|o|orig)' -delete | -regex '.*\.(a|buildinfo|c|cc|cmd|d|h|o|orig)' -delete | ||||
# remove runtime dirs and files that were moved to match hier(7) | # remove runtime dirs and files that were moved to match hier(7) | ||||
Done Inline Actions-f is already part of ${RM} jrm: `-f` is already part of ${RM} | |||||
${RM} -rf ${WRKSRC}/rel/couchdb/var \ | ${RM} -r ${WRKSRC}/rel/couchdb/var \ | ||||
${WRKSRC}/rel/couchdb/etc/*.d \ | ${WRKSRC}/rel/couchdb/etc/*.d \ | ||||
${WRKSRC}/rel/couchdb/releases/*/vm.args | ${WRKSRC}/rel/couchdb/releases/*/vm.args | ||||
(cd ${WRKSRC}/rel/couchdb && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/libexec/couchdb2) | (cd ${WRKSRC}/rel/couchdb && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}) | ||||
matUnsubmitted Done Inline ActionsNot sure why this change is needed, you have other occurrences of couchdb2 in the port, this one is no special. mat: Not sure why this change is needed, you have other occurrences of `couchdb2` in the port, this… | |||||
post-install: | post-install: | ||||
.for l in $(${FIND} -E ${STAGEDIR} -type f -regex '/(couchjs|.+.so)$') | |||||
${STRIP_CMD} ${l} | |||||
.endfor | |||||
${MKDIR} \ | ${MKDIR} \ | ||||
Done Inline ActionsNever use CP to install files, use one of the INSTALL_* macros. mat: Never use `CP` to install files, use one of the `INSTALL_*` macros. | |||||
Done Inline ActionsIt's going to WRKSRC, not STAGEDIR, and gets installed later. I don't think this needs changing. dch: It's going to WRKSRC, not STAGEDIR, and gets installed later. I don't think this needs changing. | |||||
Done Inline ActionsRight, missed that bit. mat: Right, missed that bit. | |||||
${STAGEDIR}/var/db/${PORTNAME} \ | ${STAGEDIR}/var/db/${PORTNAME} \ | ||||
${STAGEDIR}/var/log/${PORTNAME} \ | ${STAGEDIR}/var/log/${PORTNAME} \ | ||||
${STAGEDIR}/var/run/${PORTNAME} | ${STAGEDIR}/var/run/${PORTNAME} | ||||
Done Inline ActionsWouldn't -name '*.so' be enough? Are there any other .so files in there that, for some reason should not be stripped? mat: Wouldn't -name '*.so' be enough? Are there any other .so files in there that, for some reason… | |||||
(cd ${WRKSRC}/share && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR$}) | (cd ${WRKSRC}/share && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR$}) | ||||
Done Inline Actions-exec ${STRIP_CMD} {} + mat: ```
-exec ${STRIP_CMD} {} +
``` | |||||
Done Inline ActionsThey are still not being stripped. Maybe this? jrm: They are still not being stripped.
http://pkg.awarnach.mathstat.dal.ca/data/11amd64… | |||||
Done Inline Actionsaaah I have STRIP= in my poudriere make.conf which is needed for dtrace support in erlang.. after wrapping that in a if .CURDIR.. endif I see these failures too during stage-qa, and my regex needs tweaking too. BTW is there a command to tell if a given binary hasn't been stripped (outside ports framework)? dch: aaah I have `STRIP=` in my poudriere make.conf which is needed for dtrace support in erlang.. | |||||
.include <bsd.port.mk> | .include <bsd.port.mk> | ||||
Done Inline Actions@${MKDIR}.... mkdir is an exception that can be silenced here. jrm: `@${MKDIR}...`. mkdir is an exception that can be silenced here. | |||||
Done Inline ActionsExtra $ at the end? mat: Extra `$` at the end? |
There is no rebar in the base system, so remove ${LOCALBASE}/bin/.