forked from credativ/omdb-postgresql
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
19 lines (15 loc) · 671 Bytes
/
Makefile
File metadata and controls
19 lines (15 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# use oldest pg_dump available (>= 10) so the dump format is most compatible
PG_DUMP = $(firstword $(shell ls -v /usr/lib/postgresql/[123]*/bin/pg_dump /usr/pgsql-[123]*/bin/pg_dump 2> /dev/null))
PGVERSION0 = $(patsubst /usr/lib/postgresql/%/bin/pg_dump,%,$(PG_DUMP))
PGVERSION = $(patsubst /usr/pgsql-%/bin/pg_dump,%,$(PGVERSION0))
PGUSER = postgres
dump: omdb.dump
omdb.dump: www.omdb.org/data/all_movies.csv
pg_virtualenv -i '--auth=trust --username=$(PGUSER)' -v $(PGVERSION) \
sh -c "export PGUSER=$(PGUSER) && \
./import && \
$(PG_DUMP) -Fc -f $@ omdb"
www.omdb.org/data/all_movies.csv.bz2:
./download
clean:
rm -f omdb.dump www.omdb.org/data/*.bz2