New port: databases/pgloader3

Pgloader loads data into PostgreSQL using the COPY streaming protocol,and
doing so with separate threads for reading and writing data.Asynchronous
IO,compiled to the metal programming language.
pgloader knows how to read data from MySQL,SQLite or dBase databases,and
knows how to discover the schema and properly cast data types over.It also
knows how to read CSV files in several definitions of CSV,and fixed columns
files.

WWW: http://pgloader.io

PR:           219165
Submitted by: Jov <amutu@amutu.com>
This commit is contained in:
Torsten Zuehlsdorff 2017-08-07 13:46:50 +00:00
parent 2843ab3fd7
commit ec1e4f8f2e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=447494
6 changed files with 109 additions and 0 deletions

View file

@ -586,6 +586,7 @@
SUBDIR += pgFormatter
SUBDIR += pgfouine
SUBDIR += pgloader
SUBDIR += pgloader3
SUBDIR += pglogical
SUBDIR += pgmodeler
SUBDIR += pgpool

View file

@ -0,0 +1,45 @@
# Created by: Jov <amutu@amutu.com>
# $FreeBSD$
PORTNAME= pgloader
PORTVERSION= 3.4.1
DISTVERSIONPREFIX= v
CATEGORIES= databases
PKGNAMESUFFIX= 3
MAINTAINER= amutu@amutu.com
COMMENT= Data loading tool for PostgreSQL,using the COPY command
LICENSE= PostgreSQL
BUILD_DEPENDS= ccl:lang/ccl
LIB_DEPENDS= libsqlite3.so:databases/sqlite3 \
libtdsodbc.so:databases/freetds
CONFLICTS= pgloader-2*
USES= gmake
USE_GITHUB= yes
GH_ACCOUNT= dimitri
GH_TUPLE= amutu:quicklisp_offline:e9008cc:qlp/build/quicklisp
PLIST_FILES= bin/pgloader \
bin/pgloader3 \
man/man1/pgloader.1.gz
MAKE_ARGS= CL=ccl
MAKE_ENV= ASDF_OUTPUT_TRANSLATIONS=/:
# stripping can break lisp binaries
STRIP=
post-patch:
${LN} ${WRKSRC}/build/quicklisp/quicklisp.lisp ${WRKSRC}/build
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/build/bin/pgloader ${STAGEDIR}${PREFIX}/bin/pgloader3
${INSTALL_SCRIPT} ${WRKSRC}/pgloader_wrapper.sh ${STAGEDIR}${PREFIX}/bin/pgloader
${INSTALL_MAN} ${WRKSRC}/pgloader.1 ${STAGEDIR}${MANPREFIX}/man/man1
.include <bsd.port.mk>

View file

@ -0,0 +1,5 @@
TIMESTAMP = 1499825145
SHA256 (dimitri-pgloader-v3.4.1_GH0.tar.gz) = 3ac4d03706057a35e1d4d0e63571b84be7d0d07ea09e015d90e242200488fe82
SIZE (dimitri-pgloader-v3.4.1_GH0.tar.gz) = 4218005
SHA256 (amutu-quicklisp_offline-e9008cc_GH0.tar.gz) = 2085b87b2c62b0eca85784995c86a66a0a202950c242e100273c9cea4cde0453
SIZE (amutu-quicklisp_offline-e9008cc_GH0.tar.gz) = 4833120

View file

@ -0,0 +1,38 @@
--- Makefile.orig 2017-07-06 14:53:29 UTC
+++ Makefile
@@ -84,7 +84,7 @@ $(QLDIR)/local-projects/cl-csv:
$(QLDIR)/setup.lisp:
mkdir -p $(BUILDDIR)
- curl -o $(BUILDDIR)/quicklisp.lisp http://beta.quicklisp.org/quicklisp.lisp
+# curl -o $(BUILDDIR)/quicklisp.lisp http://beta.quicklisp.org/quicklisp.lisp
$(CL) $(CL_OPTS) --load $(BUILDDIR)/quicklisp.lisp \
--load src/getenv.lisp \
--eval '(quicklisp-quickstart:install :path "$(BUILDDIR)/quicklisp" :proxy (getenv "http_proxy"))' \
@@ -97,7 +97,7 @@ clones: $(QLDIR)/local-projects/cl-ixf \
$(QLDIR)/local-projects/cl-csv \
$(QLDIR)/local-projects/qmynd ;
-$(LIBS): $(QLDIR)/setup.lisp clones
+$(LIBS): $(QLDIR)/setup.lisp
$(CL) $(CL_OPTS) --load $(QLDIR)/setup.lisp \
--eval '(push "$(PWD)/" asdf:*central-registry*)' \
--eval '(ql:quickload "pgloader")' \
@@ -113,7 +113,7 @@ $(MANIFEST): $(LIBS)
manifest: $(MANIFEST) ;
-$(BUILDAPP_CCL): $(QLDIR)/setup.lisp
+$(BUILDAPP_CCL): $(QLDIR)/setup.lisp $(LIBS)
mkdir -p $(BUILDDIR)/bin
$(CL) $(CL_OPTS) --load $(QLDIR)/setup.lisp \
--eval '(ql:quickload "buildapp")' \
@@ -176,7 +176,7 @@ $(BUNDLE): $(BUNDLEDIR)
sed -e s/%VERSION%/$(VERSION)/ < bundle/Makefile > $(BUNDLEDIR)/Makefile
git archive --format=tar --prefix=pgloader-$(VERSION)/ master \
| tar -C $(BUNDLEDIR)/local-projects/ -xf -
- make QLDIR=$(BUNDLEDIR) clones
+ make QLDIR=$(BUNDLEDIR)
tar -C build/bundle \
--exclude bin \
--exclude test/sqlite \

View file

@ -0,0 +1,11 @@
--- pgloader_wrapper.sh.orig 2017-07-14 08:47:14 UTC
+++ pgloader_wrapper.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# There is a bug for current ccl on FreeBSD, which is determine_executable_name
+# doesn't do the job for FreeBSD. Now we use this script as a workaround. See:
+# https://github.com/Clozure/ccl/issues/38
+
+BIN_DIR="$(cd $(/usr/bin/dirname $0);pwd)"
+exec "${BIN_DIR}"/pgloader3 "${@}"

View file

@ -0,0 +1,9 @@
Pgloader loads data into PostgreSQL using the COPY streaming protocol,and
doing so with separate threads for reading and writing data.Asynchronous
IO,compiled to the metal programming language.
pgloader knows how to read data from MySQL,SQLite or dBase databases,and
knows how to discover the schema and properly cast data types over.It also
knows how to read CSV files in several definitions of CSV,and fixed columns
files.
WWW: http://pgloader.io