File: dpatch.make

package info (click to toggle)
dpatch 2.0.38%2Bnmu1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 676 kB
  • sloc: sh: 1,013; makefile: 225; awk: 57; perl: 17
file content (39 lines) | stat: -rw-r--r-- 973 bytes parent folder | download | duplicates (4)
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
# -*- Makefile -*-, you silly Emacs!
# vim: set ft=make:

DPATCH_PACKAGE	?= ${DEB_SOURCE_PACKAGE}
DPATCH_PACKAGE	?= ${PACKAGE}
DPATCH_STAMPDIR	?= debian/patched
DPATCH_STAMPFN	?= patch-stamp
DPATCH_PREDEPS	?=

ifdef PATCHLIST
UNPATCHLIST	:= ${PATCHLIST}
DPATCH_ALL	:=
else
DPATCH_ALL	:= -all
endif

ifneq (${DPATCH_STAMPDIR},debian/patched)
_STAMPDIR	:= --stampdir=${DPATCH_STAMPDIR}
endif

ifdef DPATCH_WORKDIR
_WORKDIR	:= --workdir ${DPATCH_WORKDIR}
endif

patch: ${DPATCH_STAMPFN}
${DPATCH_STAMPFN}: ${DPATCH_PREDEPS}
	test -d ${DPATCH_STAMPDIR} || install -d ${DPATCH_STAMPDIR}
	@echo "Patches applied in the Debian version of ${DPATCH_PACKAGE}:" > $@T
	@echo >> $@T
	dpatch ${_WORKDIR} apply${DPATCH_ALL} ${_STAMPDIR} ${PATCHLIST}
	dpatch ${_WORKDIR} cat${DPATCH_ALL} ${PATCHLIST} >>$@T
	mv -f $@T $@

unpatch:
	dpatch ${_WORKDIR} deapply${DPATCH_ALL} ${_STAMPDIR} ${UNPATCHLIST}
	rm -rf ${DPATCH_STAMPFN} ${DPATCH_STAMPFN}T ${DPATCH_STAMPDIR}


.PHONY: patch unpatch