{"id":862,"date":"2016-04-19T16:44:46","date_gmt":"2016-04-19T14:44:46","guid":{"rendered":"http:\/\/hobbykeller.spdns.de\/?p=862"},"modified":"2016-04-19T20:29:37","modified_gmt":"2016-04-19T18:29:37","slug":"compiling-duplicity-for-openwrt","status":"publish","type":"post","link":"https:\/\/hobbykeller.spdns.de\/?p=862","title":{"rendered":"Compiling duplicity for OpenWRT"},"content":{"rendered":"<p>A couple of months ago, I already presented a method to <a href=\"http:\/\/hobbykeller.spdns.de\/?p=654\" target=\"_blank\">compile duplicity for OpenWRT<\/a>. With the release of oWRT&#8217;s Chaos Calmer, a few of the major obstacles have disappeared, while a couple of new but minor problems have come up. Here is how duplicity is compiled for the Chaos Calmer release.<\/p>\n<p><!--more--><\/p>\n<h1>No more patching<\/h1>\n<p>One of the main problems with duplicity under the Barrier Breaker buildroot was that it lacked the <code>python-setuptools<\/code> package which duplicity&#8217;s <code>setup.py<\/code> imports. The workaround was to patch the <code>setup.py<\/code> file in a way that all references to setuptools were replaced by the older distutils package.<\/p>\n<p>The good news is: The Chaos Calmer release now ships with <code>python-setuptools<\/code> &#8211; no need for patches any longer. We can therefore delete the patc subdirectory from the <code>~\/myowrt\/custpacks\/duplicity<\/code> directory.<\/p>\n<h1>Update Makefile<\/h1>\n<p>Bump up <code>PKG_VERSION<\/code>, <code>PKG_SOURCE_URL<\/code> and <code>PKG_MD5SUM<\/code> to the most recent release (as of writing, this is version <code>0.7.07<\/code>).<\/p>\n<p>Update the <code>DEPENDS<\/code> variable as follows:<\/p>\n<pre class=\"lang:default decode:true\" title=\"duplicity Makefile maintenace\">DEPENDS:=+python +librsync +gnupg +python-setuptools<\/pre>\n<p>This means that we drop the <code>python-expat<\/code> and <code>lockfile<\/code> modules from our previous Barrier Breaker <code>Makefile<\/code>.<\/p>\n<p>As fas as <code>python-expat<\/code> is concerned, it has been dropped from the Chaos Calmer package support, so we cannot list it as depends. This isn&#8217;t any problem though because the shared library which duplicity needs is already provided by\u00a0<code>python-xml<\/code> (worth a thought whether we put this package into the <code>DEPENS<\/code> variable).<\/p>\n<p><code>lockfile<\/code> is a bit more tricky as it is a Python import which is invoked when running duplicity &#8211; but it is not needed for compilation. This is why we can &#8220;cheat&#8221; ourselves around this dependency by later running <code><\/code><code>easy_install lockfile<\/code> on the router (<code>pip install lockfile<\/code><code> <\/code>does not seem to work) before installing our duplicity package. The problem with <code>easy_install<\/code> is that it only registers the modules in the local Python installation &#8211; and not in <code>opkg<\/code>&#8216;s directory of installed packages. Therefore if duplicity checks for its installation depends it will not find the <code>lockfile<\/code> module even if it was installed. It is for that reason that we remove the <code>lockfile<\/code> entry from the depends list. The cleanest way would be to come up with a separate Python lockfile module which is installed by (and therefore later visible to) <code>opkg<\/code>.<\/p>\n<h1>Adapt files\/setup.cfg.in<\/h1>\n<p>In the duplicity source directory, make sure that <code>files\/setup.cfg,in<\/code> looks like that:<\/p>\n<pre class=\"lang:default decode:true \" title=\"setup.cfg template for duplicity\">[build_ext]\r\ndefine=\r\ninclude_dirs=@INCLUDE_DIRS@\r\nlibrary_dirs=@LIBRARY_DIRS@<\/pre>\n<h1>Get librsync<\/h1>\n<p>Now for the tricky part: duplicity will only compile if <code>librsync<\/code> headers are provided, but <code>librsync<\/code> package maintenance was also abandoned with the Chaos Calmer release. The cheapest way to cheat around this depend is to copy the <code>librsync <\/code>feed from the oldpackages\/libs directory of the Barrier Breaker buildroot to the custom packages. This will provide <code>librsync<\/code> in version 0.9.7 &#8211; enough until we find a way to compile the recent 2.0 release of <code>librsync<\/code>.<\/p>\n<h1>Compile and install<\/h1>\n<p>We are now ready to compile the package. Launch\u00a0 on your workstation and M-select the duplicity package. This should also select all dependencies at compile time. Check if <code>librsync<\/code> in the Libraries section has also been M-selected. Save the new menuconfig and start the compilation process:<\/p>\n<pre class=\"lang:default decode:true \" title=\"Compile command for duplicity\">ilek@i7:~\/codelab\/openwrt$ make package\/duplicity\/compile<\/pre>\n<p>Transfer the <code>ipk<\/code>-packages to your router and make a manual install with opkg.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of months ago, I already presented a method to compile duplicity for OpenWRT. With the release of oWRT&#8217;s Chaos Calmer, a few of the major obstacles have disappeared,<span class=\"more-button\"><a href=\"https:\/\/hobbykeller.spdns.de\/?p=862\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\">Compiling duplicity for OpenWRT<\/span><\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[64,16],"tags":[172,171,150,170,117,17,122],"class_list":["post-862","post","type-post","status-publish","format-standard","hentry","category-linux","category-openwrt","tag-15-05","tag-buildroot","tag-chaos-calmer","tag-compile","tag-duplicity","tag-openwrt","tag-python-setuptools"],"_links":{"self":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=862"}],"version-history":[{"count":4,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/862\/revisions"}],"predecessor-version":[{"id":866,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=\/wp\/v2\/posts\/862\/revisions\/866"}],"wp:attachment":[{"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hobbykeller.spdns.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}