|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #!/bin/bash
- #
- # Script to create a debian package for SNFServer integrated with
- # sendmail.
- #
- # Usage: create_snf-server-sendmail_debian X.Y.Z
- #
- # where X.Y.Z is the version of SNFServer.
- #
- # $Id: configure.in,v 1.33 2008/02/08 15:10:17 adeniz Exp $
- #
- # Author: Alban Deniz
- #
- # Copyright (C) 2013 by MicroNeil Corporation. All rights reserved.
- # See www.armresearch.com for the copyright terms.
- #
- #######################################################################
-
- VERSION=$1
-
- # Temporary directory.
- TEMPDIR=tempDir
-
- # Output message and exit.
- error_exit() {
- echo Error running \'$1\' in directory $(pwd).
- exit 1
- }
-
- # Prepare the directory.
- rm -rf $TEMPDIR
- if [ $? -ne 0 ]
- then
- error_exit "rm -rf $TEMPDIR"
- fi
-
- # Copy package files.
- cp -dr Packages/Ubuntu/snf-server-sendmail $TEMPDIR
- if [ $? -ne 0 ]
- then
- error_exit "cp -dr Packages/Ubuntu/snf-server-sendmail $TEMPDIR"
- fi
-
- # Remove .svn directories.
- rm -rf $(find $TEMPDIR -name .svn -type d)
- if [ $? -ne 0 ]
- then
- error_exit "rm -rf $(find $TEMPDIR -name .svn -type d)"
- fi
-
- # Create control file.
- ControlContents="Section: mail
- Priority: optional
- Maintainer: support <support@armresearch.com>
- Package: snf-server-sendmail
- Version: $VERSION-1
- Architecture: all
- Depends: snf-server, sendmail
- Description: snf-server-sendmail integrates snf-server with sendmail.
- snf-server is a plug-in for an MTA (Mail Transport Agent, such as
- sendmail or postfix) that does spam detection and IP address
- scanning. snf-server-sendmail must be installed after snf-server.
- "
- echo "$ControlContents" > $TEMPDIR/DEBIAN/control
-
- if [ $? -ne 0 ]
- then
- error_exit "echo $ControlContents > $TEMPDIR/DEBIAN/control"
- fi
-
- # Create the package.
- dpkg-deb -b $TEMPDIR snf-server-sendmail_$VERSION-1_all.deb
- if [ $? -ne 0 ]
- then
- error_exit "dpkg-deb -b $TEMPDIR snf-server-sendmail_$VERSION-1_all.deb"
- exit $ERROR_EXIT
- fi
-
- # Success.
- exit 0
-
-
|