Patch for the debian-cvs package, ip* applets in /bin, patch from Bastian Blank
[oweals/busybox.git] / debian / rules
index 67741b19f6616dbe3dbf1a292cd89410ee88e842..a1fe24543729bca303b06afbba5cf18cb8836de1 100755 (executable)
 #!/usr/bin/make -f
 
-# This is a bit unusual, in that I have to completely recompile everything
-# twice.  The first is the normal, dynamically linked package.  The second is
-# for the statically linked package.  This file has been adjusted accordingly.
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
 
-# This is the debhelper compatability version to use.
-export DH_COMPAT=1
+# This is the debhelper compatibility version to use.
+export DH_COMPAT=3
 
-bb=debian/tmp
-bbbd=debian/bb_builddir
-bbs=debian/busybox-static
-bbsbd=debian/bb-static_builddir
+VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
+ARCH = $(shell dpkg --print-architecture)
 
-#For the debian-installer .udeb package
-PACKAGE=busybox-udeb
-VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
-ARCH=$(shell dpkg --print-architecture)
-FILENAME=$(PACKAGE)_$(VERSION)_$(ARCH).udeb
-PRIORITY=$(shell grep ^Priority: debian/control | cut -d ' ' -f 2)
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+       DODEBUG = true
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+endif
 
-clean:
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp-busybox build-stamp-busybox-static
-       -$(MAKE) clean
-       -rm -rf $(bb) $(bbbd) $(bbs) $(bbsbd)
-       dh_clean
+build-arch: build-arch-stamp
+build-arch-stamp:
+       $(MAKE) clean
+       cp ./debian/config-deb .config
+       $(MAKE) dep
+       $(MAKE) DODEBUG=$(DODEBUG)
+       install busybox busybox-deb
 
-half_clean:
-       dh_testdir
-       dh_testroot
-       rm -rf $(bbs) build-stamp-busybox-static
-       -$(MAKE) clean
+       $(MAKE) clean
+       cp ./debian/config-static .config
+       $(MAKE) dep
+       $(MAKE) DODEBUG=$(DODEBUG)
+       install busybox busybox-static
 
-build: build-stamp-busybox
-build-stamp-busybox:
-       dh_testdir
-       mkdir -p $(bbbd)
-       cp Makefile Config.h $(bbbd)
-       (cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../")
-       touch build-stamp-busybox
+       $(MAKE) clean
+       cp ./debian/config-udeb .config
+       $(MAKE) dep
+       $(MAKE) DODEBUG=$(DODEBUG)
 
-install: build
+       $(MAKE) docs/BusyBox.1
+
+       touch build-arch-stamp
+
+build: build-arch
+
+clean:
        dh_testdir
        dh_testroot
-       dh_clean -k
-       dh_installdirs
-       (cd $(bbbd); $(MAKE) "BB_SRC_DIR=../../" "PREFIX=../../$(bb)" install)
-       mkdir -p $(bb)/usr/share/man/man1
-       cp docs/BusyBox.1 $(bb)/usr/share/man/man1/busybox.1
+       rm -f build-arch-stamp build-indep-stamp debian/files~
 
-# Now for the statically linked stuff
-build-static: build-stamp-busybox-static
-build-stamp-busybox-static:
-       dh_testdir
-       $(MAKE) DOSTATIC=true
-       touch build-stamp-busybox-static
+       $(MAKE) distclean
+       -rm -f busybox-deb busybox-static busybox.1
 
-install-static: build
+       dh_clean
+
+install: build-arch
        dh_testdir
        dh_testroot
        dh_clean -k
        dh_installdirs
-       # Do not run 'make install', since we do not want all the symlinks. 
-       # This just installes the busybox binary...
-       #$(MAKE) "PREFIX=$(bbs)" install
-       mkdir -p $(bbs)/bin/
-       cp busybox $(bbs)/bin/busybox
-       mkdir -p $(bbs)/usr/share/man/man1/
-       cp docs/BusyBox.1 $(bbs)/usr/share/man/man1/busybox.1
 
-do_static: half_clean build-static install-static
+       install busybox-deb $(CURDIR)/debian/busybox-cvs/bin/busybox
+       install busybox-static $(CURDIR)/debian/busybox-cvs-static/bin/busybox
+       $(MAKE) PREFIX=$(CURDIR)/debian/busybox-cvs-udeb install
+       cp docs/BusyBox.1 busybox.1
 
-
-# Build architecture-independent files here.
-binary-indep:
-# We have nothing to do by default.
+       install -m644 debian/busybox-cvs-static.override \
+               debian/busybox-cvs-static/usr/share/lintian/overrides/busybox-cvs-static
 
 # Build architecture-dependent files here.
-binary-arch: busybox busybox-static busybox-udeb
-
-busybox: install
-       @echo "--- Building: $@"
-       dh_testdir
-       dh_testroot
-       dh_installdirs
-       #
-       #Note that for busybox, we do not install any docs,
-       # or man apges or anything else.  This is in blatent violation of every
-       # Debian policy out there, since this package is intended to be used
-       # _only_ by the debian-installer.
-       #
-       #dh_installdocs       -p$@ docs/BusyBox.txt \
-       #       docs/BusyBox.html docs/busybox.lineo.com AUTHORS README TODO
-       #rm -rf $(bb)/usr/share/doc/busybox/busybox.lineo.com/CVS \
-       #       $(bb)/usr/share/doc/busybox/busybox.lineo.com/.cvsignore \
-       #       $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/CVS \
-       #       $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/.cvsignore
-       #dh_undocumented      -p$@
-       #dh_installchangelogs -p$@ Changelog
-       dh_strip             -p$@
-       dh_compress          -p$@
-       dh_fixperms          -p$@
-       dh_installdeb        -p$@
-       dh_shlibdeps         -p$@
-       #
-       #Make _very_ sure there are no docs lurking about.
-       #
-       rm -rf $(bb)/usr/share/doc
-       rm -rf $(bb)/usr/share/man
-       dh_gencontrol        -p$@
-       dh_md5sums           -p$@
-       dh_builddeb          -p$@
-
-
-busybox-static: do_static
-       @echo "--- Building: $@"
-       dh_testdir
-       dh_testroot
-       dh_installdirs
-       dh_installdocs       -p$@ docs/BusyBox.txt \
-               docs/BusyBox.html docs/busybox.lineo.com AUTHORS README TODO
-       rm -rf $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/CVS \
-               $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/.cvsignore \
-               $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/images/CVS \
-               $(bbs)/usr/share/doc/busybox-static/busybox.lineo.com/images/.cvsignore
-       dh_undocumented      -p$@
-       dh_installchangelogs -p$@ Changelog
-       dh_strip             -p$@
-       dh_compress          -p$@
-       dh_fixperms          -p$@
-       dh_installdeb        -p$@
-       dh_shlibdeps         -p$@
-       dh_gencontrol        -p$@
-       dh_md5sums           -p$@
-       dh_builddeb          -p$@
-
-
-# Note that this builds a .udeb, which is not policy compliant or anything.
-#
-busybox-udeb: install
-       @echo "--- Building: $@"
-       dh_testdir
-       dh_testroot
-       dh_installdirs
-       #
-       #Note that for busybox, we do not install any docs,
-       # or man apges or anything else.  This is in blatent violation of every
-       # Debian policy out there, since this package is intended to be used
-       # _only_ by the debian-installer.
-       #
-       #dh_installdocs       -p$@ docs/BusyBox.txt \
-       #       docs/BusyBox.html docs/busybox.lineo.com AUTHORS README TODO
-       #rm -rf $(bb)/usr/share/doc/busybox/busybox.lineo.com/CVS \
-       #       $(bb)/usr/share/doc/busybox/busybox.lineo.com/.cvsignore \
-       #       $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/CVS \
-       #       $(bb)/usr/share/doc/busybox/busybox.lineo.com/images/.cvsignore
-       #dh_undocumented      -p$@
-       #dh_installchangelogs -p$@ Changelog
-       dh_strip             -p$@
-       dh_compress          -p$@
-       dh_fixperms          -p$@
-       dh_installdeb        -p$@
-       dh_shlibdeps         -p$@
-       #
-       #Make _very_ sure there are no docs lurking about.
-       #
-       rm -rf $(bb)/usr/share/doc
-       rm -rf $(bb)/usr/share/man
-       dh_gencontrol        -p$@
-       # Don't write your stupid guesses to debian/files.
-       #dh_gencontrol        -p$@ -- -fdebian/files~
-       # Register file manually.
-       dpkg-distaddfile $(FILENAME) debian-installer $(PRIORITY)
-       dh_md5sums           -p$@
-       dh_builddeb          -p$@ --filename=$(FILENAME)
-
-binary: binary-indep binary-arch
+binary-arch: build-arch install
+       dh_testdir -a
+       dh_testroot -a
+#      dh_installdebconf -a
+       dh_installdocs -a -Nbusybox-cvs-udeb
+#      dh_installexamples -a
+#      dh_installmenu -a
+#      dh_installlogrotate -a
+#      dh_installemacsen -a
+#      dh_installpam -a
+#      dh_installmime -a
+#      dh_installinit -a
+#      dh_installcron -a
+       dh_installman -a -Nbusybox-cvs-udeb
+#      dh_installinfo -a
+#      dh_undocumented -a
+       dh_installchangelogs Changelog -a -Nbusybox-cvs-udeb
+       dh_strip -a
+       dh_link -a
+       dh_compress -a
+       dh_fixperms -a
+#      dh_makeshlibs -a
+       dh_installdeb -a
+#      dh_perl -a
+       dh_shlibdeps -a
+       dh_gencontrol -a -Nbusybox-cvs-udeb
+       dh_md5sums -a -Nbusybox-cvs-udeb
+       dh_builddeb -a -Nbusybox-cvs-udeb
+
+       dh_gencontrol -pbusybox-cvs-udeb -- -fdebian/files~
+       dpkg-distaddfile busybox-cvs-udeb_$(VERSION)_$(ARCH).udeb debian-installer extra
+       dh_builddeb -pbusybox-cvs-udeb --filename=busybox-cvs-udeb_$(VERSION)_$(ARCH).udeb
+
+binary: binary-arch
 .PHONY: build clean binary-indep binary-arch binary install