Merge lp:~ockham-razor/unity-lens-bliss/distutils into lp:unity-lens-bliss

Proposed by Bernhard Reiter on 2011-12-07
Status: Needs review
Proposed branch: lp:~ockham-razor/unity-lens-bliss/distutils
Merge into: lp:unity-lens-bliss
Diff against target: 307 lines (+48/-175)
11 files modified
MANIFEST.in (+2/-0)
Makefile.am (+0/-72)
README (+1/-12)
acinclude.m4 (+0/-40)
autogen.sh (+0/-13)
bin/unity-bliss-daemon (+1/-1)
bin/unity-bliss-daemon.in (+1/-1)
configure.ac (+0/-34)
data/bliss.lens.in (+1/-1)
data/unity-lens-bliss.service.in (+1/-1)
setup.py (+41/-0)
To merge this branch: bzr merge lp:~ockham-razor/unity-lens-bliss/distutils
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen 2011-12-07 Pending
Review via email: mp+84702@code.launchpad.net

Description of the Change

Switch from autotools to distutils. This almost certainly will require some (or a lot) more polishing, but I hope we'll get there.

To post a comment you must log in.
38. By Bernhard Reiter on 2011-12-07

Use get_config_var to determine values for datarootdir and libexecdir substitution variables.

39. By Bernhard Reiter on 2011-12-12

Move unity-bliss-daemon back to data_files, and fix libexecdir argument.

40. By Bernhard Reiter on 2011-12-12

Fix check if running from source tree to finding setup.py instead of configure.ac

Unmerged revisions

40. By Bernhard Reiter on 2011-12-12

Fix check if running from source tree to finding setup.py instead of configure.ac

39. By Bernhard Reiter on 2011-12-12

Move unity-bliss-daemon back to data_files, and fix libexecdir argument.

38. By Bernhard Reiter on 2011-12-07

Use get_config_var to determine values for datarootdir and libexecdir substitution variables.

37. By Bernhard Reiter on 2011-12-07

Add unity-lens-bliss to MANIFEST.in

36. By Bernhard Reiter on 2011-12-07

Move AUTHORS et al to MANIFEST.in

35. By Bernhard Reiter on 2011-12-07

Fix indentation

34. By Bernhard Reiter on 2011-12-07

Comment out stuff that goes to etc

33. By Bernhard Reiter on 2011-12-07

Install unity-bliss-daemon as a script instead of a data_file

32. By Bernhard Reiter on 2011-12-07

Install bliss/ directory contents as a package, not as data_files.

31. By Bernhard Reiter on 2011-12-07

from DistUtilsExtra.command import s/*/build_extra/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'MANIFEST.in'
2--- MANIFEST.in 1970-01-01 00:00:00 +0000
3+++ MANIFEST.in 2011-12-12 19:47:27 +0000
4@@ -0,0 +1,2 @@
5+include AUTHORS COPYING NEWS README
6+include data/unity-lens-bliss.menu
7
8=== removed file 'Makefile.am'
9--- Makefile.am 2011-11-03 13:47:07 +0000
10+++ Makefile.am 1970-01-01 00:00:00 +0000
11@@ -1,72 +0,0 @@
12-NULL =
13-
14-EXTRA_DIST = \
15- bin/unity-bliss-daemon.in \
16- data/bliss.lens.in \
17- data/bliss-lens.svg \
18- data/unity-lens-bliss.menu.in \
19- data/unity-lens-bliss.service.in \
20- $(docs_DATA) \
21- $(NULL)
22-
23-DISTCLEANFILES =
24-
25-DISTCHECK_CONFIGURE_FLAGS =
26-
27-######################################################
28-# Documents
29-######################################################
30-docsdir = $(datadir)/doc/unity-lens-bliss
31-docs_DATA = \
32- AUTHORS \
33- ChangeLog \
34- COPYING \
35- NEWS \
36- README \
37- $(NULL)
38-
39-######################################################
40-# Lens code
41-######################################################
42-lensdir = $(datadir)/unity-lens-bliss/bliss
43-lens_PYTHON = \
44- bliss/__init__.py \
45- bliss/apps.py \
46- $(NULL)
47-
48-libexec_SCRIPTS = \
49- bin/unity-bliss-daemon \
50- $(NULL)
51-
52-######################################################
53-# Unity .lens file
54-######################################################
55-dotlensdir = $(datadir)/unity/lenses/bliss
56-dotlens_DATA = \
57- data/bliss.lens \
58- $(NULL)
59-
60-######################################################
61-# Icons
62-######################################################
63-iconsdir = $(datadir)/unity-lens-bliss
64-icons_DATA = \
65- data/bliss-lens.svg \
66- $(NULL)
67-
68-######################################################
69-# DBus .service file
70-######################################################
71-dbusdir = $(datadir)/dbus-1/services
72-dbus_DATA = \
73- data/unity-lens-bliss.service \
74- $(NULL)
75-
76-######################################################
77-# XDG .menu file
78-######################################################
79-menudir = $(sysconfdir)/xdg/menus
80-menu_DATA = \
81- data/unity-lens-bliss.menu \
82- $(NULL)
83-
84
85=== modified file 'README'
86--- README 2011-11-03 13:47:07 +0000
87+++ README 2011-12-12 19:47:27 +0000
88@@ -12,11 +12,7 @@
89
90 Install with:
91
92- ./configure --prefix=/usr --sysconfdir=/etc && make && sudo make install
93-
94-or if you checked the code out from a bazaar branch:
95-
96- ./autogen.sh --prefix=/usr --sysconfdir=/etc && make && sudo make install
97+ python setup.py --prefix=/usr
98
99 RESOURCES
100 ---------
101@@ -30,10 +26,3 @@
102 instrumented by the executable found in bin/unity-bliss-daemon. The executable
103 is launched indirectly by the Unity shell via DBus activation when needed.
104
105-To simplify the build this project is set up with "non-recursive automake"
106-which is not completely standard (yet?), but is much easier to work with than
107-the normal recursive approach. In recursive automake setups each subdirectory
108-must contain a Makefile.am, in our non-recursive setup we only have a single
109-Makewfile.am at the top of the source tree.
110-
111-
112
113=== removed file 'acinclude.m4'
114--- acinclude.m4 2011-11-03 14:55:33 +0000
115+++ acinclude.m4 1970-01-01 00:00:00 +0000
116@@ -1,40 +0,0 @@
117-dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
118-dnl
119-dnl example
120-dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
121-dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
122-
123-AC_DEFUN([AS_AC_EXPAND],
124-[
125- EXP_VAR=[$1]
126- FROM_VAR=[$2]
127-
128- dnl first expand prefix and exec_prefix if necessary
129- prefix_save=$prefix
130- exec_prefix_save=$exec_prefix
131-
132- dnl if no prefix given, then use /usr/local, the default prefix
133- if test "x$prefix" = "xNONE"; then
134- prefix=$ac_default_prefix
135- fi
136- dnl if no exec_prefix given, then use prefix
137- if test "x$exec_prefix" = "xNONE"; then
138- exec_prefix=$prefix
139- fi
140-
141- full_var="$FROM_VAR"
142- dnl loop until it doesn't change anymore
143- while true; do
144- new_full_var="`eval echo $full_var`"
145- if test "x$new_full_var"="x$full_var"; then break; fi
146- full_var=$new_full_var
147- done
148-
149- dnl clean up
150- full_var=$new_full_var
151- AC_SUBST([$1], "$full_var")
152-
153- dnl restore prefix and exec_prefix
154- prefix=$prefix_save
155- exec_prefix=$exec_prefix_save
156-])
157
158=== removed file 'autogen.sh'
159--- autogen.sh 2011-11-03 11:34:31 +0000
160+++ autogen.sh 1970-01-01 00:00:00 +0000
161@@ -1,13 +0,0 @@
162-#!/bin/sh
163-
164-srcdir=`dirname $0`
165-
166-PKG_NAME="unity-lens-bliss"
167-
168-which gnome-autogen.sh || {
169- echo "You need gnome-common from the GNOME Git repository"
170- exit 1
171-}
172-
173-USE_GNOME2_MACROS=1 \
174-. gnome-autogen.sh
175
176=== modified file 'bin/unity-bliss-daemon'
177--- bin/unity-bliss-daemon 2011-11-03 13:47:07 +0000
178+++ bin/unity-bliss-daemon 2011-12-12 19:47:27 +0000
179@@ -4,7 +4,7 @@
180 # of the source tree, otherwise point at the installed code
181 import sys, os
182 execpath = os.path.dirname(__file__)
183-if os.path.isfile(os.path.join(execpath, "..", "configure.ac")):
184+if os.path.isfile(os.path.join(execpath, "..", "setup.py")):
185 print "Running from source tree"
186 sys.path.insert (0, os.path.join(execpath, ".."))
187 else:
188
189=== modified file 'bin/unity-bliss-daemon.in'
190--- bin/unity-bliss-daemon.in 2011-11-03 14:56:53 +0000
191+++ bin/unity-bliss-daemon.in 2011-12-12 19:47:27 +0000
192@@ -4,7 +4,7 @@
193 # of the source tree, otherwise point at the installed code
194 import sys, os
195 execpath = os.path.dirname(__file__)
196-if os.path.isfile(os.path.join(execpath, "..", "configure.ac")):
197+if os.path.isfile(os.path.join(execpath, "..", "setup.py")):
198 print "Running from source tree"
199 sys.path.insert (0, os.path.join(execpath, ".."))
200 else:
201
202=== removed file 'configure.ac'
203--- configure.ac 2011-11-04 10:01:38 +0000
204+++ configure.ac 1970-01-01 00:00:00 +0000
205@@ -1,34 +0,0 @@
206-# When releasing also remember to update the soname as instructed below
207-AC_INIT(unity-lens-bliss, 0.1.3, https://launchpad.net/unity-lens-bliss)
208-AM_INIT_AUTOMAKE([subdir-objects])
209-AM_PATH_PYTHON
210-
211-AC_PREREQ(2.59)
212-
213-# Variables to escape in .in files
214-AS_AC_EXPAND(PREFIX, $prefix)
215-AC_SUBST(PREFIX)
216-
217-AS_AC_EXPAND(DATADIR, $datarootdir)
218-AC_SUBST(DATADIR)
219-
220-AS_AC_EXPAND(LIBEXECDIR, $libexecdir)
221-AC_SUBST(LIBEXECDIR)
222-
223-AC_OUTPUT([
224-bin/unity-bliss-daemon
225-data/bliss.lens
226-data/unity-lens-bliss.menu
227-data/unity-lens-bliss.service
228-Makefile
229-])
230-
231-AC_MSG_NOTICE([
232-
233- unity-lens-bliss
234- --------------------
235-
236- Prefix : ${prefix}
237-
238-])
239-
240
241=== modified file 'data/bliss.lens.in'
242--- data/bliss.lens.in 2011-11-03 12:32:19 +0000
243+++ data/bliss.lens.in 2011-12-12 19:47:27 +0000
244@@ -2,7 +2,7 @@
245 DBusName=net.launchpad.UnityLensBliss.Lens
246 DBusPath=/net/launchpad/unitylensbliss/lens
247 Name=Apps Lens
248-Icon=@DATADIR@/unity-lens-bliss/bliss-lens.svg
249+Icon=$datarootdir/unity-lens-bliss/bliss-lens.svg
250 Description=Easily find and launch apps
251 SearchHint=Type to search
252 Shortcut=a
253
254=== modified file 'data/unity-lens-bliss.service.in'
255--- data/unity-lens-bliss.service.in 2011-11-03 15:33:52 +0000
256+++ data/unity-lens-bliss.service.in 2011-12-12 19:47:27 +0000
257@@ -1,3 +1,3 @@
258 [D-BUS Service]
259 Name=net.launchpad.UnityLensBliss.Lens
260-Exec=@LIBEXECDIR@/unity-bliss-daemon
261+Exec=$libexecdir/unity-bliss-daemon
262
263=== added file 'setup.py'
264--- setup.py 1970-01-01 00:00:00 +0000
265+++ setup.py 2011-12-12 19:47:27 +0000
266@@ -0,0 +1,41 @@
267+#!/usr/bin/env python
268+#
269+from distutils.core import setup
270+from distutils.util import subst_vars
271+from distutils.sysconfig import get_config_var
272+from DistUtilsExtra.command import build_extra
273+from os import remove
274+
275+files = [#'bin/unity-bliss-daemon',
276+ 'data/bliss.lens',
277+ 'data/unity-lens-bliss.menu',
278+ 'data/unity-lens-bliss.service']
279+
280+for filename in files:
281+ o = open(filename,"w")
282+ for line in open(filename + '.in'):
283+ line = subst_vars(line, {'datarootdir': get_config_var('datarootdir'),
284+ 'libexecdir': get_config_var('LIBDIR') + '/unity-lens-bliss'})
285+ o.write(line)
286+ o.close()
287+
288+setup(name="unity-lens-bliss",
289+ version="0.1.3",
290+ author="Mikkel Kamstrup Erlandsen",
291+ author_email="mikkel.kamstrup@canonical.com",
292+ url="http://launchpad.net/unity-lens-bliss",
293+ license="GNU General Public License Version 3 (GPLv3)",
294+ description="Simple Applications Lens for Unity",
295+ long_description="This is a very simple implementation of an apps lens for Unity. It can be used as a replacement for the default apps lens if you want something simpler, or it can be used as a solid starting point for writing your own lens.",
296+ packages=['bliss'],
297+ data_files=[
298+ ('lib/unity-lens-bliss', ['bin/unity-bliss-daemon']),
299+ ('share/unity/lenses/bliss', ['data/bliss.lens']),
300+ ('share/dbus-1/services', ['data/unity-lens-bliss.service']),
301+ ('share/unity-lens-bliss', ['data/bliss-lens.svg']),
302+ ],
303+ cmdclass = { "build" : build_extra.build_extra }
304+)
305+
306+for filename in files:
307+ remove(filename)

Subscribers

People subscribed via source and target branches

to all changes: