prepare to upload
[debian/tar] / debian / rules
index 6a369a4127c82ee60828e205cd5f618795ee26b1..d978367b9c6f3ca1b9e719c8cbee497000db373b 100755 (executable)
@@ -6,23 +6,41 @@ ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
 CONFARGS = --host=$(DEB_HOST_GNU_TYPE)
 endif
 
+CFLAGS = `dpkg-buildflags --get CFLAGS`
+CFLAGS += -Wall
+LDFLAGS += `dpkg-buildflags --get LDFLAGS`
+CPPFLAGS = `dpkg-buildflags --get CPPFLAGS`
+
 configure: configure-stamp
 configure-stamp:
        dh_testdir
        cp -f /usr/share/misc/config.sub build-aux/config.sub
        cp -f /usr/share/misc/config.guess build-aux/config.guess
-       RSH="/usr/bin/rsh" CFLAGS="-O2 -g -Wall" \
-               ./configure --prefix=/usr --libexecdir=/usr/sbin $(CONFARGS)
+       RSH="/usr/bin/rsh" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure \
+               --prefix=/usr \
+               --libexecdir=/usr/sbin \
+               --with-lzma=xz \
+               $(CONFARGS) 
        touch configure-stamp
 
-build: build-stamp
+build: build-arch build-indep
+build-arch: build-stamp
+build-indep: build-stamp
 build-stamp: configure-stamp
        dh_testdir
        RSH="/usr/bin/rsh" CFLAGS="-O2 -g -Wall -fno-gnu89-inline" $(MAKE)
 
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+       @runas=`whoami` ; \
+       if test $$runas = "root" ; \
+       then \
+         echo "Sorry, but the test suite is not designed to be run as root."; \
+         exit 1 ;\
+       fi
        (cd tests ; $(MAKE) clean)
        $(MAKE) check
+endif
 endif
 
        perl debian/tarman > debian/tar.1