automake-patches
[Top][All Lists]
Advanced

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

python-files-can-appear-in-subdirs.patch


From: Alexandre Duret-Lutz
Subject: python-files-can-appear-in-subdirs.patch
Date: Wed, 26 Sep 2001 18:47:27 +0200

This allows

 python_PYTHON = subdir/mumble.py

2001-09-26  Alexandre Duret-Lutz  <address@hidden>

        * lib/am/python.am (install-%DIR%PYTHON): Strip path of source files,
        allowing to install python files from subdirectories.

--- lib/am/python.am.15 Wed Sep 26 16:37:14 2001
+++ lib/am/python.am    Wed Sep 26 17:01:02 2001
@@ -28,16 +28,20 @@
 install-%DIR%PYTHON: $(%DIR%_PYTHON)
        @$(NORMAL_INSTALL)
        $(mkinstalldirs) $(DESTDIR)$(%DIR%dir)
-       @list='$(%DIR%_PYTHON)'; for p in $$list; do\
+       @list='$(%DIR%_PYTHON)'; dlist=''; for p in $$list; do\
          if test -f $(srcdir)/$$p; then \
+## Compute basename of source file.  We want to install 'python/foo.py'
+## as '$(DESTDIR)$(%DIR%dir)/foo.yo', not '$(DESTDIR)$(%DIR%dir)/python/foo.yo'
+           d=`echo "$$p" | sed -e 's,^.*/,,'`; \
+           dlist="$$dlist $$d"; \
 ## Don't perform translation, since script name is important.
-           echo " $(INSTALL_PROGRAM) $(srcdir)/$$p $(DESTDIR)$(%DIR%dir)/$$p"; 
\
-           $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(%DIR%dir)/$$p; \
+           echo " $(INSTALL_PROGRAM) $(srcdir)/$$p $(DESTDIR)$(%DIR%dir)/$$d"; 
\
+           $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(%DIR%dir)/$$d; \
          else :; fi; \
-       done
+       done; \
 ## Byte-compile must be done at install time, since file times are
 ## encoded in the actual files.
-       @PYTHON=$(PYTHON) $(py_compile) --basedir $(DESTDIR)$(%DIR%dir) 
$(%DIR%_PYTHON)
+       PYTHON=$(PYTHON) $(py_compile) --basedir $(DESTDIR)$(%DIR%dir) $$dlist
 endif %?INSTALL%
 
 



reply via email to

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