summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/automake.dep33
-rwxr-xr-xscripts/awk9
-rwxr-xr-xscripts/cpio18
-rwxr-xr-x[-rw-r--r--]scripts/create-busybox.sh0
-rwxr-xr-xscripts/create-image.sh89
-rwxr-xr-xscripts/install.sh87
-rw-r--r--scripts/ipkg6
-rw-r--r--scripts/ipkg-build6
-rw-r--r--scripts/rstrip.sh3
-rw-r--r--scripts/scan-pkgs.sh147
-rw-r--r--scripts/scan-tools.sh109
-rw-r--r--scripts/split-cfg.sh51
-rwxr-xr-xscripts/tarpkg35
-rwxr-xr-xscripts/tsort13
14 files changed, 367 insertions, 239 deletions
diff --git a/scripts/automake.dep b/scripts/automake.dep
new file mode 100644
index 000000000..13e4e87a9
--- /dev/null
+++ b/scripts/automake.dep
@@ -0,0 +1,33 @@
+configure configure.ac
+configure configure.in
+configure configure.sh
+configure missing
+/Makefile.in /Makefile.am
+/Makefile.in configure.in
+/Makefile.in configure.ac
+/Makefile.in aclocal.m4
+aclocal.m4 configure.in
+aclocal.m4 configure.ac
+aclocal.m4 acinclude.m4
+config.h.in configure.in
+config.h.in configure.ac
+config.h.in aclocal.m4
+config.h.in autoconfig.h.in
+config.h.in gpsd_config.h.in
+configure configure.in
+configure configure.ac
+configure aclocal.m4
+stamp-h.in configure.in
+stamp-h.in configure.ac
+stamp-h.in aclocal.m4
+stamp-h.in acconfig.h
+/Makefile.am subdirs
+/Makefile.am /Makefile.am.in
+subdirs /Makefile.am.in
+configure.files subdirs
+configure.files /configure.in.in
+configure.files admin/configure.in.min
+configure.in configure.files
+acinclude.m4 admin/libtool.m4.in
+acinclude.m4 admin/acinclude.m4.in
+acinclude.m4 libltdl/ltdl.m4
diff --git a/scripts/awk b/scripts/awk
new file mode 100755
index 000000000..ff6f9b002
--- /dev/null
+++ b/scripts/awk
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+if [ -z "$(which gawk 2>/dev/null)" ];then
+ /bin/awk "$@"
+else
+ gawk "$@"
+fi
diff --git a/scripts/cpio b/scripts/cpio
new file mode 100755
index 000000000..7936b727f
--- /dev/null
+++ b/scripts/cpio
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+os=$(uname)
+case $os in
+ NetBSD|MirBSD|OpenBSD)
+ quiet=""
+ ;;
+ *)
+ quiet="--quiet"
+ ;;
+esac
+if [ -x /usr/bin/cpio ];then
+ /usr/bin/cpio $quiet "$@"
+else
+ /bin/cpio $quiet "$@"
+fi
diff --git a/scripts/create-busybox.sh b/scripts/create-busybox.sh
index 7dc1c13bb..7dc1c13bb 100644..100755
--- a/scripts/create-busybox.sh
+++ b/scripts/create-busybox.sh
diff --git a/scripts/create-image.sh b/scripts/create-image.sh
index bbebcf4d2..b4824aea7 100755
--- a/scripts/create-image.sh
+++ b/scripts/create-image.sh
@@ -1,19 +1,16 @@
#!/usr/bin/env bash
-grubinstall=1
+filesystem=ext2
-while getopts ":tin" option
+while getopts "f:i" option
do
case $option in
- t)
- emul=$OPTARG
+ f)
+ filesystem=$OPTARG
;;
i)
initramfs=1
;;
- n)
- grubinstall=0
- ;;
*)
printf "Option not recognized\n"
exit 1
@@ -27,10 +24,10 @@ if [ $(id -u) -ne 0 ];then
exit 1
fi
-printf "Checking if grub is installed"
-grub=$(which grub)
+printf "Checking if mkfs is installed"
+mkfs=$(which mkfs.$filesystem)
-if [ ! -z $grub -a -x $grub ];then
+if [ ! -z $mkfs -a -x $mkfs ];then
printf "...okay\n"
else
printf "...failed\n"
@@ -75,27 +72,40 @@ else
fi
-printf "Generate qemu image\n"
-$qimg create -f raw $1 300M
+printf "Generate qemu image (512 MB)\n"
+$qimg create -f raw $1 512M >/dev/null
+
+printf "Creating filesystem $filesystem\n"
printf "Create partition and filesystem\n"
$parted -s $1 mklabel msdos
-$parted -s $1 mkpart primary ext2 0 300
+$parted -s $1 mkpart primary ext2 0 100%
$parted -s $1 set 1 boot on
-$parted -s $1 mkfs 1 ext2
+
+dd if=$1 of=mbr bs=16384 count=1 2>/dev/null
+dd if=$1 skip=16384 of=$1.new 2>/dev/null
+
+if [ "$filesystem" = "ext2" -o "$filesystem" = "ext3" -o "$filesystem" = "ext4" ];then
+ mkfsopts=-F
+fi
+
+mkfs.$filesystem $mkfsopts ${1}.new >/dev/null
if [ $? -eq 0 ];then
printf "Successfully created partition\n"
- $parted $1 print
+ #$parted $1 print
else
printf "Partition creation failed, Exiting.\n"
exit 1
fi
+cat mbr ${1}.new > $1
+rm ${1}.new
+rm mbr
tmp=$(mktemp -d)
-mount -o loop,offset=16384 -t ext2 $1 $tmp
+mount -o loop,offset=16384 -t $filesystem $1 $tmp
if [ -z $initramfs ];then
printf "Extracting install archive\n"
@@ -110,59 +120,16 @@ else
cp $2-initramfs $tmp/boot/initramfs
fi
-if [ $grubinstall -eq 1 ];then
-printf "Copying grub files\n"
-mkdir $tmp/boot/grub
-cp /boot/grub/stage1 $tmp/boot/grub
-cp /boot/grub/stage2 $tmp/boot/grub
-cp /boot/grub/e2fs_stage1_5 $tmp/boot/grub
-
-if [ -z $initramfs ];then
-cat << EOF > $tmp/boot/grub/menu.lst
-serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
-terminal --timeout=2 serial console
-timeout 2
-default 0
-hiddenmenu
-title linux
-root (hd0,0)
-kernel /boot/kernel root=/dev/sda1 init=/init console=ttyS0,115200 console=tty0 panic=10 rw
-EOF
-else
-cat << EOF > $tmp/boot/grub/menu.lst
-serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
-terminal --timeout=2 serial console
-timeout 4
-default 0
-hiddenmenu
-title linux
-root (hd0,0)
-kernel /boot/kernel root=/dev/sda1 console=ttyS0,115200 console=tty0 rw
-initrd /boot/initramfs
-EOF
-fi
-
-printf "Installing Grub bootloader\n"
-$grub --batch --no-curses --no-floppy --device-map=/dev/null >/dev/null << EOF
-device (hd0) $1
-root (hd0,0)
-setup (hd0)
-quit
-EOF
-
-fi
-
-printf "Creating device nodes\n"
+#printf "Creating device nodes\n"
mknod -m 666 $tmp/dev/zero c 1 5
mknod -m 666 $tmp/dev/null c 1 3
mknod -m 622 $tmp/dev/console c 5 1
mknod -m 666 $tmp/dev/tty c 5 0
mknod -m 666 $tmp/dev/tty0 c 4 0
-mknod -m 660 $tmp/dev/hda b 3 0
-mknod -m 660 $tmp/dev/hda1 b 3 1
mknod -m 666 $tmp/dev/ttyS0 c 4 64
umount $tmp
printf "Successfully installed.\n"
+printf "Be sure $1 is writable for the user which use qemu\n"
exit 0
diff --git a/scripts/install.sh b/scripts/install.sh
index 5cb5e01f4..79bfa36bf 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -4,16 +4,6 @@ if [ $(id -u) -ne 0 ];then
exit 1
fi
-printf "Checking if grub is installed"
-grub=$(which grub)
-
-if [ ! -z $grub -a -x $grub ];then
- printf "...okay\n"
-else
- printf "...failed\n"
- exit 1
-fi
-
printf "Checking if sfdisk is installed"
sfdisk=$(which sfdisk)
@@ -79,7 +69,7 @@ if [ -z $1 ];then
exit 1
else
if [ -z $2 ];then
- printf "Please give your install tar as second parameter\n"
+ printf "Please give your install tar archive as second parameter\n"
exit 2
fi
if [ -f $2 ];then
@@ -105,7 +95,7 @@ else
printf "This will destroy all data on $1, are you sure?\n"
printf "Type "y" to continue\n"
read y
- if [ $y = "y" ];then
+ if [ "$y" = "y" ];then
$sfdisk -l $1 2>&1 |grep 'No medium'
if [ $? -eq 0 ];then
exit 1
@@ -135,34 +125,45 @@ if [ $($sfdisk -l $1 2>/dev/null|grep Empty|wc -l) -ne 4 ];then
read y
if [ $y = "y" ];then
printf "Wiping existing partitions\n"
- dd if=/dev/zero of=$1 bs=512 count=1
+ dd if=/dev/zero of=$1 bs=512 count=1 >/dev/null 2>&1
else
printf "Exiting.\n"
exit 1
fi
fi
-printf "Create partition and filesystem\n"
+case $2 in
+ wrap*)
+ speed=38400
+ ;;
+ *)
+ speed=115200
+ ;;
+esac
+
if [ $rb532 -ne 0 ];then
+ printf "Create partition and filesystem for rb532\n"
rootpart=${1}2
$parted -s $1 mklabel msdos
sleep 2
- maxsize=$(parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
+ maxsize=$(env LC_ALL=C $parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
rootsize=$(($maxsize-2))
$parted -s $1 unit cyl mkpart primary ext2 0 1
- $parted -s $1 unit cyl mkpartfs primary ext2 1 $rootsize
+ $parted -s $1 unit cyl mkpart primary ext2 1 $rootsize
$parted -s $1 unit cyl mkpart primary fat32 $rootsize $maxsize
$parted -s $1 set 1 boot on
$sfdisk --change-id $1 1 27
$sfdisk --change-id $1 3 88
sleep 2
+ $mke2fs ${1}2
sync
dd if=$3 of=${1}1 bs=2048
sync
else
rootpart=${1}1
if [ $cfgfs -eq 0 ];then
+ printf "Create partition and filesystem without cfgfs\n"
$sfdisk $1 << EOF
,,L
;
@@ -172,15 +173,17 @@ y
EOF
$mke2fs ${rootpart}
else
+ printf "Create partition and filesystem with cfgfs\n"
$parted -s $1 mklabel msdos
sleep 2
- maxsize=$(parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
- rootsize=$(($maxsize-1))
+ maxsize=$(env LC_ALL=C $parted $1 -s unit cyl print |awk '/^Disk/ { print $3 }'|sed -e 's/cyl//')
+ rootsize=$(($maxsize-2))
- $parted -s $1 unit cyl mkpartfs primary ext2 0 $rootsize
+ $parted -s $1 unit cyl mkpart primary ext2 0 $rootsize
$parted -s $1 unit cyl mkpart primary fat32 $rootsize $maxsize
$parted -s $1 set 1 boot on
$sfdisk --change-id $1 2 88
+ $mke2fs ${1}1
fi
fi
@@ -192,7 +195,7 @@ else
fi
sleep 2
-$tune2fs -c 0 -i 0 ${rootpart} >/dev/null
+$tune2fs -c 0 -i 0 -m 1 ${rootpart} >/dev/null
if [ $? -eq 0 ];then
printf "Successfully disabled filesystem checks on ${rootpart}\n"
else
@@ -209,30 +212,28 @@ chmod 1777 $tmp/tmp
chmod 4755 $tmp/bin/busybox
if [ $rb532 -eq 0 ];then
- printf "Copying grub files\n"
- mkdir $tmp/boot/grub
- cp /boot/grub/stage1 $tmp/boot/grub
- cp /boot/grub/stage2 $tmp/boot/grub
- cp /boot/grub/e2fs_stage1_5 $tmp/boot/grub
-
-cat << EOF > $tmp/boot/grub/menu.lst
-serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
-terminal --timeout=2 serial console
-timeout 2
-default 0
-hiddenmenu
-title linux
-root (hd0,0)
-kernel /boot/kernel root=/dev/sda1 init=/init console=ttyS0,115200 console=tty0 panic=10 rw
-EOF
-
- printf "Installing Grub bootloader\n"
-$grub --batch --no-curses --no-floppy --device-map=/dev/null >/dev/null << EOF
-device (hd0) $1
-root (hd0,0)
-setup (hd0)
-quit
+ printf "Installing GRUB bootloader\n"
+ mkdir -p $tmp/boot/grub
+ mount -o bind /dev $tmp/dev
+ chroot $tmp mount -t proc /proc /proc
+ chroot $tmp mount -t sysfs /sys /sys
+cat << EOF > $tmp/boot/grub/grub.cfg
+set default=0
+set timeout=1
+serial --unit=0 --speed=$speed
+terminal_output serial
+terminal_input serial
+
+menuentry "GNU/Linux (OpenADK)" {
+ insmod ext2
+ set root=(hd0,1)
+ linux /boot/vmlinuz-adk root=/dev/sda1 ro init=/init console=ttyS0,$speed console=tty0 panic=10
+}
EOF
+ chroot $tmp grub-install $1
+ umount $tmp/proc
+ umount $tmp/sys
+ umount $tmp/dev
fi
printf "Creating device nodes\n"
diff --git a/scripts/ipkg b/scripts/ipkg
index 39520094f..cfa1cfe97 100644
--- a/scripts/ipkg
+++ b/scripts/ipkg
@@ -777,7 +777,7 @@ ipkg_install_file_dest() {
mkdir -p $IPKG_TMP/$pkg/data
mkdir -p $info_dir
- if ! $pkg_extract_stdout $filename ./control.tar.gz | (cd $IPKG_TMP/$pkg/control; tar -xzf - ) ; then
+ if ! $pkg_extract_stdout $filename ./control.tar.gz|gzip -dc|tar -xf - -C $IPKG_TMP/$pkg/control ; then
echo "ipkg_install_file: ERROR unpacking control.tar.gz from $filename"
return 1
fi
@@ -807,7 +807,7 @@ Status: install ok pending" | ipkg_status_update_sd $sd $pkg
set -o noglob
rm -r $IPKG_TMP/$pkg/control
- if ! $pkg_extract_stdout $filename ./data.tar.gz | (cd $IPKG_TMP/$pkg/data; tar -xzf - ) ; then
+ if ! $pkg_extract_stdout $filename ./data.tar.gz|gzip -dc|tar -xf - -C $IPKG_TMP/$pkg/data ; then
echo "ipkg_install_file: ERROR unpacking data.tar.gz from $filename"
return 1
fi
@@ -879,7 +879,7 @@ diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile"
rm -rf $IPKG_TMP/$pkg/data
rmdir $IPKG_TMP/$pkg
rm -f $info_dir/$pkg.list
- $pkg_extract_stdout $filename ./data.tar.gz | tar tzf - | sed -e 's/^\.//' > $info_dir/$pkg.list
+ $pkg_extract_stdout $filename ./data.tar.gz | gzip -dc | tar tf - | sed -e 's/^\.//' > $info_dir/$pkg.list
if [ -x "$info_dir/$pkg.postinst" ]; then
IPKG_INSTROOT="$IPKG_INSTROOT" $info_dir/$pkg.postinst configure
diff --git a/scripts/ipkg-build b/scripts/ipkg-build
index 378236b78..a94593944 100644
--- a/scripts/ipkg-build
+++ b/scripts/ipkg-build
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/usr/bin/env bash
# ipkg-build -- construct a .ipk from a directory
# Carl Worth <cworth@east.isi.edu>
@@ -98,7 +98,7 @@ You probably want to remove them: " >&2
[ "$?" -ne 0 ] && PKG_ERROR=1
if [ -z "$section" ]; then
echo "The Section field should have one of the following values:" >&2
- echo "admin, base, comm, editors, extras, games, graphics, kernel, lang, libs, misc, net, text, web, x11" >&2
+ echo "admin, base, comm, editors, extras, games, graphics, kernel, lang, libs, misc, net, scm, text, web, x11" >&2
fi
priority=`required_field Priority`
@@ -233,7 +233,7 @@ tmp_dir=$dest_dir/IPKG_BUILD.$$
mkdir $tmp_dir
echo $CONTROL > $tmp_dir/tarX
-( cd $pkg_dir && tar $ogargs -czf $tmp_dir/data.tar.gz . -X $tmp_dir/tarX )
+( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -czf $tmp_dir/data.tar.gz . )
( cd $pkg_dir/$CONTROL && tar $ogargs -czf $tmp_dir/control.tar.gz . )
rm $tmp_dir/tarX
diff --git a/scripts/rstrip.sh b/scripts/rstrip.sh
index d897c0ef3..0c7550d8e 100644
--- a/scripts/rstrip.sh
+++ b/scripts/rstrip.sh
@@ -33,10 +33,8 @@ find $TARGETS -type f -a -exec file {} \; | \
T=$T$stripcomm
case $line in
*ELF*executable*statically\ linked*)
- echo >&2 "$SELF: *WARNING* '$V' is not dynamically linked!"
;;
*ELF*relocatable*,\ not\ stripped*)
- echo >&2 "$SELF: *WARNING* '$V' is a relocatable!"
;;
esac
case $line in
@@ -58,3 +56,4 @@ find $TARGETS -type f -a -exec file {} \; | \
echo "-> $T $F"
eval "$T $F"
done
+exit 0
diff --git a/scripts/scan-pkgs.sh b/scripts/scan-pkgs.sh
index 69f2b1e3a..a1e9e9440 100644
--- a/scripts/scan-pkgs.sh
+++ b/scripts/scan-pkgs.sh
@@ -18,13 +18,27 @@ test -z "$BASH_VERSION$KSH_VERSION" && exec $BASH $0 "$@"
[[ -n $BASH_VERSION ]] && shopt -s extglob
topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
-OStype=$(env NOFAKE=yes uname)
+OStype=$(uname)
out=0
. $topdir/.config
-if [[ -n $ADK_PACKAGE_ALSA_UTILS ]]; then
- NEED_XMLTO="$NEED_XMLTO alsa-utils"
+if [[ -n $ADK_NATIVE ]];then
+ if [[ -n $ADK_PACKAGE_GIT ]];then
+ NEED_CURLDEV="$NEED_CURLDEV git"
+ NEED_SSLDEV="$NEED_SSLDEV git"
+ fi
+ if [[ -n $ADK_TARGET_PACKAGE_RPM ]]; then
+ NEED_RPM="$NEED_RPM rpm"
+ fi
+fi
+
+if [[ -n $ADK_PACKAGE_LIBUSB ]]; then
+ NEED_BISON="$NEED_BISON libusb"
+fi
+
+if [[ -n $ADK_COMPILE_HEIMDAL ]]; then
+ NEED_BISON="$NEED_BISON heimdal-server"
fi
if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
@@ -37,18 +51,52 @@ fi
if [[ -n $ADK_PACKAGE_SQUID ]]; then
NEED_SSLDEV="$NEED_SSLDEV squid"
+ NEED_GXX="$NEED_GXX squid"
+fi
+
+if [[ -n $ADK_PACKAGE_DANSGUARDIAN ]]; then
+ NEED_PKGCONFIG="$NEED_PKGCONFIG dansguardian"
+fi
+
+if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
+ NEED_INTL="$NEED_INTL xkeyboard-config"
+fi
+
+if [[ -n $ADK_PACKAGE_GLIB ]]; then
+ NEED_GLIBZWO="$NEED_GLIBZWO glib"
+ NEED_GETTEXT="$NEED_GETTEXT glib"
+ NEED_PKGCONFIG="$NEED_PKGCONFIG glib"
+fi
+
+if [[ -n $ADK_PACKAGE_LIBPCAP ]]; then
+ NEED_FLEX="$NEED_FLEX libpcap"
+ NEED_BISON="$NEED_BISON libpcap"
+fi
+
+if [[ -n $ADK_PACKAGE_LIBXFONT ]]; then
+ NEED_WWW="$NEED_WWW libXfont"
+ NEED_XMLTO="$NEED_XMLTO libXfont"
+fi
+
+if [[ -n $ADK_PACKAGE_EGLIBC ]]; then
+ NEED_GPERF="$NEED_GPERF eglibc"
+fi
+
+if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_100DPI ]]; then
+ NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-100dpi"
fi
-#if [[ -n $ADK_PACKAGE_RUBY ]]; then
-# NEED_RUBY="$NEED_RUBY ruby"
-#fi
+if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_75DPI ]]; then
+ NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-75dpi"
+fi
-if [[ -n $ADK_PACKAGE_GLIB2 ]]; then
- NEED_GLIBZWO="$NEED_GLIBZWO glib2"
- NEED_GETTEXT="$NEED_GETTEXT glib2"
- NEED_PKGCONFIG="$NEED_PKGCONFIG glib2"
+if [[ -n $ADK_PACKAGE_FONT_ADOBE_100DPI ]]; then
+ NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-100dpi"
fi
+if [[ -n $ADK_PACKAGE_FONT_ADOBE_75DPI ]]; then
+ NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-75dpi"
+fi
if [[ -n $NEED_GETTEXT ]]; then
if ! which xgettext >/dev/null 2>&1; then
@@ -60,6 +108,15 @@ if [[ -n $NEED_GETTEXT ]]; then
fi
fi
+if [[ -n $NEED_CURLDEV ]];then
+ if ! test -f /usr/include/curl/curl.h >/dev/null; then
+ if ! test -f /usr/local/include/curl/curl.h >/dev/null; then
+ echo >&2 You need curl headers to build $NEED_CURLDEV
+ out=1
+ fi
+ fi
+fi
+
if [[ -n $NEED_SSLDEV ]]; then
if ! test -f /usr/lib/pkgconfig/openssl.pc >/dev/null; then
if ! test -f /usr/include/openssl/ssl.h >/dev/null; then
@@ -69,6 +126,52 @@ if [[ -n $NEED_SSLDEV ]]; then
fi
fi
+if [[ -n $NEED_MKFONTDIR ]]; then
+ if ! which mkfontdir >/dev/null 2>&1; then
+ echo >&2 You need mkfontdir to build $NEED_MKFONTDIR
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_INTL ]]; then
+ if ! which intltool-update >/dev/null 2>&1; then
+ echo >&2 You need intltool-update to build $NEED_INTL
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_WWW ]]; then
+ if ! which w3m >/dev/null 2>&1; then
+ if ! which lynx >/dev/null 2>&1; then
+ if ! which links >/dev/null 2>&1; then
+ echo >&2 You need w3m/links/lynx to build $NEED_WWW
+ out=1
+ fi
+ fi
+ fi
+fi
+
+if [[ -n $NEED_BISON ]]; then
+ if ! which bison >/dev/null 2>&1; then
+ echo >&2 You need bison to build $NEED_BISON
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_GPERF ]]; then
+ if ! which gperf >/dev/null 2>&1; then
+ echo >&2 You need gperf to build $NEED_GPERF
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_GXX ]]; then
+ if ! which g++ >/dev/null 2>&1; then
+ echo >&2 You need GNU c++ compiler to build $NEED_GXX
+ out=1
+ fi
+fi
+
if [[ -n $NEED_RUBY ]]; then
if ! which ruby >/dev/null 2>&1; then
echo >&2 You need ruby to build $NEED_RUBY
@@ -83,13 +186,6 @@ if [[ -n $NEED_XKBCOMP ]]; then
fi
fi
-if [[ -n $NEED_XMLTO ]]; then
- if ! which xmlto >/dev/null 2>&1; then
- echo >&2 You need xmlto to build $NEED_XMLTO
- out=1
- fi
-fi
-
if [[ -n $NEED_PKGCONFIG ]]; then
if ! which pkg-config >/dev/null 2>&1; then
echo >&2 You need pkg-config to build $NEED_PKGCONFIG
@@ -111,9 +207,18 @@ if [[ -n $ADK_USE_CCACHE ]]; then
fi
fi
-#if [[ -n $ADK_COMPILE_MYSQL && $OStype != Linux ]]; then
-# echo >&2 mySQL does not build on non-GNU/Linux.
-# out=1
-#fi
+if [[ -n $NEED_RPM ]]; then
+ if ! which rpmbuild >/dev/null 2>&1; then
+ echo >&2 You need rpmbuild to to use $NEED_RPM package backend
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_FLEX ]]; then
+ if ! which flex >/dev/null 2>&1; then
+ echo >&2 You need flex to to use $NEED_FLEX package
+ out=1
+ fi
+fi
exit $out
diff --git a/scripts/scan-tools.sh b/scripts/scan-tools.sh
index 29cdf0fef..89e368d8b 100644
--- a/scripts/scan-tools.sh
+++ b/scripts/scan-tools.sh
@@ -5,10 +5,10 @@ shopt -s extglob
topdir=$(pwd)
opath=$PATH
out=0
-if [ -z $(which gmake) ];then
- makecmd=$(which make)
+if [ -z $(which gmake 2>/dev/null ) ];then
+ makecmd=$(which make 2>/dev/null )
else
- makecmd=$(which gmake)
+ makecmd=$(which gmake 2>/dev/null )
fi
if [[ $NO_ERROR != @(0|1) ]]; then
@@ -39,21 +39,17 @@ Linux)
FreeBSD)
# supported with no extra quirks at the moment
;;
+MirBSD)
+ # supported with no extra quirks at the moment
+ ;;
CYG*)
- # mkdir /openadk
- # mount -b -s -o managed "C:/openadk" "/openadk"
- # cd /
- # git clone git+ssh://openadk.org/git/openadk.git
- echo "Building OpenADK on $os is needs a managed mount point."
- echo '"mount -b -s -o managed "C:/openadk" "/openadk"'
+ echo "Building OpenADK on $os needs a small registry change."
+ echo 'http://cygwin.com/cygwin-ug-net/using-specialnames.html'
+ echo "You can ignore this message, when you already done the change"
+ sleep 3
;;
NetBSD)
- echo "Building OpenADK on $os is currently unsupported."
- echo "Sorry."
- echo
- echo There are unresolved issues relating to ncurses not
- echo being included in NetBSD®, and these provided by pkgsrc®
- echo lack important header files.
+ # supported with no extra quirks at the moment
;;
OpenBSD)
# supported with no extra quirks at the moment
@@ -101,51 +97,13 @@ if [[ $X != *@(Native compiler works)* ]]; then
fi
rm test 2>/dev/null
-if ! which cpp >/dev/null 2>&1; then
- echo You must install a C preprocessor to continue.
- echo
- out=1
-fi
-
-#if ! which flex >/dev/null 2>&1; then
-# echo You must install flex to continue.
-# echo
-# out=1
-#else
-# echo '%%' | flex -
-# if fgrep _POSIX_SOURCE lex.yy.c; then
-# echo Your lexer \(flex\) contains a broken skeleton.
-# if [[ $NO_ERROR = 1 ]]; then
-# echo WARNING: continue at your own risk.
-# echo Some packages may be broken.
-# else
-# echo You can continue the build by issuing \'make prereq-noerror\'
-# echo However, several packages may faild to build correctly.
-# out=1
-# fi
-# echo
-# fi
-#fi
-
-#if ! which bison >/dev/null 2>&1; then
-# echo You must install GNU bison to continue.
-# echo
-# out=1
-#fi
-
-#if ! which gperf >/dev/null 2>&1; then
-# echo You must install gperf to continue.
-# echo
-# out=1
-#fi
-
if ! which tar >/dev/null 2>&1; then
echo You must install GNU tar to continue.
echo
out=1
fi
-if ! tar --version|grep GNU >/dev/null 2>&1;then
+if ! (tar --version | grep GNU) >/dev/null 2>&1;then
if ! which gtar >/dev/null 2>&1; then
echo You must install GNU tar to continue.
echo
@@ -159,6 +117,12 @@ if ! which gzip >/dev/null 2>&1; then
out=1
fi
+if ! which lzma >/dev/null 2>&1; then
+ echo You must install lzma to continue.
+ echo
+ out=1
+fi
+
if ! which bzip2 >/dev/null 2>&1; then
echo You must install bzip2 to continue.
echo
@@ -218,13 +182,12 @@ if [[ $X != *@(Native compiler works)* ]]; then
out=1
fi
-[[ -s /usr/include/ncurses.h ]] || if [[ -s /usr/pkg/include/ncurses.h ]]; then
- echo 'HOSTCFLAGS+= -isystem /usr/pkg/include' >>$topdir/prereq.mk
- echo 'HOSTLDFLAGS+=-L/usr/pkg/lib -Wl,-rpath -Wl,/usr/pkg/lib' >>$topdir/prereq.mk
-else
- echo Install ncurses header files, please.
- echo
- out=1
+if [[ ! -s /usr/include/ncurses.h ]]; then
+ if [[ ! -s /usr/include/curses.h ]]; then
+ echo Install ncurses header files, please.
+ echo
+ out=1
+ fi
fi
if ! which gawk >/dev/null 2>&1; then
@@ -253,24 +216,6 @@ if ! which wget >/dev/null 2>&1; then
out=1
fi
-if ! which autoconf >/dev/null 2>&1; then
- echo You must install autoconf to continue.
- echo
- out=1
-fi
-
-if ! which automake >/dev/null 2>&1; then
- echo You must install automake to continue.
- echo
- out=1
-fi
-
-if ! which libtool >/dev/null 2>&1; then
- echo You must install libtool to continue.
- echo
- out=1
-fi
-
if ! which file >/dev/null 2>&1; then
echo You must install \"file\" to continue.
echo
@@ -283,6 +228,12 @@ if ! which perl >/dev/null 2>&1; then
out=1
fi
+if ! which m4 >/dev/null 2>&1; then
+ echo "You must install m4 (macro processor) to continue."
+ echo
+ out=1
+fi
+
cd $topdir
rm -rf tmp
diff --git a/scripts/split-cfg.sh b/scripts/split-cfg.sh
index 4331709a5..f5d2db07f 100644
--- a/scripts/split-cfg.sh
+++ b/scripts/split-cfg.sh
@@ -4,21 +4,23 @@
# ses the slow-down.
TOPDIR=$1
-
-[[ -n $BASH_VERSION ]] && shopt -s extglob
+TARGET=$2
+LIBC=$3
+(( x_cols = (COLUMNS > 10) ? COLUMNS - 2 : 80 ))
+typeset -L$x_cols pbar
grep -v '^BUSYBOX\|^# BUSYBOX' $TOPDIR/.config > $TOPDIR/.config.split
-mkdir -p $TOPDIR/.cfg
-cd $TOPDIR/.cfg
+mkdir -p $TOPDIR/.cfg_${TARGET}_${LIBC}
+cd $TOPDIR/.cfg_${TARGET}_${LIBC}
-oldfiles=$(echo *)
+oldfiles=$(print -r -- *)
newfiles=:
-echo -n 'autosplitting main config...'
+print -nu2 'autosplitting main config...'
while read line; do
oline=$line
- [[ -n $line ]] && if [[ $line = @(# [A-Z])* ]]; then
+ [[ -n $line ]] && if [[ $line = @(\# [A-Z])* ]]; then
line=${line#? }
if [[ $line = *@( is not set) ]]; then
line=${line% is not set}
@@ -28,12 +30,12 @@ while read line; do
fi
elif [[ $line = @([A-Z])*@(=)* ]]; then
line=${line%%=*}
- elif [[ $line = @(#)* ]]; then
+ elif [[ $line = \#* ]]; then
# valid comment
line=
else
# invalid non-comment
- echo "Warning: line '$oline' invalid!" >&2
+ print -u2 "\nWarning: line '$oline' invalid!"
line=
fi
# if the line is a valid yes/no/whatever, write it
@@ -44,9 +46,9 @@ while read line; do
else
fline=
fi
- [[ $oline = $fline ]] || echo "$oline" >$line
+ [[ $oline = $fline ]] || print -r -- "$oline" >$line
if [[ $newfiles = *:$line:* ]]; then
- echo "Error: duplicate Config.in option '$line'!" >&2
+ print -u2 "\nError: duplicate Config.in option '$line'!"
exit 1
fi
newfiles=$newfiles$line:
@@ -54,33 +56,28 @@ while read line; do
done <$TOPDIR/.config.split
# now handle the case of removals
-echo -n ' removals...'
+print -nu2 ' removals...'
for oldfile in $oldfiles; do
[[ $newfiles = *:$oldfile:* ]] || rm -f $oldfile
done
-printf '\r%60s\r' ''
+print -nu2 '\r'
-# now scan for dependencies of packages; the information
-# should probably be in build_mipsel because it's generated
-# at build time, but OTOH, soon enough, parts of Makefile
-# and the entire Config.in will be auto-generated anyway,
-# so we're better off placing it here
-#XXX this is too slow @868 configure options
-cd $TOPDIR/.cfg
+# now handle package dependencies
+cd $TOPDIR/.cfg_${TARGET}_${LIBC}
rm -f $TOPDIR/package/*/info.mk
for option in *; do
- echo -n "$option ..."
- x=$(( ${#option} + 4 ))
+ pbar="$option ..."
+ print -nu2 "$pbar\r"
ao=:
- fgrep -l $option $TOPDIR/package/*/{Makefile,Config.*} 2>&- | \
+ fgrep -l $option $TOPDIR/package/*/Config.* 2>&- | \
while read line; do
- echo ${line%/*}/info.mk
+ print -r -- ${line%/*}/info.mk
done | while read fname; do
[[ $ao = *:$fname:* ]] && continue
ao=$ao$fname:
- echo "\${_IPKGS_COOKIE}: \${TOPDIR}/.cfg/$option" >>$fname
+ if [ "$option" != "ADK_HAVE_DOT_CONFIG" ];then
+ echo "\${_IPKGS_COOKIE}: \${TOPDIR}/.cfg_${TARGET}_${LIBC}/$option" >>$fname
+ fi
done
- printf '\r%'$x's\r' ''
done
-
exit 0
diff --git a/scripts/tarpkg b/scripts/tarpkg
new file mode 100755
index 000000000..37c0b2079
--- /dev/null
+++ b/scripts/tarpkg
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+# create/install compressed tar balls
+#set -x
+
+if [ "$1" = "build" ];then
+ if [ ! -d $2 ];then
+ echo "not a directory"
+ exit 1
+ fi
+ pkgname=$(grep "^Package:" $2/CONTROL/control | sed -e "s/^[^:]*:[[:space:]]*//")
+ version=$(grep "^Version:" $2/CONTROL/control | sed -e "s/^[^:]*:[[:space:]]*//")
+ arch=$(grep "^Architecture:" $2/CONTROL/control | sed -e "s/^[^:]*:[[:space:]]*//")
+ for file in preinst postinst prerm postrm; do
+ [ ! -f $2/CONTROL/$file ] || ( mkdir -p ${2}/usr/lib/pkg && \
+ cp $2/CONTROL/$file ${2}/usr/lib/pkg/${pkgname}.$file && \
+ chmod +x ${2}/usr/lib/pkg/${pkgname}.$file )
+ done
+ rm -rf $2/CONTROL
+ (cd $2 && tar -czf $3/${pkgname}_${version}_${arch}.tar.gz .)
+elif [ "$1" = "install" ];then
+ pkg=$(echo $(basename $2)|sed -e "s#_.*##")
+ if [ -x ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.preinst ]; then
+ IPKG_INSTROOT="$PKG_INSTROOT" ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.preinst
+ rm ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.preinst
+ fi
+ tar -xzpf $2 -C ${PKG_INSTROOT}
+ if [ -x ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.postinst ]; then
+ IPKG_INSTROOT="$PKG_INSTROOT" ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.postinst
+ rm ${PKG_INSTROOT}/usr/lib/pkg/${pkg}.postinst
+ fi
+ rm -rf ${PKG_INSTROOT}/usr/lib/pkg
+else
+ echo "unknown command"
+ exit 1
+fi
diff --git a/scripts/tsort b/scripts/tsort
new file mode 100755
index 000000000..d4b176f6f
--- /dev/null
+++ b/scripts/tsort
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+os=$(uname)
+case $os in
+ NetBSD|MirBSD|OpenBSD)
+ /usr/bin/tsort -r
+ ;;
+ *)
+ /usr/bin/tsort | tac
+ ;;
+esac