From fced57e5ddb9fc65fc56e5efe62c897e219d3759 Mon Sep 17 00:00:00 2001 From: Rene Wagner Date: Tue, 1 Aug 2006 23:35:51 +0200 Subject: [PATCH] gnupg: add 1.4.3-2 from Debian. Signed-off-by: Rene Wagner --- org.handhelds.familiar/classes/base.bbclass | 6 ++ .../classes/debian-vampyre.bbclass | 72 ++++++++++++++++++- .../classes/package_ipk.bbclass | 8 +-- .../packages/gnupg/gnupg_1.4.3-2.bb | 20 ++++++ 4 files changed, 100 insertions(+), 6 deletions(-) create mode 100644 org.handhelds.familiar/packages/gnupg/gnupg_1.4.3-2.bb diff --git a/org.handhelds.familiar/classes/base.bbclass b/org.handhelds.familiar/classes/base.bbclass index 66563f3..e270ffd 100644 --- a/org.handhelds.familiar/classes/base.bbclass +++ b/org.handhelds.familiar/classes/base.bbclass @@ -446,6 +446,7 @@ python base_do_patch() { bb.build.exec_func("do_patchcleancmd", d) workdir = bb.data.getVar('WORKDIR', d, 1) + i = 0 for url in src_uri: (type, host, path, user, pswd, parm) = bb.decodeurl(url) @@ -479,6 +480,11 @@ python base_do_patch() { bb.data.setVarFlag("do_patchcmd", "func", 1, d) bb.data.setVarFlag("do_patchcmd", "dirs", "${WORKDIR} ${S}", d) bb.build.exec_func("do_patchcmd", d) + + if bb.data.getVar("patch_applied", d): + bb.data.setVar("PATCH_APPLIED_NUM", i, d) + bb.build.exec_func("patch_applied", d) + i += 1 } diff --git a/org.handhelds.familiar/classes/debian-vampyre.bbclass b/org.handhelds.familiar/classes/debian-vampyre.bbclass index a7bb6a5..f00965f 100644 --- a/org.handhelds.familiar/classes/debian-vampyre.bbclass +++ b/org.handhelds.familiar/classes/debian-vampyre.bbclass @@ -10,9 +10,77 @@ PR = "${@(bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[1] or '1 DEBIAN_ARCHIVE ?= "main" DEBIAN_BASE_URI = "${DEBIAN_MIRROR}/${DEBIAN_ARCHIVE}/${@bb.data.getVar('PN', d, 1)[0]}/${PN}" -SRC_URI = "${DEBIAN_BASE_URI}/${PN}_${PV}.orig.tar.gz \ - ${DEBIAN_BASE_URI}/${PN}_${PV}-${PR}.diff.gz;patch=1" +SRC_URI_prepend = "${DEBIAN_BASE_URI}/${PN}_${PV}.orig.tar.gz \ + ${DEBIAN_BASE_URI}/${PN}_${PV}-${PR}.diff.gz;patch=1 " +python do_dpatch () { + plist = (base_read_file("%s/debian/patches/00list" % bb.data.getVar("S", d, 1)) or "").split() + for p in plist: + bb.note("Applying patch '%s'" % p) + bb.data.setVar("do_patchcmd", bb.data.getVar("PATCHCMD", d, 1) % (1, p, "${S}/debian/patches/%s.dpatch" % p), d) + bb.data.setVarFlag("do_patchcmd", "func", 1, d) + bb.data.setVarFlag("do_patchcmd", "dirs", "${WORKDIR} ${S}", d) + bb.build.exec_func("do_patchcmd", d) +} + +python patch_applied() { + if bb.data.getVar("PATCH_APPLIED_NUM", d, 1) != 0: + return + + import os + import os.path + + dpatch = False + try: + os.stat(os.path.join(bb.data.getVar("S", d, 1), "debian", "patches", "00list")) + dpatch = True + except Exception, e: + pass + + if dpatch: + bb.event.fire(bb.build.TaskStarted("do_dpatch", d)) + bb.build.exec_func("do_dpatch", d) + bb.event.fire(bb.build.TaskSucceeded("do_dpatch", d)) +} + +def parse_control(bbvar, field, d): + import bb + import re + + readable = False + try: + control = (base_read_file("%s/debian/control" % bb.data.getVar("S", d, 1)) or "").split("\n") + readable = True + except Exception, e: + pass + + if readable: + pkg = None + r = re.compile("([a-zA-Z]*): (.*)$") + + fields = {} + for line in control: + m = r.match(line) + if m: + if m.group(1) == "Package": + pkg = m.group(2) + if not pkg or pkg == bb.data.getVar("PN", d, 1): + fields[m.group(1)] = m.group(2) + if fields.has_key(field): + return fields[field] + + return "" + +def flatten(s): + return ' '.join(s.split(',')) + +DESCRIPTION = "${@parse_control('DESCRIPTION', 'Description', d)}" +SECTION = "${@parse_control('SECTION', 'Section', d)}" +PRIORITY = "${@parse_control('PRIORITY', 'Priority', d)}" +RCONFLICTS_${PN} = "${@flatten(parse_control('RCONFLICTS', 'Conflicts', d))}" +RREPLACES_${PN} = "${@flatten(parse_control('RREPLACES', 'Replaces', d))}" +RPROVIDES_${PN} = "${@flatten(parse_control('RPROVIDES', 'Provides', d))}" + do_install_append () { mkdir -p ${D}${datadir}/doc/${PN} rm -f ${D}${datadir}/doc/${PN}/changelog.Debian* diff --git a/org.handhelds.familiar/classes/package_ipk.bbclass b/org.handhelds.familiar/classes/package_ipk.bbclass index 6d3e1eb..568d216 100644 --- a/org.handhelds.familiar/classes/package_ipk.bbclass +++ b/org.handhelds.familiar/classes/package_ipk.bbclass @@ -168,10 +168,10 @@ python do_package_ipk () { # more fields rdepends = explode_deps(bb.data.getVar("RDEPENDS", localdata, 1) or "") rrecommends = explode_deps(bb.data.getVar("RRECOMMENDS", localdata, 1) or "") - rsuggests = (bb.data.getVar("RSUGGESTS", localdata, 1) or "").split() - rprovides = (bb.data.getVar("RPROVIDES", localdata, 1) or "").split() - rreplaces = (bb.data.getVar("RREPLACES", localdata, 1) or "").split() - rconflicts = (bb.data.getVar("RCONFLICTS", localdata, 1) or "").split() + rsuggests = explode_deps(bb.data.getVar("RSUGGESTS", localdata, 1) or "") + rprovides = explode_deps(bb.data.getVar("RPROVIDES", localdata, 1) or "") + rreplaces = explode_deps(bb.data.getVar("RREPLACES", localdata, 1) or "") + rconflicts = explode_deps(bb.data.getVar("RCONFLICTS", localdata, 1) or "") if rdepends: ctrlfile.write("Depends: %s\n" % ", ".join(rdepends)) if rsuggests: diff --git a/org.handhelds.familiar/packages/gnupg/gnupg_1.4.3-2.bb b/org.handhelds.familiar/packages/gnupg/gnupg_1.4.3-2.bb new file mode 100644 index 0000000..4b7dc44 --- /dev/null +++ b/org.handhelds.familiar/packages/gnupg/gnupg_1.4.3-2.bb @@ -0,0 +1,20 @@ +LICENSE = "GPLv2" +DEPENDS = "zlib bzip2" +DEPENDS += "readline" + +inherit autotools gettext debian-vampyre + +EXTRA_OECONF = "--disable-ldap \ + --with-zlib=${STAGING_LIBDIR}/.. \ + --with-bzip2=${STAGING_LIBDIR}/.. \ + --disable-selinux-support" +EXTRA_OECONF += "--with-readline=${STAGING_LIBDIR}/.." +# --without-readline do not support fancy command line editing + +do_install () { + autotools_do_install + install -d ${D}${docdir}/${PN} + mv ${D}${datadir}/${PN}/* ${D}/${docdir}/${PN}/ || : + mv ${D}${prefix}/doc/* ${D}/${docdir}/${PN}/ || : +} + -- 2.41.1