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)
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
}
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*
# 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:
--- /dev/null
+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}/ || :
+}
+