[mw-devel] MW3 r1066 - in trunk: . debian-template
welshbyte at sucs.org
welshbyte at sucs.org
Thu Mar 12 01:19:43 GMT 2009
Author: welshbyte
Date: 2009-03-12 01:19:42 +0000 (Thu, 12 Mar 2009)
New Revision: 1066
Removed:
trunk/debian-template/changelog
Modified:
trunk/Makefile
trunk/debian-template/rules
Log:
Make building debian packages simple:
- Remove the debian changelog: generate one each time the package builds instead
- Switch the rules file from CDBS (small, broken) to debhelper (verbose, controllable)
- Add a 'make deb' rule to the root Makefile
- Split 'tarball' rule into 'export' and 'tarball' rules (deb packaging doesn't need a tarball)
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2009-03-11 20:42:14 UTC (rev 1065)
+++ trunk/Makefile 2009-03-12 01:19:42 UTC (rev 1066)
@@ -8,11 +8,18 @@
INSTALLFILES = colour help login.banner mudhelp rooms scripthelp talkhelp wizhelp COPYING INSTALL LICENSE README
ifndef TMPDIR
-rpm:
- make TMPDIR=`mktemp -d` rpm
+rpm deb:
+ make TMPDIR=`mktemp -d` $@
else
rpm: tarball
rpmbuild -ta $(TMPDIR)/mw3-$(VERSION).tar.gz
+
+deb: export
+ cp -a $(TMPDIR)/mw3-$(VERSION)/debian-template $(TMPDIR)/mw3-$(VERSION)/debian
+ dch --create --package mw3 -v $(VERSION) -c $(TMPDIR)/mw3-$(VERSION)/debian/changelog "Build mw3 $(VERSION) package"
+ cd $(TMPDIR)/mw3-$(VERSION) && debuild -us -uc -b
+ mv $(TMPDIR)/mw3_$(VERSION)*.deb .
+ rm -rf $(TMPDIR)/mw3-$(VERSION)
endif
install:
@@ -20,12 +27,12 @@
cp -a $(INSTALLFILES) $(libdir)/mw/
make -C src install
-tarball:
+export:
rm -rf $(TMPDIR)/mw3-$(VERSION)
svn export . $(TMPDIR)/mw3-$(VERSION)
+
+tarball: export
mv $(TMPDIR)/mw3-$(VERSION)/mw.spec $(TMPDIR)/mw.spec
sed -e 's/^.*%define changeset.*$$/%define changeset $(VERSION_TWEAK)/' < $(TMPDIR)/mw.spec > $(TMPDIR)/mw3-$(VERSION)/mw.spec
tar zchvf $(TMPDIR)/mw3-$(VERSION).tar.gz -C $(TMPDIR) mw3-$(VERSION)
rm -fr $(TMPDIR)/mw3-$(VERSION)
-
-
Deleted: trunk/debian-template/changelog
===================================================================
Modified: trunk/debian-template/rules
===================================================================
--- trunk/debian-template/rules 2009-03-11 20:42:14 UTC (rev 1065)
+++ trunk/debian-template/rules 2009-03-12 01:19:42 UTC (rev 1066)
@@ -1,14 +1,53 @@
#!/usr/bin/make -f
-DEB_SRCDIR = $(CURDIR)/src
-HOMEPATH = $(DEB_DESTDIR)
-CPPFLAGS+=-I/usr/include/mozjs
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/makefile.mk
-DEB_MAKE_BUILD_TARGET := libdir=/usr/lib bindir=/usr/bin
-DEB_MAKE_INSTALL_TARGET := -C $(CURDIR) install libdir=$(DEB_DESTDIR)/usr/lib bindir=$(DEB_DESTDIR)/usr/bin localstatedir=$(DEB_DESTDIR)/var
+#export DH_VERBOSE=1
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ touch configure-stamp
-install/mw3::
- @rm $(DEB_DESTDIR)/usr/lib/mw/COPYING
- @rm $(DEB_DESTDIR)/usr/lib/mw/LICENSE
- @rm $(DEB_DESTDIR)/usr/lib/mw/README
- @rm $(DEB_DESTDIR)/usr/lib/mw/INSTALL
+build: build-stamp
+build-stamp: configure-stamp
+ dh_testdir
+ $(MAKE) -C src
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+ $(MAKE) -C src clean
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+ $(MAKE) libdir=$(CURDIR)/debian/mw3/usr/lib \
+ bindir=$(CURDIR)/debian/mw3/usr/bin \
+ localstatedir=$(CURDIR)/debian/mw3/var install
+ rm $(CURDIR)/debian/mw3/usr/lib/mw/COPYING
+ rm $(CURDIR)/debian/mw3/usr/lib/mw/LICENSE
+ rm $(CURDIR)/debian/mw3/usr/lib/mw/README
+ rm $(CURDIR)/debian/mw3/usr/lib/mw/INSTALL
+
+binary-indep: build install
+
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+
More information about the mw-devel
mailing list