Name package busybox-unstable to keep a clean seperation between the official packages.
[oweals/busybox.git] / debian / rules
index 04714d648bd1c83b102be46461bb451c217fb7b0..d9a86547205f31402df0be88cf8f5f7325e1f96d 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.
-
-# This is the debhelper compatability version to use.
-export DH_COMPAT=1
-
-bb=debian/tmp
-bbs=debian/busybox-static
-
-clean:
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp-busybox build-stamp-busybox-static
-       -$(MAKE) clean
-       -rm -rf $(bb) $(bbs)
-       dh_clean
-
-half_clean:
+export DH_VERBOSE=1
+export DH_COMPAT=3
+
+# These wont actually do anything yet, need to hack Rules.mak
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+       INSTALL_PROGRAM += -s
+endif
+
+busybox-deb:
        dh_testdir
        dh_testroot
-       rm -rf $(bbs) build-stamp-busybox-static
-       -$(MAKE) clean
-
-build: build-stamp-busybox
-build-stamp-busybox:
-       dh_testdir
+       $(MAKE) clean
+       cp ./debian/config-deb .config
+       cp ./debian/Rules.mak.shared Rules.mak
+       $(MAKE) dep
        $(MAKE)
-       touch build-stamp-busybox
-
-install: build
+       install -D busybox ./debian/busybox-unstable/bin/busybox
+       dh_installchangelogs Changelog -pbusybox-unstable
+       dh_installdocs -pbusybox-unstable
+       dh_strip -pbusybox-unstable
+       dh_compress -pbusybox-unstable
+       dh_fixperms -pbusybox-unstable
+       dh_installdeb -pbusybox-unstable
+       dh_shlibdeps -pbusybox-unstable
+       dh_gencontrol -pbusybox-unstable
+       dh_md5sums -pbusybox-unstable
+       dh_builddeb -pbusybox-unstable
+                       
+busybox-udeb:
        dh_testdir
        dh_testroot
-       dh_clean -k
-       dh_installdirs
-       $(MAKE) "PREFIX=$(bb)" install
-       mkdir -p $(bb)/usr/share/man/man1
-       cp docs/BusyBox.1 $(bb)/usr/share/man/man1/busybox.1
-
-# 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
-
-install-static: build
+       $(MAKE) clean
+       cp ./debian/config-udeb .config
+       cp ./debian/Rules.mak.shared Rules.mak
+       $(MAKE) dep
+       $(MAKE)
+       install -D busybox ./debian/busybox-unstable-udeb/bin/busybox
+       dh_installchangelogs Changelog -pbusybox-unstable-udeb
+       dh_strip -pbusybox-unstable-udeb
+       dh_compress -pbusybox-unstable-udeb
+       dh_fixperms -pbusybox-unstable-udeb
+       dh_installdeb -pbusybox-unstable-udeb
+       dh_shlibdeps -pbusybox-unstable-udeb
+       dh_gencontrol -pbusybox-unstable-udeb
+       dh_md5sums -pbusybox-unstable-udeb
+       dh_builddeb -pbusybox-unstable-udeb
+
+
+busybox-static:
        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
-
+       $(MAKE) clean
+       cp ./debian/config-static .config
+       cp ./debian/Rules.mak.static Rules.mak
+       $(MAKE) dep
+       $(MAKE)
+       install -D busybox ./debian/busybox-unstable-static/bin/busybox
+       dh_installchangelogs Changelog -pbusybox-unstable-static
+       dh_installdocs -pbusybox-unstable-static
+       dh_strip -pbusybox-unstable-static
+       dh_compress -pbusybox-unstable-static
+       dh_fixperms -pbusybox-unstable-static
+       dh_installdeb -pbusybox-unstable-static
+       dh_shlibdeps -pbusybox-unstable-static
+       dh_gencontrol -pbusybox-unstable-static
+       dh_md5sums -pbusybox-unstable-static
+       dh_builddeb -pbusybox-unstable-static
+
+binary-arch: busybox-deb busybox-udeb busybox-static
 
-# Build architecture-independent files here.
 binary-indep:
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: busybox busybox-static
-
-busybox: install
-       @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 $(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$@
-       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$@
-
+       $(MAKE) clean
+       $(MAKE) newdoc
+       dh_installdocs -pbusybox-unstable-doc
+       dh_installchangelogs Changelog -pbusybox-unstable-doc
+       dh_compress -pbusybox-unstable-doc
+       dh_fixperms -pbusybox-unstable-doc
+       dh_installdeb -pbusybox-unstable-doc
+       dh_gencontrol -pbusybox-unstable-doc
+       dh_md5sums -pbusybox-unstable-doc
+       dh_builddeb -pbusybox-unstable-doc
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+.PHONY: build clean binary-indep binary-arch binary install configure