evolution.SlackBuild 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. #!/bin/bash
  2. # Slackware build script for evolution
  3. # Copyright 2022 Ozan Türkyılmaz
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  15. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. cd $(dirname $0) ; CWD=$(pwd)
  23. PRGNAM=evolution
  24. VERSION=${VERSION:-3.44.2}
  25. BUILD=${BUILD:-1}
  26. TAG=${TAG:-_SBo}
  27. PKGTYPE=${PKGTYPE:-tgz}
  28. GCOV=${GCOV:-no}
  29. GTKDOC=${GTKDOC:-no}
  30. TESTS=${TESTS:-no}
  31. BOGOFILTER=${BOGOFILTER:-no}
  32. SPAMASSASION=${SPAMASSASION:-no}
  33. GNOMEDESKTOP=${GNOMEDESKTOP:-no}
  34. if [ "$GCOV" = "yes" ]; then
  35. GCOVP="ON"
  36. else
  37. GCOVP="OFF"
  38. fi
  39. if [ "$GTKDOC" = "yes" ]; then
  40. GTKDOCP="ON"
  41. else
  42. GTKDOCP="OFF"
  43. fi
  44. if [ "$TESTS" = "yes" ]; then
  45. TESTSP="ON"
  46. else
  47. TESTSP="OFF"
  48. fi
  49. if [ "$BOGOFILTER" = "yes" ]; then
  50. BOGOFILTERP="ON"
  51. else
  52. BOGOFILTERP="OFF"
  53. fi
  54. if [ "$SPAMASSASION" = "yes" ]; then
  55. SPAMASSASIONP="ON"
  56. else
  57. SPAMASSASIONP="OFF"
  58. fi
  59. if [ "$GNOMEDESKTOP" = "yes" ]; then
  60. GNOMEDESKTOPP="ON"
  61. else
  62. GNOMEDESKTOPP="OFF"
  63. fi
  64. if [ -z "$ARCH" ]; then
  65. case "$( uname -m )" in
  66. i?86) ARCH=i586 ;;
  67. arm*) ARCH=arm ;;
  68. *) ARCH=$( uname -m ) ;;
  69. esac
  70. fi
  71. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  72. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  73. exit 0
  74. fi
  75. TMP=${TMP:-/tmp/SBo}
  76. PKG=$TMP/package-$PRGNAM
  77. OUTPUT=${OUTPUT:-/tmp}
  78. if [ "$ARCH" = "i586" ]; then
  79. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  80. LIBDIRSUFFIX=""
  81. elif [ "$ARCH" = "i686" ]; then
  82. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  83. LIBDIRSUFFIX=""
  84. elif [ "$ARCH" = "x86_64" ]; then
  85. SLKCFLAGS="-O2 -fPIC"
  86. LIBDIRSUFFIX="64"
  87. else
  88. SLKCFLAGS="-O2"
  89. LIBDIRSUFFIX=""
  90. fi
  91. set -e
  92. rm -rf $PKG
  93. mkdir -p $TMP $PKG $OUTPUT
  94. cd $TMP
  95. rm -rf $PRGNAM-$VERSION
  96. tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
  97. cd $PRGNAM-$VERSION
  98. chown -R root:root .
  99. find -L . \
  100. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  101. -o -perm 511 \) -exec chmod 755 {} \; -o \
  102. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  103. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  104. mkdir -p build
  105. cd build
  106. cmake \
  107. -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  108. -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  109. -DCMAKE_INSTALL_PREFIX=/usr \
  110. -DSYSCONF_INSTALL_DIR=/etc \
  111. -DLIB_SUFFIX=${LIBDIRSUFFIX} \
  112. -DMAN_INSTALL_DIR=/usr/man \
  113. -DENABLE_CODE_COVERAGE="$GCOV" \
  114. -DENABLE_GNOME_DESKTOP="$GNOMEDESKTOP" \
  115. -DENABLE_GTK_DOC="$GTKDOC" \
  116. -DENABLE_INSTALLED_TESTS="$TESTS" \
  117. -DENABLE_SMIME=ON \
  118. -DENABLE_PST_IMPORT=ON \
  119. -DENABLE_GTKSPELL=OFF \
  120. -DENABLE_YTNEF=ON \
  121. -DENABLE_CONTACT_MAPS=ON \
  122. -DENABLE_TEXT_HIGHLIGHT=ON \
  123. -DWITH_BOGOFILTER="$BOGOFILTER"\
  124. -DWITH_SPAMASSASSIN="$SPAMASSASION"\
  125. -DWITH_SA_LEARN=OFF \
  126. -DWITH_GWEATHER4=ON \
  127. -DENABLE_PLUGINS=all \
  128. -DDWITH_ENCHANT_VERSION=2 \
  129. -DENABLE_SCHEMAS_COMPILE=OFF \
  130. -DWITH_GLADE_CATALOG=OFF \
  131. -DENABLE_MARKDOWN=ON \
  132. -DCMAKE_BUILD_TYPE=Release .. \
  133. -G Ninja
  134. "${NINJA:=ninja}"
  135. DESTDIR=$PKG $NINJA install
  136. cd ..
  137. rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
  138. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  139. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  140. find $PKG/usr/man -type f -exec gzip -9 {} \;
  141. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  142. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  143. cp -a \
  144. AUTHORS COPYING COPYING-DOCS COPYING-DOCS.CCBYSA COPYING-DOCS.GFDL COPYING.LGPL2 COPYING.LGPL3 \
  145. COPYING.OPENLDAP HACKING MAINTAINERS NEWS NEWS-1.0 README.md README.translators \
  146. $PKG/usr/doc/$PRGNAM-$VERSION
  147. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  148. mkdir -p $PKG/install
  149. cat $CWD/slack-desc > $PKG/install/slack-desc
  150. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  151. cd $PKG
  152. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE