compress-package 838 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. # Wrapper for building freon extension into a package.
  3. # Version: 0.0.1
  4. # (C) Chris Dorman, 2020 GPLv3+
  5. # work directories
  6. tmpdir="`pwd`/pkg"
  7. srcdir="`pwd`/pkgsrc"
  8. rootdir="`pwd`/src/rootfs"
  9. freondir="/freon"
  10. pkgdir="`pwd`/pkgs"
  11. if [ ! -d "$tmpdir" ]; then
  12. echo "Warning: tmp directory not found, creating."
  13. mkdir $tmpdir > /dev/null 2>&1
  14. fi
  15. if [ ! -d "$pkgdir" ]; then
  16. echo "Warning: tgz directory not found, creating."
  17. mkdir $pkgdir > /dev/null 2>&1
  18. fi
  19. case $1 in
  20. * ) echo "Building $1.tgz..."
  21. if [ -d $tmpdir ]; then
  22. rm -rf $tmpdir
  23. fi
  24. mkdir $tmpdir
  25. cd $tmpdir/..
  26. if [ -f "deps/${1}.exec" ]; then
  27. cp deps/$1.exec $tmpdir/execute.sh
  28. fi
  29. cp -av $freondir $tmpdir/.
  30. cd $tmpdir
  31. tar -czf $1.tgz *
  32. cp $1.tgz $pkgdir/$1.tgz
  33. rm -rf $tmpdir
  34. echo "Done!"
  35. ;;
  36. esac