From 9496e743424c1c9000c4abcb5d3404e17bcc6c76 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 21 Dec 2008 19:35:33 +0000 Subject: [PATCH] debian: Switch to CDBS. 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 | 1 + Makefile | 12 +++++++----- debian/.gitignore | 4 +++- debian/noip.install | 6 +++--- debian/rules | 51 +++++++-------------------------------------------- debian/uopen.install | 6 +++--- 6 files changed, 24 insertions(+), 56 deletions(-) diff --git a/.gitignore b/.gitignore index 7ae0ae4..0191032 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ build noip uopen COPYING +*.o diff --git a/Makefile b/Makefile index f69375a..c7afb3a 100644 --- 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; \ diff --git a/debian/.gitignore b/debian/.gitignore index 4193c2f..48e3561 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -5,4 +5,6 @@ substvars *.debhelper noip uopen - +*.log +compat +stamp-* diff --git a/debian/noip.install b/debian/noip.install index 018d14a..53b5ef3 100644 --- a/debian/noip.install +++ b/debian/noip.install @@ -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 diff --git a/debian/rules b/debian/rules index 6739f8f..3d24648 100755 --- a/debian/rules +++ b/debian/rules @@ -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 diff --git a/debian/uopen.install b/debian/uopen.install index cb36fa7..957cd42 100644 --- a/debian/uopen.install +++ b/debian/uopen.install @@ -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 -- 2.11.0