debian packaging

This commit is contained in:
dim 2007-11-29 21:30:25 +00:00
parent 88db262b89
commit d9f328ce4d
25 changed files with 59 additions and 45 deletions

View File

@ -1,4 +1,10 @@
DOCS = pgloader.1.txt
# $Id: Makefile,v 1.6 2007-11-29 21:30:22 dim Exp $
#
# Makefile for debian packaging purpose, make install not intended to work.
DOCS = pgloader.1.txt
CVSROOT = $(shell cat CVS/Root)
VERSION = $(shell ./pgloader.py --version | cut -d' ' -f3)
# debian setting
DESTDIR =
@ -11,8 +17,12 @@ examples = examples
libs = $(wildcard pgloader/*.py)
refm = $(wildcard reformat/*.py)
DEBDIR = /tmp/pgloader
EXPORT = $(DEBDIR)/export/pgloader
ORIG = $(DEBDIR)/export/pgloader_$(VERSION).orig.tar.gz
install:
install -m 755 $(pgloader) $(libdir)
install -m 755 $(pgloader) $(DESTDIR)/usr/bin/pgloader
install -m 755 -d $(libdir)/pgloader
install -m 755 -d $(libdir)/reformat
@ -28,3 +38,23 @@ pgloader.1.xml: $(DOCS)
man: ${DOCS:.txt=.xml}
xmlto man $<
deb:
# working copy from where to make the .orig archive
rm -rf $(DEBDIR)
mkdir -p $(DEBDIR)/pgloader
mkdir -p $(EXPORT)
cp -a . $(EXPORT)
for n in "*~" "*.pyc"; do \
find $(EXPORT) -name "$$n" -print0|xargs -0 rm -f; \
done
find $(EXPORT) -type d -name CVS -print0|xargs -0 rm -rf
# prepare the .orig without the debian/ packaging stuff
cp -a $(EXPORT) $(DEBDIR)
rm -rf $(DEBDIR)/pgloader/debian
(cd $(DEBDIR) && tar czf $(ORIG) pgloader)
# build the debian package and copy them to ..
(cd $(EXPORT) && debuild)
cp -a $(DEBDIR)/export/pgloader_$(VERSION)* ..

15
debian/control vendored
View File

@ -9,13 +9,8 @@ Package: pgloader
Architecture: all
Depends: python (>=2.4.4), python-psycopg2 | python-psycopg (<< 1.1.21)
Description: loads flat data files into PostgreSQL
pgloader imports data from a flat file and insert it into a database
table. It uses a flat file per database table, and you can configure as
many Sections as you want, each one associating a table name and a data
file.
.
Data are parsed and rewritten, then given to PostgreSQL COPY command.
Parsing is necessary for dealing with end of lines and eventual trailing
separator characters, and for column reordering: your flat data file may
not have the same column order as the databse table has.
pgloader imports data from flat files and insert it into a database
table. You have to provide a configuration file containing sections,
which each defines how to load a table. CSV and text format are
supported, the latter being able to parse multi-line non-quoted with
trailing delimiter quite CSV input, such as given by Informix UNLOAD.

2
debian/docs vendored
View File

@ -1 +1 @@
pgloader.1
pgloader.1

View File

@ -1,2 +0,0 @@
/usr/share/pgloader/pgloader.py /usr/bin/pgloader

View File

@ -1 +1 @@
pgloader.1
pgloader.1

2
debian/pycompat vendored
View File

@ -1 +1 @@
2
2

2
debian/pyversions vendored
View File

@ -1 +1 @@
2.3-
2.3-

11
debian/rules vendored
View File

@ -29,25 +29,16 @@ configure-stamp:
build: build-stamp
$(MAKE) man
build-stamp: configure-stamp
dh_testdir
# Add here commands to compile the package.
#$(MAKE)
#docbook-to-man pgloader.1.sgml > pgloader.1
$(MAKE) man
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
-$(MAKE) clean
dh_clean
install: build

View File

@ -4,4 +4,4 @@
4|59,15,clob.out
5|6e,13,clob.out
6|81,6,clob.out
7|87,d,clob.out
7|87,d,clob.out

View File

@ -1 +1 @@
This is some clob dataTo be used on several data entryReferences to those are to be foundIn the clob.data fileThey refer to beginlengthand filename.
This is some clob dataTo be used on several data entryReferences to those are to be foundIn the clob.data fileThey refer to beginlengthand filename.

View File

@ -1,4 +1,4 @@
CREATE TABLE clob (
a integer primary key,
b text
);
);

View File

@ -13,4 +13,4 @@ escaping^just to test^
escaped value\
\
with empty line\
embeded^last line^
embeded^last line^

View File

@ -2,4 +2,4 @@ CREATE TABLE cluttered (
a integer primary key,
b text,
c text
);
);

View File

@ -3,4 +3,4 @@ CREATE TABLE csv (
b bigint,
c char(2),
d text
);
);

View File

@ -4,4 +4,4 @@
4|\ |2006-16-4|
5|some fifth row text|2006-5-12|
6|some sixth row text|2006-13-10|
7|some null date to play with||
7|some null date to play with||

View File

@ -2,4 +2,4 @@ CREATE TABLE errors (
a integer primary key,
b date,
c text
);
);

View File

@ -4,4 +4,4 @@ CREATE TABLE partial (
c text,
d text,
e text
);
);

View File

@ -1,4 +1,4 @@
CREATE TABLE reformat (
id integer primary key,
timestamp timestamp
);
);

View File

@ -4,4 +4,4 @@ some third row text;2006-10-12
\ ;2006-10-4
some fifth row text;2006-5-12
some sixth row text;2006-7-10
some null date to play with;
some null date to play with;

View File

@ -2,4 +2,4 @@ CREATE TABLE serial (
a serial primary key,
b date,
c text
);
);

View File

@ -4,4 +4,4 @@
4|\ |2006-10-4|
5|some fifth row text|2006-5-12|
6|some sixth row text|10/7/6|
7|some null date to play with||
7|some null date to play with||

View File

@ -2,4 +2,4 @@ CREATE TABLE simple (
a integer primary key,
b date,
c text
);
);

View File

@ -2,4 +2,4 @@ CREATE TABLE udc (
b integer primary key,
c text,
d integer
);
);

View File

@ -108,7 +108,7 @@ def parse_options():
(opts, args) = parser.parse_args()
if opts.version:
print "PgLoader version %s" % pgloader.options.PGLOADER_VERSION
print "PGLoader version %s" % pgloader.options.PGLOADER_VERSION
sys.exit(0)
# check existence en read ability of config file

View File

@ -2,7 +2,7 @@
#
# Some common options, for each module to get them
PGLOADER_VERSION = '2.2.5-devel'
PGLOADER_VERSION = '2.2.5~dev'
INPUT_ENCODING = None
PG_CLIENT_ENCODING = 'latin9'