OpenSDE Framework (without history before r20070)
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.

51 lines
1.5 KiB

  1. #!/bin/sh
  2. #
  3. # Convert an Old-Style ROCK Linux Extension to the standard package format.
  4. #
  5. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  6. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  7. #
  8. # T2 SDE: misc/archive/extconv.sh
  9. # Copyright (C) 2004 - 2006 The T2 SDE Project
  10. # Copyright (C) 1998 - 2003 Clifford Wolf
  11. #
  12. # More information can be found in the files COPYING and README.
  13. #
  14. # This program is free software; you can redistribute it and/or modify
  15. # it under the terms of the GNU General Public License as published by
  16. # the Free Software Foundation; version 2 of the License. A copy of the
  17. # GNU General Public License can be found in the file COPYING.
  18. # --- T2-COPYRIGHT-NOTE-END ---
  19. if [ -z "$1" -o ! -f "$1.ext" ] ; then
  20. [ ! -f "$1.ext" ] && echo "No such file: $1.ext"
  21. echo "Usage: $0 <ext-name>"
  22. exit 1
  23. fi
  24. egrep '^# +\[' $1.ext | sed 's,^# *,,' | \
  25. egrep -v '^\[(P|PRI|PRIORITY)\]' > $1.desc
  26. pri=`{ egrep '^# +\[(P|PRI|PRIORITY)\] +' $1.ext ; echo ". . 5" ; } | head -n 1 | tr -s ' ' | cut -f3 -d' '`
  27. echo "[P] X ------6--9 300.$pri" >> $1.desc
  28. {
  29. echo "#"
  30. echo "# Converted from $name.ext by <rock-base>/misc/archive/extconv.sh"
  31. echo "#"
  32. echo
  33. echo 'if [ "$prefix" != "opt/$pkg" ] ; then'
  34. echo ' abort "!! This package is converted from an old-style .ext file and'
  35. echo '!! might only compile fine when built with the Build-Pkg'
  36. echo '!! option \"-prefix /opt/$pkg\"."'
  37. echo 'fi'
  38. echo
  39. echo "main() {"
  40. egrep -v '^# +\[' $1.ext
  41. echo "}"
  42. echo
  43. echo "autoextract=0"
  44. echo "custmain=main"
  45. echo
  46. } > $1.conf