File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 7
7
#
8
8
9
9
PG_CONFIG ?= pg_config
10
+ EXTENSION = pg_repack
10
11
11
- # Pull out the version number from pg_config
12
+ .PHONY : dist/$(EXTENSION ) -$(EXTVERSION ) .zip
13
+
14
+ # Pull out PostgreSQL version number from pg_config
12
15
VERSION := $(shell $(PG_CONFIG ) --version | awk '{print $$2}')
13
16
ifeq ("$(VERSION ) ","")
14
17
$(error pg_config not found)
15
18
endif
16
19
17
- # version as a number, e.g. 9.1.4 -> 901
20
+ # PostgreSQL version as a number, e.g. 9.1.4 -> 901
18
21
INTVERSION := $(shell echo $$(($$(echo $(VERSION ) | sed 's/\([[:digit:]]\{1,\}\ ) \.\([[:digit:]]\{1,\}\ ) .* /\1* 100+\2/') )))
19
22
23
+ # The version number of the library
24
+ EXTVERSION = $(shell grep '"version":' META.json | head -1 \
25
+ | sed -e 's/[ ]* "version":[ ]* "\(.* \) ",/\1/')
26
+
20
27
# We support PostgreSQL 8.3 and later.
21
28
ifeq ($(shell echo $$(($(INTVERSION ) < 803 ) ) ),1)
22
- $(error pg_repack requires PostgreSQL 8.3 or later. This is $(VERSION))
29
+ $(error $(EXTENSION) requires PostgreSQL 8.3 or later. This is $(VERSION))
23
30
endif
24
31
25
32
@@ -36,3 +43,9 @@ check installcheck:
36
43
$(MAKE ) -C $$ dir $@ || CHECKERR=$$? ; \
37
44
done ; \
38
45
exit $$ CHECKERR
46
+
47
+ # Prepare the package for PGXN submission
48
+ package : $(EXTENSION ) -$(EXTVERSION ) .zip
49
+
50
+ $(EXTENSION ) -$(EXTVERSION ) .zip :
51
+ git archive --format zip --prefix=$(EXTENSION ) -$(EXTVERSION ) / --output $@ master
You can’t perform that action at this time.
0 commit comments