debian: Switch to CDBS.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 21 Dec 2008 19:35:33 +0000 (19:35 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 21 Dec 2008 19:35:33 +0000 (19:35 +0000)
This involves hacking the Makefile a little to separate CFLAGS and
LDFLAGS into things the Debian build system can mess with and things
which will screw the build.

It also involves messing with the debian/*.install files in obvious
ways.  And the build leaves a bunch of cruft which needs ignoring.

.gitignore
Makefile
debian/.gitignore
debian/noip.install
debian/rules
debian/uopen.install

index 7ae0ae4..0191032 100644 (file)
@@ -6,3 +6,4 @@ build
 noip
 uopen
 COPYING
+*.o
index f69375a..c7afb3a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,8 +10,10 @@ man1dir = ${mandir}/man1
 
 CC = gcc
 LD = gcc
-CFLAGS = -O2 -g -fPIC -Wall
-LDFLAGS = -shared
+CFLAGS = -O2 -g -Wall
+LDFLAGS =
+REAL_CFLAGS = $(CFLAGS) -fPIC
+REAL_LDFLAGS = $(LDFLAGS) -shared
 LDLIBS = -ldl
 INST_BIN = install -c -m755
 INST_LIB = install -c -m644
@@ -27,11 +29,11 @@ TARGETS = $(LIBS) $(SCRIPTS)
 SOURCES = noip.c uopen.c withlib.in
 all: $(TARGETS)
 %.o: %.c
-       $(CC) -c $(CFLAGS) $< -o $@
+       $(CC) -c $(REAL_CFLAGS) $< -o $@
 noip.so: $(patsubst %.c, %.o, noip.c)
-       $(LD) $(LDFLAGS) $< $(LDLIBS) -o $@
+       $(LD) $(REAL_LDFLAGS) $< $(LDLIBS) -o $@
 uopen.so: $(patsubst %.c, %.o, uopen.c)
-       $(LD) $(LDFLAGS) $< $(LDLIBS) -o $@
+       $(LD) $(REAL_LDFLAGS) $< $(LDLIBS) -o $@
 $(SCRIPTS): withlib.in
        for i in $(SCRIPTS); do \
          sed "s/@lib@/$$i/" withlib.in >$$i.new || exit 1; \
index 4193c2f..48e3561 100644 (file)
@@ -5,4 +5,6 @@ substvars
 *.debhelper
 noip
 uopen
-
+*.log
+compat
+stamp-*
index 018d14a..53b5ef3 100644 (file)
@@ -1,3 +1,3 @@
-usr/bin/noip
-usr/lib/noip.so
-usr/share/man/man1/noip.1
+debian/tmp/usr/bin/noip
+debian/tmp/usr/lib/noip.so
+debian/tmp/usr/share/man/man1/noip.1
index 6739f8f..3d24648 100755 (executable)
@@ -1,48 +1,11 @@
 #! /usr/bin/make -f
 
-export DH_COMPAT = 4
+CDBS = /usr/share/cdbs/1
 
-build:
-       make clean
-       make
-       touch build
+include $(CDBS)/rules/debhelper.mk
+include $(CDBS)/class/makefile.mk
 
-clean:
-       dh_clean
-       make clean
-
-install: build
-       dh_clean
-       make install \
-         prefix=/usr \
-         mandir=/usr/share/man \
-         DESTDIR=`pwd`/debian/tmp
-       dh_install --sourcedir=debian/tmp
-       rm -rf debian/tmp
-
-binary-indep:
-
-binary-arch: install
-       dh_testdir -a
-       dh_testroot -a
-       dh_compress -a
-       dh_installdocs -a
-       dh_strip -a
-       dh_shlibdeps -a
-       dh_gencontrol -a
-       dh_fixperms -a
-       dh_installdeb -a
-       dh_md5sums -a
-       dh_builddeb -a
-
-binary: binary-indep binary-arch
-
-source:
-       rm -rf deb-dist.tar.gz =deb=
-       make dist DISTTAR=deb-dist.tar.gz
-       mkdir =deb=
-       cd =deb=; tar xvfz ../deb-dist.tar.gz
-       d=`pwd`; cd ..; dpkg-source -i -i'/\.svn/' -b $$d/=deb=/*
-       rm -rf deb-dist.tar.gz =deb=
-
-.PHONY: binary binary-arch binary-indep clean install source 
+DEB_MAKE_CLEAN_TARGET = clean
+DEB_MAKE_INSTALL_TARGET = install \
+       prefix=/usr mandir=/usr/share/man \
+       DESTDIR=debian/tmp
index cb36fa7..957cd42 100644 (file)
@@ -1,3 +1,3 @@
-usr/bin/uopen
-usr/lib/uopen.so
-usr/share/man/man1/uopen.1
+debian/tmp/usr/bin/uopen
+debian/tmp/usr/lib/uopen.so
+debian/tmp/usr/share/man/man1/uopen.1