make-ipkg-dir.sh 816 B

1234567891011121314151617181920212223
  1. BASE=http://www.openadk.org/distfiles
  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|^$ADK_TOPDIR/||g")
  15. [ "$pkgbase" = "$WD" ] && src="N/A" || src="$BASE"
  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"