File: rules

package info (click to toggle)
fusiondirectory 1.2.3-4%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 33,140 kB
  • sloc: php: 45,518; pascal: 3,700; perl: 2,026; xml: 1,521; sh: 137; makefile: 22
file content (30 lines) | stat: -rwxr-xr-x 1,222 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
#!/usr/bin/make -f

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

PKD   = $(word 1,$(abspath $(dir $(MAKEFILE_LIST))))
PKG   = $(DEB_SOURCE)
UVER  = $(shell echo $(DEB_VERSION) | cut -d "-" -f1)
DTYPE =
VER  ?= $(subst $(DTYPE),,$(UVER))
PLUGINS = $(shell ls debian/watch.* | cut -d "." -f2 | sed -e 's/fusiondirectory-//')


%:
	dh $@

override_dh_installchangelogs:
	dh_installchangelogs -k core/Changelog

get-orig-source: $(patsubst %,$(PKG)-%_$(VER)$(DTYPE).orig.tar.gz,$(PLUGINS))
	cd $(PKD) && XZ_OPT=-6v tar -caf "../$(PKG)_$(VER)$(DTYPE).orig.tar.gz" --owner=root --group=root --mode=a+rX README.multi-orig-tarball-package
	cd $(PKD)/.. && mv *.tar.gz ..

$(PKG)-%_$(VER)$(DTYPE).orig.tar.gz:
	cd $(PKD)/..
	@echo "# Downloading..."
	uscan --noconf --force-download --package $(PKG)-$* --watchfile debian/watch.fusiondirectory-$* --upstream-version $(UVER) --download-version $(VER) --rename --destdir=.
	@echo "# Renaming..."
	mv -v $(PKG)-$*_$(VER).orig.tar.gz $(PKG)_$(VER)$(DTYPE).orig-$*.tar.gz
	if test "$*" = "core"; then mv -v $(PKG)-$(UVER).tar.gz.pgp ../$(PKG)_${VER}${DTYPE}.orig-$*.tar.gz.asc; fi
	if test "$*" != "core"; then mv -v $(PKG)-$*-$(UVER).tar.gz.pgp ../$(PKG)_${VER}${DTYPE}.orig-$*.tar.gz.asc; fi