Copy config.{sub,guess} in pre-config phase instead of clean
authorStephane Glondu <steph@glondu.net>
Tue, 8 Jul 2008 11:56:53 +0000 (13:56 +0200)
committerStephane Glondu <steph@glondu.net>
Tue, 8 Jul 2008 11:56:53 +0000 (13:56 +0200)
debian/rules

index 98c334b6f1da0d357996af11b2a15daa44602603..07e0a7644fcf35e0ac7bd43b57bed3d0dd5c5ab6 100755 (executable)
@@ -57,7 +57,14 @@ debian/control:
        sed -e 's/#OcamlNativeArchs#/$(NATIVE_ARCHS)/g' debian/control.in > $@
 
 pre-config: debian/$(SRCTARBALL)
+       for ext in sub guess; do \
+         if [ -f /usr/share/misc/config.$$ext ] && ! [ -f debian/config.orig.$$ext ] ; then \
+           mv config/gnu/config.$$ext debian/config.orig.$$ext; \
+           cp -f /usr/share/misc/config.$$ext config/gnu/config.$$ext; \
+         fi; \
+       done
        touch $@
+
 debian/$(SRCTARBALL):
        ln -fs . $(DISTDIR)     # beware of the symlink recursion!
        tar --anchored -chjf $@ \
@@ -134,12 +141,11 @@ clean: abi-sed unpatch
        $(MAKE) -C debian/ocaml-md5sums clean
        $(MAKE) -C debian/dh-ocaml clean
        $(MAKE) -C debian/policy clean
-ifneq "$(wildcard /usr/share/misc/config.sub)" ""
-       -cp -f /usr/share/misc/config.sub config/gnu/config.sub
-endif
-ifneq "$(wildcard /usr/share/misc/config.guess)" ""
-       -cp -f /usr/share/misc/config.guess config/gnu/config.guess
-endif
+       for ext in sub guess; do \
+         if [ -f debian/config.orig.$$ext ] ; then \
+           mv -f debian/config.orig.$$ext config/gnu/config.$$ext; \
+         fi; \
+       done
        # File not cleaned by upstream
        -$(RM) _boot_log1
        -$(RM) _boot_log2