recipe 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # Build recipe for xdg-user-dirs.
  2. #
  3. # Copyright (c) 2018-2019 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=xdg-user-dirs
  19. version=0.17
  20. release=2
  21. # Define a category for the output of the package name
  22. pkgcategory=xorg_extra
  23. tarname=${program}-${version}.tar.gz
  24. # Remote source(s)
  25. fetch=https://user-dirs.freedesktop.org/releases/$tarname
  26. description="
  27. A tool to help manage user directories like the Desktop folder.
  28. xdg-user-dirs is a tool to help manage \"well known\" user directories
  29. like the desktop folder and the music folder. It also handles
  30. localization (i.e. translation) of the filenames.
  31. The way it works is that xdg-user-dirs-update is run very early in the
  32. login phase. This program reads a configuration file, and a set of
  33. default directories. It then creates localized versions of these
  34. directories in the users home directory and sets up a config file in
  35. \$(XDG_CONFIG_HOME)/user-dirs.dirs (XDG_CONFIG_HOME defaults to
  36. ~/.config) that applications can read to find these directories.
  37. "
  38. homepage=https://freedesktop.org/wiki/Software/xdg-user-dirs
  39. license=GPLv2+
  40. # Source documentation
  41. docs="AUTHORS COPYING ChangeLog NEWS README TODO"
  42. docsdir="${docdir}/${program}-${version}"
  43. build()
  44. {
  45. unpack "${tardir}/$tarname"
  46. cd "$srcdir"
  47. # Set sane permissions
  48. chmod -R u+w,go-w,a+rX-s .
  49. ./configure \
  50. CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
  51. $configure_args \
  52. --libdir=/usr/lib${libSuffix} \
  53. --mandir=$mandir \
  54. --docdir=$docsdir \
  55. --enable-documentation \
  56. --build="$(gcc -dumpmachine)"
  57. make -j${jobs} V=1
  58. make -j${jobs} DESTDIR="$destdir" install-strip
  59. # To manage dot new files via graft(1)
  60. touch "${destdir}/etc/xdg/.graft-config"
  61. # Compress and link man pages (if needed)
  62. if test -d "${destdir}/$mandir"
  63. then
  64. (
  65. cd "${destdir}/$mandir"
  66. find . -type f -exec lzip -9 {} +
  67. find . -type l | while read -r file
  68. do
  69. ln -sf "$(readlink -- "$file").lz" "${file}.lz"
  70. rm -- "$file"
  71. done
  72. )
  73. fi
  74. # Copy documentation
  75. mkdir -p "${destdir}/$docsdir"
  76. cp -p $docs "${destdir}/$docsdir"
  77. }