automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

.py.in? _PYTHON?


From: David Lee
Subject: .py.in? _PYTHON?
Date: Thu, 20 Jul 2006 11:10:35 +0100 (BST)

Background: I'm closely involved in the portability aspects of the
"Linux-HA" (heartbeat) software which uses autotools.

We're having trouble cleanly maintaining and installing some python
scripts.

In the early days, our "Makefile.am" declared these using "_SCRIPTS":

   thing_SCRIPTS = one.py two.py three.py

This seemed to work well:  a source "one.py.in" file could be updated;
"make" would detect the update to re-generate "one.py";  "make install"
would nicely install the "one.py" files.

But I saw that "uninstall" was leaving behind some corresponding ".pyo"
and ".pyc".  That felt unclean.  The fact that these files were generated
at run-time also felt unclean and against the spirit of packaging addition
and removal mechanisms (RPM, deb, Sun/pkg, including "make uninstall").

Looking deeper, I discovered "_PYTHON" primary (which hadn't existed when
we started with automake, and wasn't in the "Goat Book").  This sounded
very promising.  I tried it; changing "Makefile.am" from:
   thing_SCRIPTS = one.py two.py three.py
to:
   thing_PYTHON = one.py two.py three.py

An effective, clean-looking change.  The install and uninstall behaved
very well.  Good.

(But there's always a "but", isn't there?)

But a development colleague reported shortly afterwards that the Makefile
was no longer updating the ".py" from his changed ".py.in".  (I verified
this with my own automake, version 1.8.3)

Looking at the generated "Makefile" suggests that "all-am:" target doesn't
include things from the "_PYTHON" primary (unlike from "_SCRIPTS").


Is this our bug?  Or might it be an automake bug in that, whereas a
typical "_SCRIPTS" entry "sss" can be maintained from a corresponding
"sss.in", alas "_PYTHON" cannot maintain a "ppp.py" from its "ppp.py.in".

How should we proceed?


-- 

:  David Lee                                I.T. Service          :
:  Senior Systems Programmer                Computer Centre       :
:                                           Durham University     :
:  http://www.dur.ac.uk/t.d.lee/            South Road            :
:                                           Durham DH1 3LE        :
:  Phone: +44 191 334 2752                  U.K.                  :




reply via email to

[Prev in Thread] Current Thread [Next in Thread]