On Wed, Dec 27, 2017 at 05:43:39PM +0000, Stuart Henderson wrote:
> On 2017/12/25 07:34, Landry Breuil wrote:
> > On Sun, Dec 24, 2017 at 08:27:11PM +0000, Stuart Henderson wrote:
> > > On 2017/12/24 10:35, Landry Breuil wrote:
> > > > Hi,
> > > > 
> > > > here's a port for influxdb 1.4.2, a time series database to store
> > > > metrics/events/analytics. I had to fight a bit with go.port.mk, and hack
> > > > my way around bundling the dependencies (which are vendored in the
> > > > selfhosted tarball) but it builds, installs and starts fine.
> > > > 
> > > > I haven't done any real testing yet (read: send metrics to it and try to
> > > > read them) but it can be used as a target for collectd network plugin,
> > > > ie replacing old-school rrd storage (no need for rrdcached anymore!),
> > > > and facette is supposed to be able to read metrics from it. Of course,
> > > > the next step is to port grafana..
> > > > 
> > > > Testing & feedback welcome!
> > > > 
> > > > Landry
> > > 
> > > GH_* shouldn't be set alongside MASTER_SITES .. Probably should just be
> > > the usual DISTNAME and/or PKGNAME ..
> > 
> > Well, for now it's more a convenience so that i can fetch the original
> > source from github (without the vendored dependencies) - this way i only
> > need to comment MASTER_SITES/EXTRACT_SUFX and run make tarball.
> > Maybe a comment would help ? Or commented out values ?
> > 
> 
> Probably better if that fetching is handled in 'make tarball' I think,
> it's even more confusing to temporarily use ports distfile fetching as an
> intermediate step to producing the actual ports distfile..

Well, i tried to remove the GH_* stuff and put all the gory bits of
tarball repacking in this make tarball target, but that becomes *very*
ugly. Having GH_ACCOUNT/GH_PROJECT set triggers lots of magic in
go.port.mk (whether it's a good idea or not is another topic) that the
other targets of the port sort of rely on (setting WRKSRC correctly,
among others.. ALL_TARGET, that weird MODGO_SETUP_WORKSPACE thing) so i
end up reinventing some bits.

Here's what the a diff between two variations of the Makefile would look
like. And i have to admit i find this ugly :)

-GH_ACCOUNT =   influxdata
-GH_PROJECT =   influxdb
-GH_TAGNAME =   v1.4.2
+V =            1.4.2
+DISTNAME =     influxdb-${V}
 
-EXTRACT_SUFX = .tar.bz2
+HOMEPAGE =     https://influxdata.com
+# selfhosted because we bundle go deps
 MASTER_SITES = https://rhaalovely.net/stuff/
 
 CATEGORIES =           databases
@@ -25,6 +25,7 @@
 # our handrolled distfile has the "right" layout already
 # disables MODGO_SETUP_WORKSPACE
 CONFIGURE_STYLE =      No
+WRKSRC =       ${MODGO_WORKSPACE}/src/github.com/influxdata/influxdb
 # for patches to apply
 WRKDIST =      ${WRKSRC}
 # for man/Makefile
@@ -47,9 +48,12 @@
                ${PREFIX}/share/examples/influxdb/
 
 # convenience hackish target to bundle/vendor dependencies
-tarball:
-       ftp -o /tmp/gpm 
https://raw.githubusercontent.com/pote/gpm/v1.4.0/bin/gpm
-       ${SETENV} ${MODGO_ENV} bash /tmp/gpm get ${WRKDIST}/Godeps
+tarball: clean
+       mkdir -p ${WRKDIR}/go/src/github.com/influxdata/
+       ftp -o ${WRKDIR}/${DISTFILES} 
https://github.com/influxdata/influxdb/archive/v${V}/${DISTFILES}
+       tar -s /influxdb-${V}/influxdb/ -C 
${WRKDIR}/go/src/github.com/influxdata/ -xzf ${WRKDIR}/${DISTFILES}
+       ftp -o ${WRKDIR}/gpm 
https://raw.githubusercontent.com/pote/gpm/v1.4.0/bin/gpm
+       ${SETENV} ${MODGO_ENV} bash ${WRKDIR}/gpm get ${WRKDIST}/Godeps
        cd ${WRKDIR} && tar -cjf /usr/ports/distfiles/${DISTFILES} go

Reply via email to