recipe 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. # Build recipe for tdenetwork.
  2. #
  3. # Copyright (c) 2023 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # Exit immediately on any error
  17. set -e
  18. program=tdenetwork
  19. version=20230113_4a1b4b6b
  20. release=1
  21. # Define a category for the output of the package name
  22. pkgcategory=tde
  23. tarname=${program}-${version}.tar.lz
  24. # Remote source(s)
  25. fetch="
  26. https://dragora.mirror.garr.it/current/sources/$tarname
  27. rsync://rsync.dragora.org/current/sources/$tarname
  28. "
  29. description="
  30. TDE network applications.
  31. What it is
  32. * kdict: graphical client for the DICT protocol.
  33. * kit: AOL instant messenger client, using the TOC protocol.
  34. * knewsticker: RDF newsticker applet.
  35. * kpf: public fileserver applet.
  36. * kppp: dialer and front end for pppd.
  37. * ksirc: IRC client.
  38. * ktalkd: talk daemon.
  39. * kxmlrpc: TDE XmlRpc Daemon.
  40. * lanbrowsing: lan browsing tdeio slave.
  41. * krfb: Desktop Sharing server, allow others to access your desktop via VNC.
  42. * krdc: a client for Desktop Sharing and other VNC servers.
  43. * wifi: Wireless LAN tools.
  44. "
  45. homepage=https://www.trinitydesktop.org/
  46. license="GPLv2+, GFDLv1.2"
  47. # Source documentation
  48. docs="AUTHORS COPYING* README*"
  49. docsdir="${docdir}/${program}-${version}"
  50. build()
  51. {
  52. unpack "${tardir}/$tarname"
  53. cd "$srcdir"
  54. # Set sane permissions
  55. chmod -R u+w,go-w,a+rX-s .
  56. rm -rf BUILD
  57. mkdir BUILD
  58. cd BUILD
  59. cmake \
  60. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
  61. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  62. -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="$QICFLAGS" \
  63. -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="$QICXXFLAGS" \
  64. -DCMAKE_SHARED_LINKER_FLAGS:STRING="$(echo $QILDFLAGS | sed 's/-s//')" \
  65. -DLIB_SUFFIX=${libSuffix} \
  66. -DCMAKE_VERBOSE_MAKEFILE=ON \
  67. -DCMAKE_SKIP_RPATH=OFF \
  68. -DCMAKE_INSTALL_PREFIX=/opt/trinity \
  69. -DCONFIG_INSTALL_DIR=/etc/trinity \
  70. -DSYSCONF_INSTALL_DIR=/etc/trinity \
  71. -DCMAKE_LIBRARY_PATH=/opt/trinity/lib${libSuffix} \
  72. -DCMAKE_INCLUDE_PATH=/opt/trinity/include \
  73. -DXDG_MENU_INSTALL_DIR=/etc/xdg/menus \
  74. -DHTDIG_SEARCH_BINARY=/usr/bin/hlsearch \
  75. -DWITH_GCC_VISIBILITY=ON \
  76. -DBUILD_ALL=ON \
  77. -DBUILD_KPPP=OFF \
  78. -DBUILD_LANBROWSING=OFF \
  79. -G Ninja ..
  80. ninja -j${jobs}
  81. DESTDIR="$destdir" ninja -j${jobs} install
  82. # Create post-install script
  83. mkdir -p "${destdir}/var/lib/qi"
  84. cat << EOF > "${destdir}/var/lib/qi/${full_pkgname}.sh"
  85. # Make symlink for canonical path at /opt/trinity/lib
  86. #
  87. # Link using \$libSuffix
  88. if test -n "$libSuffix" && test ! -e "\${rootdir}/opt/trinity/lib"
  89. then
  90. ( cd -- "\${rootdir}/opt/trinity" && ln -sf lib${libSuffix} lib )
  91. fi
  92. echo "Updating ICON cache: gtk-update-icon-cache -q -f -i opt/trinity/share/icons/crystalsvg"
  93. chroot "\$rootdir" /usr/bin/gtk-update-icon-cache -q -f -i opt/trinity/share/icons/crystalsvg 2> /dev/null
  94. echo "Updating ICON cache: gtk-update-icon-cache -q -f -i opt/trinity/share/icons/hicolor"
  95. chroot "\$rootdir" /usr/bin/gtk-update-icon-cache -q -f -i opt/trinity/share/icons/hicolor 2> /dev/null
  96. echo "Updating desktop database: update-desktop-database -q opt/trinity/share/applications/locolor"
  97. chroot "\$rootdir" /usr/bin/update-desktop-database -q opt/trinity/share/applications/locolor 2> /dev/null
  98. # Set xinitrc as default to start TDE when this package is installed
  99. cd -- "\${rootdir}/etc/X11/xinit" && ln -sf xinitrc-tde xinitrc
  100. EOF
  101. # Compress and link man pages (if needed)
  102. if test -d "${destdir}/$mandir"
  103. then
  104. (
  105. cd "${destdir}/$mandir"
  106. find . -type f -exec lzip -9 {} +
  107. find . -type l | while read -r file
  108. do
  109. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  110. rm -- "$file"
  111. done
  112. )
  113. fi
  114. cd ..
  115. # Copy documentation
  116. mkdir -p "${destdir}/$docsdir"
  117. cp -p $docs "${destdir}/$docsdir"
  118. }