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
|
#! /usr/bin/make -f
# Copyright 1994-97 joey@infodrom.north.de (Martin Schulze)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 dated June, 1991.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave., Cambridge, MA 02139, USA.
# The name and version of the source
#
source = $(shell grep "^Source: " debian/control|head -1|sed 's/Source: \(.*\)/\1/g')
package = $(shell grep "^Package: " debian/control|head -1|sed 's/Package: \(.*\)/\1/g')
version = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*(\(.*\)\-[^\-]*).*/\1/g')
revision = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*([^\-]*\-\(.*\)).*/\1/g')
mkdosfs=mkdosfs-0.3b
dosfsck=dosfsck-1
installbin = install -g root -o root -m 755
installdoc = install -g root -o root -m 644
build:
$(MAKE) -C $(mkdosfs) CFLAGS='-O2 -g -Wall'
$(MAKE) -C $(dosfsck) CFLAGS='-O2 -g -Wall -Wno-parentheses'
touch stamp-build
clean: debclean
$(MAKE) -C $(mkdosfs) clean
$(MAKE) -C $(dosfsck) clean
rm -rf `find -name '*~'`
debclean:
# Cleans debian binary directories to allow binary creation
rm -rf stamp-build
rm -rf debian/tmp
rm -f debian/{files,substvars}
binary: binary-indep binary-arch
binary-indep:
# Nothing to be done here
binary-arch: debclean
test root = "`whoami`" || exit 1
test -f stamp-build || $(MAKE) -f debian/rules build
$(installbin) -d debian/tmp/DEBIAN
chmod -R g-ws debian/tmp
#
$(installbin) -d debian/tmp/usr/doc/$(package)
$(installdoc) debian/changelog debian/tmp/usr/doc/$(package)/changelog.Debian
$(installdoc) debian/copyright debian/tmp/usr/doc/$(package)/copyright
$(installdoc) $(mkdosfs)/README debian/tmp/usr/doc/$(package)/mkdosfs
$(installdoc) $(dosfsck)/README debian/tmp/usr/doc/$(package)/dosfsck
$(installdoc) $(mkdosfs)/ChangeLog debian/tmp/usr/doc/$(package)/changelog.mkdosfs
$(installdoc) $(dosfsck)/CHANGES debian/tmp/usr/doc/$(package)/changelog.dosfsck
gzip -9f debian/tmp/usr/doc/$(package)/{changelog.*,mkdosfs,dosfsck}
#
$(installbin) -d debian/tmp/sbin
$(installbin) -s $(mkdosfs)/mkdosfs debian/tmp/sbin
$(installbin) -s $(dosfsck)/dosfsck debian/tmp/sbin
$(installbin) -d debian/tmp/sbin
(cd debian/tmp/sbin && ln -s mkdosfs mkfs.msdos)
(cd debian/tmp/sbin && ln -s dosfsck fsck.msdos)
#
$(installbin) -d debian/tmp/usr/man/man8
$(installdoc) $(mkdosfs)/mkdosfs.8 debian/tmp/usr/man/man8
$(installdoc) $(dosfsck)/dosfsck.8 debian/tmp/usr/man/man8
gzip -9f debian/tmp/usr/man/man?/*
(cd debian/tmp/usr/man/man8 && ln -s mkdosfs.8.gz mkfs.msdos.8.gz)
(cd debian/tmp/usr/man/man8 && ln -s dosfsck.8.gz fsck.msdos.8.gz)
#
dpkg-shlibdeps debian/tmp/sbin/{mkdosfs,dosfsck}
dpkg-gencontrol
dpkg --build debian/tmp ..
source diff:
@echo >&2 'source and diff are obsolete - use dpkg-source -b' or dsc; false
dsc: clean
-test -d debian/tmp && $(MAKE) -f debian/rules debclean
-test -f ../$(source)_$(version).orig.tar.gz -a \
-f ../orig/$(source)_$(version).orig.tar.gz \
|| (ln -s orig/$(source)_$(version).orig.tar.gz ../$(source)_$(version).orig.tar.gz; \
touch /tmp/stamp-$(source)-link)
cd .. && dpkg-source -b $(source)-$(version)
-test -f /tmp/stamp-$(source)-link && \
(rm ../$(source)_$(version).orig.tar.gz /tmp/stamp-$(source)-link ) || true
dist: binary dsc
.PHONY: binary binary-arch binary-indep clean
|