]> asedeno.scripts.mit.edu Git - 1ts-debian.git/blobdiff - zephyr/debian/rules
first cut at updated packaging
[1ts-debian.git] / zephyr / debian / rules
index 57af99254d2d40cdb3a6e6fa51aa36cba27c6f94..71dc4d4d91f50e591cb62eec138dd50926d0466a 100755 (executable)
@@ -10,6 +10,7 @@
 #export DH_VERBOSE=1
 VARIETALS=krb5
 #VARIETALS=krb45 krb5
+CFLAGS=-g -O
 
 PACKAGES:=-plibzephyr4 -pzephyr-clients -pzephyr-server -plibzephyr-dev $(foreach i,$(VARIETALS),-plibzephyr4-$(i) -pzephyr-server-$(i))
 
@@ -27,39 +28,35 @@ export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
 # FOR AUTOCONF 2.52 AND NEWER ONLY
 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
-  confflags += --build $(DEB_HOST_GNU_TYPE)
+  CONFIGURE_ROOT += --build $(DEB_HOST_GNU_TYPE)
 else
-  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+  CONFIGURE_ROOT += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
 endif
 
 BUILD_VARIETALS=$(VARIETALS) no-krb
-
-# The autotools target adds forced build-time dependencies on
-# autotools-dev (for /usr/share/misc/config.*) and devscripts (for dch)
-# It's also a .PHONY make target.
-autotools:
-       chmod u+x config.sub
-       chmod u+x config.guess
-       OLDDATESUB=`./config.sub -t | tr -d -` ;\
-       OLDDATEGUESS=`./config.guess -t | tr -d -` ;\
-       NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d -` ;\
-       NEWDATEGUESS=`/usr/share/misc/config.guess -t | tr -d -` ;\
-       if [ $$OLDDATESUB -lt $$NEWDATESUB -o \
-            $$OLDDATEGUESS -lt $$NEWDATEGUESS ]; then \
-          dch -a -p "GNU config automated update: config.sub\
-            ($$OLDDATESUB to $$NEWDATESUB), config.guess\
-            ($$OLDDATEGUESS to $$NEWDATEGUESS)" ;\
-          cp -f /usr/share/misc/config.sub config.sub ;\
-          cp -f /usr/share/misc/config.guess config.guess ;\
-          echo WARNING: GNU config scripts updated from master copies 1>&2 ;\
-       fi
-
-configure: configure-stamp autotools
-configure-stamp:
+PKG_VERSION:=$(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
+PKG_DISTRO:=$(shell lsb_release -si)
+
+STASH:=debian/autogoo-stash
+STASH_H:=debian/autogoo-h-stash
+
+stash: stash-stamp
+stash-stamp:
+       -mkdir $(STASH)
+       mv -v m4 autom4te.cache aclocal.m4 config.guess config.sub configure install-sh ltmain.sh VERSION $(STASH)
+       -mkdir $(STASH_H)
+       mv -v h/config.h.in $(STASH_H)
+       touch stash-stamp
+
+configure: configure-stamp
+configure-stamp: stash-stamp
        dh_testdir
        # Add here commands to configure the package.
+       libtoolize -ic
+       autoreconf
+       echo "$(PKG_VERSION) ($(PKG_DISTRO))" > VERSION
        mkdir -p $(BUILD_VARIETALS)
-       $(foreach VARIETY,$(BUILD_VARIETALS),(cd $(VARIETY) && CFLAGS="-g -O" ../configure $(CONFIGURE_$(VARIETY)) $(CONFIGURE_ROOT));)
+       $(foreach VARIETY,$(BUILD_VARIETALS),(cd $(VARIETY) && CFLAGS="$(CFLAGS)" ../configure $(CONFIGURE_$(VARIETY)) $(CONFIGURE_ROOT));)
        touch configure-stamp
 
 build: configure-stamp build-stamp
@@ -69,7 +66,7 @@ build-stamp:
        # Add here commands to compile the package.
        set -e; \
        for dir in $(VARIETALS) ; do  \
-               $(MAKE) -C $$dir/lib all; $(MAKE) -C $$dir/server; \
+               $(MAKE) -C $$dir h/zephyr_version.h; $(MAKE) -C $$dir/lib all; $(MAKE) -C $$dir/server; \
        done
        $(MAKE) -C no-krb all
 
@@ -87,8 +84,15 @@ clean:
         rm $(foreach v,$(filter-out krb5,$(VARIETALS)),$(foreach s,docs init postrm,debian/zephyr-server-$(v).$(s))); \
        fi
        -rm debian/libzephyr4-krb5.files debian/libzephyr4-krb45.files
+       -rm stash-stamp
+       -test -d $(STASH)/autom4te.cache && rm -rf autom4te.cache
+       -test -d $(STASH)/m4 && rm -rf m4
+       -test -d $(STASH) && mv $(STASH)/* .
+       -rmdir $(STASH)
+       -test -d $(STASH_H) && mv $(STASH_H)/* h
+       -rmdir $(STASH_H)
 
-       dh_clean
+       dh_clean -v -Xautom4te.cache
 
 install: DH_OPTIONS=
 install: build
@@ -174,4 +178,4 @@ binary-arch: build install
 
 binary: binary-indep binary-arch
 
-.PHONY: autotools build clean binary-indep binary-arch binary install 
+.PHONY: autotools build clean binary-indep binary-arch binary install stash