You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

create_snf-server-postfix_debian 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/bin/bash
  2. #
  3. # Script to create a debian package for SNFServer integrated with
  4. # postfix.
  5. #
  6. # Usage: create_snf-server-postfix_debian X.Y.Z
  7. #
  8. # where X.Y.Z is the version of SNFServer.
  9. #
  10. # $Id: configure.in,v 1.33 2008/02/08 15:10:17 adeniz Exp $
  11. #
  12. # Author: Alban Deniz
  13. #
  14. # Copyright (C) 2013 by MicroNeil Corporation. All rights reserved.
  15. # See www.armresearch.com for the copyright terms.
  16. #
  17. #######################################################################
  18. VERSION=$1
  19. # Temporary directory.
  20. TEMPDIR=tempDir
  21. # Output message and exit.
  22. error_exit() {
  23. echo Error running \'$1\' in directory $(pwd).
  24. exit 1
  25. }
  26. # Prepare the directory.
  27. rm -rf $TEMPDIR
  28. if [ $? -ne 0 ]
  29. then
  30. error_exit "rm -rf $TEMPDIR"
  31. fi
  32. # Copy package files.
  33. cp -dr Packages/Ubuntu/snf-server-postfix $TEMPDIR
  34. if [ $? -ne 0 ]
  35. then
  36. error_exit "cp -dr Packages/Ubuntu/snf-server-postfix $TEMPDIR"
  37. fi
  38. # Remove .svn directories.
  39. rm -rf $(find $TEMPDIR -name .svn -type d)
  40. if [ $? -ne 0 ]
  41. then
  42. error_exit "rm -rf $(find $TEMPDIR -name .svn -type d)"
  43. fi
  44. # Create control file.
  45. ControlContents="Section: mail
  46. Priority: optional
  47. Maintainer: support <support@armresearch.com>
  48. Package: snf-server-postfix
  49. Version: $VERSION-1
  50. Architecture: all
  51. Depends: snf-server, postfix
  52. Description: snf-server-postfix integrates snf-server with postfix.
  53. snf-server is a plug-in for an MTA (Mail Transport Agent, such as
  54. sendmail or postfix) that does spam detection and IP address
  55. scanning. snf-server-postfix must be installed after snf-server.
  56. "
  57. echo "$ControlContents" > $TEMPDIR/DEBIAN/control
  58. if [ $? -ne 0 ]
  59. then
  60. error_exit "echo $ControlContents > $TEMPDIR/DEBIAN/control"
  61. fi
  62. # Create the package.
  63. dpkg-deb -b $TEMPDIR snf-server-postfix_$VERSION-1_all.deb
  64. if [ $? -ne 0 ]
  65. then
  66. error_exit "dpkg-deb -b $TEMPDIR snf-server-postfix_$VERSION-1_all.deb"
  67. exit $ERROR_EXIT
  68. fi
  69. # Success.
  70. exit 0