File: rules

package info (click to toggle)
dict-foldoc 20250211-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,460 kB
  • sloc: perl: 85; sh: 47; makefile: 26
file content (33 lines) | stat: -rwxr-xr-x 1,027 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

get-orig-source:
	set -ex; tempdir=$$(mktemp -d); \
	udate=$$(curl -s -I https://foldoc.org/Dictionary| \
	sed -n 's/^[Ll]ast-[Mm]odified: //p'); \
	uver=$$(date -u -d "$$udate" +"%Y%m%d"); \
	fdir="$$tempdir/dict-foldoc-$$uver"; \
	mkdir "$$fdir"; \
	curl -s -f -o $$fdir/Dictionary https://foldoc.org/Dictionary; \
	tar czf dict-foldoc-$$uver.tar.gz -C $$tempdir .; \
	rm -rf $$tempdir

%:
	dh $@

override_dh_auto_build:
	dh_testdir

	cat Dictionary debian/Dictionary.debian > newdict
	set -ex ; \
	uver=$(DEB_VERSION_UPSTREAM) ; \
	udate=$$(LC_ALL=C date -d "$$uver" +"%d %B %Y"); \
	perl debian/condense newdict | \
	  /usr/bin/dictfmt -f --headword-separator %%% --break-headwords \
	  --allchars -u http://foldoc.org/Dictionary.gz \
	  -s "The Free On-line Dictionary of Computing ($$udate)" \
	  --utf8 --without-time foldoc
	# Ensure deterministic mtime for dictzip to inherit
	touch --date='@$(SOURCE_DATE_EPOCH)' foldoc.dict
	/usr/bin/dictzip -v foldoc.dict