File: rules

package info (click to toggle)
dict-foldoc 20140720-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,364 kB
  • ctags: 4
  • sloc: perl: 85; makefile: 57; sh: 33
file content (76 lines) | stat: -rwxr-xr-x 1,834 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#! /usr/bin/make -f

FILES_TO_CLEAN  = foldoc.* newdict
DICTDIR = debian/dict-foldoc/usr/share/dictd


install_file = install -p -o root -g root -m 644

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

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp

build-stamp:
	dh_testdir

	cat Dictionary debian/Dictionary.debian > newdict
	set -ex ; \
	uver=$$(dpkg-parsechangelog |\
	sed -rn -e 's/^Version: ([0-9]+)-.*$$/\1/p') ; \
	udate=$$(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 foldoc
	/usr/bin/dictzip -v foldoc.dict

	touch $@

clean:
# Undoes the effect of `$(MAKE) -f debian/rules build'.
	dh_testdir
	dh_testroot
	rm -f $(FILES_TO_CLEAN)
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	$(install_file) foldoc.dict.dz $(DICTDIR)
	$(install_file) foldoc.index   $(DICTDIR)

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir Dictionary
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

binary: binary-indep binary-arch
.PHONY: build build-arch build-indep clean \
	binary-indep binary-arch binary install