netkit-tiny-udeb
Hi Erik,
I debianized netkit-tiny. The way that I made a reduced feature udeb isn't
terribly pretty, perhaps you can think of a better way. I toyed with the idea
of using autoconf and a bunch of --[dis|e]nable's, but that may not be worth it.
-David
diff -uwdrN netkit-tiny/Makefile netkit-tiny-udeb/Makefile
--- netkit-tiny/Makefile Fri Dec 22 11:30:07 2000
+++ netkit-tiny-udeb/Makefile Wed Jan 3 22:46:51 2001
@@ -118,6 +118,7 @@
ifdef NKT_INIT_SCRIPT
CFLAGS += -DINIT_SCRIPT='"$(NKT_INIT_SCRIPT)"'
endif
+CFLAGS +=$(CONFIG_H)
all: netkit-tiny netkit-tiny.links
diff -uwdrN netkit-tiny/config.h netkit-tiny-udeb/config.h
--- netkit-tiny/config.h Wed Dec 31 16:00:00 1969
+++ netkit-tiny-udeb/config.h Wed Jan 3 22:45:49 2001
@@ -0,0 +1,5 @@
+#undef NKT_HOSTID
+#undef NKT_HOSTNAME
+#undef NKT_NSLOOKUP
+#undef NKT_ROUTE
+#undef NKT_TELNET
diff -uwdrN netkit-tiny/debian/changelog netkit-tiny-udeb/debian/changelog
--- netkit-tiny/debian/changelog Wed Dec 31 16:00:00 1969
+++ netkit-tiny-udeb/debian/changelog Wed Jan 3 22:28:36 2001
@@ -0,0 +1,10 @@
+netkit-tiny (0.1pre-1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- David Whedon <dwhedon@gordian.com> Sat, 30 Dec 2000 23:01:09 -0800
+
+Local variables:
+mode: debian-changelog
+add-log-mailing-address "dwhedon@gordian.com"
+End:
diff -uwdrN netkit-tiny/debian/control netkit-tiny-udeb/debian/control
--- netkit-tiny/debian/control Wed Dec 31 16:00:00 1969
+++ netkit-tiny-udeb/debian/control Wed Jan 3 22:43:56 2001
@@ -0,0 +1,24 @@
+Source: netkit-tiny
+Section: admin
+Priority: extra
+Maintainer: David Whedon <dwhedon@gordian.com>
+Build-Depends: debhelper (>= 2.1.18), dpkg-dev (>= 1.7.0)
+Standards-Version: 3.1.1
+
+Package: netkit-tiny
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Various small network utilities.
+ netkit-tiny provides small reduced featre versions of the standard network
+ utilities hostid, hostname, ifconfig, nc, nslookup, ping, route, and
+ telnet.
+
+Package: netkit-tiny-udeb
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Various small network utilities.
+ netkit-tiny provides small reduced featre versions of the standard network
+ utilities.
+ .
+ netkit-tiny-udeb is a minimal package containing only those utilties needed
+ by debian-installer: ping, ifconfig and nc.
diff -uwdrN netkit-tiny/debian/copyright netkit-tiny-udeb/debian/copyright
--- netkit-tiny/debian/copyright Wed Dec 31 16:00:00 1969
+++ netkit-tiny-udeb/debian/copyright Wed Jan 3 22:45:05 2001
@@ -0,0 +1,13 @@
+netkit-tiny
+
+Author(s):
+Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
+Charles P. Wright <cpwright@villagenet.com>
+
+This software is Copyright (C) 1999 by Lineo, inc.
+nc is copyright 1998 Charles P. Wright <cpwright@villagenet.com>
+
+You are free to distribute this software under the terms of
+the GNU General Public License.
+On Debian systems, the complete text of the GNU General Public
+License can be found in /usr/share/common-licenses/GPL file.
diff -uwdrN netkit-tiny/debian/rules netkit-tiny-udeb/debian/rules
--- netkit-tiny/debian/rules Wed Dec 31 16:00:00 1969
+++ netkit-tiny-udeb/debian/rules Wed Jan 3 22:56:57 2001
@@ -0,0 +1,116 @@
+#!/usr/bin/make -f
+# -*-makefile-*-
+# MAde with the aid of dh_make, by Craig Small
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+# Some lines taken from debmake, by Cristoph Lameter.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+build: build-stamp
+build-stamp:
+ dh_testdir
+
+ # need to make clean since udeb and deb build in same area
+ -$(MAKE) clean
+
+ # Add here commands to compile the package.
+ $(MAKE)
+
+ touch $@
+
+
+# note: if you add anything to this you may have to adjust
+# the lines below that create netkit-tiny.links
+UDEB_PROGS=ping.c ifconfig.c nc.c
+OBJS=utility.o usage.o netkit-tiny.o $(patsubst %.c,%.o,$(UDEB_PROGS))
+
+build-udeb: build-udeb-stamp
+build-udeb-stamp:
+ dh_testdir
+
+ # need to make clean since udeb and deb build in same area
+ -$(MAKE) clean
+
+ # Add here commands to compile the package.
+ $(MAKE) netkit-tiny OBJECTS="$(OBJS)" CONFIG_H="-DHAVE_CONFIG_H"
+
+ $(foreach PROG, $(UDEB_PROGS), \
+ (echo $(subst .c, , /bin/$(PROG)) >> netkit-tiny.links; ) ; )
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp build-udeb-stamp
+
+ # Add here commands to clean up after the build process.
+ -$(MAKE) clean
+ rm -rf debian/netkit-tiny debian/netkit-tiny-udeb
+ rm -f netkit-tiny
+ dh_clean
+
+# Build architecture-independent files here.
+binary-indep: build
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: netkit-tiny netkit-tiny-udeb
+netkit-tiny: build
+# dh_testversion
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the files into debian/tmp
+ $(MAKE) install PREFIX=`pwd`/debian/$@
+
+ dh_installdocs -p$@
+
+# dh_installmanpages
+# dh_undocumented
+ dh_installchangelogs -p$@
+ dh_strip
+ dh_compress
+ dh_fixperms
+ dh_suidregister
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol -p$@
+ dh_md5sums
+ dh_builddeb -p$@
+
+
+PACKAGE=netkit-tiny-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)
+
+netkit-tiny-udeb: build-udeb
+ mkdir -p debian/$@/bin/
+ ./install.sh `pwd`/debian/$@
+ @echo "Building $@"
+ dh_testdir
+ dh_testroot
+ dh_installdirs
+ dh_strip -p$@
+ dh_compress -p$@
+ dh_fixperms -p$@
+ dh_installdeb -p$@
+ dh_shlibdeps -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)
+
+
+
+source diff:
+ @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary
diff -uwdrN netkit-tiny/netkit-tiny.c netkit-tiny-udeb/netkit-tiny.c
--- netkit-tiny/netkit-tiny.c Fri Dec 22 11:30:07 2000
+++ netkit-tiny-udeb/netkit-tiny.c Wed Jan 3 22:47:33 2001
@@ -5,6 +5,10 @@
#include <unistd.h>
#include <errno.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#undef APPLET
#undef APPLET_NOUSAGE
#undef PROTOTYPES
Reply to: