puppy.sh 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/bash
  2. APP=pybitmessage
  3. PREV_VERSION=0.3.5
  4. VERSION=0.3.5
  5. RELEASE=1
  6. BUILDDIR=~/petbuild
  7. CURRDIR=`pwd`
  8. PROJECTDIR=${BUILDDIR}/${APP}-${VERSION}-${RELEASE}
  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 arch.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. # Make directories within which the project will be built
  20. mkdir -p ${BUILDDIR}
  21. mkdir -p ${PROJECTDIR}
  22. # Build the project
  23. make clean
  24. make
  25. make install -B DESTDIR=${PROJECTDIR} PREFIX=/usr
  26. # Alter the desktop file categories
  27. sed -i "s/Categories=Office;Email;/Categories=Internet;mailnews;/g" ${PROJECTDIR}/usr/share/applications/${APP}.desktop
  28. # Create directories specific to puppy
  29. mkdir ${PROJECTDIR}/usr
  30. mkdir ${PROJECTDIR}/usr/local
  31. mkdir ${PROJECTDIR}/usr/local/bin
  32. # Copy anything in /usr/bin into /usr/local/bin
  33. cp ${PROJECTDIR}/usr/bin/* ${PROJECTDIR}/usr/local/bin/
  34. # Copy the spec file into the build directory
  35. cp ${CURRDIR}/puppypackage/${APP}-${VERSION}.pet.specs ${PROJECTDIR}
  36. # Copy the XPM mini icon into the build directory
  37. cp ${CURRDIR}/desktop/icon14.xpm ${PROJECTDIR}/${APP}.xpm
  38. # Compress the build directory
  39. cd ${BUILDDIR}
  40. tar -c -f ${APP}-${VERSION}-${RELEASE}.tar .
  41. sync
  42. gzip ${APP}-${VERSION}-${RELEASE}.tar
  43. mv ${APP}-${VERSION}-${RELEASE}.tar.gz ${CURRDIR}/puppypackage
  44. cd ${CURRDIR}/puppypackage
  45. # Create the PET package
  46. MD5SUM="`md5sum ${APP}-${VERSION}-${RELEASE}.tar.gz | cut -f 1 -d ' '`"
  47. echo -n "$MD5SUM" >> ${APP}-${VERSION}-${RELEASE}.tar.gz
  48. sync
  49. mv -f ${APP}-${VERSION}-${RELEASE}.tar.gz ${APP}-${VERSION}-${RELEASE}.pet
  50. sync
  51. cd ${CURRDIR}
  52. # Remove the temporary build directory
  53. rm -fr ${BUILDDIR}