3 # Debian package information
6 DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
7 DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
8 DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
10 VERSION := $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }')
11 UDEB := strace-udeb_$(VERSION)_$(DEB_HOST_ARCH).udeb
13 ifeq ($(DEB_HOST_GNU_TYPE),sparc-linux)
15 HOST64 = sparc64-linux
19 ifeq ($(DEB_HOST_GNU_TYPE),s390-linux)
26 extra_build_targets += stamp-build64
29 ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
30 CONFIG_OPTS = --build=$(DEB_BUILD_GNU_TYPE)
32 CONFIG_OPTS = --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
35 all build: stamp-build
43 cd $(@D); sh ../configure --prefix=/usr $(CONFIG_OPTS)
47 cd $(@D); CC="$(CC64)" sh ../configure --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(HOST64)
50 rm -rf debian/tmp debian/substvars debian/files debian/files~
51 rm -rf build64 stamp-build64
52 rm -rf build stamp-build
54 binary: binary-indep binary-arch
58 binary-arch: $(extra_build_targets) build checkroot
59 test -f stamp-build || make $(MFLAGS) -f debian/rules build
60 -rm -rf debian/tmp debian/files debian/substvars
62 install -d -m 755 -o root -g root debian/tmp
63 # reset the mode to work around a bug in install
65 install -d -m 755 -o root -g root debian/tmp/DEBIAN
68 install -d -o root -g root -m 755 debian/tmp/usr/bin
69 install -o root -g root -m 755 build/strace debian/tmp/usr/bin/strace
72 dpkg-gencontrol -is -pstrace-udeb -fdebian/files~
73 dpkg-deb --build debian/tmp ../$(UDEB)
74 dpkg-distaddfile $(UDEB) debian-installer extra
76 # Install documentation
77 install -d -o root -g root -m 755 debian/tmp/usr/share/doc/$(package)
78 install -d -o root -g root -m 755 debian/tmp/usr/share/man/man1
79 install -p -o root -g root -m 644 debian/changelog \
80 debian/tmp/usr/share/doc/$(package)/changelog.Debian
81 install -p -o root -g root -m 644 TODO \
82 debian/tmp/usr/share/doc/$(package)/TODO
83 install -p -o root -g root -m 644 NEWS \
84 debian/tmp/usr/share/doc/$(package)/changelog
85 gzip -9 debian/tmp/usr/share/doc/$(package)/*
86 install -p -o root -g root -m 644 debian/copyright \
87 debian/tmp/usr/share/doc/$(package)/copyright
88 install -p -o root -g root -m 644 strace.1 debian/tmp/usr/share/man/man1/strace.1
89 gzip -9 debian/tmp/usr/share/man/man1/strace.1
92 install -o root -g root -m 755 build64/strace debian/tmp/usr/bin/strace64
93 ln -s strace.1.gz debian/tmp/usr/share/man/man1/strace64.1.gz
97 dpkg-shlibdeps build/strace $(patsubst yes,build64/strace,$(build64))
99 dpkg-gencontrol -is -pstrace
100 dpkg-deb --build debian/tmp ..
103 test root = "`whoami`"