forked from pgq/skytools-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
170 lines (130 loc) · 4.97 KB
/
Makefile
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
-include config.mak
PYTHON ?= python
pyver = $(shell $(PYTHON) -V 2>&1 | sed 's/^[^ ]* \([0-9]*\.[0-9]*\).*/\1/')
SUBDIRS = sql doc
#SCRIPTS = python/londiste.py python/qadmin.py python/pgqadm.py python/walmgr.py \
# scripts/queue_loader.py scripts/queue_mover.py scripts/queue_splitter.py \
# scripts/scriptmgr.py scripts/skytools_upgrade.py
# add suffix
SFX_SCRIPTS = python/londiste.py python/walmgr.py scripts/scriptmgr.py \
scripts/queue_splitter.py scripts/queue_mover.py
# dont add
NOSFX_SCRIPTS = python/qadmin.py
SCRIPT_SUFFIX = $(SUFFIX)
SQLDIR = $(prefix)/share/skytools$(SUFFIX)
# modules that use doctest for regtests
DOCTESTMODS = skytools.quoting skytools.parsing skytools.timeutil \
skytools.sqltools skytools.querybuilder
all: python-all sub-all config.mak
install: sub-install python-install
distclean: sub-distclean
sub-all sub-install sub-clean sub-distclean:
for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir $(subst sub-,,$@) DESTDIR=$(DESTDIR) || exit $?; \
done
.PHONY: sub-all sub-clean sub-install sub-distclean
python-all: config.mak
$(PYTHON) setup_skytools.py build
clean: sub-clean
$(PYTHON) setup_skytools.py clean
rm -rf build
find python -name '*.py[oc]' -print | xargs rm -f
rm -f python/skytools/installer_config.py source.list
rm -rf tests/londiste/sys
rm -rf tests/londiste/file_logs
rm -rf tests/londiste/fix.*
rm -rf tests/scripts/sys
installcheck:
$(MAKE) -C sql installcheck
modules-install: config.mak
$(MAKE) -C sql install DESTDIR=$(DESTDIR)
test \! -d compat || $(MAKE) -C compat $@ DESTDIR=$(DESTDIR)
SITEDIR = site-packages
python-install: config.mak sub-all
mkdir -p $(DESTDIR)/$(bindir)
rm -rf build
$(PYTHON) setup_pkgloader.py install --prefix=$(prefix) --root=$(DESTDIR)/ $(BROKEN_PYTHON)
find build -name 'pkgloader*' | xargs rm
$(PYTHON) setup_skytools.py install --prefix=$(prefix) --root=$(DESTDIR)/ \
--install-lib=$(prefix)/lib/python$(pyver)/$(SITEDIR)/skytools-3.0 \
--record=tmp_files.lst
for s in $(SFX_SCRIPTS); do \
exe=`echo $$s|sed -e 's!.*/!!' -e 's/[.]py//'`; \
install $$s $(DESTDIR)/$(bindir)/$${exe}$(SCRIPT_SUFFIX) || exit 1; \
done
for s in $(NOSFX_SCRIPTS); do \
exe=`echo $$s|sed -e 's!.*/!!' -e 's/[.]py//'`; \
install $$s $(DESTDIR)/$(bindir)/$$exe || exit 1; \
done
$(MAKE) -C doc DESTDIR=$(DESTDIR) install
python-install python-all: python/skytools/installer_config.py
python/skytools/installer_config.py: python/skytools/installer_config.py.in config.mak
sed -e 's!@SQLDIR@!$(SQLDIR)!g' \
-e 's!@SKYLOG@!$(SKYLOG)!g' \
-e 's!@PACKAGE_VERSION@!$(PACKAGE_VERSION)!g' \
$< > $@
realclean: distclean
$(MAKE) -C doc $@
$(MAKE) distclean
distclean: sub-distclean
rm -rf source.list dist skytools-*
find python -name '*.pyc' | xargs rm -f
rm -rf dist build
rm -rf autom4te.cache config.log config.status config.mak
deb80:
./configure --with-pgconfig=/usr/lib/postgresql/8.0/bin/pg_config --with-python=$(PYTHON)
sed -e s/PGVER/8.0/g -e s/PYVER/$(pyver)/g < debian/packages.in > debian/packages
yada rebuild
debuild -uc -us -b
deb81:
./configure --with-pgconfig=/usr/lib/postgresql/8.1/bin/pg_config --with-python=$(PYTHON)
sed -e s/PGVER/8.1/g -e s/PYVER/$(pyver)/g < debian/packages.in > debian/packages
yada rebuild
debuild -uc -us -b
deb82:
./configure --with-pgconfig=/usr/lib/postgresql/8.2/bin/pg_config --with-python=$(PYTHON)
sed -e s/PGVER/8.2/g -e s/PYVER/$(pyver)/g < debian/packages.in > debian/packages
yada rebuild
debuild -uc -us -b
deb83:
./configure --with-pgconfig=/usr/lib/postgresql/8.3/bin/pg_config --with-python=$(PYTHON)
sed -e s/PGVER/8.3/g -e s/PYVER/$(pyver)/g < debian/packages.in > debian/packages
yada rebuild
debuild -uc -us -b
deb84:
./configure --with-pgconfig=/usr/lib/postgresql/8.4/bin/pg_config --with-python=$(PYTHON)
sed -e s/PGVER/8.4/g -e s/PYVER/$(pyver)/g < debian/packages.in > debian/packages
yada rebuild
debuild -uc -us -b
deb90:
./configure --with-pgconfig=/usr/lib/postgresql/9.0/bin/pg_config --with-python=$(PYTHON)
sed -e s/PGVER/9.0/g -e s/PYVER/$(pyver)/g < debian/packages.in > debian/packages
yada rebuild
debuild -uc -us -b
tgz: config.mak clean
$(MAKE) -C doc man html
rm -f source.list
$(PYTHON) setup_skytools.py sdist -t source.cfg -m source.list
debclean: distclean
rm -rf debian/tmp-* debian/build* debian/control debian/packages-tmp*
rm -f debian/files debian/rules debian/sub* debian/packages
boot: configure
configure: configure.ac lib/m4/usual.m4
aclocal -I lib/m4
autoheader
autoconf
tags:
ctags `find python -name '*.py'`
check:
./misc/docheck.sh
# workaround for Debian's broken python
debfix:
@$(PYTHON) setup_skytools.py install --help | grep -q install-layout \
&& echo BROKEN_PYTHON=--install-layout=deb || echo 'WORKING_PYTHON=found'
.PHONY: all clean distclean install deb debclean tgz tags
.PHONY: python-all python-clean python-install check test
test:
@cd python; for m in $(DOCTESTMODS); do \
printf "%-22s ... " $$m; \
$(PYTHON) -m $$m && echo "ok" || { echo "FAIL"; exit 1; }; \
done