maketarball 916 B

12345678910111213141516171819202122232425262728293031
  1. # For building the tarball. To be used only by ebuild maintainers
  2. DISTDIR=/usr/portage/distfiles
  3. PN=bitpim
  4. PV=$1
  5. P=$PN-$PV
  6. if [ -z "$PV" ]; then
  7. echo "usage: $0 version"
  8. else
  9. svnrev=$(svn log -q --limit 1 https://${PN}.svn.sourceforge.net/svnroot/${PN}/releases/${PV} | sed -r '/^[^r]/d;s/^r([0-9]+) .*$/\1/')
  10. [ $? = 0 ] || return 1
  11. #Fetch the source (only those directories that are needed)
  12. cd "${DISTDIR}" && mkdir -p ${P} || return 1
  13. for x in resources packaging src ; do
  14. svn export https://${PN}.svn.sourceforge.net/svnroot/${PN}/releases/${PV}/${x} ${P}/${x} || return 1
  15. done
  16. #Remove unneeded stuff
  17. rm ${P}/resources/*.chm ${P}/src/package.py
  18. #Freeze version and set vendor name to Gentoo
  19. sed -i -e 's/\(^__FROZEN__="[$]Id: \).*\( $"\)/\1'${svnrev}'\2/' \
  20. -e 's/^vendor=".*"/vendor="Gentoo"/' \
  21. ${P}/src/version.py || return 1
  22. #Make the tarball
  23. tar -cjf ${P}.tar.bz2 ${P}
  24. rm -r ${P}
  25. fi