pastebin

Paste Search Dynamic
translations
  1. #!/bin/bash
  2.  
  3. VERSION=`python -c "from recent_notifications.Globals import VERSION; print VERSION"`
  4. NAME="recent-notifications-${VERSION}"
  5. SDIST="${NAME}.tar.gz"
  6. ORIG="${NAME}.orig.tar.gz"
  7.  
  8. # Get command line arguments
  9. BUILD_BINARY=0
  10. CLEAN=0
  11. PRINT_HELP=0
  12.  
  13. usage () {
  14.   echo "usage: build-package.sh [options]"
  15.   echo ""
  16.   echo "Options:"
  17.   echo "-b, --binary  only build an unsigned binary package"
  18.   echo "-c, --clean   delete everything in the dist directory"
  19.   echo "-h, --help    print this help message and exit"
  20.   echo ""
  21. }
  22.  
  23. for ARG in $*
  24. do
  25.   case "${ARG}" in
  26.     "-b" | "--binary") BUILD_BINARY=1;;
  27.     "-c" | "--clean" ) CLEAN=1;;
  28.     "-h" | "--help"  ) PRINT_HELP=1;;
  29.   esac
  30. done
  31.  
  32. # Print the usage and exit
  33. if [ "${PRINT_HELP}" -eq "1" ]
  34. then
  35.   usage
  36.   exit
  37. fi
  38.  
  39. # Clean the dist directory
  40. if [ "${CLEAN}" -eq "1" ]
  41. then
  42.   echo "Cleaning the dist directory"
  43.   rm -rf dist/*
  44. fi
  45.  
  46. mkdir -p "dist/deb"
  47.  
  48. echo "Building source distribution for ${SDIST}"
  49. python setup.py sdist
  50. rm "MANIFEST"
  51. cp "dist/${SDIST}" "dist/deb/${ORIG}"
  52. cd "dist/deb"
  53.  
  54. echo "Unpacking source distribution in deb directory"
  55. tar xzf "${ORIG}"
  56. cd "${NAME}"
  57.  
  58. echo "Building deb package"
  59. if [ "${BUILD_BINARY}" -eq "1" ]
  60. then
  61.   dpkg-buildpackage -us -uc
  62. else
  63.   # Build the karmic source package
  64.   dpkg-buildpackage -S
  65.   # Update the changelog for lucid
  66.   #sed -i -e 's/karmic/lucid/g' debian/changelog
  67.   # Build the lucid source package
  68.   #dpkg-buildpackage -S
  69. fi
  70.  
Parsed in 0.019 seconds