3 # Gnulib files in zmanda repo are from gnulib GIT. To check out the
4 # same version as was used to generate the source in the repository,
5 # run the following in your git repository:
7 # git checkout 09b8fa6cb737f6e091931c494cbd56d12b3ad08d
9 # get to the project root
11 if [ ! -f configure.in ]
13 echo "Cannot navigate to project root"
17 # check that gnulib-tool is available before we do anything drastic
18 [ -z "${GNULIB_TOOL}" ] && GNULIB_TOOL=gnulib-tool
19 "${GNULIB_TOOL}" --version >/dev/null 2>/dev/null
22 echo "gnulib-tool not found; try using"
23 echo " GNULIB_TOOL=/path/to/gnulib-tool ${0} ${@}"
27 # remove the files in gnulib and config/gnulib, but not directories
28 # (and, in particular, not the gnulib/regenerate directory)
30 for filename in gnulib/* config/gnulib/*
32 [ -d "${filename}" ] && continue
33 echo "Removing ${filename}"
34 rm "${filename}" || exit 1
38 ########################## DEVELOPERS! ###############################
39 ## Add your modules here, then see below if you need to patch them. ##
40 ######################################################################
42 GNULIB_MODULES="getaddrinfo lock base64 physmem fsusage"
43 GNULIB_MODULES="$GNULIB_MODULES mkdtemp getopt-gnu full-read full-write"
44 GNULIB_MODULES="$GNULIB_MODULES lseek ftruncate fseeko ftello regex environ"
45 GNULIB_MODULES="$GNULIB_MODULES inet_pton"
47 ######################################################################
49 ######################################################################
51 # create a brand new gnulib directory
53 "${GNULIB_TOOL}" --import \
54 --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib \
55 --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl \
56 ${GNULIB_MODULES} || exit 1
58 ########################## DEVELOPERS! ###############################
59 ## Add your patch commands here, or use sed invoacations, etc. ##
60 ## Please comment heavily! ##
61 ######################################################################
62 PATCH_DIR="`pwd`/gnulib/regenerate"
65 # Patch Makefile.am to not error out on warnings
66 patch -p0 < "${PATCH_DIR}/no-error.patch" || exit 1
67 rm -f gnulib/Makefile.am.orig
69 # Patch fsusage.h to not use 'bool', as it doesn't play nicely with
71 patch -p1 < "${PATCH_DIR}/fsusage-no-bool.patch" || exit 1
73 # Add info to the makefile to ensure all this stuff gets put in
74 # the distribution tarball
76 echo "# Make sure regenerate/* are in the distribution tarball"
77 echo "EXTRA_DIST += "`cd gnulib; find regenerate -name .svn -prune -o -type f -print | sort`
78 ) >> gnulib/Makefile.am
80 # remove .gitignore files, which ignore things we would like to see
81 rm -f config/gnulib/.gitignore
82 rm -f gnulib/.gitignore
84 ######################################################################
86 ######################################################################