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
|
#!/usr/bin/make -f
testdir = test -f wmifs/wmifs.c && test -f debian/rules
testroot = test x`whoami` = xroot
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
export CFLAGS
clean:
$(testdir)
rm -f build debian/files debian/rejected debian/substvars
$(MAKE) -C wmifs clean
-cat `ls -r debian/patches/*.diff` /dev/null | patch -RENtp1 -r debian/rejected --no-backup-if-mismatch
rm -rf debian/tmp
build:
$(testdir)
-cat debian/patches/*.diff | patch -Ntp1 -r debian/rejected --no-backup-if-mismatch
$(MAKE) -C wmifs
touch $@
binary: binary-arch
binary-indep:
binary-arch: build
$(testdir)
$(testroot)
rm -rf debian/tmp
$(MAKE) -C wmifs install prefix=/usr DESTDIR=$(CURDIR)/debian/tmp
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
strip -R .comment -R .note debian/tmp/usr/bin/wmifs
endif
install -D -p -m 0644 debian/wmifs.1 debian/tmp/usr/share/man/man1/wmifs.1
install -D -p -m 0644 debian/menu debian/tmp/usr/share/menu/wmifs
install -D -p -m 0644 debian/changelog debian/tmp/usr/share/doc/wmifs/changelog.Debian
install -D -p -m 0644 CHANGES debian/tmp/usr/share/doc/wmifs/changelog
install -p -m 0644 BUGS HINTS README TODO debian/copyright debian/tmp/usr/share/doc/wmifs
install -d -p -m 0755 debian/tmp/DEBIAN
install -p -m 0644 debian/control debian/tmp/DEBIAN
install -p -m 0755 debian/postinst debian/postrm debian/tmp/DEBIAN
find debian/tmp/usr/share/man -type f ! -name '*.gz' -print0 | xargs -0 gzip -9n
find debian/tmp/usr/share/doc -type f \( -size +8 -o -name 'changelog*' \) \
! -name copyright ! -name '*.htm*' ! -name '*.gz' -print0 | xargs -0 gzip -9n
cd debian/tmp && find etc -type f | sed 's/^/\//' > DEBIAN/conffiles
cd debian/tmp && find usr -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums
chmod 0644 debian/tmp/DEBIAN/md5sums
dpkg-shlibdeps debian/tmp/usr/bin/wmifs
dpkg-gencontrol -isp -pwmifs
chown -R root:root debian/tmp
chmod -R u+w,go=u-w debian/tmp
dpkg --build debian/tmp ..
.PHONY: clean binary-indep binary-arch binary
|