File: rules

package info (click to toggle)
aspell-sk 2.04%2Bds.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 176 kB
  • sloc: makefile: 36
file content (52 lines) | stat: -rwxr-xr-x 1,601 bytes parent folder | download
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
#!/usr/bin/make -f

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

DICT_LANG = $(lastword $(subst -, ,$(DEB_SOURCE)))
DEB_DESTDIR = debian/$(DEB_SOURCE)

%:
	dh $@

override_dh_auto_configure:
	cp /usr/share/hunspell/sk_SK.aff sk_affix.dat
	cp /usr/share/hunspell/sk_SK.dic sk_sk.dic
	# remove the word count (the first line)
	# remove words with spaces, but not possible hunspell morphological data
	# remove hunspell morphological data
	# remove words with dashes, aspell doesn’t support those
	# remove words with French accents, fall outside of the charset
	LC_ALL=C sed \
		-e 1d \
		-e 's/ [a-z][a-z]:.*//' \
		-e '/ /d' \
		-e '/-/d' \
		-e '/à/d' \
		-e '/ê/d' \
		sk_sk.dic > sk.wl
	prezip -sz sk.wl

override_dh_md5sums:
	dh_md5sums -Xvar/lib/aspell

override_dh_auto_install:
	for f in *.cwl; do \
	    gzip -9 -c "$$f" > "$(DEB_DESTDIR)/usr/share/aspell/"$$f".gz"; \
	    WL=`echo $$f | sed 's/\.cwl$$//'`; \
	    touch "$(DEB_DESTDIR)/var/lib/aspell/$$WL.rws"; \
	    dh_link "var/lib/aspell/$$WL.rws" "usr/lib/aspell/$$WL.rws"; \
	    echo "$$WL" >> "$(DEB_DESTDIR)/usr/share/aspell/$(DICT_LANG).contents"; \
	done

	LC_ALL=C sort -o $(DEB_DESTDIR)/usr/share/aspell/$(DICT_LANG).contents \
		$(DEB_DESTDIR)/usr/share/aspell/$(DICT_LANG).contents

	touch $(DEB_DESTDIR)/var/lib/aspell/$(DICT_LANG).compat

	installdeb-aspell

execute_before_dh_gencontrol:
	package=hunspell-sk; \
	pkgname=$$(dpkg-query -W -f='$${source:Package}' $$package); \
	pkgver=$$(dpkg-query -W -f='$${source:Version}' $$package); \
	echo "$$package:Built-Using=$$pkgname (= $$pkgver)" >> debian/$(DEB_SOURCE).substvars