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