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.

91 lines
3.0 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/misc/jailing/package-functions
  9. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. jail_pkg_apache_postmake() {
  23. jail_ensure_users http
  24. ### Updates paths in $datadir/build/config_vars.mk
  25. echo "Updateing paths in $datadir/build/config_vars.mk"
  26. tmp=`mktemp`
  27. # A copy of original config_vars.mk is left for reference
  28. cp $datadir/build/config_vars.mk $datadir/build/config_vars.mk.orig
  29. cp -f $datadir/build/config_vars.mk $tmp
  30. # s|$base/$builddir/httpd-$ver|/$jail/usr|; is repeated many times
  31. # because it appear many times in same line ... probably there is
  32. # a not so silly way but I can't find it :(
  33. # Feel free of cleaning it
  34. sed " /^exp_.* = \/.*/ {s| = /*usr| = /$jail/usr|; \
  35. s| = /*etc| = /$jail/etc|; s| = /*var| = /$jail/var|; \
  36. p; d; }; \
  37. /^rel_.* = \/.*/ {s| = /*usr/| = |; s| = /*usr| = |; \
  38. s| = /*etc| = ../etc|; s| = /*var| = ../var|; p; d; }; \
  39. / = \/.*/ {s| = /*usr| = /$jail/usr|; \
  40. s| = /*etc| = /$jail/etc|; s| = /*var| = /$jail/var|; \
  41. p; d; }; \
  42. " < $tmp > $datadir/build/config_vars.mk
  43. ### END Updates paths in $datadir/build/config_vars.mk
  44. ### Updates paths in $sbindir/apxs
  45. echo "Updateing paths in $sbindir/apxs"
  46. cp -f $sbindir/apxs $tmp
  47. sed "s|/usr/share/build|/$datadir/build|" < $tmp \
  48. > $sbindir/apxs
  49. ### END Updates paths in $sbindir/apxs
  50. ### Update apachectl
  51. echo "Updateing paths in $sbindir/apachectl"
  52. cp -f $sbindir/apachectl $tmp
  53. sed "s|HTTPD=.*|HTTPD='chroot /$jail ${sbindir/\/$jail}/httpd'|" \
  54. < $tmp > $sbindir/apachectl
  55. ### END Update apachectl
  56. rm $tmp
  57. unset tmp
  58. }
  59. jail_pkg_postfix_postmake() {
  60. ./postfix-install -non-interactive \
  61. daemon_directory=/usr/libexec command_directory=/usr/bin \
  62. sendmail_path=/usr/bin/sendmail \
  63. newaliases_path=/usr/bin/newaliases \
  64. mailq_path=/usr/bin/mailq manpage_directory=/man/ \
  65. sample_directory=/usr/share/$pkg
  66. jail_ensure_users postfix
  67. jail_ensure_groups postdrop
  68. }
  69. jail_pkg_mysql_postmake() {
  70. mv $libdir/mysql/* $libdir
  71. rmdir $libdir/mysql
  72. mkdir -p $docdir
  73. cp support-files/my-*.cnf $docdir
  74. chown $pkg.$pkg $localstatedir
  75. }