synfigstudio-release.sh 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. #!/bin/bash
  2. # Usage notes
  3. #
  4. # Running this script will creates release tarballs for all synfig
  5. # modules and testing them by installing into ~/local-synfig/.
  6. #
  7. # It is also possible to run procedure for each module separately by
  8. # passing specific arguments to the script:
  9. # * Run procedures for ETL:
  10. # synfigstudio-release.sh etl
  11. # * Run procedures for synfig-core:
  12. # synfigstudio-release.sh core
  13. # * Run procedures for synfig-studio:
  14. # synfigstudio-release.sh studio
  15. #
  16. set -e
  17. export SCRIPTPATH=$(cd `dirname "$0"`; pwd)
  18. export SRCPREFIX=`dirname "$SCRIPTPATH"`
  19. export PREFIX="$HOME/local-synfig"
  20. export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PREFIX/lib/pkgconfig"
  21. export PATH="$PREFIX/bin:$PATH"
  22. export ETL_VERSION=`cat $SRCPREFIX/ETL/configure.ac |egrep "AC_INIT\(\[Extended Template Library\],"| sed "s|.*Library\],\[||" | sed "s|\],\[.*||"`
  23. echo "ETL_VERSION=$ETL_VERSION"
  24. export CORE_VERSION=`cat $SRCPREFIX/synfig-core/configure.ac |egrep "AC_INIT\(\[Synfig Core\],"| sed "s|.*Core\],\[||" | sed "s|\],\[.*||"`
  25. echo "CORE_VERSION=$CORE_VERSION"
  26. export STUDIO_VERSION=`cat $SRCPREFIX/synfig-studio/configure.ac |egrep "AC_INIT\(\[Synfig Studio\],"| sed "s|.*Studio\],\[||" | sed "s|\],\[.*||"`
  27. echo "STUDIO_VERSION=$STUDIO_VERSION"
  28. if [ -e /etc/debian_version ] && [ -z $with_boost_libdir ]; then
  29. # Debian/Ubuntu multiarch
  30. MULTIARCH_LIBDIR="/usr/lib/`uname -m`-linux-gnu/"
  31. if [ -e "${MULTIARCH_LIBDIR}/libboost_program_options.so" ]; then
  32. export with_boost_libdir=$MULTIARCH_LIBDIR
  33. fi
  34. fi
  35. if [ -z $THREADS ]; then
  36. export THREADS=4
  37. fi
  38. pack-etl()
  39. {
  40. cd $SRCPREFIX/ETL
  41. autoreconf -if
  42. ./configure --prefix="$PREFIX"
  43. make distcheck -j${THREADS}
  44. mv ETL-${ETL_VERSION}.tar.gz ../../
  45. }
  46. test-etl()
  47. {
  48. cd $SRCPREFIX/../
  49. tar xf ETL-${ETL_VERSION}.tar.gz
  50. cd ETL-${ETL_VERSION}
  51. ./configure --prefix="$PREFIX"
  52. make install -j${THREADS}
  53. cd ..
  54. rm -rf $SRCPREFIX/../ETL-${ETL_VERSION}
  55. }
  56. etl()
  57. {
  58. pack-etl
  59. test-etl
  60. }
  61. pack-core()
  62. {
  63. cd $SRCPREFIX/synfig-core
  64. ./bootstrap.sh
  65. ./configure --prefix="$PREFIX"
  66. echo "------------------------------------- pack-core make"
  67. make distcheck -j${THREADS}
  68. mv synfig-${CORE_VERSION}.tar.gz ../../
  69. }
  70. test-core()
  71. {
  72. echo "------------------------------------- test-core"
  73. cd $SRCPREFIX/../
  74. tar xf synfig-${CORE_VERSION}.tar.gz
  75. cd synfig-${CORE_VERSION}
  76. ./configure --prefix="$PREFIX"
  77. make install -j${THREADS}
  78. cd ..
  79. rm -rf $SRCPREFIX/../synfig-${CORE_VERSION}
  80. }
  81. core()
  82. {
  83. pack-core
  84. test-core
  85. }
  86. pack-studio()
  87. {
  88. cd $SRCPREFIX/synfig-studio
  89. ./bootstrap.sh
  90. ./configure --prefix="$PREFIX"
  91. make distcheck -j${THREADS}
  92. mv synfigstudio-${STUDIO_VERSION}.tar.gz ../..
  93. }
  94. test-studio()
  95. {
  96. cd $SRCPREFIX/../
  97. tar xf synfigstudio-${STUDIO_VERSION}.tar.gz
  98. cd synfigstudio-${STUDIO_VERSION}
  99. ./configure --prefix="$PREFIX"
  100. make install -j${THREADS}
  101. cd ..
  102. rm -rf $SRCPREFIX/../synfigstudio-${STUDIO_VERSION}
  103. }
  104. studio()
  105. {
  106. pack-studio
  107. test-studio
  108. }
  109. mkall()
  110. {
  111. etl
  112. core
  113. studio
  114. }
  115. do_cleanup()
  116. {
  117. echo "Cleaning up..."
  118. if [ ${PREFIX} != ${DEPSPREFIX} ]; then
  119. [ ! -e ${DEPSPREFIX} ] || mv ${DEPSPREFIX} ${DEPSPREFIX}.off
  120. fi
  121. [ ! -e ${SYSPREFIX} ] || mv ${SYSPREFIX} ${SYSPREFIX}.off
  122. exit
  123. }
  124. #trap do_cleanup INT SIGINT SIGTERM EXIT
  125. if [ -z $1 ]; then
  126. rm -rf "$PREFIX" || true
  127. mkall
  128. else
  129. echo "Executing custom user command..."
  130. $@
  131. fi
  132. #do_cleanup