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.

58 lines
1.8 KiB

  1. #!/bin/sh
  2. #
  3. # Convert an Old-Style ROCK Linux Extension to the standard package format.
  4. #
  5. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  6. #
  7. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  8. # Please add additional copyright information _after_ the line containing
  9. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  10. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  11. #
  12. # ROCK Linux: rock-src/misc/archive/extconv.sh
  13. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  14. #
  15. # This program is free software; you can redistribute it and/or modify
  16. # it under the terms of the GNU General Public License as published by
  17. # the Free Software Foundation; either version 2 of the License, or
  18. # (at your option) any later version. A copy of the GNU General Public
  19. # License can be found at Documentation/COPYING.
  20. #
  21. # Many people helped and are helping developing ROCK Linux. Please
  22. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  23. # file for details.
  24. #
  25. # --- ROCK-COPYRIGHT-NOTE-END ---
  26. if [ -z "$1" -o ! -f "$1.ext" ] ; then
  27. [ ! -f "$1.ext" ] && echo "No such file: $1.ext"
  28. echo "Usage: $0 <ext-name>"
  29. exit 1
  30. fi
  31. egrep '^# +\[' $1.ext | sed 's,^# *,,' | \
  32. egrep -v '^\[(P|PRI|PRIORITY)\]' > $1.desc
  33. pri=`{ egrep '^# +\[(P|PRI|PRIORITY)\] +' $1.ext ; echo ". . 5" ; } | head -n 1 | tr -s ' ' | cut -f3 -d' '`
  34. echo "[P] X ------6--9 300.$pri" >> $1.desc
  35. {
  36. echo "#"
  37. echo "# Converted from $name.ext by <rock-base>/misc/archive/extconv.sh"
  38. echo "#"
  39. echo
  40. echo 'if [ "$prefix" != "opt/$pkg" ] ; then'
  41. echo ' abort "!! This package is converted from an old-style .ext file and'
  42. echo '!! might only compile fine when built with the Build-Pkg'
  43. echo '!! option \"-prefix /opt/$pkg\"."'
  44. echo 'fi'
  45. echo
  46. echo "main() {"
  47. egrep -v '^# +\[' $1.ext
  48. echo "}"
  49. echo
  50. echo "autoextract=0"
  51. echo "custmain=main"
  52. echo
  53. } > $1.conf