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 8d2524ce78ca107074727cbd8780c26a203a107c
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 visibility base64 physmem fsusage"
43 GNULIB_MODULES="$GNULIB_MODULES mkdtemp getopt full-read full-write"
44 GNULIB_MODULES="$GNULIB_MODULES lseek ftruncate fseeko ftello regex"
46 ######################################################################
48 ######################################################################
50 # create a brand new gnulib directory
52 "${GNULIB_TOOL}" --import \
53 --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib \
54 --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl \
55 ${GNULIB_MODULES} || exit 1
57 ########################## DEVELOPERS! ###############################
58 ## Add your patch commands here, or use sed invoacations, etc. ##
59 ## Please comment heavily! ##
60 ######################################################################
61 PATCH_DIR="`pwd`/gnulib/regenerate"
64 # Patch Makefile.am to not error out on warnings
65 patch -p0 < "${PATCH_DIR}/no-error.patch" || exit 1
66 rm -f gnulib/Makefile.am.orig
68 # Add info to the makefile to ensure all this stuff gets put in
69 # the distribution tarball
71 echo "# Make sure regenerate/* are in the distribution tarball"
72 echo "EXTRA_DIST += "`cd gnulib; find regenerate -name .svn -prune -o -type f -print | sort`
73 ) >> gnulib/Makefile.am
75 # remove .gitignore files, which ignore things we would like to see
76 rm -f config/gnulib/.gitignore
77 rm -f gnulib/.gitignore
79 ######################################################################
81 ######################################################################