2009-06-25 14:53:48 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# Stop script on first error.
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Retrieve libnfc version from configure.ac
|
|
|
|
LIBNFC_VERSION=$(grep AC_INIT configure.ac | sed 's/^.*(\(.*\))/\1/g' | awk -F', ' '{ print $2 }')
|
|
|
|
|
2010-01-18 10:30:11 +00:00
|
|
|
# Easiest part: GNU/linux, BSD and other POSIX systems.
|
2009-06-25 14:53:48 +00:00
|
|
|
LIBNFC_AUTOTOOLS_ARCHIVE=libnfc-$LIBNFC_VERSION.tar.gz
|
|
|
|
|
2010-04-26 13:40:42 +00:00
|
|
|
echo ">>> Cleaning sources..."
|
2010-04-26 12:58:17 +00:00
|
|
|
# First, clean what we can
|
2010-10-08 13:52:19 +00:00
|
|
|
rm -f configure config.h config.h.in
|
2010-04-26 12:58:17 +00:00
|
|
|
autoreconf -is && ./configure && make distclean
|
2012-11-27 18:56:54 +01:00
|
|
|
git clean -dfX
|
2010-04-26 13:40:42 +00:00
|
|
|
echo "<<< Sources cleaned."
|
2010-04-26 12:58:17 +00:00
|
|
|
|
2009-06-25 14:53:48 +00:00
|
|
|
if [ ! -f $LIBNFC_AUTOTOOLS_ARCHIVE ]; then
|
2010-04-26 13:40:42 +00:00
|
|
|
echo ">>> Autotooled archive generation..."
|
2010-01-14 15:54:55 +00:00
|
|
|
|
2010-03-31 13:54:31 +00:00
|
|
|
# Second, generate dist archive (and test it)
|
2010-04-26 12:58:17 +00:00
|
|
|
autoreconf -is && ./configure && make distcheck
|
2010-01-18 10:30:11 +00:00
|
|
|
|
2010-03-31 13:54:31 +00:00
|
|
|
# Finally, clean up
|
2010-01-18 11:20:38 +00:00
|
|
|
make distclean
|
2010-04-26 13:40:42 +00:00
|
|
|
echo "<<< Autotooled archive generated."
|
2009-06-25 14:53:48 +00:00
|
|
|
else
|
2010-04-26 13:40:42 +00:00
|
|
|
echo "--- Autotooled archive (GNU/Linux, BSD, etc.) is already done: skipped."
|
2009-06-25 14:53:48 +00:00
|
|
|
fi
|
|
|
|
|
2010-01-18 10:30:11 +00:00
|
|
|
# Documentation part
|
|
|
|
LIBNFC_DOC_DIR=libnfc-doc-$LIBNFC_VERSION
|
|
|
|
LIBNFC_DOC_ARCHIVE=$LIBNFC_DOC_DIR.zip
|
|
|
|
|
|
|
|
if [ ! -f $LIBNFC_DOC_ARCHIVE ]; then
|
2010-04-26 13:40:42 +00:00
|
|
|
echo ">>> Documentation archive generation..."
|
2010-01-18 11:20:38 +00:00
|
|
|
if [ -d $LIBNFC_DOC_DIR ]; then
|
|
|
|
rm -rf $LIBNFC_DOC_DIR
|
|
|
|
fi
|
2010-01-18 10:30:11 +00:00
|
|
|
|
|
|
|
# Build documentation
|
2010-03-31 13:54:31 +00:00
|
|
|
autoreconf -is && ./configure --enable-doc && make doc || false
|
2010-01-18 10:30:11 +00:00
|
|
|
|
|
|
|
# Create archive
|
|
|
|
cp -r doc/html $LIBNFC_DOC_DIR
|
|
|
|
zip -r $LIBNFC_DOC_ARCHIVE $LIBNFC_DOC_DIR
|
|
|
|
|
|
|
|
# Clean up
|
2010-01-18 11:20:38 +00:00
|
|
|
rm -rf $LIBNFC_DOC_DIR
|
|
|
|
make distclean
|
2010-04-26 13:40:42 +00:00
|
|
|
echo "<<< Documentation archive generated."
|
2010-01-18 10:30:11 +00:00
|
|
|
else
|
2010-04-26 13:40:42 +00:00
|
|
|
echo "--- Documentation archive is already done: skipped."
|
2009-06-25 14:53:48 +00:00
|
|
|
fi
|
|
|
|
|