slack.sh 1.7 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. BUILDDIR=~/slackbuild
  8. CURRDIR=`pwd`
  9. PROJECTDIR=${BUILDDIR}/${APP}-${VERSION}-${RELEASE}
  10. # Update version numbers automatically - so you don't have to
  11. sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' Makefile debian.sh rpm.sh arch.sh puppy.sh ebuild.sh
  12. sed -i 's/Version: '${PREV_VERSION}'/Version: '${VERSION}'/g' rpmpackage/${APP}.spec
  13. sed -i 's/Release: '${RELEASE}'/Release: '${RELEASE}'/g' rpmpackage/${APP}.spec
  14. sed -i 's/pkgrel='${RELEASE}'/pkgrel='${RELEASE}'/g' archpackage/PKGBUILD
  15. sed -i 's/pkgver='${PREV_VERSION}'/pkgver='${VERSION}'/g' archpackage/PKGBUILD
  16. sed -i "s/-${PREV_VERSION}-/-${VERSION}-/g" puppypackage/*.specs
  17. sed -i "s/|${PREV_VERSION}|/|${VERSION}|/g" puppypackage/*.specs
  18. sed -i 's/VERSION='${PREV_VERSION}'/VERSION='${VERSION}'/g' puppypackage/pinstall.sh puppypackage/puninstall.sh
  19. sed -i 's/-'${PREV_VERSION}'.so/-'${VERSION}'.so/g' debian/*.links
  20. # Make directories within which the project will be built
  21. mkdir -p ${BUILDDIR}
  22. mkdir -p ${PROJECTDIR}
  23. # Build the project
  24. make clean
  25. make
  26. make install -B DESTDIR=${PROJECTDIR} PREFIX=/usr
  27. # Copy the slack-desc and doinst.sh files into the build install directory
  28. mkdir ${PROJECTDIR}/install
  29. cp ${CURRDIR}/slackpackage/slack-desc ${PROJECTDIR}/install
  30. cp ${CURRDIR}/slackpackage/doinst.sh ${PROJECTDIR}/install
  31. # Compress the build directory
  32. cd ${BUILDDIR}
  33. tar -c -f ${APP}-${VERSION}-${RELEASE}.tar .
  34. sync
  35. xz ${APP}-${VERSION}-${RELEASE}.tar
  36. sync
  37. mv ${APP}-${VERSION}-${RELEASE}.tar.xz ${CURRDIR}/slackpackage/${APP}-${VERSION}-${ARCH_TYPE}-${RELEASE}.txz
  38. cd ${CURRDIR}
  39. # Remove the temporary build directory
  40. rm -fr ${BUILDDIR}