create_popufare_package.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2019 Clementine Computing LLC.
  4. #
  5. # This file is part of PopuFare.
  6. #
  7. # PopuFare is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # PopuFare is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with PopuFare. If not, see <https://www.gnu.org/licenses/>.
  19. #
  20. VERBOSE=0
  21. mkdir -p stage
  22. mkdir -p package
  23. pkgver=`date '+%Y%m%d-%H-%M-%S'`
  24. DIUDIR=`realpath ../../busunit`
  25. pkgfile="package-$pkgver.tgz"
  26. pkgdir="package-$pkgver"
  27. mkdir -p stage/$pkgdir
  28. pushd stage/$pkgdir > /dev/null
  29. if [[ "$VERBOSE" == 1 ]] ; then
  30. echo "# Creating $pkgfile in './stage/'"
  31. fi
  32. cp -R $DIUDIR/. .
  33. cp $DIUDIR/scripts/package_install.sh install.sh
  34. touch popufare.witness
  35. # copy over site specific files that overwrite default
  36. # files.
  37. #
  38. cp -R ../../site .
  39. tar -czf ../$pkgfile *
  40. popd > /dev/null
  41. rm -rf stage/$pkgdir
  42. if [[ "$VERBOSE" == 1 ]] ; then
  43. echo "# done"
  44. fi
  45. if [[ "$VERBOSE" == 1 ]] ; then
  46. echo "# putting package '$pkgfile' in ./package"
  47. fi
  48. mv stage/$pkgfile package