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
|
#!/usr/bin/make -f
INSTALL = install
INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755
INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755
package = mktemp
CFLAGS = -Wall -g
define checkdir
test -f debian/rules
endef
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) \
--cache=config.$(DEB_HOST_GNU_TYPE).cache
else
CROSS= --build $(DEB_BUILD_GNU_TYPE)
endif
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
CONFIGFLAGS = --prefix=/usr --mandir=\$${prefix}/share/man --bindir=/bin $(CROSS)
config.status: configure
$(checkdir)
CFLAGS="$(CFLAGS)" ./configure $(CONFIGFLAGS)
build: build-stamp
build-stamp: config.status
$(checkdir)
$(MAKE)
touch build-stamp
clean: checkroot
rm -f build-stamp
test ! -f Makefile || $(MAKE) distclean
rm -f debian/mktemp.substvars config.*cache
rm -rf debian/mktemp
install: checkroot build
rm -f debian/mktemp.substvars
rm -rf debian/mktemp
# Add here commands to install the package into debian/mktemp.
$(MAKE) install prefix=$(CURDIR)/debian/mktemp/usr \
bindir=$(CURDIR)/debian/mktemp/bin
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install checkroot
$(INSTALL_DIR) debian/mktemp/DEBIAN debian/mktemp/usr/share/doc/mktemp
$(INSTALL_FILE) debian/changelog debian/mktemp/usr/share/doc/mktemp/changelog.Debian
$(INSTALL_FILE) README debian/copyright debian/mktemp/usr/share/doc/mktemp/
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
strip --remove-section=.comment --remove-section=.note debian/mktemp/bin/mktemp
endif
gzip -9f debian/mktemp/usr/share/man/man1/mktemp.1 \
debian/mktemp/usr/share/doc/mktemp/changelog.Debian
dpkg-shlibdeps -Tdebian/mktemp.substvars debian/mktemp/bin/mktemp
dpkg-gencontrol -ldebian/changelog -isp -Tdebian/mktemp.substvars -Pdebian/mktemp
cd debian/mktemp && find . -type f ! -regex '.*/DEBIAN/.*' -printf "%P\n" | xargs -r md5sum > DEBIAN/md5sums
chown -R root:root debian/mktemp/*
chmod -R u+w,a+rX debian/mktemp/*
dpkg-deb --build debian/mktemp ..
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
checkroot:
$(checkdir)
test root = "`whoami`"
|