Merge lp:~ahasenack/landscape-client/client-package-lintian-fixes into lp:~landscape/landscape-client/trunk

Proposed by Andreas Hasenack
Status: Merged
Approved by: Alberto Donato
Approved revision: 585
Merged at revision: 567
Proposed branch: lp:~ahasenack/landscape-client/client-package-lintian-fixes
Merge into: lp:~landscape/landscape-client/trunk
Diff against target: 310 lines (+106/-44)
8 files modified
Makefile (+45/-26)
debian/control (+6/-4)
debian/landscape-client.templates (+1/-1)
debian/landscape-common.templates (+1/-1)
debian/po/templates.pot (+30/-8)
debian/rules (+7/-4)
debian/source.lintian-overrides (+15/-0)
debian/source/format (+1/-0)
To merge this branch: bzr merge lp:~ahasenack/landscape-client/client-package-lintian-fixes
Reviewer Review Type Date Requested Status
Free Ekanayaka (community) Approve
Alberto Donato (community) Approve
Jerry Seutter (community) Approve
Review via email: mp+107688@code.launchpad.net

Description of the change

This branch makes some changes to debian/* in an attempt to address some lintian warnings and errors in the packaging of landscape-client.

Notable changes:
- standard-version bumped to 3.8.2, the one in lucid. Also added a lintian override about it
- added dynamic dependency ${shlibs:Depends) to -common and -client so they grab the libc6 dependency automatically, and the required debian/rules change to generate those
- stripped binaries
- changed ${Source-Version} to ${binary:Version} in Depends as the former is deprecated
- changed _Choices to __Choices in the -common template which helps translators. Instead of having to translate the whole line, they can now translate each selection (between commas) independently
- added dummy build-arch and build-indep debian/rules targets
- uncommented dh_lintian in debian/rules, since all supported distros now have it. It's a noop for now, because we don't have lintian overrides for the binary packages yet, but might in the future
- added a lintian override for our usage of dh_python, which is not obsolete in lucid for example
- added some other lintian overrides, with comments explaining the reasoning
- added an explicit debian/source/format file, with "3.0 (quilt)", effectively making this a non-native package.
- removed some old makefile targets
- added new makefile targets to build a binary package, a source package and a so called "orig" tarball, which doesn't have the debian/ directory.

To run a source build with lintian output, type:

make sourcepackage

To make a binary build, use:

make package

To use your key to sign the build instead of the one from the changelog entry, set the DEBUILD_OPTS makefile variable like this:

make <something> <email address hidden>"

For example:

make sourcepackage <email address hidden>"

To just get the orig tarball in the parent directory:

make origtarball

All the above commands will build a source package, binary package or origtarball, respectively, with:
- all local uncommitted changes
- a debian/changelog entry with a version of XX.YY+bzr<revno>-0ubuntu0 (not in the case of the origtarball, which doesn't have debian/*)
- XX.YY+bzr<revno> UPSTREAM_VERSION set in landscape/__init__.py

To post a comment you must log in.
Revision history for this message
Jerry Seutter (jseutter) wrote :

Builds as advertised, seems okay to my limited understanding of packaging. +1

review: Approve
585. By Andreas Hasenack

Reconciled with trunk

Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

It looks good to me, +1.

review: Approve
Revision history for this message
Alberto Donato (ack) wrote :

Looks good! +1

review: Approve
Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

After talking with Andreas on IRC, we came up with this plan:

1) we'll have a Makefile target that does builds an .orig.tar.gz tarball with the content of trunk, minus debian/ and with landscape/__init__.py sed'ed as appropriate

2) to prepare the branch for uploading to Ubuntu we use bzr merge-upstream passing the resulting .dsc, merge-upstream should handle the orig.tar.gz appropriately

3) to prepare development build we'll use XX.YY+bzr<REV> as versioning schema

review: Needs Fixing
586. By Andreas Hasenack

Change source format back to non-native

587. By Andreas Hasenack

Drop old deploy makefile target, no longer used

588. By Andreas Hasenack

Drop checkcertificate makefile target, no longer needed

589. By Andreas Hasenack

Get tarball version from changelog and append bzr revno

590. By Andreas Hasenack

Update version in __init__.py when making the tarball

591. By Andreas Hasenack

First attempt at package building from makefile

592. By Andreas Hasenack

Deal with changelog

593. By Andreas Hasenack

Run clean before tarring up things

594. By Andreas Hasenack

Don't rebuild manpages for the tarball for now

595. By Andreas Hasenack

Fix (hopefully) double +bzr in version

596. By Andreas Hasenack

- revert previous fix, was bogus
- don't do bzr revert

597. By Andreas Hasenack

Oh, got it, thanks to ruda on irc. Use := instead of =, and read up on variable recursive expansion that make does

598. By Andreas Hasenack

Added a comment about :=, and used it a few more times

599. By Andreas Hasenack

- move prepchangelog to the package targets
- export uncommitted changes too

600. By Andreas Hasenack

Also update version in the local __init__.py, not just the one in the
orig tarball. I'm just sure yet if I'm doing it in the best makefile
target.

601. By Andreas Hasenack

Sed the __init__.py file in the right place

602. By Andreas Hasenack

Take upstream version from landscape/__init__.py as authoritative
instead of the changelog one.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Ok, this took longer than expected, but I think I have made the plan work. I'll update the initial description now.

603. By Andreas Hasenack

Added comment about the usage of --uncommitted

604. By Andreas Hasenack

More comments

605. By Andreas Hasenack

Added makefile variable which can be used to pass command-line options
to debuild, such as the gpg signing key to use.

Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

Nice work, +1!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2012-03-07 19:15:02 +0000
3+++ Makefile 2012-05-31 00:35:24 +0000
4@@ -3,6 +3,19 @@
5 PYTHON ?= python
6 TRIAL_ARGS ?=
7 TEST_COMMAND = trial $(TRIAL_ARGS) landscape
8+UBUNTU_RELEASE := $(shell lsb_release -cs)
9+# version in the code is authoritative
10+# Use := here, not =, it's really important, otherwise UPSTREAM_VERSION
11+# will be updated behind your back with the current result of that
12+# command everytime it is mentioned/used.
13+UPSTREAM_VERSION := $(shell python -c "from landscape import UPSTREAM_VERSION; print UPSTREAM_VERSION")
14+CHANGELOG_VERSION := $(shell dpkg-parsechangelog | grep ^Version | cut -f 2 -d " " | cut -f 1 -d '-')
15+BZR_REVNO := $(shell bzr revno)
16+ifeq (+bzr,$(findstring +bzr,$(UPSTREAM_VERSION)))
17+TARBALL_VERSION := $(UPSTREAM_VERSION)
18+else
19+TARBALL_VERSION := $(UPSTREAM_VERSION)+bzr$(BZR_REVNO)
20+endif
21
22 all: build
23
24@@ -28,9 +41,6 @@
25 pyflakes:
26 -pyflakes `find landscape -name \*py|grep -v twisted_amp\.py|grep -v configobj\.py|grep -v mocker\.py`
27
28-checkcertificate:
29- -echo | openssl s_client -connect landscape.canonical.com:443 -CAfile /etc/ssl/certs/ca-certificates.crt
30-
31 clean:
32 -find landscape -name \*.pyc -exec rm {} \;
33 -rm tags
34@@ -52,26 +62,32 @@
35 ${TXT2MAN} -P Landscape -s 1 -t landscape-config < man/landscape-config.txt > man/landscape-config.1
36 ${TXT2MAN} -P Landscape -s 1 -t landscape-message < man/landscape-message.txt > man/landscape-message.1
37
38-package: manpages
39- @fakeroot debian/rules binary
40- @echo "\n\nYou remembered to update the changelog, right?\n\n"
41+origtarball: sdist
42+ cp -f sdist/landscape-client-$(TARBALL_VERSION).tar.gz \
43+ ../landscape-client_$(TARBALL_VERSION).orig.tar.gz
44
45-SSH_USERNAME=`whoami`
46-SSH_HOST=people.ubuntu.com
47-PACKAGE_DIR=/home/jkakar/public_html/landscape
48-deploy:
49-ifneq (${PACKAGE},)
50- @echo "Copying ${PACKAGE} to $(SSH_HOST):$(PACKAGE_DIR)"
51- @scp ${PACKAGE} $(SSH_USERNAME)@$(SSH_HOST):$(PACKAGE_DIR)
52- @echo "\nScanning packages and recreating the Packages file."
53- @ssh -l $(SSH_USERNAME) $(SSH_HOST) \
54- "cd $(PACKAGE_DIR) " \
55- "&& dpkg-scanpackages . /dev/null > Packages " \
56- "&& gzip -f Packages"
57+prepchangelog:
58+# add a temporary entry for a local build if needed
59+ifeq (,$(findstring +bzr,$(CHANGELOG_VERSION)))
60+ dch -v $(TARBALL_VERSION)-0ubuntu0 "New local test build" --distribution $(UBUNTU_RELEASE)
61 else
62- @echo "You need to specify PACKAGE, as in: make deploy PACKAGE=<name>"
63+# just update the timestamp
64+ dch --distribution $(UBUNTU_RELEASE) --release $(UBUNTU_RELEASE)
65 endif
66
67+updateversion:
68+ sed -i -e "s/^UPSTREAM_VERSION.*/UPSTREAM_VERSION = \"$(TARBALL_VERSION)\"/g" \
69+ landscape/__init__.py
70+
71+package: clean prepchangelog updateversion
72+ debuild -b $(DEBUILD_OPTS)
73+
74+sourcepackage: clean origtarball prepchangelog updateversion
75+ # need to remove sdist here because it doesn't exist in the
76+ # orig tarball
77+ rm -rf sdist
78+ debuild -S $(DEBUILD_OPTS)
79+
80 MESSAGE_DIR = `pwd`/runclient-messages
81 LOG_FILE = `pwd`/runclient.log
82
83@@ -101,13 +117,16 @@
84 etags:
85 -etags --languages=python -R .
86
87-UPSTREAM_VERSION=$(shell python -c "from landscape import UPSTREAM_VERSION; print UPSTREAM_VERSION")
88-sdist:
89+sdist: clean
90 mkdir -p sdist
91- bzr export sdist/landscape-client-$(UPSTREAM_VERSION)
92- rm -rf sdist/landscape-client-$(UPSTREAM_VERSION)/debian
93- cd sdist && tar cfz landscape-client-$(UPSTREAM_VERSION).tar.gz landscape-client-$(UPSTREAM_VERSION)
94- cd sdist && md5sum landscape-client-$(UPSTREAM_VERSION).tar.gz > landscape-client-$(UPSTREAM_VERSION).tar.gz.md5
95- rm -rf sdist/landscape-client-$(UPSTREAM_VERSION)
96+ # --uncommitted because we want any changes the developer might have made
97+ # locally to be included in the package without having to commit
98+ bzr export --uncommitted sdist/landscape-client-$(TARBALL_VERSION)
99+ rm -rf sdist/landscape-client-$(TARBALL_VERSION)/debian
100+ sed -i -e "s/^UPSTREAM_VERSION.*/UPSTREAM_VERSION = \"$(TARBALL_VERSION)\"/g" \
101+ sdist/landscape-client-$(TARBALL_VERSION)/landscape/__init__.py
102+ cd sdist && tar cfz landscape-client-$(TARBALL_VERSION).tar.gz landscape-client-$(TARBALL_VERSION)
103+ cd sdist && md5sum landscape-client-$(TARBALL_VERSION).tar.gz > landscape-client-$(TARBALL_VERSION).tar.gz.md5
104+ rm -rf sdist/landscape-client-$(TARBALL_VERSION)
105
106 .PHONY: tags etags
107
108=== modified file 'debian/control'
109--- debian/control 2012-03-30 12:24:31 +0000
110+++ debian/control 2012-05-31 00:35:24 +0000
111@@ -4,12 +4,13 @@
112 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
113 XSBC-Original-Maintainer: Landscape Team <landscape-team@canonical.com>
114 Build-Depends: debhelper (>= 5), po-debconf, python-dev, python-central | python-support, lsb-release, gawk, python-twisted-core, python-distutils-extra
115-Standards-Version: 3.8.0
116+Standards-Version: 3.8.2
117 XS-Python-Version: >= 2.4, << 2.8
118
119 Package: landscape-common
120 Architecture: any
121 Depends: ${python:Depends}, ${misc:Depends}, ${extra:Depends},
122+ ${shlibs:Depends},
123 python-gnupginterface,
124 python-twisted-core,
125 python-apt,
126@@ -33,9 +34,10 @@
127 Package: landscape-client
128 Architecture: any
129 Depends: ${python:Depends}, ${misc:Depends}, ${extra:Depends},
130+ ${shlibs:Depends},
131 python-twisted-web,
132 python-twisted-names,
133- landscape-common (= ${Source-Version})
134+ landscape-common (= ${binary:Version})
135 Suggests: ${extra:Suggests}
136 Description: The Landscape administration system client
137 Landscape is a web-based tool for managing Ubuntu systems. This
138@@ -48,8 +50,8 @@
139 Package: landscape-client-ui
140 Architecture: any
141 Depends: ${python:Depends}, ${misc:Depends},
142- landscape-client (= ${Source-Version}),
143- landscape-client-ui-install (= ${Source-Version}),
144+ landscape-client (= ${binary:Version}),
145+ landscape-client-ui-install (= ${binary:Version}),
146 python-gi,
147 python-dbus,
148 policykit-1,
149
150=== modified file 'debian/landscape-client.templates'
151--- debian/landscape-client.templates 2012-05-10 17:56:04 +0000
152+++ debian/landscape-client.templates 2012-05-31 00:35:24 +0000
153@@ -64,7 +64,7 @@
154 Template: landscape-client/tags
155 Type: string
156 Default:
157-_Description: Initial tags for first registration
158+_Description: Initial tags for first registration:
159 Comma separated list of tags which will be assigned to this computer on its
160 first registration. Once the machine is registered, these tags can only be
161 changed using the Landscape server.
162
163=== modified file 'debian/landscape-common.templates'
164--- debian/landscape-common.templates 2008-09-10 21:03:34 +0000
165+++ debian/landscape-common.templates 2012-05-31 00:35:24 +0000
166@@ -6,7 +6,7 @@
167 # try to keep below ~71 characters.
168 # DO NOT USE commas (,) in Choices translations otherwise
169 # this will break the choices shown to users
170-_Choices: Do not display sysinfo on login, Cache sysinfo in /etc/motd, Run sysinfo on every login
171+__Choices: Do not display sysinfo on login, Cache sysinfo in /etc/motd, Run sysinfo on every login
172 Default: Cache sysinfo in /etc/motd
173 _Description: landscape-sysinfo configuration:
174 Landscape includes a tool and a set of modules that can display
175
176=== modified file 'debian/po/templates.pot'
177--- debian/po/templates.pot 2012-05-10 14:47:07 +0000
178+++ debian/po/templates.pot 2012-05-31 00:35:24 +0000
179@@ -6,9 +6,9 @@
180 #, fuzzy
181 msgid ""
182 msgstr ""
183-"Project-Id-Version: PACKAGE VERSION\n"
184+"Project-Id-Version: landscape-client\n"
185 "Report-Msgid-Bugs-To: landscape-client@packages.debian.org\n"
186-"POT-Creation-Date: 2012-03-07 17:07+0100\n"
187+"POT-Creation-Date: 2012-05-28 16:40-0300\n"
188 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
189 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
190 "Language-Team: LANGUAGE <LL@li.org>\n"
191@@ -55,8 +55,8 @@
192 #. Description
193 #: ../landscape-client.templates:3001
194 msgid ""
195-"Client registration key for the given Landscape account. Only needed "
196-"if the given account is requesting a client registration key."
197+"Client registration key for the given Landscape account. Only needed if the "
198+"given account is requesting a client registration key."
199 msgstr ""
200
201 #. Type: string
202@@ -152,7 +152,7 @@
203 #. Type: string
204 #. Description
205 #: ../landscape-client.templates:11001
206-msgid "Initial tags for first registration"
207+msgid "Initial tags for first registration:"
208 msgstr ""
209
210 #. Type: string
211@@ -187,9 +187,31 @@
212 #. DO NOT USE commas (,) in Choices translations otherwise
213 #. this will break the choices shown to users
214 #: ../landscape-common.templates:1001
215-msgid ""
216-"Do not display sysinfo on login, Cache sysinfo in /etc/motd, Run sysinfo on "
217-"every login"
218+msgid "Do not display sysinfo on login"
219+msgstr ""
220+
221+#. Type: select
222+#. Choices
223+#. Translators beware! the following three strings form a single
224+#. Choices menu. - Every one of these strings has to fit in a standard
225+#. 80 characters console, as the fancy screen setup takes up some space
226+#. try to keep below ~71 characters.
227+#. DO NOT USE commas (,) in Choices translations otherwise
228+#. this will break the choices shown to users
229+#: ../landscape-common.templates:1001
230+msgid "Cache sysinfo in /etc/motd"
231+msgstr ""
232+
233+#. Type: select
234+#. Choices
235+#. Translators beware! the following three strings form a single
236+#. Choices menu. - Every one of these strings has to fit in a standard
237+#. 80 characters console, as the fancy screen setup takes up some space
238+#. try to keep below ~71 characters.
239+#. DO NOT USE commas (,) in Choices translations otherwise
240+#. this will break the choices shown to users
241+#: ../landscape-common.templates:1001
242+msgid "Run sysinfo on every login"
243 msgstr ""
244
245 #. Type: select
246
247=== modified file 'debian/rules'
248--- debian/rules 2012-05-25 20:13:38 +0000
249+++ debian/rules 2012-05-31 00:35:24 +0000
250@@ -30,6 +30,10 @@
251 landscape_common_substvars = debian/landscape-common.substvars
252 landscape_client_substvars = debian/landscape-client.substvars
253
254+build-arch: build
255+
256+build-indep: build
257+
258 build: build-stamp
259 build-stamp:
260 dh_testdir
261@@ -69,10 +73,7 @@
262 # do nothing
263 #
264 binary-arch: build install
265- # That's not present in Ubuntu releases we still support, so
266- # we're just installing the lintian overrides file by hand
267- # for now.
268- #dh_lintian
269+ dh_lintian
270 dh_testdir
271 dh_testroot
272 dh_installdocs
273@@ -82,8 +83,10 @@
274 dh_installinit -- start 45 2 3 4 5 . stop 15 0 1 6 .
275 dh_installlogrotate
276 dh_installdebconf
277+ dh_strip
278 dh_compress
279 dh_fixperms
280+ dh_shlibdeps
281
282 ifneq (,$(findstring $(dist_release),hardy))
283 # We depend on bug-fixed versions of python-dbus and pycurl on hardy
284
285=== added directory 'debian/source'
286=== added file 'debian/source.lintian-overrides'
287--- debian/source.lintian-overrides 1970-01-01 00:00:00 +0000
288+++ debian/source.lintian-overrides 2012-05-31 00:35:24 +0000
289@@ -0,0 +1,15 @@
290+# we use dh_python or dh_python2 depending on the ubuntu release
291+# the package is being built on, this is detected dynamically
292+# in the rules file
293+landscape-client source: dh_python-is-obsolete
294+
295+# the package has to build on lucid, where the standards version
296+# is 3.8.2
297+landscape-client source: ancient-standards-version
298+
299+# it's a bug that should be fixed in quantal
300+landscape-client source: unknown-field-in-dsc original-maintainer
301+
302+# this is only used in a very specific client upgrade from
303+# the dbus to the amp version
304+landscape-client: start-stop-daemon-in-maintainer-script postinst:130
305
306=== added file 'debian/source/format'
307--- debian/source/format 1970-01-01 00:00:00 +0000
308+++ debian/source/format 2012-05-31 00:35:24 +0000
309@@ -0,0 +1,1 @@
310+3.0 (quilt)

Subscribers

People subscribed via source and target branches

to all changes: