Hi,

I'm working on getting rdiff-backup running from an OE build and have
two python related issues that I thought I'd ask about.

First is that rdiff-backup requires UserList from the python
distribution but UserList is not in any of the python packages. For
now I've patched the manifest to add a separate package for it (see
patches below). That gets it to the point where I can run
rdiff-backup, but the manifest file says it is auto-generated and I'm
not convinced it deserves it's own package. Perhaps it'd be best to
raise a bug requesting that UserList is added to the installable
packages for python?

The second issues is that when using the standard do_compile from
distutils class the application ends up like this on the target:

 [EMAIL PROTECTED]:/# head -1 /usr/bin/rdiff-backup
 #!/data/oe/build/titan-glibc/tmp/staging/x86_64-linux/bin/python

which isn't very useful since that's not where python gets installed
on the target. For now I've done this:

+do_compile() {
+    BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+    ${STAGING_BINDIR}/python setup.py build --executable=/usr/bin/python || \
+    oefatal "python setup.py build execution failed."
+}

which fixes it, but doesn't really seem to be the correct thing to
do. Has anyone seen this before and/or have a better option for this?

---------------------------------------------------------------------------

Here are my current patches that get rdiff-backup building and
working correctly with glibc for my sh4 based board:

1) Python patch to add a package for userlist:

# 
# old_revision [08d59f8435f64e09bd59fc6ecd800150d983b6de]
# 
# patch "packages/python/python-2.4.2-manifest.inc"
#  from [4bba830288d1ccfff5f3f9f2ecd394fc94ae0a07]
#    to [d92210a3d152bac5053e1f3b196a58a38f1ac406]
# 
============================================================
--- packages/python/python-2.4.2-manifest.inc   
4bba830288d1ccfff5f3f9f2ecd394fc94ae0a07
+++ packages/python/python-2.4.2-manifest.inc   
d92210a3d152bac5053e1f3b196a58a38f1ac406
@@ -8,8 +8,13 @@
 
########################################################################################################################
  
 
-PACKAGES="python-threading python-distutils python-textutils python-codecs 
python-pickle python-datetime python-core python-io python-compiler 
python-compression python-re python-xmlrpc python-terminal python-email 
python-image python-resource python-devel python-math python-hotshot 
python-unixadmin python-tkinter python-gdbm python-fcntl python-netclient 
python-pprint python-netserver python-curses python-syslog python-html 
python-readline python-pydoc python-logging python-xml python-mime python-tests 
python-unittest python-stringold python-lib-old-and-deprecated python-compile 
python-shell python-bsddb python-mmap python-zlib python-db python-crypt 
python-idle python-lang python-audio "
+PACKAGES="python-threading python-distutils python-textutils python-codecs 
python-pickle python-datetime python-core python-io python-compiler 
python-compression python-re python-xmlrpc python-terminal python-email 
python-image python-resource python-devel python-math python-hotshot 
python-unixadmin python-tkinter python-gdbm python-fcntl python-netclient 
python-pprint python-netserver python-curses python-syslog python-html 
python-readline python-pydoc python-logging python-xml python-mime python-tests 
python-unittest python-stringold python-lib-old-and-deprecated python-compile 
python-shell python-bsddb python-mmap python-zlib python-db python-crypt 
python-idle python-lang python-audio python-userlist"
 
+DESCRIPTION_python-userlist="Python UserList"
+PR_python-userlist="ml1"
+RDEPENDS_python-userlist="python-core"
+FILES_python-userlist="${libdir}/python2.4/UserList.*"
+
 DESCRIPTION_python-threading="Python Threading & Synchronization Support"
 PR_python-threading="ml1"
 RDEPENDS_python-threading="python-core python-lang"


2) Patch to add librsync which rdiff-backup needs:

# 
# old_revision [08d59f8435f64e09bd59fc6ecd800150d983b6de]
# 
# add_file "packages/librsync/librsync_0.9.7.bb"
# 
# patch "packages/librsync/librsync_0.9.7.bb"
#  from []
#    to [aa3663b511d29a15a3153d0798a93e1e2c121da3]
# 
============================================================
--- packages/librsync/librsync_0.9.7.bb 
+++ packages/librsync/librsync_0.9.7.bb aa3663b511d29a15a3153d0798a93e1e2c121da3
@@ -0,0 +1,23 @@
+DESCRIPTION = "librsync is a free software library that implements the rsync \
+remote-delta algorithm. This algorithm allows efficient remote updates of a \
+file, without requiring the old and new versions to both be present at the \
+sending end."
+SECTION = "libs"
+LICENSE = "LGPL"
+PR = "r0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/librsync/librsync-${PV}.tar.gz"
+
+inherit autotools pkgconfig
+
+PARALLEL_MAKE = ""
+EXTRA_OECONF = "--disable-build-docs --enable-shared "
+
+do_stage() {
+       oe_libinstall -a -so -C .libs librsync ${STAGING_LIBDIR}
+        install -d ${STAGING_INCDIR}/
+        for X in librsync.h librsync-config.h
+        do
+                install -m 0644 ${S}/$X ${STAGING_INCDIR}/$X
+        done
+}


3) Patch to add rdiff-backup - this needs the new python package and librsync

# 
# old_revision [08d59f8435f64e09bd59fc6ecd800150d983b6de]
# 
# add_file "packages/rdiff-backup/rdiff-backup_1.0.4.bb"
# 
# patch "packages/rdiff-backup/rdiff-backup_1.0.4.bb"
#  from []
#    to [08387b05facd99a682d9a3d11ac1b0ff0f2bf979]
# 
============================================================
--- packages/rdiff-backup/rdiff-backup_1.0.4.bb 
+++ packages/rdiff-backup/rdiff-backup_1.0.4.bb 
08387b05facd99a682d9a3d11ac1b0ff0f2bf979
@@ -0,0 +1,42 @@
+DESCRIPTION = "A python application that backs up one directory to \
+another, possibly over a network. It combines the best features of a \
+mirror and an incremental backup. The target directory ends up a copy \
+of the source directory, but extra reverse diffs are stored in a \
+special subdirectory of that target directory, so you can still \
+recover files lost some time ago. It is also able to preserve \
+subdirectories, hard links, dev files, permissions, uid/gid \
+ownership, modification times, extended attributes, acls, and \
+resource forks."
+SECTION = "admin"
+PRIORITY = "optional"
+LICENSE = "GPL"
+DEPENDS = "librsync"
+RDEPENDS_${PN} = "python-re python-io python-lang python-datetime 
python-pickle \
+                 python-shell python-compression python-unixadmin 
python-netclient \
+                 python-userlist"
+PR = "r0"
+
+SRC_URI = 
"http://savannah.nongnu.org/download/rdiff-backup/rdiff-backup-${PV}.tar.gz";
+
+inherit distutils
+
+#
+# Without this the python interpreter path points to the installed python
+# interpretter in the build area...
+#
+do_compile() {
+    BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+    ${STAGING_BINDIR}/python setup.py build --executable=/usr/bin/python || \
+    oefatal "python setup.py build execution failed."
+}
+
+#
+# The default do_install sets install-data to ${D}/${datadir} which ends up
+# with documentation in /usr/share/share/... instead of /usr/share/...
+# Modify the install data directory here to get it into the correct place.
+#
+do_install() {
+    BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+    ${STAGING_BINDIR}/python setup.py install --prefix=${D}/${prefix} 
--install-data=${D}/${prefix} || \
+    oefatal "python setup.py install execution failed."
+}


-- 
 Jamie Lenehan <[EMAIL PROTECTED]>
_______________________________________________
Oe mailing list
[email protected]
https://www.handhelds.org/mailman/listinfo/oe

Reply via email to