Index: /trunk/Makefile
===================================================================
--- /trunk/Makefile	(revision 141)
+++ /trunk/Makefile	(revision 141)
@@ -0,0 +1,31 @@
+# quick makefile for debbuild
+# $Id$
+
+MANIFEST = \
+	debbuild Makefile COPYING debbuild.spec
+
+PKGNAME=debbuild
+VERSION=0.9
+
+MANDIR=/usr/share/man
+CONFDIR=/etc
+
+all:
+	# nothing to do
+
+install:
+	mkdir -p $(DESTDIR)/usr/bin
+	cp debbuild $(DESTDIR)/usr/bin
+
+	mkdir -p $(DESTDIR)$(MANDIR)/man8
+	pod2man --center="DeepNet Dev Tools" --section 8 \
+		repoput | gzip > $(DESTDIR)$(MANDIR)/man8/debbuild.8.gz
+
+dist:
+	mkdir $(PKGNAME)-$(VERSION)
+	tar cf - $(MANIFEST) | (cd $(PKGNAME)-$(VERSION); tar xvf -)
+	/usr/bin/perl -p -e 's/#VERSION#/$(VERSION)/' < $(PKGNAME).spec > $(PKGNAME)-$(VERSION)/$(PKGNAME).spec
+	tar cvf $(PKGNAME)-$(VERSION).tar $(PKGNAME)-$(VERSION)
+	gzip -v -f -9 $(PKGNAME)-$(VERSION).tar
+	rm -rf $(PKGNAME)-$(VERSION)
+	# gpg --detach-sign $(PKGNAME)-$(VERSION).tar.gz
Index: /trunk/debbuild.spec
===================================================================
--- /trunk/debbuild.spec	(revision 141)
+++ /trunk/debbuild.spec	(revision 141)
@@ -0,0 +1,88 @@
+# $Id$
+# Refer to the following for more info on .spec file syntax:
+#   http://www.rpm.org/max-rpm/
+#   http://www.rpm.org/max-rpm-snapshot/	(Updated version of above)
+#   http://docs.fedoraproject.org/drafts/rpm-guide-en/
+# More links may be available from http://www.rpm.org
+
+# A collection of magic to set the release "number" such that dist upgrades will, erm, upgrade.
+# NB:  This really only applies to packages built with debbuild.
+%if %{?debdist:0}%{?!debdist:1}
+%define debdist etch
+%endif
+%if "%{debdist}" == "sarge"
+%define errata 0
+%endif
+%if "%{debdist}" == "dapper"
+%define errata 1
+%endif
+%if "%{debdist}" == "etch"
+%define errata 2
+%endif
+%if "%{debdist}" == "lenny"
+%define errata 3
+%endif
+%if %{?relnum:0}%{?!relnum:1}
+%define relnum 1
+%endif
+
+# %{_vendor} is only set to "redhat" on Red Hat (Enterprise) Linux and direct
+# derivatives/ancestors (eg Fedora Core).  Upstream rpm (as packaged in Debian,
+# for instance) sets it to "rpm".  debbuild sets it to "debbuild".
+%if %{_vendor} == "redhat"
+%define errata el4
+%define release %{relnum}.%{errata}
+%else
+%define release %{relnum}.%{errata}%{debdist}
+%endif
+
+Summary: Build Debian-compatible .deb packages from RPM .spec files
+Name: debbuild
+Version: #VERSION#
+Release: %{release}
+Source: http://www.deepnet.cx/debbuild/debbuild-%{version}.tar.gz
+Group: Development/Tools
+License: GPLv2
+Packager: Kris Deugau <kdeugau@deepnet.cx>
+Requires: build-essential, pax, fakeroot
+%if %{_vendor} == "debbuild"
+Recommends: patch
+Suggests: rpm, subversion
+%endif
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+
+%description
+debbuild attempts to build Debian-friendly semi-native packages from
+RPM spec files, RPM-friendly tarballs, and RPM source packages
+(.src.rpm files).  It accepts most of the options rpmbuild does, and
+should be able to interpret most spec files usefully.  Perl modules
+should be handled via CPAN+dh-make-perl instead as it's simpler
+than even tweaking a .spec template.
+
+Note that patch is not strictly required unless you have .spec files
+with %patch directives, and RPM is not required unless you wish to
+rebuild .src.rpm source packages as .deb binary packages.
+
+%prep
+# Steps to unpack and patch source as needed
+%setup -q
+
+%build
+# Steps to compile the source
+%configure
+make
+
+%install
+# Steps to install to a temporary location for packaging
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+%makeinstall
+
+# Fill in the pathnames to be packaged here
+%files
+%{_bindir}/*
+%{_mandir}/man1/*
+%doc README
+
+%changelog
+* Mon Jan 01 1900  Name <email@site> -relnum
+- Packaging comment
