From: Felipe Contreras Date: Mon, 15 Apr 2013 01:19:03 +0000 (+1900) Subject: Re: [PATCH] debian: package ruby bindings X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bb08a54b5bf82ca52b1934df4374faef21b842f7;p=notmuch-archives.git Re: [PATCH] debian: package ruby bindings --- diff --git a/64/f90df514d3ff5222c0105c9dd04fd273723bc5 b/64/f90df514d3ff5222c0105c9dd04fd273723bc5 new file mode 100644 index 000000000..7189e8c68 --- /dev/null +++ b/64/f90df514d3ff5222c0105c9dd04fd273723bc5 @@ -0,0 +1,230 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id BC0BB431FB6 + for ; Sun, 14 Apr 2013 18:19:06 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id B8IxPd-IofvC for ; + Sun, 14 Apr 2013 18:19:06 -0700 (PDT) +Received: from mail-la0-f41.google.com (mail-la0-f41.google.com + [209.85.215.41]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id A9D23431FAF + for ; Sun, 14 Apr 2013 18:19:05 -0700 (PDT) +Received: by mail-la0-f41.google.com with SMTP id er20so3953323lab.0 + for ; Sun, 14 Apr 2013 18:19:04 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=mime-version:x-received:in-reply-to:references:date:message-id + :subject:from:to:cc:content-type; + bh=jIjU4PxLgaJ4TzQ1xQLu/gdNvzWAWDTwt6Yv/VADsg8=; + b=awOtLKUWkm5BmMTPP2lk6CfIgdyHiQpk+Ds+A03UNsO8FBEPoZUbcWwXiQBvs/R3W7 + wv+1ZycTtmjWSPRuuZtllCkg4tGLa2dmUb1wBn1ArKR+mtnA8zs5XmE+gLAevOpLhuyH + InfDo2RMLjc7WuX7lpWEQtLHcN4kureZYY5TA9+ndq0M8AMZJT+z5BBoLcRf/T9/Kft7 + mxodpshZTYbDA/jDjWuoKCgTibkNpERcV/SMkJtA42Jqgj44bCBChhMqBOjsnhA1Wdlq + L4+QxEFJ4R4vMsu0iLdshOzO/J71z4c0N6GjeEZh82u3RNxHJkT2yCKy2qHA+CRWU/rZ + LEYg== +MIME-Version: 1.0 +X-Received: by 10.152.5.134 with SMTP id s6mr4492192las.24.1365988744109; Sun, + 14 Apr 2013 18:19:04 -0700 (PDT) +Received: by 10.114.59.210 with HTTP; Sun, 14 Apr 2013 18:19:03 -0700 (PDT) +In-Reply-To: <87y5clte1j.fsf@zancas.localnet> +References: <1365031678-25188-1-git-send-email-felipe.contreras@gmail.com> + <87y5clte1j.fsf@zancas.localnet> +Date: Sun, 14 Apr 2013 20:19:03 -0500 +Message-ID: + +Subject: Re: [PATCH] debian: package ruby bindings +From: Felipe Contreras +To: David Bremner +Content-Type: text/plain; charset=UTF-8 +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 15 Apr 2013 01:19:06 -0000 + +On Sun, Apr 14, 2013 at 8:52 AM, David Bremner wrote: +> Felipe Contreras writes: +> +>> +>> diff --git a/debian/control b/debian/control +>> index 854a32a..620c5ce 100644 +>> --- a/debian/control +>> +++ b/debian/control +>> @@ -15,6 +15,7 @@ Build-Depends: +>> libz-dev, +>> python-all (>= 2.6.6-3~), +>> python3-all (>= 3.1.2-7~), +>> + ruby-dev, +>> emacs23-nox | emacs23 (>=23~) | emacs23-lucid (>=23~) | +>> emacs24-nox | emacs24 (>=24~) | emacs24-lucid (>=24~), +>> gdb, +> +> This doesn't build in a clean sid chroot, because ruby-dev does not +> depend on ruby, so you need to explicitly add it. + +Right, I just found that too. + +>> Package: notmuch-emacs +>> Architecture: all +>> Section: mail +>> diff --git a/debian/notmuch-ruby.install b/debian/notmuch-ruby.install +>> new file mode 100644 +>> index 0000000..f92f09c +>> --- /dev/null +>> +++ b/debian/notmuch-ruby.install +>> @@ -0,0 +1 @@ +>> +usr/local/lib/site_ruby/*/*/notmuch.so +>> diff --git a/debian/rules b/debian/rules +>> index c4e3930..7c7247a 100755 +>> --- a/debian/rules +>> +++ b/debian/rules +>> @@ -12,15 +12,24 @@ override_dh_auto_build: +>> dh_auto_build +>> dh_auto_build --sourcedirectory bindings/python +>> cd bindings/python && $(python3_all) setup.py build +>> + dh_auto_build --sourcedirectory bindings/ruby +>> + cd bindings/ruby && ruby extconf.rb && make +> +> Why are both these lines needed? + +The first one isn't. + +> On a related note, is the ruby build +> procedure documented somewhere? + +Not really, it's just standard. + +>> override_dh_auto_clean: +>> dh_auto_clean +>> dh_auto_clean --sourcedirectory bindings/python +>> cd bindings/python && $(python3_all) setup.py clean -a +>> + dh_auto_build --sourcedirectory bindings/ruby +>> + cd bindings/ruby && test -f Makefile && make clean || true +>> $(MAKE) -C contrib/notmuch-mutt clean +> +> This looks suspect, calling dh_auto_build from the clean target. + +A mistake, probably the first line is enough. + +> The +> clean target cannot assume that e.g. notmuch is already built. + +It doesn't, that's what the 'test -f Makefile' was for. + +>> override_dh_auto_install: +>> dh_auto_install +>> dh_auto_install --sourcedirectory bindings/python +>> cd bindings/python && $(python3_all) setup.py install --install-layout=deb --root=$(CURDIR)/debian/tmp +>> + dh_auto_build --sourcedirectory bindings/ruby +>> + cd bindings/ruby && make install DESTDIR=$(CURDIR)/debian/tmp +> +> This call to dh_auto_build also confuses me. The top level sequencer +> will ensure that the override_dh_auto_build is called before this one. + +A mistake. + +>> + +>> +# ruby's site is configured in /usr/local +>> +override_dh_usrlocal: +> +> The package is still installing files into /usr/local, which is a +> violation of debian policy 9.1.2 +> +> It's a good idea to run "lintian" on the resulting debian packages; +> that's how I caught the problem with /usr/local. + +Tell that to debian maintainers who configure ruby that way: + +require 'rbconfig' +RbConfig::CONFIG['sitelibdir'] +=> "/usr/local/lib/site_ruby/1.9.1" +RbConfig::CONFIG['configure_args'] +=> " '--build=x86_64-linux-gnu' '--prefix=/usr' +'--includedir=/usr/include' '--mandir=/usr/share/man' +'--infodir=/usr/share/info' '--sysconfdir=/etc' '--localstatedir=/var' +'--libexecdir=/usr/lib/ruby1.9.1' '--srcdir=.' +'--disable-maintainer-mode' '--disable-dependency-tracking' +'--disable-silent-rules' '--enable-pthread' '--enable-shared' +'--disable-rpath' '--disable-install-doc' +'--with-vendordir=/usr/lib/ruby/vendor_ruby' +'--with-sitedir=/usr/local/lib/site_ruby' '--program-suffix=1.9.1' +'--with-soname=ruby-1.9.1' '--with-baseruby=/usr/bin/ruby1.8' +'--enable-ipv6' '--with-dbm-type=gdbm_compat' '--with-tklib=tk8.5' +'--with-tcllib=tcl8.5' '--with-tcl-include=/usr/include/tcl8.5' +'--with-bundled-sha1' '--with-bundled-md5' '--with-bundled-rmd160' +'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector +--param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall +-fno-strict-aliasing' 'LDFLAGS=-Wl,-z,relro' +'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector +--param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall +-fno-strict-aliasing'" + +So, the changes I propose are: + +--- b/debian/control ++++ a/debian/control +@@ -15,7 +15,7 @@ Build-Depends: + libz-dev, + python-all (>= 2.6.6-3~), + python3-all (>= 3.1.2-7~), +- ruby-dev, ++ ruby, ruby-dev, + emacs23-nox | emacs23 (>=23~) | emacs23-lucid (>=23~) | + emacs24-nox | emacs24 (>=24~) | emacs24-lucid (>=24~), + gdb, +diff --git b/debian/rules a/debian/rules +index 7c7247a..1dd59d2 100755 +--- b/debian/rules ++++ a/debian/rules +@@ -12,7 +12,6 @@ override_dh_auto_build: + dh_auto_build + dh_auto_build --sourcedirectory bindings/python + cd bindings/python && $(python3_all) setup.py build +- dh_auto_build --sourcedirectory bindings/ruby + cd bindings/ruby && ruby extconf.rb && make + $(MAKE) -C contrib/notmuch-mutt + +@@ -20,16 +19,14 @@ override_dh_auto_clean: + dh_auto_clean + dh_auto_clean --sourcedirectory bindings/python + cd bindings/python && $(python3_all) setup.py clean -a +- dh_auto_build --sourcedirectory bindings/ruby +- cd bindings/ruby && test -f Makefile && make clean || true ++ dh_auto_clean --sourcedirectory bindings/ruby + $(MAKE) -C contrib/notmuch-mutt clean + + override_dh_auto_install: + dh_auto_install + dh_auto_install --sourcedirectory bindings/python + cd bindings/python && $(python3_all) setup.py install +--install-layout=deb --root=$(CURDIR)/debian/tmp +- dh_auto_build --sourcedirectory bindings/ruby +- cd bindings/ruby && make install DESTDIR=$(CURDIR)/debian/tmp ++ dh_auto_install --sourcedirectory bindings/ruby + + # ruby's site is configured in /usr/local + override_dh_usrlocal: + +Cheers. + +-- +Felipe Contreras