Changeset View
Standalone View
databases/couchdb2/Makefile
- This file was added.
# Created by: Dave Cottlehuber <dch@FreeBSD.org> | |||||
# $FreeBSD$ | |||||
PORTNAME= couchdb2 | |||||
DISTVERSION= 2.2.0 | |||||
CATEGORIES= databases | |||||
MASTER_SITES= APACHE/couchdb/source/${DISTVERSION} | |||||
DISTNAME= apache-couchdb-${DISTVERSION} | |||||
MAINTAINER= dch@FreeBSD.org | |||||
COMMENT= JSON document database with HTTP API and scalable multi-master sync | |||||
LICENSE= APACHE20 BSD3CLAUSE ISCL WTFPL OFL11 | |||||
LICENSE_COMB= multi | |||||
BUILD_DEPENDS= rebar:devel/rebar | |||||
mat: There is no `rebar` in the base system, so remove `${LOCALBASE}/bin/`. | |||||
LIB_DEPENDS= libicudata.so:devel/icu \ | |||||
libmozjs185.so:lang/spidermonkey185 | |||||
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} | |||||
USES= cpe gmake libtool ncurses python:run shebangfix | |||||
USE_RC_SUBR= couchdb2 | |||||
CPE_VENDOR= apache | |||||
SHEBANG_FILES= rel/overlay/bin/couchup | |||||
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=… | |||||
USERS= couchdb | |||||
GROUPS= couchdb | |||||
SUB_FILES= pkg-message couchdb2 | |||||
matUnsubmitted Done Inline ActionsNo need for couchdb2 here. mat: No need for couchdb2 here. | |||||
SUB_LIST= PORTNAME=${PORTNAME} APPDIR=${APPDIR} RELDIR=${RELDIR} ERL_PATH=${ERL_PATH} | |||||
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. | |||||
PLIST_SUB= VERSION=${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… | |||||
HAS_CONFIGURE= yes | |||||
CONFIGURE_ARGS= --skip-deps --user ${USERS} --disable-docs --disable-fauxton | |||||
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… | |||||
ALL_TARGET= release | |||||
OPTIONS_DEFINE= DOCS | |||||
OPTIONS_DEFAULT=OTP20 | |||||
OPTIONS_SUB= yes | |||||
OPTIONS_SINGLE= ENV | |||||
OPTIONS_SINGLE_ENV=OTP19 OTP20 | |||||
OTP19_DESC= Use Erlang OTP19 | |||||
Done Inline ActionsOPTIONS_DEFAULT should be first. mat: OPTIONS_DEFAULT should be first. | |||||
OTP19_BUILD_DEPENDS=${LOCALBASE}/lib/erlang19/bin/erlc:lang/erlang-runtime19 | |||||
OTP19_RUN_DEPENDS+=${LOCALBASE}/lib/erlang19/bin/erl:lang/erlang-runtime19 | |||||
matUnsubmitted Done Inline ActionsWhy +=? mat: Why `+=`? | |||||
dchAuthorUnsubmitted 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… | |||||
matUnsubmitted 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… | |||||
OTP19_MAKE_ENV= PATH=${LOCALBASE}/lib/erlang19/bin:${PATH} | |||||
OTP19_VARS= ERL_PATH=${LOCALBASE}/lib/erlang19/bin/erl | |||||
OTP20_DESC= Use Erlang OTP20 | |||||
OTP20_BUILD_DEPENDS=${LOCALBASE}/lib/erlang20/bin/erlc:lang/erlang-runtime20 | |||||
OTP20_RUN_DEPENDS+=${LOCALBASE}/lib/erlang20/bin/erl:lang/erlang-runtime20 | |||||
matUnsubmitted Done Inline ActionsWhy +=? mat: Why `+=`? | |||||
OTP20_MAKE_ENV= PATH=${LOCALBASE}/lib/erlang20/bin:${PATH} | |||||
OTP20_VARS= ERL_PATH=${LOCALBASE}/lib/erlang20/bin/erl | |||||
DBDIR?= /var/db/${PORTNAME} | |||||
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… | |||||
LOGFILE?= /var/log/${PORTNAME}/couch.log | |||||
APPDIR= ${LOCALBASE}/libexec/${PORTNAME} | |||||
RELDIR= ${APPDIR}/releases/${DISTVERSION} | |||||
Done Inline ActionsThis should be post-patch. mat: This should be post-patch. | |||||
Done Inline Actionsdone - but why is this better? dch: done - but why is this better? | |||||
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… | |||||
post-patch: | |||||
@${REINPLACE_CMD} \ | |||||
-e 's,%%APPDIR%%,${APPDIR},g' \ | |||||
-e 's,%%DATADIR%%,${DATADIR},g' \ | |||||
-e 's,%%DBDIR%%,${DBDIR},g' \ | |||||
-e 's,%%LOCALBASE%%,${LOCALBASE},g' \ | |||||
-e 's,%%PORTNAME%%,${PORTNAME},g' \ | |||||
-e 's,\$COUCHDB_USER,${USERS},g' \ | |||||
-e 's,\$LOG_FILE,${LOGFILE},g' \ | |||||
${WRKSRC}/configure | |||||
pre-install: | |||||
Done Inline ActionsNo need for the / here. mat: No need for the `/` here. | |||||
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… | |||||
# relocate user-modifiable runtime configs to match hier(7) | |||||
${MKDIR} ${STAGEDIR}${ETCDIR} | |||||
${INSTALL_DATA} ${WRKSRC}/rel/couchdb/etc/local.ini \ | |||||
${STAGEDIR}${ETCDIR}/local.ini.sample | |||||
${INSTALL_DATA} ${WRKSRC}/rel/couchdb/etc/vm.args \ | |||||
${STAGEDIR}${ETCDIR}/vm.args.sample | |||||
${INSTALL_MAN} ${WRKSRC}/share/docs/man/apachecouchdb.1 \ | |||||
${STAGEDIR}${MANPREFIX}/man/man1 | |||||
# prune build artefacts and surplus headers | |||||
@${FIND} -E ${WRKSRC} -type f \ | |||||
-regex '.*\.(a|buildinfo|c|cc|cmd|d|h|o|orig|1)' -delete | |||||
Done Inline Actions-f is already part of ${RM} jrm: `-f` is already part of ${RM} | |||||
# remove runtime dirs and files that were moved to match hier(7) | |||||
@${RM} -r ${WRKSRC}/rel/couchdb/var \ | |||||
${WRKSRC}/rel/couchdb/etc/*.d \ | |||||
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… | |||||
${WRKSRC}/rel/couchdb/etc/local.ini \ | |||||
${WRKSRC}/rel/couchdb/etc/vm.args \ | |||||
${WRKSRC}/rel/couchdb/releases/*/vm.args \ | |||||
${WRKSRC}/rel/couchdb/lib/couch-*/priv/couchjs \ | |||||
${WRKSRC}/share/server | |||||
@${CP} ${WRKSRC}/src/docs/images/favicon.ico ${WRKSRC}/share/www/ | |||||
matUnsubmitted 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. | |||||
dchAuthorUnsubmitted 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. | |||||
matUnsubmitted Done Inline ActionsRight, missed that bit. mat: Right, missed that bit. | |||||
(cd ${WRKSRC}/rel/couchdb && ${COPYTREE_SHARE} . ${STAGEDIR}${APPDIR}) | |||||
post-install: | |||||
@${FIND} -E ${STAGEDIR} -type f \ | |||||
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… | |||||
-regex '.+/(couchjs|.+\.so)$$' \ | |||||
Done Inline Actions-exec ${STRIP_CMD} {} + mat: ```
-exec ${STRIP_CMD} {} +
``` | |||||
-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.. | |||||
@${MKDIR} \ | |||||
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? | |||||
${STAGEDIR}/var/db/${PORTNAME} \ | |||||
${STAGEDIR}/var/log/${PORTNAME} | |||||
# fauxton UI is a required component | |||||
(cd ${WRKSRC}/share/www && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/www) | |||||
post-install-DOCS-on: | |||||
${MKDIR} ${STAGEDIR}${DATADIR}/www/docs | |||||
(cd ${WRKSRC}/share/docs/html && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/www/docs) | |||||
.include <bsd.port.mk> |
There is no rebar in the base system, so remove ${LOCALBASE}/bin/.