File: Makefile

package info (click to toggle)
pgloader 2.3.3~dev3-1.1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 13,868 kB
  • sloc: python: 2,683; makefile: 109; sql: 74
file content (96 lines) | stat: -rw-r--r-- 2,383 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# $Id: Makefile,v 1.19 2008-06-03 12:58:14 dim Exp $
#
# Makefile for debian packaging purpose, make install not intended to work.

DOCS    = pgloader.1.txt
TODO    = TODO.txt
BUGS    = BUGS.txt
CVSROOT = $(shell cat CVS/Root)
VERSION = $(shell ./pgloader.py --version |cut -d' ' -f3)
SHORTVER= $(shell ./pgloader.py --version |cut -d' ' -f3 |cut -d '~' -f1)

# debian setting
DESTDIR =

libdir   = $(DESTDIR)/usr/share/python-support/pgloader
exdir    = $(DESTDIR)/usr/share/doc/pgloader

pgloader = pgloader.py
examples = examples
libs = $(wildcard pgloader/*.py)
refm = $(wildcard reformat/*.py)

TMPDIR?= /tmp
DEBDIR = $(TMPDIR)/pgloader
EXPORT = $(DEBDIR)/export/pgloader-$(VERSION)
ORIG   = $(DEBDIR)/export/pgloader_$(VERSION).orig.tar.gz
ARCHIVE= $(DEBDIR)/export/pgloader-$(VERSION).tar.gz

install:
	install -m 755 $(pgloader) $(DESTDIR)/usr/bin/pgloader
	install -m 755 -d $(libdir)/pgloader
	install -m 755 -d $(libdir)/reformat

	cp -a $(libs) $(libdir)/pgloader
	cp -a $(refm) $(libdir)/reformat
	cp -a $(examples) $(exdir)
	cp -a $(TODO) $(BUGS) $(DESTDIR)/usr/share/doc/pgloader

html: $(DOCS)
	asciidoc -a toc $<

todo: $(TODO)
	asciidoc -a toc $<

bugs: $(BUGS)
	asciidoc -a toc $<

site: html
	scp ${DOCS:.txt=.html} cvs.pgfoundry.org:htdocs

pgloader.1.xml: $(DOCS)
	asciidoc -d manpage -b docbook $<

man: ${DOCS:.txt=.xml}
	xmlto man $<

doc: man html todo bugs

clean:
	rm -f *.xml *.html *.1 *~

prepare-deb:
	# working copy from where to make the .orig archive
	rm -rf $(DEBDIR)	
	mkdir -p $(DEBDIR)/pgloader-$(VERSION)
	mkdir -p $(EXPORT)
	rsync -Ca . $(EXPORT)

	# get rid of temp and build files
	for n in ".#*" "*~" "*.pyc" "build-stamp" "configure-stamp" "parallel.o*"; do \
	  find $(EXPORT) -name "$$n" -print0|xargs -0 echo rm -f; \
	  find $(EXPORT) -name "$$n" -print0|xargs -0 rm -f; \
	done

	# prepare the .orig without the debian/ packaging stuff
	rsync -Ca $(EXPORT) $(DEBDIR)
	rm -rf $(DEBDIR)/pgloader-$(VERSION)/debian
	(cd $(DEBDIR) && tar czf $(ORIG) pgloader-$(VERSION))

	# have a copy of the $ORIG file named $ARCHIVE for non-debian packagers
	cp $(ORIG) $(ARCHIVE)

debuild:
	(cd $(EXPORT) && debuild)

debuild-unsign:
	(cd $(EXPORT) && debuild -us -uc)

copy-package:
	cp -a $(DEBDIR)/export/pgloader[_-]$(VERSION)* ..
	cp -a $(ARCHIVE) ..

deb: prepare-deb debuild copy-package

deb-unsign: prepare-deb debuild-unsign copy-package