mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.8 KiB

  1. #!/bin/bash
  2. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  3. #
  4. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  5. # Please add additional copyright information _after_ the line containing
  6. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  7. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  8. #
  9. # ROCK Linux: rock-src/package/praenti/cups/cups.conf
  10. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License, or
  15. # (at your option) any later version. A copy of the GNU General Public
  16. # License can be found at Documentation/COPYING.
  17. #
  18. # Many people helped and are helping developing ROCK Linux. Please
  19. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  20. # file for details.
  21. #
  22. # --- ROCK-COPYRIGHT-NOTE-END ---
  23. hook_add postmake 5 cups_pm
  24. cups_pm(){
  25. install_init cups $confdir/cups.init
  26. # Run usb backend as root so it is allowed to access printer device files
  27. chmod 700 $root/usr/lib/cups/backend/usb
  28. }
  29. if [ "${ROCKCFG_X86_BITS}" = "64" ] ; then
  30. var_append patchfiles ' ' "$confdir/hotfix.diff_x86_64"
  31. fi
  32. var_append extraconfopt " " "--with-cups-user=daemon --with-cups-group=daemon"
  33. # Don't add files for the configuration front-end to :doc packages.
  34. splitreg 70 . "${docdir#/}"
  35. splitreg 75 doc "(CHANGES|CREDITS|INSTALL|LICENSE|README)"
  36. # Force same compiler version for C and C++
  37. export CC="${CXX/[cg]++/gcc}"
  38. # Don't install the init scripts provided by cups.
  39. var_append makeinstopt " " 'INITDIR=""'
  40. # Install binaries to temp. directory and rename to *_cups.
  41. bindir="$dummydir/bin"
  42. sbindir="$dummydir/sbin"
  43. # Install man pages to temp. directory and rename to *_cups.*.
  44. mandir="$dummydir/man"
  45. # hook_add inmake 5 'mkdir -p "$dummydir"/{bin,sbin,man}'
  46. hook_add postinstall 5 'cups_postinstall'
  47. cups_postinstall() {
  48. for x in bin sbin ; do
  49. for y in $( cd "$dummydir/$x" ; ls -dA * ) ; do
  50. file="$dummydir/$x/$y"
  51. if [ ! -f "$file" ] ; then continue ; fi
  52. echo $x $y
  53. case "$y" in
  54. lpc|lpq|lpr|lprm|accept|reject|lpadmin|lpinfo|lpmove|cancel|lp|lpoptions|lpstat|lppasswd)
  55. cp -a "$file" "$root/$prefix/$x/${y}_cups"
  56. ;;
  57. *)
  58. cp -a "$file" "$root/$prefix/$x/"
  59. ;;
  60. esac
  61. done
  62. done
  63. for x in $( cd $dummydir ; ls -dA man/* ) ; do
  64. mkdir -p "$root/$prefix/$x"
  65. for y in $( cd $dummydir/$x ; ls -dA * ) ; do
  66. file="$dummydir/$x/$y"
  67. if [ ! -f "$file" ] ; then continue ; fi
  68. case "${y%%.*}" in
  69. lpc|lpq|lpr|lprm|accept|reject|lpadmin|lpinfo|lpmove|cancel|lp|lpoptions|lpstat|lppasswd)
  70. cp -a "$file" "$root/$prefix/$x/${y%%.*}_cups.${y#*.}"
  71. ;;
  72. *)
  73. cp -a "$file" "$root/$prefix/$x/"
  74. ;;
  75. esac
  76. done
  77. done
  78. }