| 1 |
#! /usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/pkg-info.mk |
| 4 |
|
| 5 |
get-orig-source: |
| 6 |
set -ex; tempdir=$$(mktemp -d); \ |
| 7 |
udate=$$(curl -s -I https://foldoc.org/Dictionary| \ |
| 8 |
sed -n 's/^[Ll]ast-[Mm]odified: //p'); \ |
| 9 |
uver=$$(date -u -d "$$udate" +"%Y%m%d"); \ |
| 10 |
fdir="$$tempdir/dict-foldoc-$$uver"; \ |
| 11 |
mkdir "$$fdir"; \ |
| 12 |
curl -s -f -o $$fdir/Dictionary https://foldoc.org/Dictionary; \ |
| 13 |
tar czf dict-foldoc-$$uver.tar.gz -C $$tempdir .; \ |
| 14 |
rm -rf $$tempdir |
| 15 |
|
| 16 |
%: |
| 17 |
dh $@ |
| 18 |
|
| 19 |
override_dh_auto_build: |
| 20 |
dh_testdir |
| 21 |
|
| 22 |
cat Dictionary debian/Dictionary.debian > newdict |
| 23 |
set -ex ; \ |
| 24 |
uver=$(DEB_VERSION_UPSTREAM) ; \ |
| 25 |
udate=$$(LC_ALL=C date -d "$$uver" +"%d %B %Y"); \ |
| 26 |
perl debian/condense newdict | \ |
| 27 |
/usr/bin/dictfmt -f --headword-separator %%% --break-headwords \ |
| 28 |
--allchars -u http://foldoc.org/Dictionary.gz \ |
| 29 |
-s "The Free On-line Dictionary of Computing ($$udate)" \ |
| 30 |
--utf8 --without-time foldoc |
| 31 |
# Ensure deterministic mtime for dictzip to inherit |
| 32 |
touch --date='@$(SOURCE_DATE_EPOCH)' foldoc.dict |
| 33 |
/usr/bin/dictzip -v foldoc.dict |