2013-12-02 23:29:02 +08:00
|
|
|
# cartodb/Makefile
|
|
|
|
|
|
|
|
EXTENSION = cartodb
|
2014-05-08 15:58:58 +08:00
|
|
|
EXTVERSION = 0.1dev
|
2013-12-02 23:29:02 +08:00
|
|
|
|
2014-05-01 01:03:14 +08:00
|
|
|
CDBSCRIPTS = \
|
2014-05-12 17:44:44 +08:00
|
|
|
scripts-available/CDB_Roles.sql \
|
2014-05-05 23:13:06 +08:00
|
|
|
scripts-enabled/*.sql \
|
2014-05-01 01:03:14 +08:00
|
|
|
$(END)
|
|
|
|
|
2014-05-08 15:58:58 +08:00
|
|
|
DATA_built = \
|
|
|
|
$(EXTENSION)--$(EXTVERSION).sql \
|
|
|
|
$(EXTENSION)--unpackaged--$(EXTVERSION).sql \
|
2014-05-08 16:07:47 +08:00
|
|
|
$(EXTENSION).control \
|
2014-05-08 23:21:41 +08:00
|
|
|
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_NEW = test_ddl_triggers
|
|
|
|
REGRESS_OLD = $(wildcard test/*.sql)
|
|
|
|
REGRESS_LEGACY = $(REGRESS_OLD:.sql=)
|
|
|
|
REGRESS = test_setup $(REGRESS_NEW) $(REGRESS_LEGACY)
|
2013-12-02 23:29:02 +08:00
|
|
|
|
|
|
|
PG_CONFIG = pg_config
|
|
|
|
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
|
|
|
include $(PGXS)
|
|
|
|
|
2014-05-08 16:07:47 +08:00
|
|
|
$(EXTENSION)--$(EXTVERSION).sql: $(CDBSCRIPTS) cartodb_hooks.sql cartodb_version.sql Makefile
|
2014-05-06 16:54:37 +08:00
|
|
|
: > $@
|
2014-05-06 00:04:14 +08:00
|
|
|
cat $(CDBSCRIPTS) | \
|
|
|
|
sed -e 's/\<public\./cartodb./g' \
|
|
|
|
-e 's/:DATABASE_USERNAME/cdb_org_admin/g' >> $@
|
2014-05-05 18:20:38 +08:00
|
|
|
echo "GRANT USAGE ON SCHEMA cartodb TO public;" >> $@
|
2014-05-01 01:03:14 +08:00
|
|
|
cat cartodb_hooks.sql >> $@
|
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)
|
|
|
|
|
|
|
|
$(EXTENSION).control: $(EXTENSION).control.in
|
|
|
|
sed -e 's/@@VERSION@@/$(EXTVERSION)/' $< > $@
|
2014-05-08 00:06:20 +08:00
|
|
|
|
2014-05-08 16:07:47 +08:00
|
|
|
cartodb_version.sql: cartodb_version.sql.in
|
|
|
|
sed -e 's/@@VERSION@@/$(EXTVERSION)/' $< > $@
|
|
|
|
|
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; \
|
|
|
|
echo '\\set ECHO off' > $${of}; \
|
|
|
|
echo '\\a' >> $${of}; \
|
|
|
|
echo '\\t' >> $${of}; \
|
|
|
|
echo '\\set QUIET off' >> $${of}; \
|
|
|
|
cat $${f} | \
|
|
|
|
sed -e 's/\<public\./cartodb./g' >> $${of}; \
|
|
|
|
exp=expected/test/$${tn}.out; \
|
|
|
|
echo '\\set ECHO off' > $${exp}; \
|
|
|
|
cat test/$${tn}_expect >> $${exp}; \
|
|
|
|
done
|
|
|
|
|
|
|
|
legacy_tests: legacy_regress
|
|
|
|
|
|
|
|
installcheck: legacy_tests
|
|
|
|
|