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.

132 lines
3.5 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/package/mnemoc/runit/runit.conf
  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. [ "$prefix" = usr ] && sbindir="$root/sbin"
  23. . $base/package/mnemoc/runit/djb-config
  24. pkg_runit_main() {
  25. local agettyargs speed
  26. hook_eval premake
  27. ./package/compile
  28. hook_eval inmake
  29. pkg_djb_installpackage admin $sbindir
  30. hook_eval postmake
  31. # main scripts and virtual consoles
  32. #if [ ! -f $sysconfdir/1 ]; then
  33. echo "Creating main scripts and virtual consoles..."
  34. mkdir -p $sysconfdir
  35. cp -vf ./doc/debian/[123] $sysconfdir/
  36. cp -vf ./doc/debian/ctrlaltdel $sysconfdir/
  37. chmod 744 $sysconfdir/[123]
  38. chmod 744 $sysconfdir/ctrlaltdel
  39. for i in console 1 2 3 4 5 6; do
  40. if [ "$i" == "console" ]; then
  41. echo "Creating getty $i..."
  42. speed=9600
  43. else
  44. echo "Creating getty tty$i..."
  45. i="vc/$i"
  46. speed=38400
  47. fi
  48. mkdir -p $sysconfdir/getty-${i#vc/}
  49. if [ "$i" == "console" -o "$i" == "vc/1" ]; then
  50. agettyargs='-L -i -I '"'"'\012\015\012Maintenance Console:\012'"'"
  51. else
  52. agettyargs='-f /etc/issue.ansi'
  53. fi
  54. cat << EOT > $sysconfdir/getty-${i#vc/}/run
  55. #!/bin/sh
  56. ${pkg_djb_commanddir#$root}/utmpset -w $i
  57. exec /sbin/agetty $agettyargs $speed $i linux
  58. EOT
  59. chmod 744 $sysconfdir/getty-${i#vc/}/run
  60. done
  61. #fi
  62. # getties to svscan
  63. echo "Make getties available to svscan..."
  64. for i in 1 2 3 4 5 6; do
  65. ln -sfv ${sysconfdir#$root}/getty-$i $pkg_djb_servicedir/
  66. done
  67. # and minimal services
  68. if pkgcheck sysklogd X; then
  69. echo "Make sysklogd available to svscan..."
  70. ln -sfv ${sysconfdir#$root}/syslogd $pkg_djb_servicedir/
  71. ln -sfv ${sysconfdir#$root}/klogd $pkg_djb_servicedir/
  72. fi
  73. if pkgcheck cron X; then
  74. echo "Make cron available to svscan..."
  75. ln -sfv ${sysconfdir#$root}/cron $pkg_djb_servicedir/
  76. fi
  77. if [ ${pkg_djb_commanddir} != $sbindir ]; then
  78. echo "Copying init files to /sbin..."
  79. cp -vf ${pkg_djb_commanddir}/runit* $sbindir/
  80. fi
  81. }
  82. pkg_runit_doc() {
  83. if [ $createdocs -eq 1 ]; then
  84. #rm -fv $docdir/debian $docdir/*.bak
  85. pkg_djb_installdoc admin
  86. gzip -9 ./man/*.8
  87. echo "Installing man pages ... "
  88. cp -vf ./man/*.8.gz $mandir/man8/
  89. #cp -vf ./man/*.8 $mandir/man8/
  90. fi
  91. }
  92. if [ "$ROCKCFG_PKG_DJB_LAYOUT" == "1" ]; then
  93. hook_add premake 5 "for x in ./doc/debian/*; do \
  94. if [ -f \$x ]; then \
  95. echo Fixing \$x... ; \
  96. sed -e 's,/var/service,/service,g' \$x > \$x.new ; \
  97. mv -f \$x.new \$x ; \
  98. fi ; \
  99. done"
  100. else
  101. hook_add premake 5 "for x in ./doc/debian/*; do \
  102. if [ -f \$x ]; then \
  103. echo Fixing \$x... ; \
  104. sed -e 's,/command:,,g' \$x > \$x.new ; \
  105. mv -f \$x.new \$x ; \
  106. fi ; \
  107. done"
  108. fi
  109. sysconfdir="$sysconfdir/runit"
  110. srcdir="admin/$pkg-$ver"
  111. custmain="pkg_runit_main"
  112. postdoc="pkg_runit_doc"
  113. createdocs=1