X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=boot.sh;h=ae2b366594e3b5ef076695baaf01d429a0b42977;hb=58b3bc45e4513ec01b52a74d7a02c6e8de799823;hp=d39ba903c7d18a42aeba2f0352ecbaef79c21b2c;hpb=4fbcabe10406118bb1856772cd7fbfb2a193869b;p=sliver-openvswitch.git diff --git a/boot.sh b/boot.sh index d39ba903c..ae2b36659 100755 --- a/boot.sh +++ b/boot.sh @@ -1,4 +1,6 @@ -#! /bin/sh -e +#! /bin/sh + +set -e have_ext=$(if test -e ext/automake.mk; then echo yes; else echo no; fi) for opt @@ -20,24 +22,33 @@ EOF esac done - # Generate list of files in debian/ to distribute. (echo '# Automatically generated by boot.sh (from Git tree).' && - echo 'EXTRA_DIST += \' && + printf 'EXTRA_DIST += \\\n' && git ls-files debian | grep -v '^debian/\.gitignore$' | sed -e 's/\(.*\)/ \1 \\/' -e '$s/ \\//') > debian/automake.mk -# Find the "include ext/automake.mk" line in Makefile.am and comment -# it out or in according to whether ext is available, and similarly -# for "m4_include(ext/configure.m4)" in configure.ac. +# Enable or disable ext. if test "$have_ext" = yes; then echo 'Enabling openflowext...' - perl -i.bak -pe 's|^#(include ext/automake\.mk)$|$1|' Makefile.am - perl -i.bak -pe 's|^#(m4_include\(ext/configure\.m4\))$|$1|' configure.ac + echo 'include ext/automake.mk' > ext.mk + echo 'm4_include([ext/configure.m4])' > ext.m4 + cat debian/control.in ext/debian/control.in > debian/control + for d in $(cd ext/debian && git ls-files --exclude-from=debian/dontlink) + do + test -e debian/$d || ln -s ../ext/debian/$d debian/$d + if ! fgrep -q $d debian/.gitignore; then + echo "Adding $d to debian/.gitignore" + (cat debian/.gitignore && printf '/%s' "$d") \ + | LC_ALL=C sort > tmp$$ \ + && mv tmp$$ debian/.gitignore + fi + done else echo 'Disabling openflowext...' - perl -i.bak -pe 's|^(include ext/automake\.mk)$|#$1|' Makefile.am - perl -i.bak -pe 's|^(m4_include\(ext/configure\.m4\))$|#$1|' configure.ac + echo '# This file intentionally left blank.' > ext.mk + echo '# This file intentionally left blank.' > ext.m4 + cat debian/control.in > debian/control fi # Bootstrap configure system from .ac/.am files