arch.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. APP=pybitmessage
  3. PREV_VERSION=0.3.5
  4. VERSION=0.3.5
  5. RELEASE=1
  6. ARCH_TYPE=`uname -m`
  7. CURRDIR=`pwd`
  8. SOURCE=archpackage/${APP}-${VERSION}.tar.gz
  9. # Update version numbers automatically - so you don't have to
  10. sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' Makefile debian.sh rpm.sh puppy.sh ebuild.sh slack.sh
  11. sed -i 's/Version: '${PREV_VERSION}'/Version: '${VERSION}'/g' rpmpackage/${APP}.spec
  12. sed -i 's/Release: '${RELEASE}'/Release: '${RELEASE}'/g' rpmpackage/${APP}.spec
  13. sed -i 's/pkgrel='${RELEASE}'/pkgrel='${RELEASE}'/g' archpackage/PKGBUILD
  14. sed -i 's/pkgver='${PREV_VERSION}'/pkgver='${VERSION}'/g' archpackage/PKGBUILD
  15. sed -i "s/-${PREV_VERSION}-/-${VERSION}-/g" puppypackage/*.specs
  16. sed -i "s/|${PREV_VERSION}|/|${VERSION}|/g" puppypackage/*.specs
  17. sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' puppypackage/pinstall.sh puppypackage/puninstall.sh
  18. sed -i 's/-'${PREV_VERSION}'.so/-'${VERSION}'.so/g' debian/*.links
  19. # Create the source code
  20. make clean
  21. rm -f archpackage/*.gz
  22. # having the root directory called name-version seems essential
  23. mv ../${APP} ../${APP}-${VERSION}
  24. tar -cvzf ${SOURCE} ../${APP}-${VERSION} --exclude-vcs
  25. # rename the root directory without the version number
  26. mv ../${APP}-${VERSION} ../${APP}
  27. # calculate the MD5 checksum
  28. CHECKSM=$(md5sum ${SOURCE})
  29. sed -i "s/md5sums[^)]*)/md5sums=(${CHECKSM%% *})/g" archpackage/PKGBUILD
  30. cd archpackage
  31. # Create the package
  32. tar -c -f ${APP}-${VERSION}.pkg.tar .
  33. sync
  34. xz ${APP}-${VERSION}.pkg.tar
  35. sync
  36. # Move back to the original directory
  37. cd ${CURRDIR}