Merge lp:~yolanda.robla/ubuntu/trusty/couchdb/add_distribution into lp:ubuntu/trusty/couchdb

Proposed by Yolanda Robla
Status: Rejected
Rejected by: Iain Lane
Proposed branch: lp:~yolanda.robla/ubuntu/trusty/couchdb/add_distribution
Merge into: lp:ubuntu/trusty/couchdb
Diff against target: 134 lines (+58/-3)
8 files modified
.pc/applied-patches (+1/-0)
debian/changelog (+8/-0)
debian/control (+3/-0)
debian/patches/fix-distribution.patch (+38/-0)
debian/patches/series (+1/-0)
debian/rules (+1/-1)
etc/couchdb/Makefile.am (+4/-0)
etc/couchdb/default.ini.tpl.in (+2/-2)
To merge this branch: bzr merge lp:~yolanda.robla/ubuntu/trusty/couchdb/add_distribution
Reviewer Review Type Date Requested Status
Dave Cottlehuber (community) Needs Fixing
James Page Pending
Ubuntu branches Pending
Review via email: mp+195788@code.launchpad.net

Description of the change

Show distribution in welcome message

To post a comment you must log in.
Revision history for this message
Dave Cottlehuber (skunkwerks) wrote :

Hi Yolanda,

Great idea -- luckily CouchDB already provides functionality to do this without needing an erlang patch;

You should use the dict `vendor` option and store this in the default.ini file. There are name and version files specifically for that.

# $SOURCE/etc/couchdb/default.ini.tpl.in
[vendor]
name = Ubuntu
version = Trusty 14.04

Obviously you have a better idea of what these fields should be than me.

You should get something like this back after installing CouchDB:

GET / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate, compress
Content-Type: application/json; charset=utf-8
Host: localhost:5984
User-Agent: HTTPie/0.8.0-dev

HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Length: 145
Content-Type: application/json
Date: Sat, 30 Nov 2013 21:14:03 GMT
Server: CouchDB/1.5.0 (Erlang OTP/R16B02)

{
    "couchdb": "Welcome",
    "version": "1.5.0"
    "uuid": "24ca0e5e74a4e40356e498dcfb0575b1",
    "vendor": {
        "name": "Ubuntu",
        "version": "Trusty-14.04"
    },
}

The UUID entry is unique per couchdb installation, its shown here for completeness but shouldn't be part of the ubuntu package.

A gentle reminder to all reviewers, Apache CouchDB would love to hear more from downstream / packaging teams. We're here to help you help us!

review: Needs Fixing
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Yolada,

I'm working on getting CouchDB 1.5.0 ready for Trusty:
https://code.launchpad.net/~jderose/ubuntu/trusty/couchdb/1.5.0/+merge/197291

And I want to incorporate the improvements you've made here. Could you explain why lsb-release, dh-autoreconf, autoconf-archive are now build dependencies, and why you're using "--with autoreconf" now?

I'm not doubting the correctness, just want to understand why it's being done, so please excuse my ignorance :)

75. By Yolanda Robla

updated vendor to show Ubuntu distribution and release

Revision history for this message
Yolanda Robla (yolanda.robla) wrote :

Hi, thanks for the tip
I already considered that option but I wasn't sure to override the Vendor section. I've updated the patch to show these fields in template, patch looks more cleaner now.

Revision history for this message
Iain Lane (laney) wrote :

Hey Jason & Yolanda; I take it that this merge proposal will be incorporated into the 5.2.0 work linked above and therefore I think I'll obsolete this one as the work will get in via that route.

Thanks for your work here :-)

Revision history for this message
Yolanda Robla (yolanda.robla) wrote :

Hi Iain, Jason
It's ok for me if you incorporate my changes into another merge.

Jason, i added lsb-release as build dependency because that's used for patching the vendor section of the template, by this way we are able to pass the Ubuntu release and distribution into it.

As I patched the input template, now autoreconf is needed to update the final template. That's why I added dh-autoreconf and --with-autoreconf lines.

And autoconf-archive is used because autoreconf was failing if that dependency wasn't present, so I had to add it.

I hope it helps. Best
Yolanda

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Iain,
Yes, my proposed 1.5.0 branch incorporates an equivalent change.

Yolanda,
Thanks for the clarification. So the solution I came up with was to modify etc/couchdb/default.ini.tpl after ./configure is called:
http://bazaar.launchpad.net/~jderose/ubuntu/trusty/couchdb/1.5.0/view/head:/debian/rules

BTW, etc/couchdb/default.ini.tpl isn't in the source tarball, only exists after ./configure is called.

I still seems kinda hacky to me, but I think it's probably about the best we can do currently with the 1.5.0 release. I've been talking to upstream about making this easier. Personally, I think configure should automatically set these values when `lsb_release` is present.

Revision history for this message
Dave Cottlehuber (skunkwerks) wrote :

On 16. Dezember 2013 at 02:42:15, Jason Gerard DeRose (<email address hidden>) wrote:
>
> Iain,
> Yes, my proposed 1.5.0 branch incorporates an equivalent change.
>
> Yolanda,
> Thanks for the clarification. So the solution I came up with was
> to modify etc/couchdb/default.ini.tpl after ./configure
> is called:
> http://bazaar.launchpad.net/~jderose/ubuntu/trusty/couchdb/1.5.0/view/head:/debian/rules
>
> BTW, etc/couchdb/default.ini.tpl isn't in the source tarball,
> only exists after ./configure is called.

I moved this to before ./configure is run:

https://github.com/dch/couchdb-launchpad/blob/master/debian/rules#L7-L8

Which seems better to me as this approach will also work when we build
from git for dailies. What do you think?

> I still seems kinda hacky to me, but I think it's probably about
> the best we can do currently with the 1.5.0 release. I've been
> talking to upstream about making this easier. Personally, I
> think configure should automatically set these values when
> `lsb_release` is present.

My concern with that approach is that its 100% linux specific. We
support Windows, Free & OpenBSD, Solaris, SmartOS etc.

In https://github.com/dch/couchdb-launchpad/blob/master/debian/rules#L9 we should likely add —disable-launchd too.

I think I have a couple of other differences; I need to ship this by Thursday so I hope we can get these trusty & precise versions lined up perfectly!

A+
Dave

Unmerged revisions

75. By Yolanda Robla

updated vendor to show Ubuntu distribution and release

74. By Yolanda Robla

* debian/rules: added autoreconf
* debian/control: added lsb-release, dh-autoreconf, autoconf-archive as dep
* debian/patches/fix-distribution.patch: update to show Ubuntu as distribution

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.pc/applied-patches'
2--- .pc/applied-patches 2013-08-28 16:28:32 +0000
3+++ .pc/applied-patches 2013-12-02 12:12:20 +0000
4@@ -0,0 +1,1 @@
5+fix-distribution.patch
6
7=== modified file 'debian/changelog'
8--- debian/changelog 2013-08-28 16:28:32 +0000
9+++ debian/changelog 2013-12-02 12:12:20 +0000
10@@ -1,3 +1,11 @@
11+couchdb (1.4.0-0ubuntu2) trusty; urgency=low
12+
13+ * debian/rules: added autoreconf
14+ * debian/control: added lsb-release, dh-autoreconf, autoconf-archive as dep
15+ * debian/patches/fix-distribution.patch: update to show Ubuntu as distribution
16+
17+ -- Yolanda Robla <yolanda.robla@canonical.com> Mon, 18 Nov 2013 09:53:34 +0000
18+
19 couchdb (1.4.0-0ubuntu1) saucy; urgency=low
20
21 * New upstream release (LP: #1212481)
22
23=== modified file 'debian/control'
24--- debian/control 2013-08-28 16:28:32 +0000
25+++ debian/control 2013-12-02 12:12:20 +0000
26@@ -22,6 +22,9 @@
27 texlive-latex-extra,
28 texlive-fonts-recommended,
29 texinfo,
30+ lsb-release,
31+ dh-autoreconf,
32+ autoconf-archive
33 Homepage: http://couchdb.apache.org/
34
35 Package: couchdb-common
36
37=== added file 'debian/patches/fix-distribution.patch'
38--- debian/patches/fix-distribution.patch 1970-01-01 00:00:00 +0000
39+++ debian/patches/fix-distribution.patch 2013-12-02 12:12:20 +0000
40@@ -0,0 +1,38 @@
41+Index: couchdb/etc/couchdb/default.ini.tpl.in
42+===================================================================
43+--- couchdb.orig/etc/couchdb/default.ini.tpl.in 2013-12-02 11:29:19.986386103 +0000
44++++ couchdb/etc/couchdb/default.ini.tpl.in 2013-12-02 11:29:19.982386103 +0000
45+@@ -2,8 +2,8 @@
46+
47+ ; Upgrading CouchDB will overwrite this file.
48+ [vendor]
49+-name = %package_author_name%
50+-version = %version%
51++name = %couchdb_so_distribution%
52++version = %couchdb_so_version%
53+
54+ [couchdb]
55+ database_dir = %localstatelibdir%
56+
57+Index: couchdb/etc/couchdb/Makefile.am
58+===================================================================
59+--- couchdb.orig/etc/couchdb/Makefile.am 2013-12-02 11:29:19.986386103 +0000
60++++ couchdb/etc/couchdb/Makefile.am 2013-12-02 11:29:19.982386103 +0000
61+@@ -37,6 +37,8 @@
62+ -e "s|%couchjs_command_name%|couchjs.exe|g" \
63+ -e "s|%package_author_name%|$(package_author_name)|g" \
64+ -e "s|%version%|$(version)|g" \
65++ -e "s|%couchdb_so_distribution%|Windows|g" \
66++ -e "s|%couchdb_so_version%|Windows|g" \
67+ < $< > $@
68+ else
69+ default.ini: default.ini.tpl
70+@@ -51,6 +53,8 @@
71+ -e "s|%couchjs_command_name%|$(couchjs_command_name)|g" \
72+ -e "s|%package_author_name%|$(package_author_name)|g" \
73+ -e "s|%version%|$(version)|g" \
74++ -e "s|%couchdb_so_distribution%|$(shell lsb_release -si)|g" \
75++ -e "s|%couchdb_so_version%|$(shell lsb_release -sc)|g" \
76+ < $< > $@
77+ endif
78+
79
80=== modified file 'debian/patches/series'
81--- debian/patches/series 2013-08-28 16:28:32 +0000
82+++ debian/patches/series 2013-12-02 12:12:20 +0000
83@@ -0,0 +1,1 @@
84+fix-distribution.patch
85
86=== modified file 'debian/rules'
87--- debian/rules 2013-08-28 16:28:32 +0000
88+++ debian/rules 2013-12-02 12:12:20 +0000
89@@ -1,7 +1,7 @@
90 #!/usr/bin/make -f
91
92 %:
93- dh $@
94+ dh $@ --with autoreconf
95
96 override_dh_auto_configure:
97 dh_auto_configure -- --enable-strictness --disable-init
98
99=== modified file 'etc/couchdb/Makefile.am'
100--- etc/couchdb/Makefile.am 2013-08-28 16:28:32 +0000
101+++ etc/couchdb/Makefile.am 2013-12-02 12:12:20 +0000
102@@ -37,6 +37,8 @@
103 -e "s|%couchjs_command_name%|couchjs.exe|g" \
104 -e "s|%package_author_name%|$(package_author_name)|g" \
105 -e "s|%version%|$(version)|g" \
106+ -e "s|%couchdb_so_distribution%|Windows|g" \
107+ -e "s|%couchdb_so_version%|Windows|g" \
108 < $< > $@
109 else
110 default.ini: default.ini.tpl
111@@ -51,6 +53,8 @@
112 -e "s|%couchjs_command_name%|$(couchjs_command_name)|g" \
113 -e "s|%package_author_name%|$(package_author_name)|g" \
114 -e "s|%version%|$(version)|g" \
115+ -e "s|%couchdb_so_distribution%|$(shell lsb_release -si)|g" \
116+ -e "s|%couchdb_so_version%|$(shell lsb_release -sc)|g" \
117 < $< > $@
118 endif
119
120
121=== modified file 'etc/couchdb/default.ini.tpl.in'
122--- etc/couchdb/default.ini.tpl.in 2013-08-28 16:28:32 +0000
123+++ etc/couchdb/default.ini.tpl.in 2013-12-02 12:12:20 +0000
124@@ -2,8 +2,8 @@
125
126 ; Upgrading CouchDB will overwrite this file.
127 [vendor]
128-name = %package_author_name%
129-version = %version%
130+name = %couchdb_so_distribution%
131+version = %couchdb_so_version%
132
133 [couchdb]
134 database_dir = %localstatelibdir%

Subscribers

People subscribed via source and target branches

to all changes: