Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 99 lines (83 sloc) 2.61 KB
# Build the monit.tar.gz package
: ${MAKE:=make}
rm -f $MAN_OBJS
rm -f pod2*
rm -fr ./autom4te*
rm -f log
rm -f aclocal.m4
rm -f monit.spec
rm -f valgrind*
rm -f y.output
find ./ -name ".#*" -exec rm -f {} \;
find ./ -name "*orig" -exec rm -f {} \;
# Get version from the file
VERSION=`perl -ne 'if(/AC_INIT.*\[(\w)([\.\w]+)(\-\w+)?\]/){print"$1$2$3\n";}'`
# Get current dir. must be named monit
WORKDIR=`basename $PWD`
# The relase string
# The tar.gz file name
# Objects created by configure
CONFIGURE_OBJS="Makefile config.cache config.log config.h \
confdefs.h config.status configure"
# Man-file objects
# Create the Makefile
# Cleanup before build
rm -f *.tar.gz
${MAKE} devclean
# --------------------
# Create documentation
# --------------------
#rm -f doc/api-docs/*
#perl -pi.bak -e 's/\@VERSION\@/'$VERSION'/' doxygen.cfg
#${MAKE} doc
#mv doxygen.cfg.bak doxygen.cfg
echo "Generating documentation"
d=`date '+%B %d. %Y'`
pod2man --center "User Commands" --release "${d}" --date="" --lax monit.pod > monit.1
pod2html monit.pod > doc/monit.html
rm -f pod2*
grep -v "<\?php include" web/doc/examples.php | sed -e 's/<img src="index.gif">//' > doc/examples.html
chmod 644 doc/examples.html
# Copy the specfile to allow direct rpmbuild -ta
cp contrib/packages/redhat/monit.spec ./
perl -pi -e 's/^Version: .*/Version: '$VERSION'/' monit.spec
# -----------------------------
# Set standard file permissions
# -----------------------------
chmod 600 monitrc
chmod 755 install-sh
# -------------
# Build package
# -------------
./ # configure,
${MAKE} distclean # Keep only the relevant files
# Build the dist file using current version in filename
cd ..
mv $WORKDIR $RELEASE # Rename the monit dir to include the version number
tar zcvfX ${TARGET} $RELEASE/exclude $RELEASE # Create the tar file
mv $RELEASE $WORKDIR # Rename the work dir. back to monit
mv $TARGET $WORKDIR # Move the tar.gz package into work dir.
openssl dgst -md5 $TARGET > $TARGET.md5
openssl dgst -sha256 $TARGET > $TARGET.sha256
# cleanup
if test "`uname`" != "Linux"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "please verify the manual page with 'man --warnings monit.1 > /dev/null'"
echo "if warnings will be showed, please generate the manual page on linux "
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"