1
0

make-ipkg-dir.sh 811 B

12345678910111213141516171819202122
  1. BASE=http://www.openadk.org
  2. TARGET=$1
  3. CONTROL=$2
  4. VERSION=$3
  5. ARCH=$4
  6. WD=$(pwd)
  7. mkdir -p "$TARGET/CONTROL"
  8. grep '^[^(Version|Architecture)]' "$CONTROL" > "$TARGET/CONTROL/control"
  9. grep '^Maintainer' "$CONTROL" 2>&1 >/dev/null || \
  10. echo "Maintainer: Waldemar Brodkorb <wbx@openadk.org>" >> "$TARGET/CONTROL/control"
  11. grep '^Priority' "$CONTROL" 2>&1 >/dev/null || \
  12. echo "Priority: optional" >> "$TARGET/CONTROL/control"
  13. grep '^Source' "$CONTROL" 2>&1 >/dev/null || {
  14. pkgbase=$(echo "$WD" | sed -e "s|^$TOPDIR/||g")
  15. [ "$pkgbase" = "$WD" ] && src="N/A" || src="$BASE/$pkgbase"
  16. echo "Source: $src" >> "$TARGET/CONTROL/control"
  17. }
  18. echo "Version: $VERSION" >> "$TARGET/CONTROL/control"
  19. echo "Architecture: $ARCH" >> "$TARGET/CONTROL/control"
  20. chmod 644 "$TARGET/CONTROL/control"