#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_build:
	./debian/md.sh DE405
	./debian/md.sh DE200

get-orig-source:
	(mkdir jpl-de ; \
	cd jpl-de ; \
	curl -R -OOOO \
          ftp://ssd.jpl.nasa.gov/pub/eph/planets/ascii/de200/header.200 \
          ftp://ssd.jpl.nasa.gov/pub/eph/planets/ascii/de405/header.405 \
          ftp://ssd.jpl.nasa.gov/pub/eph/planets/ascii/de200/ascp[1960-2040:20].200 \
          ftp://ssd.jpl.nasa.gov/pub/eph/planets/ascii/de405/ascp[1960-2040:20].405; \
	VERSION=`TZ=UTC ls --full-time -tr header.* |tail -1 | cut -d\  -f6 |sed s/-/./g` ; \
	tar cf ../casacore-data-jplde_$$VERSION+ds.1.orig.tar *.200 *.405 ; \
	cd .. ; \
	rm -rf jpl-de ; \
	xz casacore-data-jplde_$$VERSION+ds.1.orig.tar )