diff options
-rwxr-xr-x | scripts/make_deb.sh | 60 |
1 files changed, 47 insertions, 13 deletions
diff --git a/scripts/make_deb.sh b/scripts/make_deb.sh index 32625f4..a744a83 100755 --- a/scripts/make_deb.sh +++ b/scripts/make_deb.sh @@ -32,27 +32,61 @@ main() { rm -rf "${debian_tmp}" fi - mkdir -p "${debian_tmp}/DEBIAN" + mkdir -p "${debian_tmp}"/{tmp,debian} - cat <<EOF > "${debian_tmp}/DEBIAN/control" -Package: ${package} -Version: ${version} -Priority: optional -Architecture: ${arch} -Essential: no -Section: devel + cat <<EOF > "${debian_tmp}/debian/control" +Source: oselas.toolchain Maintainer: Pengutronix <ptxdist@pengutronix.de> -Description: ${package} -Origin: pengutronix.de +Uploaders: $(git config user.name) <$(git config user.email)> +Section: devel +Priority: optional +Origin: pengutronix Homepage: http://www.pengutronix.de/oselas/toolchain/ Bugs: mailto:bugs@pengutronix.de + +Package: ${package} +Architecture: ${arch} +Depends: \${shlibs:Depends} +Description: ${package} +EOF + cat <<EOF > "${debian_tmp}/debian/changelog" +oselas.toolchain (${version}) unstable; urgency=low + + * New upstream release. + + -- $(git config user.name) <$(git config user.email)> $(date -R) +EOF + cat <<EOF > "${debian_tmp}/debian/compat" +9 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}" --exclude=gcc-first -c "${prefix}" | tar -C "${debian_tmp}" -x + echo "Copy data..." + tar -C "${destdir}" --exclude=gcc-first -c "${prefix}" | tar -C "${debian_tmp}/tmp" -x + + ( + cd "${debian_tmp}" + + # generate dependencies + echo "Generate dependencies..." + local sysroot="$(ptxd_get_ptxconf PTXCONF_SYSROOT_TARGET)" + sysroot="${debian_tmp}/tmp${sysroot#${PTX_AUTOBUILD_DESTDIR}}" + local other="$(ptxd_get_ptxconf PTXCONF_SYSROOT_CROSS)" + other="${debian_tmp}/tmp${other#${PTX_AUTOBUILD_DESTDIR}}/$(ptxd_get_ptxconf PTXCONF_GNU_TARGET)" + + fakeroot dh_shlibdeps \ + -P"${debian_tmp}/tmp" \ + -l"${sysroot}/lib:${sysroot}/usr/lib:${sysroot}/usr/lib/gconv:${other}/lib" \ + -- \ + -T"${debian_tmp}/substvars" && + + # generate DEBIAN/control + dpkg-gencontrol \ + -P"${debian_tmp}/tmp" \ + -T"${debian_tmp}/substvars" + ) || exit # make a deb out of it - echo dpkg-deb --build -Zxz "${debian_tmp}" "${deb}" | fakeroot + echo dpkg-deb --build -Zxz "${debian_tmp}/tmp" "${deb}" | fakeroot rm -rf "${debian_tmp}" } |