mktarball.sh 889 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. VERSION=$1
  3. if [ -z "${VERSION}" ]; then
  4. echo "Please specify the version number"
  5. exit 1
  6. fi
  7. DESTDIR=scrypt-${VERSION}
  8. RELEASEDATE=$(date "+%B %d, %Y")
  9. # Copy bits in
  10. mkdir "${DESTDIR}" "${DESTDIR}/autotools"
  11. cp main.c FORMAT COPYRIGHT BUILDING README.md STYLE "${DESTDIR}"
  12. cp Makefile.am .autom4te.cfg "${DESTDIR}"
  13. cp Makefile.am "${DESTDIR}/autotools"
  14. cp -R lib lib-platform libcperciva libscrypt-kdf m4 tests "${DESTDIR}"
  15. # Copy with substitution
  16. sed -e "s/@DATE@/${RELEASEDATE}/" < scrypt.1 > "${DESTDIR}/scrypt.1"
  17. sed -e "s/\[m4_esyscmd(\[sh get-version\.sh\])]/${VERSION}/" \
  18. < configure.ac > "${DESTDIR}/configure.ac"
  19. cp "${DESTDIR}/configure.ac" "${DESTDIR}/autotools"
  20. # Generate autotools files
  21. ( cd "${DESTDIR}" || exit
  22. autoreconf -i
  23. rm .autom4te.cfg Makefile.am aclocal.m4 configure.ac )
  24. # Create tarball
  25. tar -czf "${DESTDIR}.tgz" "${DESTDIR}"
  26. rm -r "${DESTDIR}"