mkdoc.sh 864 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. # Create the xpra-prebuilt-docs tarball. Part of SlackBuilds.org xpra
  3. # build. Run from within the SlackBuild dir. Does not require root
  4. # acces, but does need to write to its current directory.
  5. set -e
  6. # get VERSION:
  7. source ./xpra.info
  8. OUTDIR=xpra-$VERSION-prebuilt-docs
  9. TARBALL=$OUTDIR.tar.xz
  10. RPMFILE=xpra-common-4.4.3-10.el8.noarch.rpm
  11. URL=https://www.xpra.org/dists/CentOS/8/x86_64/$RPMFILE
  12. # only download the file if we don't already have it.
  13. [ -e $RPMFILE ] || wget $URL
  14. [ -e $RPMFILE ] || exit 1
  15. rm -rf $OUTDIR
  16. mkdir -p $OUTDIR
  17. cd $OUTDIR
  18. # extract without creating an intermediate tarball (as rpm2targz would):
  19. rpm2cpio ../$RPMFILE | cpio -imd
  20. # remove everything but the docs:
  21. mkdir .keep
  22. mv usr/share/doc/xpra/* .keep
  23. rm -rf *
  24. mv .keep/* .
  25. rmdir .keep
  26. # now ready to create the tarball.
  27. cd -
  28. tar cvfJ $TARBALL $OUTDIR
  29. md5sum $TARBALL