build_debian.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. # Builds a debian package from SVN source.
  3. #
  4. # For paralelle builds use:
  5. # DEB_BUILD_OPTIONS="parallel=5" sh build_files/package_spec/build_debian.sh
  6. # this needs to run in the root dir.
  7. cd $(dirname $0)/../../
  8. rm -rf debian
  9. cp -a build_files/package_spec/debian .
  10. # Get values from blender to use in debian/changelog.
  11. # value may be formatted: 35042:35051M
  12. BLENDER_REVISION=$(svnversion | cut -d: -f2 | tr -dc 0-9)
  13. blender_version=$(grep BLENDER_VERSION source/blender/blenkernel/BKE_blender.h | tr -dc 0-9)
  14. blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' source/blender/blenkernel/BKE_blender.h)
  15. BLENDER_VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)
  16. # map the version a -> 1, to conform to debian naming convention
  17. # not to be confused with blender's internal subversions
  18. if [ "$blender_version_char" ]; then
  19. BLENDER_VERSION=${BLENDER_VERSION}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char)
  20. fi
  21. DEB_VERSION=${BLENDER_VERSION}+svn${BLENDER_REVISION}-bf
  22. # update debian/changelog
  23. dch -b -v $DEB_VERSION "New upstream SVN snapshot."
  24. # run the rules makefile
  25. rm -rf get-orig-source
  26. debian/rules get-orig-source SVN_URL=.
  27. mv *.gz ../
  28. # build the package
  29. debuild -i -us -uc -b
  30. # remove temp dir
  31. rm -rf debian