File: rules

package info (click to toggle)
tar 1.29b-1.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 17,520 kB
  • ctags: 8,450
  • sloc: ansic: 75,918; sh: 48,709; yacc: 1,254; makefile: 460; sed: 16
file content (115 lines) | stat: -rwxr-xr-x 3,251 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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/make -f

DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
CONFARGS = --host=$(DEB_HOST_GNU_TYPE)
endif

CFLAGS = `dpkg-buildflags --get CFLAGS`
CFLAGS += -Wall
LDFLAGS += `dpkg-buildflags --get LDFLAGS`
CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`

export BUILD_DATE = $(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p')

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  MAKEFLAGS += -j$(NUMJOBS)
endif

configure: configure-stamp
configure-stamp:
	dh_testdir
	cp -f /usr/share/misc/config.sub build-aux/config.sub
	cp -f /usr/share/misc/config.guess build-aux/config.guess
	autoreconf --force -v --install
	RSH="/usr/bin/rsh" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure \
		--prefix=/usr \
		--libexecdir=/usr/lib/tar \
		--enable-backup-scripts \
		--with-lzma=xz \
		--disable-silent-rules \
		$(CONFARGS) 
	touch configure-stamp

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
	dh_testdir
	RSH="/usr/bin/rsh" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
		LDFLAGS="$(LDFLAGS)" $(MAKE) $(MAKEFLAGS)

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	@runas=`whoami` ; \
	if test $$runas = "root" ; \
	then \
	  echo "Sorry, but the test suite is not designed to be run as root."; \
	  exit 1 ;\
	fi
	$(MAKE) check
endif
endif

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	make install bindir=`pwd`/debian/tar/bin prefix=`pwd`/debian/tar/usr \
		libexecdir=`pwd`/debian/tar/usr/lib/tar 
	install -m 755 debian/rmt.sh debian/tar/etc/rmt
	mv debian/tar/usr/lib/tar/rmt debian/tar/usr/sbin/rmt-tar
	install -m 755 debian/tarcat debian/tar/usr/sbin/tarcat

	mv debian/tar/usr/sbin/backup debian/tar-scripts/usr/sbin/tar-backup
	mv debian/tar/usr/sbin/restore debian/tar-scripts/usr/sbin/tar-restore
	mv debian/tar/usr/lib/tar/backup.sh debian/tar-scripts/usr/lib/tar/
	mv debian/tar/usr/lib/tar/dump-remind debian/tar-scripts/usr/lib/tar/

# Build architecture-independent files here.
binary-indep: build install

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	mv -f debian/tar/usr/share/doc/tar/ChangeLog \
		debian/tar/usr/share/doc/tar/changelog
	mv -f debian/tar/usr/share/doc/tar/ChangeLog.1 \
		debian/tar/usr/share/doc/tar/changelog.1
	dh_installexamples
	dh_installmenu
	dh_installcron
	dh_installman doc/tar.1 doc/rmt.8 debian/tarcat.1
	mv debian/tar/usr/share/man/man8/rmt.8 \
	   debian/tar/usr/share/man/man8/rmt-tar.8
	dh_installinfo
	rm -f debian/tar/usr/share/info/dir*
	dh_installmime
	dh_installchangelogs #CHANGELOGS#
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure