summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2008-12-16 16:04:00 +0000
committerMarc Kleine-Budde <mkl@pengutronix.de>2008-12-16 16:04:00 +0000
commit3b201a09eeb40a246eeeb62442c6934d8e41713f (patch)
tree5d152168727e6436a9ca755e29c17f8548e2d377
parentefacffac58fd89549c0507c0ef67cae97f42860b (diff)
downloadOSELAS.Toolchain-3b201a09eeb40a246eeeb62442c6934d8e41713f.tar.gz
* scripts/make_deb.sh:
add debian package generater script git-svn-id: https://svn.pengutronix.de/svn/oselas/toolchain/trunks/OSELAS.Toolchain-trunk@8649 f8d472c7-5700-0410-ac5a-87979cec3adf
-rwxr-xr-xscripts/make_deb.sh59
1 files changed, 59 insertions, 0 deletions
diff --git a/scripts/make_deb.sh b/scripts/make_deb.sh
new file mode 100755
index 0000000..a89c7ca
--- /dev/null
+++ b/scripts/make_deb.sh
@@ -0,0 +1,59 @@
+#!/bin/bash -x
+
+main() {
+ while getopts "d:s:" opt; do
+ case "${opt}" in
+ d)
+ local deb="${OPTARG}"
+ ;;
+ s)
+ local src="${OPTARG}"
+ esac
+ done
+
+ if [ -z "${deb}" -o -z "${src}" ]; then
+ exit 1
+ fi
+
+ local ifs_orig="${IFS}"
+ IFS="_"
+ set -- ${deb}
+ IFS="${ifs_orig}"
+
+ local package="${1##*/}"
+ local inst="${1%${package}}"
+ local version="${2}"
+ local arch="${3%%.deb}"
+
+ local prefix="opt/${src##*/opt/}"
+ local destdir="${src%${prefix}}"
+ local debian_tmp="${inst}/${package}-temp"
+ if [ -e "${debian_tmp}" ]; then
+ rm -rf "${debian_tmp}"
+ fi
+
+ mkdir -p "${debian_tmp}/DEBIAN"
+
+ cat <<EOF > "${debian_tmp}/DEBIAN/control"
+Package: ${package}
+Version: ${version}
+Priority: optional
+Architecture: ${arch}
+Essential: no
+Maintainer: Pengutronix <ptxdist@pengutronix.de>
+Description: ${package}
+EOF
+#Depends: autoconf, automake, libtool, flex, bison, gcc, g++, python-dev, libncurses5-dev, gawk, pkg-config, make, diff, patch, quilt
+ # copy data
+ tar -C "${destdir}" -c "${prefix}" | tar -C "${debian_tmp}" -x
+
+ # make a deb out of it
+ echo dpkg -b "${debian_tmp}" "${deb}" | fakeroot
+
+ exit 1
+ rm -rf "${debian_tmp}"
+}
+
+
+main "${@}"
+exit $?