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
|
#!/usr/bin/make -f
BUILDDIR = debian/wmwork
DEBDIR = $(BUILDDIR)/DEBIAN
DOCDIR = $(BUILDDIR)/usr/share/doc/wmwork
testdir = test -f src/wmwork.c && test -f debian/rules
testroot = test x`whoami` = xroot
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
else
CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif
CPPFLAGS = -Wall $(shell dpkg-buildflags --get CPPFLAGS)
export CPPFLAGS
CFLAGS = -Wall -g $(shell dpkg-buildflags --get CFLAGS)
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
export CFLAGS
LDFLAGS = -Wall $(shell dpkg-buildflags --get LDFLAGS)
export LDFLAGS
clean:
$(testdir)
rm -f build debian/files debian/substvars
[ ! -f src/Makefile ] || $(MAKE) -C src distclean
rm -rf debian/wmwork
build: build-arch
build-indep:
build-arch:
$(testdir)
cd src && ./configure $(CONFFLAGS) --prefix=/usr --mandir=/usr/share/man
$(MAKE) -C src
touch build
binary: binary-arch
binary-indep:
binary-arch: build
$(testdir)
$(testroot)
rm -rf debian/wmwork
$(MAKE) -C src install DESTDIR=$(CURDIR)/debian/wmwork
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
strip -R .comment -R .note $(BUILDDIR)/usr/bin/wmwork
endif
gzip -9n $(BUILDDIR)/usr/share/man/man1/wmwork.1
install -D -o root -g root -m 0644 debian/menu $(BUILDDIR)/usr/share/menu/wmwork
install -D -o root -g root -m 0644 CHANGES $(DOCDIR)/changelog
install -D -o root -g root -m 0644 debian/changelog $(DOCDIR)/changelog.Debian
install -o root -g root -m 0644 README debian/copyright $(DOCDIR)
install -D -o root -g root -m 0644 debian/worklog $(DOCDIR)/examples/worklog
gzip -9n $(DOCDIR)/changelog*
install -d -o root -g root -m 0755 $(DEBDIR)
install -o root -g root -m 0644 debian/control $(DEBDIR)
install -o root -g root -m 0755 debian/postinst debian/postrm $(DEBDIR)
cd $(BUILDDIR) && find usr -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums
chmod 0644 $(DEBDIR)/md5sums
dpkg-shlibdeps $(BUILDDIR)/usr/bin/wmwork
dpkg-gencontrol -isp -pwmwork -P$(BUILDDIR)
dpkg --build $(BUILDDIR) ..
.PHONY: clean binary binary-indep binary-arch
|