File: rules

package info (click to toggle)
asterisk-core-sounds 1.4.27-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid, stretch
  • size: 199,436 kB
  • ctags: 26
  • sloc: perl: 163; sh: 144; makefile: 54
file content (72 lines) | stat: -rwxr-xr-x 2,463 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/make -f

BASE_URL=http://downloads.asterisk.org/pub/telephony/sounds/releases/
PACKAGE=$(shell sed -e '2,$$d' -e 's/ .*//' debian/changelog)
VERSION=$(shell sed -e '2,$$d' -e 's/^[^(]*(\([^-]*\)-.*)*)*/\1/' debian/changelog)
LANGS=en es fr it ru
FORMATS=gsm g722 wav
TMPDIR=tmp
# or . if you prefer
TARGET_DIR=../tarballs
#TARGET_DIR=..

PKGNAME=$(PACKAGE)-$(VERSION)
PKGDIR=$(TMPDIR)/$(PKGNAME)

TARBALL_NAMES=$(foreach lang,$(LANGS),$(foreach fmt,$(FORMATS),$(lang)-$(fmt)))
TARBALLS_EXTRA=$(TARBALL_NAMES:%=$(TARGET_DIR)/$(PACKAGE)_$(VERSION).orig-%.tar.gz)

TARBALLS_EXTRA_SHA1=$(TARBALLS_EXTRA:%=%.sha1)

$(TARGET_DIR)/$(PACKAGE)_$(VERSION).orig-%.tar.gz.sha1:
	wget -q -O $@ -c $(BASE_URL)/$(PACKAGE)-$*-$(VERSION).tar.gz.sha1

$(TARGET_DIR)/$(PACKAGE)_$(VERSION).orig-%.tar.gz: \
	$(TARGET_DIR)/$(PACKAGE)_$(VERSION).orig-%.tar.gz.sha1
	set -e; cd $(@D); \
		wget -q -c $(BASE_URL)/$(PACKAGE)-$*-$(VERSION).tar.gz
	ln -fs $(PACKAGE)-$*-$(VERSION).tar.gz $@

%:
	dh $@

override_dh_install:
	dh_install
	# excluding this way is simpler:
	find $(CURDIR)/debian/asterisk-core-sounds-*/usr/share/asterisk \
		\( -name '[CL]*' -o -name '*.txt' \) -exec rm -f \{\} \;

override_dh_installchangelogs:
	dh_installchangelogs -pasterisk-core-sounds-en en-gsm/CHANGES-asterisk-core-en-$(VERSION)
	dh_installchangelogs -pasterisk-core-sounds-es es-gsm/CHANGES-asterisk-core-es-$(VERSION)
	dh_installchangelogs -pasterisk-core-sounds-fr fr-gsm/CHANGES-asterisk-core-fr-$(VERSION)
	dh_installchangelogs -pasterisk-core-sounds-it it-gsm/CHANGES-asterisk-core-it-$(VERSION)
	dh_installchangelogs -pasterisk-core-sounds-ru ru-gsm/CHANGES-asterisk-core-ru-$(VERSION)
	dh_installchangelogs

update-control:
	# Regenerate 
	./debian/mkcontrol "$(LANGS)" "$(FORMATS)" >debian/control.new
	@if ! cmp --silent debian/control debian/control.new; then \
		mv debian/control.new debian/control; \
		echo "debian/control has changed"; \
	fi

print-version:
	@echo languages: $(LANGS)
	@echo formats: $(FORMATS)
	@echo package: $(PACKAGE)
	@echo version: $(VERSION)
	@echo names: $(TARBALLS_EXTRA)

get-orig-source: $(TARBALLS_EXTRA) $(TARBALLS_EXTRA_SHA1)
	set -e; for tarball in $(TARBALLS_EXTRA); do \
	  filename="$${tarball##*/}"; \
	  (cd $(TARGET_DIR); sha1sum --quiet -c $$filename.sha1) \
	done
	rm -rf $(PKGDIR)
	mkdir -p $(PKGDIR)
	# Empty tarball
	tar czf $(TARGET_DIR)/$(PACKAGE)_$(VERSION).orig.tar.gz \
		-C $(TMPDIR) $(PACKAGE)-$(VERSION)
	rm -rf $(TMPDIR)