2013-12-02 23:29:02 +08:00
|
|
|
# cartodb/Makefile
|
|
|
|
|
|
|
|
EXTENSION = cartodb
|
2016-03-07 19:05:14 +08:00
|
|
|
EXTVERSION = 0.14.1
|
2013-12-02 23:29:02 +08:00
|
|
|
|
2014-06-04 18:58:19 +08:00
|
|
|
SED = sed
|
2013-12-02 23:29:02 +08:00
|
|
|
|
2014-05-01 01:03:14 +08:00
|
|
|
CDBSCRIPTS = \
|
2014-05-05 23:13:06 +08:00
|
|
|
scripts-enabled/*.sql \
|
2014-05-19 19:26:01 +08:00
|
|
|
scripts-available/CDB_SearchPath.sql \
|
2014-05-23 23:40:14 +08:00
|
|
|
scripts-available/CDB_ExtensionPost.sql \
|
2014-06-04 16:28:48 +08:00
|
|
|
scripts-available/CDB_ExtensionUtils.sql \
|
2015-10-22 18:38:00 +08:00
|
|
|
scripts-available/CDB_Helper.sql \
|
2014-05-01 01:03:14 +08:00
|
|
|
$(END)
|
|
|
|
|
2014-05-28 15:43:21 +08:00
|
|
|
UPGRADABLE = \
|
|
|
|
unpackaged \
|
|
|
|
0.1.0 \
|
|
|
|
0.1.1 \
|
2014-06-09 19:04:42 +08:00
|
|
|
0.2.0 \
|
2014-06-12 01:30:32 +08:00
|
|
|
0.2.1 \
|
2014-07-16 18:30:19 +08:00
|
|
|
0.3.0 \
|
2014-07-28 21:16:19 +08:00
|
|
|
0.3.0dev \
|
2014-07-28 23:53:19 +08:00
|
|
|
0.3.1 \
|
|
|
|
0.3.2 \
|
2014-08-02 00:21:48 +08:00
|
|
|
0.3.3 \
|
2014-08-11 21:41:53 +08:00
|
|
|
0.3.4 \
|
2014-08-11 22:18:02 +08:00
|
|
|
0.3.5 \
|
2014-08-25 18:00:45 +08:00
|
|
|
0.3.6 \
|
2014-10-21 22:19:44 +08:00
|
|
|
0.4.0 \
|
2014-11-18 22:24:54 +08:00
|
|
|
0.4.1 \
|
2014-12-06 00:30:47 +08:00
|
|
|
0.5.0 \
|
2015-01-30 00:37:59 +08:00
|
|
|
0.5.1 \
|
2015-02-17 22:47:18 +08:00
|
|
|
0.5.2 \
|
2015-02-19 00:31:04 +08:00
|
|
|
0.5.3 \
|
2015-02-19 21:11:54 +08:00
|
|
|
0.6.0 \
|
2015-02-19 21:34:32 +08:00
|
|
|
0.7.0 \
|
2015-03-03 17:49:33 +08:00
|
|
|
0.7.1 \
|
2015-03-04 00:10:56 +08:00
|
|
|
0.7.2 \
|
2015-06-29 18:09:35 +08:00
|
|
|
0.7.3 \
|
2015-06-30 17:11:21 +08:00
|
|
|
0.7.4 \
|
2015-07-07 21:07:41 +08:00
|
|
|
0.8.0 \
|
2015-07-27 22:12:42 +08:00
|
|
|
0.8.1 \
|
2015-08-19 21:08:07 +08:00
|
|
|
0.8.2 \
|
|
|
|
0.9.0 \
|
2015-08-20 01:42:29 +08:00
|
|
|
0.9.1 \
|
2015-08-24 21:20:50 +08:00
|
|
|
0.9.2 \
|
2015-08-27 18:14:48 +08:00
|
|
|
0.9.3 \
|
2015-08-27 22:47:10 +08:00
|
|
|
0.9.4 \
|
2015-09-07 19:02:05 +08:00
|
|
|
0.10.0 \
|
2015-09-16 18:40:14 +08:00
|
|
|
0.10.1 \
|
2015-09-24 23:54:47 +08:00
|
|
|
0.10.2 \
|
2015-09-21 18:54:14 +08:00
|
|
|
0.11.0 \
|
2015-10-06 20:45:35 +08:00
|
|
|
0.11.1 \
|
2015-10-19 20:35:10 +08:00
|
|
|
0.11.2 \
|
2015-10-27 21:16:17 +08:00
|
|
|
0.11.3 \
|
2015-11-25 00:00:45 +08:00
|
|
|
0.11.4 \
|
2016-02-12 23:37:59 +08:00
|
|
|
0.11.5 \
|
|
|
|
0.12.0 \
|
|
|
|
0.13.0 \
|
|
|
|
0.13.1 \
|
|
|
|
0.14.0 \
|
2016-03-07 19:05:14 +08:00
|
|
|
0.14.1 \
|
2014-07-17 21:43:19 +08:00
|
|
|
$(EXTVERSION)dev \
|
2014-05-28 15:43:21 +08:00
|
|
|
$(EXTVERSION)next \
|
2014-05-01 01:03:14 +08:00
|
|
|
$(END)
|
|
|
|
|
2014-05-28 15:43:21 +08:00
|
|
|
UPGRADES = \
|
|
|
|
$(shell echo $(UPGRADABLE) | \
|
2014-06-04 18:58:19 +08:00
|
|
|
$(SED) 's/^/$(EXTENSION)--/' | \
|
|
|
|
$(SED) 's/$$/--$(EXTVERSION).sql/' | \
|
|
|
|
$(SED) 's/ /--$(EXTVERSION).sql $(EXTENSION)--/g')
|
2014-05-28 15:43:21 +08:00
|
|
|
|
2014-06-06 22:13:47 +08:00
|
|
|
GITDIR=$(shell test -d .git && echo '.git' || cat .git | $(SED) 's/^gitdir: //')
|
2014-06-03 19:20:49 +08:00
|
|
|
|
2014-05-08 15:58:58 +08:00
|
|
|
DATA_built = \
|
|
|
|
$(EXTENSION)--$(EXTVERSION).sql \
|
2014-05-28 15:43:21 +08:00
|
|
|
$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql \
|
|
|
|
$(UPGRADES) \
|
2014-05-27 21:51:45 +08:00
|
|
|
$(EXTENSION).control
|
|
|
|
|
|
|
|
EXTRA_CLEAN = cartodb_version.sql
|
2014-05-08 15:58:58 +08:00
|
|
|
|
2014-05-01 01:03:14 +08:00
|
|
|
DOCS = README.md
|
2014-05-06 16:18:38 +08:00
|
|
|
REGRESS_OLD = $(wildcard test/*.sql)
|
|
|
|
REGRESS_LEGACY = $(REGRESS_OLD:.sql=)
|
2016-01-21 18:46:39 +08:00
|
|
|
REGRESS = test_setup $(REGRESS_LEGACY)
|
2013-12-02 23:29:02 +08:00
|
|
|
|
|
|
|
PG_CONFIG = pg_config
|
|
|
|
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
|
|
|
include $(PGXS)
|
|
|
|
|
2014-05-23 23:40:14 +08:00
|
|
|
$(EXTENSION)--$(EXTVERSION).sql: $(CDBSCRIPTS) cartodb_version.sql Makefile
|
2014-05-14 18:39:53 +08:00
|
|
|
echo '\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \quit' > $@
|
2014-05-06 00:04:14 +08:00
|
|
|
cat $(CDBSCRIPTS) | \
|
2014-06-04 21:11:30 +08:00
|
|
|
$(SED) -e 's/public\./cartodb./g' \
|
2016-02-12 18:34:04 +08:00
|
|
|
-e 's/:DATABASE_USERNAME/cdb_org_admin/g' \
|
2016-02-12 02:16:00 +08:00
|
|
|
-e "s/''public''/''cartodb''/g" >> $@
|
2014-05-05 18:20:38 +08:00
|
|
|
echo "GRANT USAGE ON SCHEMA cartodb TO public;" >> $@
|
2014-05-08 16:07:47 +08:00
|
|
|
cat cartodb_version.sql >> $@
|
2014-05-06 16:18:38 +08:00
|
|
|
|
2014-05-08 15:58:58 +08:00
|
|
|
$(EXTENSION)--unpackaged--$(EXTVERSION).sql: $(EXTENSION)--$(EXTVERSION).sql util/create_from_unpackaged.sh Makefile
|
|
|
|
./util/create_from_unpackaged.sh $(EXTVERSION)
|
|
|
|
|
2014-05-28 15:43:21 +08:00
|
|
|
$(EXTENSION)--%--$(EXTVERSION).sql: $(EXTENSION)--$(EXTVERSION).sql
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql: $(EXTENSION)--$(EXTVERSION).sql
|
|
|
|
cp $< $@
|
|
|
|
|
2014-05-23 22:43:01 +08:00
|
|
|
$(EXTENSION).control: $(EXTENSION).control.in Makefile
|
2014-06-04 18:58:19 +08:00
|
|
|
$(SED) -e 's/@@VERSION@@/$(EXTVERSION)/' $< > $@
|
2014-05-08 00:06:20 +08:00
|
|
|
|
2014-06-06 22:13:47 +08:00
|
|
|
cartodb_version.sql: cartodb_version.sql.in Makefile $(GITDIR)/index
|
2014-08-22 00:52:21 +08:00
|
|
|
$(SED) -e 's/@@VERSION@@/$(EXTVERSION)/' $< > $@
|
2014-05-08 16:07:47 +08:00
|
|
|
|
2014-05-06 16:18:38 +08:00
|
|
|
legacy_regress: $(REGRESS_OLD) Makefile
|
|
|
|
mkdir -p sql/test/
|
|
|
|
mkdir -p expected/test/
|
2014-05-08 16:31:23 +08:00
|
|
|
mkdir -p results/test/
|
2014-05-06 16:18:38 +08:00
|
|
|
for f in $(REGRESS_OLD); do \
|
|
|
|
tn=`basename $${f} .sql`; \
|
|
|
|
of=sql/test/$${tn}.sql; \
|
2015-02-17 22:40:26 +08:00
|
|
|
echo '\\set ECHO none' > $${of}; \
|
2014-05-06 16:18:38 +08:00
|
|
|
echo '\\a' >> $${of}; \
|
|
|
|
echo '\\t' >> $${of}; \
|
|
|
|
echo '\\set QUIET off' >> $${of}; \
|
|
|
|
cat $${f} | \
|
2014-06-04 21:11:30 +08:00
|
|
|
$(SED) -e 's/public\./cartodb./g' >> $${of}; \
|
2014-05-06 16:18:38 +08:00
|
|
|
exp=expected/test/$${tn}.out; \
|
2015-02-17 22:40:26 +08:00
|
|
|
echo '\\set ECHO none' > $${exp}; \
|
2014-05-06 16:18:38 +08:00
|
|
|
cat test/$${tn}_expect >> $${exp}; \
|
|
|
|
done
|
|
|
|
|
2014-06-16 22:10:53 +08:00
|
|
|
test_organization:
|
2014-06-16 22:28:28 +08:00
|
|
|
bash test/organization/test.sh
|
2014-06-16 22:10:53 +08:00
|
|
|
|
2014-11-18 22:24:54 +08:00
|
|
|
test_extension_new:
|
|
|
|
bash test/extension/test.sh
|
|
|
|
|
2014-05-06 16:18:38 +08:00
|
|
|
legacy_tests: legacy_regress
|
|
|
|
|
2015-08-13 19:27:27 +08:00
|
|
|
installcheck: legacy_tests test_extension_new test_organization
|
2014-05-06 16:18:38 +08:00
|
|
|
|