head     1.1;
branch   1.1.1;
access   ;
symbols  gfxboot-grub25:1.1.1.1 morphix:1.1.1;
locks    ; strict;
comment  @# @;


1.1
date     2005.10.17.17.14.26;  author tcheun;  state Exp;
branches 1.1.1.1;
next     ;

1.1.1.1
date     2005.10.17.17.14.26;  author tcheun;  state Exp;
branches ;
next     ;


desc
@@



1.1
log
@Initial revision
@
text
@#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets  by Bill Allombert 2001

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

SHELL = bash

CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif


# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_BUILD_GNU_CPU  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
DEB_BUILD_GNU_SYSTEM  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)

GRUB_VERSION=0.95
GRUB_DISK_IMAGE=grub-${GRUB_VERSION}-$(DEB_BUILD_GNU_CPU)-pc

patch: patch-stamp
patch-stamp:
	dh_testdir

	# Add here commands to patch the source..
	set -e ; for i in `cat debian/patches/00list | grep -v ^#` ; \
	do \
	echo "--- $$i ---" ; patch -p1 < debian/patches/$$i ; \
	done

	touch patch-stamp

unpatch:
	dh_testdir

	# Add here commands to reverse patchs to the source.
	if [ -f patch-stamp ] ; then \
	set -e ; for i in `tac debian/patches/00list | grep -v ^#` ; \
	do \
	echo "--- $$i ---" ; patch -R -p1 < debian/patches/$$i ; \
	done ; \
	fi \

	if [ -f patch-stamp ] ; then \
	rm patch-stamp ; \
	fi

configure: configure-stamp
configure-stamp: patch-stamp
	dh_testdir

	# Add here commands to configure the package.
	aclocal-1.8 && automake-1.8 && autoconf
	./configure \
		--host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--prefix=/ \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-auto-linux-mem-opt

	touch configure-stamp

build: build-arch

build-arch: build-arch-stamp
build-arch-stamp: configure-stamp
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE)

	## the creation of these manpages here is temporary,
	## when building grub finally works with the version
	## of autoconf in debian we can use MAINTAINER_MODE_TRUE
	# create man page for grub
	( cd docs && ./help2man \
	--name="the grub shell" \
	--section=8 --output=grub.8 \
	../grub/grub )

	# create man page for grub-install
	( cd util && chmod 755 grub-install )
	( cd docs && ./help2man \
	--name="install GRUB on your drive" \
	--section=8 --output=grub-install.8 \
	../util/grub-install )

	# create man page for mbchk
	( cd docs && ./help2man \
	--name="check the format of a Multiboot kernel" \
	--section=1 --output=mbchk.1 \
	../util/mbchk )

	# create man page for grub-md5-crypt
	( cd util && chmod 755 grub-md5-crypt )
	( cd docs && ./help2man \
	--name="Encrypt a password in MD5 format" \
	--section=8 --output=grub-md5-crypt.8 \
	../util/grub-md5-crypt )

	touch build-arch-stamp

build-indep: build-indep-stamp
build-indep-stamp: configure-stamp
	dh_testdir

	# create html documentation from texi files
	( cd docs && texi2html -split_chapter grub.texi )
	( cd docs && texi2html -split_chapter multiboot.texi )

	touch build-indep-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp build-indep-stamp configure-stamp config.log

	# Add here commands to clean up after the build process.
	-$(MAKE) distclean

	# The Makefile doesn't clean up the generated info files so we will do
	# it here so the doco is uptodate.
	-( cd docs && rm -f *.info* )

	# clean up generated html documentation
	-( cd docs && rm -f *.html )

	# reverse patchs we applied this has to happen after make distclean
	-$(MAKE) -s -f debian/rules unpatch

	dh_clean

install: install-indep install-arch
install-indep: install-arch
	#dh_testdir
	#dh_testroot
	#dh_clean -k -i 
	#dh_installdirs -i

	# Add here commands to install the indep part of the package into
	# debian/<package>-doc.
	#INSTALLDOC#

	# grub-disk
	#mkdir -p $(CURDIR)/debian/tmp/root/boot/grub
	#cp $(CURDIR)/debian/grub/lib/grub/i386-*/{stage1,e2fs_stage1_5,stage2} \
	#	$(CURDIR)/docs/menu.lst \
	#	$(CURDIR)/debian/tmp/root/boot/grub
	#tar -C $(CURDIR)/debian/tmp/root \
	#	-cvzf $(CURDIR)/debian/tmp/grub.tar.gz boot
	#chmod +x $(CURDIR)/util/mkbimage
	#$(CURDIR)/util/mkbimage -t 1.44 \
	#	-d $(CURDIR)/debian/tmp/ -s ext2 \
	#	-f $(CURDIR)/debian/tmp/grub.tar.gz
	#
	#rm -f $(CURDIR)/debian/tmp/root/boot/grub/*stage*
	#cp $(CURDIR)/debian/grub/lib/grub/i386-*/stage2_eltorito \
	#	$(CURDIR)/debian/tmp/root/boot/grub

	#mkisofs \
	#	-b boot/grub/stage2_eltorito \
	#	-no-emul-boot -boot-load-size 4 -boot-info-table \
	#	-o $(CURDIR)/debian/tmp/raw.iso \
	#	-r $(CURDIR)/debian/tmp/root

	#gzip -c9 $(CURDIR)/debian/tmp/1.44.image > \
	#	$(CURDIR)/debian/grub-disk/usr/share/grub-disk/${GRUB_DISK_IMAGE}.ext2fs.gz
	#gzip -c9 $(CURDIR)/debian/tmp/raw.iso > \
	#	 $(CURDIR)/debian/grub-disk/usr/share/grub-disk/${GRUB_DISK_IMAGE}.iso.gz

	#dh_install -i

install-arch:
	dh_testdir
	dh_testroot
	dh_clean -k -s 
	dh_installdirs -s

	# Add here commands to install the package into debian/grub.
	$(MAKE) install DESTDIR=$(CURDIR)/debian/grub-gfxboot/

	# make install puts the info files in the grub package but we want them
	# in the grub-doc package so lets clean shop and let dh_installinfo do
	# the work
	rm -rf debian/grub-gfxboot/usr/share/info

	dh_install -s

# Must not depend on anything. This is to be called by
# binary-arch/binary-indep
# in another 'make' thread.
binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installexamples
#	dh_installmenu
#	dh_installdebconf	
#	dh_installlogrotate	
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
#	dh_installcron
	dh_installinfo
	dh_installman
#	dh_link
	dh_strip
	dh_compress 
	dh_fixperms
#	dh_perl
#	dh_python
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
	#$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure patch unpatch
@


1.1.1.1
log
@morhhix
@
text
@@
