- # There is really no reason to run this unless somebody adds a
- # patch that patches the autoconf system, in which case they can
- # include a patch for autogen.sh and uncomment this stuff.
- #cp /usr/share/misc/config.sub config.sub
- #cp /usr/share/misc/config.sub libsysio/config.sub
- #cp /usr/share/misc/config.sub ldiskfs/config.sub
- #cp /usr/share/misc/config.guess config.guess
- #cp /usr/share/misc/config.guess libsysio/config.guess
- #cp /usr/share/misc/config.guess ldiskfs/config.guess
- #sh ./autogen.sh
- #touch $@
+ # see if any patches requires us to run autogen
+ # (for a distribution release tarball, it is expected that if
+ # downstream adds any patches that requires autogen.sh to be
+ # run, a patch will be added by downstream to install the
+ # needed autogen.sh scripts
+ # see https://bugzilla.lustre.org/attachment.cgi?id=27156
+ # for an example)
+ if grep -e "^--- .*\/autoconf\/" \
+ -e "^--- .*\/autoMakefile\.am" \
+ -e "^--- .*\/Makefile\.am" \
+ -e "^--- .*\/configure\.ac" \
+ -e "^--- .*\/configure\.in" \
+ debian/patches/*; then \
+ if [ ! -f build/autogen.sh ]; then \
+ echo "You have patches which require autogen.sh to be run, but it doesn't exist"; \
+ echo "Please see https://bugzilla.lustre.org/attachment.cgi?id=27156"; \
+ exit 1; \
+ fi; \
+ cp /usr/share/misc/config.sub config.sub; \
+ cp /usr/share/misc/config.sub libsysio/config.sub; \
+ cp /usr/share/misc/config.sub ldiskfs/config.sub; \
+ cp /usr/share/misc/config.guess config.guess; \
+ cp /usr/share/misc/config.guess libsysio/config.guess; \
+ cp /usr/share/misc/config.guess ldiskfs/config.guess; \
+ sh build/autogen.sh; \
+ fi; \
+ touch $@