File: rules

package info (click to toggle)
asterisk-moh-opsound 2.03-1.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 27,848 kB
  • sloc: makefile: 33
file content (41 lines) | stat: -rwxr-xr-x 1,055 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
#!/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)
TMPDIR=tmp
FORMATS=gsm g722 wav
TARGET_DIR=.

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

%:
	dh $@


print-version:
	@echo package: $(PACKAGE)
	@echo version: $(VERSION)

get-orig-source:
	rm -rf $(PKGDIR)
	mkdir -p $(PKGDIR)
	set -e ; \
	cd $(TMPDIR); for format in $(FORMATS); do \
	  tarball="$(PACKAGE)-$$format-$(VERSION).tar.gz"; \
	  wget -q -c $(BASE_URL)/$$tarball; \
	  mkdir $(PKGNAME)/$$format; \
	  cd $(PKGNAME)/$$format; \
	    tar xzf ../../$$tarball; \
	  cd ../..; \
	done
	# Remove tarballs: only after a successful download:
	set -e ; \
	cd $(TMPDIR); for format in $(FORMATS); do \
	  tarball="$(PACKAGE)-$$format-$(VERSION).tar.gz"; \
	  $(RM) -f $$tarball; \
	 done
	tar czf $(TARGET_DIR)/$(PACKAGE)_$(VERSION).orig.tar.gz \
		-C $(TMPDIR) $(PACKAGE)-$(VERSION)
	rm -rf $(TMPDIR)