git-svn-id: https://svn.microneil.com/svn/PKG-SNF-CS-NIX/trunk@81 233e721a-07f6-49eb-a7da-05e0e16828fcmaster
@@ -0,0 +1,82 @@ | |||
#!/bin/bash | |||
# | |||
# Script to create a debian package for SNFServer integrated with | |||
# postfix. | |||
# | |||
# Usage: create_snf-server-postfix_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-postfix $TEMPDIR | |||
if [ $? -ne 0 ] | |||
then | |||
error_exit "cp -dr Packages/Ubuntu/snf-server-postfix $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-postfix | |||
Version: $VERSION-1 | |||
Architecture: all | |||
Depends: snf-server, postfix | |||
Description: snf-server-postfix integrates snf-server with postfix. | |||
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-postfix 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-postfix_$VERSION-1_all.deb | |||
if [ $? -ne 0 ] | |||
then | |||
error_exit "dpkg-deb -b $TEMPDIR snf-server-postfix_$VERSION-1_all.deb" | |||
exit $ERROR_EXIT | |||
fi | |||
# Success. | |||
exit 0 | |||
@@ -0,0 +1,82 @@ | |||
#!/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 | |||
@@ -0,0 +1,92 @@ | |||
#!/bin/bash | |||
# | |||
# Script to create a debian package for SNFServer. | |||
# | |||
# Usage: create_snf-server_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 | |||
# Output message and exit. | |||
error_exit() { | |||
echo Error running \'$1\' in directory $(pwd). | |||
exit 1 | |||
} | |||
# Create the tarball distribution. | |||
make dist | |||
if [ $? -ne 0 ] | |||
then | |||
error_exit "make dist" | |||
fi | |||
# Prepare the directory. | |||
rm -rf snf-server-$VERSION | |||
if [ $? -ne 0 ] | |||
then | |||
error_exit "rm -rf snf-server-$VERSION" | |||
fi | |||
tar xvzf snf-server-$VERSION.tar.gz | |||
if [ $? -ne 0 ] | |||
then | |||
error_exit "tar xvzf snf-server-$VERSION.tar.gz" | |||
fi | |||
cd snf-server-$VERSION | |||
if [ $? -ne 0 ] | |||
then | |||
error_exit "cd snf-server-$VERSION" | |||
fi | |||
# Initialize the package. | |||
echo | dh_make --single --copyright artistic -f ../snf-server-$VERSION.tar.gz | |||
if [ $? -ne 0 ] | |||
then | |||
error_exit "echo | dh_make --single --copyright artistic -f ../snf-server-$VERSION.tar.gz" | |||
fi | |||
# Remove unneeded directory. | |||
mv debian debian.orig | |||
if [ $? -ne 0 ] | |||
then | |||
error_exit "mv debian debian.orig" | |||
exit $ERROR_EXIT | |||
fi | |||
# Copy package files. | |||
cp --archive ../Packages/Ubuntu/snf-server debian | |||
if [ $? -ne 0 ] | |||
then | |||
error_exit "cp --archive ../Packages/Ubuntu/snf-server debian" | |||
exit $ERROR_EXIT | |||
fi | |||
# Build the source package. | |||
debuild -S -us -uc -rfakeroot | |||
if [ $? -ne 0 ] | |||
then | |||
error_exit "debuild -S -us -uc -rfakeroot" | |||
fi | |||
# Build the binary package. | |||
dpkg-buildpackage -rfakeroot -us -uc | |||
if [ $? -ne 0 ] | |||
then | |||
error_exit "dpkg-buildpackage -rfakeroot -us -uc" | |||
fi | |||
# Success. | |||
exit 0 | |||