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 92 93 94 95 96 97 98 99 100 101 102 103
|
#! /usr/bin/make -f
# -*- Makefile -*-
# Written by Antti-Juhani Kaijanaho <ajk@debian.org>. Use, distribute
# and modify as you please.
install := install -o root -g root
install_exec := $(install) -m 755 -s
install_dir := $(install) -m 755 -d
install_nonex := $(install) -m 644
install_script := $(install) -m 755
install_zipped := false
install_symlink := ln -s
GZIP = gzip -9
package = grep-dctrl
rootdir = `pwd`/debian/tmp
docdir = $(rootdir)/usr/share/doc/$(package)
bindir = $(rootdir)/usr/bin
mandir = $(rootdir)/usr/share/man
man1dir = $(mandir)/man1
build: debian/build.stamp
debian/build.stamp: debian/build-depends.stamp \
debian/build-configure.stamp
$(checkdir)
$(MAKE)
touch $@
debian/build-configure.stamp:
./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share
touch $@
debian/build-depends.stamp:
$(checkdir)
chmod u+x debian/check-sourcedeps
debian/check-sourcedeps publib-dev
touch $@
clean-build:
$(RM) debian/build*.stamp
-$(MAKE) distclean
binary: binary-arch binary-indep
binary-indep: debian/binary-indep.stamp
debian/binary-indep.stamp :
touch $@
binary-arch: debian/binary-arch.stamp
debian/binary-arch.stamp : build
$(checkdir)
$(RM) -r $(rootdir)
# Create the filesystem
$(install_dir) $(rootdir)
$(install_dir) $(rootdir)/DEBIAN
$(install_dir) $(docdir)
# Install by the master makefile
$(MAKE) prefix=$(rootdir)/usr sysconfdir=$(rootdir)/etc \
mandir=$(mandir) install
# Install copyright file.
$(install_nonex) debian/copyright $(docdir)
# Install the change logs.
$(install_nonex) debian/changelog $(docdir)
$(GZIP) $(docdir)/changelog
# Install the binary.
$(install_exec) grep-dctrl $(bindir)
set -e ; for dest in grep-status grep-available ; do \
$(install_symlink) grep-dctrl $(bindir)/$$dest ; \
done
# Zip the manual page.
gzip -9v $(man1dir)/grep-dctrl.1
set -e ; for dest in grep-status grep-available ; do \
$(install_symlink) grep-dctrl.1.gz $(man1dir)/$$dest.1.gz ; \
done
# Install the supporting documentation.
$(install_nonex) TODO NEWS Compatibility $(docdir)
# Generate the binary control file.
dpkg-shlibdeps $(bindir)/grep-dctrl
dpkg-gencontrol -isp
# Install the control files
$(install_nonex) debian/conffiles $(rootdir)/DEBIAN
$(install_script) debian/prerm debian/postinst $(rootdir)/DEBIAN
# Fix permissions.
chown -R root.root $(rootdir)
chmod -R g-ws $(rootdir)
# Genearate the deb.
dpkg --build $(rootdir) ..
touch binary-arch
define checkdir
test -f grep-dctrl.c -a -f debian/rules
endef
clean-binary:
$(RM) debian/binary*.stamp
$(RM) *~
$(RM) -r debian/tmp debian/*~ debian/files debian/substvars
clean: clean-build clean-binary
|