automake
[Top][All Lists]
Advanced

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

Python & Automake


From: Akim Demaille
Subject: Python & Automake
Date: Thu, 26 Feb 2004 09:35:15 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Hi!

I'm looking for the recommended way to handle Python executables.
I've read the current documentation, but it refers only to Python
libraries (unless I'm mistaken).

Looking for some inspiration, I found this old piece of code from
François Pinard, but it's problem completely outdated.


----------------------------------------
AUTOMAKE_OPTIONS = gnits
bin_SCRIPTS = libitize
pkgdata_DATA = libit.pyc

EXTRA_DIST = libitize.in libit.py

PYTHON = @PYTHON@

SUFFIXES = .py .pyc

.py.pyc:
        @echo "Compiling $<..."
        @$(PYTHON) -c "import py_compile; py_compile.compile('$<', '$*.pyc')"
----------------------------------------

----------------------------------------
address@hidden@
# Update a distribution by using libit files.
# Copyright © 2000 Progiciels Bourbeau-Pinard inc.
# François Pinard <address@hidden>, 2000.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

import string, sys
sys.path.insert(0, '@prefix@/share/@PACKAGE@')

package = '@PACKAGE@'
version = '@VERSION@'
prefix = '@prefix@'
datadir = string.replace('@datadir@', '${prefix}', prefix)
pkgdatadir = string.replace('@pkgdatadir@', '${datadir}', datadir)

import libit
apply(libit.main, tuple(sys.argv[1:]))
----------------------------------------

Aside from the needed update for the Makefile.am machinery, is the top
level generation and redirection the recommended way?




reply via email to

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