Centralize the python build/install bits in the top Makefile. Build for python2 and python3 (if both present)

This commit is contained in:
Jean-Francois Dockes 2018-06-01 09:42:20 +02:00
parent 7c7eafa98a
commit dae381f49b
4 changed files with 14 additions and 16 deletions

View File

@ -540,7 +540,12 @@ VERSION
if MAKEPYTHON
all-local: recollpython
recollpython: librecoll.la
${MAKE} -C python/recoll libdir=$(libdir)
(cd python/recoll; \
set -x; \
for v in 2 3;do test -n "`which python$${v}`" && \
libdir=$(libdir) python$${v} setup.py build; \
done \
)
install-exec-local: recollpython-install
recollpython-install:
(cd python/recoll; \
@ -548,11 +553,16 @@ recollpython-install:
OPTSFORPYTHON=--install-layout=deb; \
fi; \
set -x; \
python setup.py install \
--prefix=${prefix} --root=$${DESTDIR:-/} $${OPTSFORPYTHON})
for v in 2 3;do test -n "`which python$${v}`" && \
python$${v} setup.py install \
--prefix=${prefix} --root=$${DESTDIR:-/} $${OPTSFORPYTHON}; \
done; \
)
clean-local: recollpython-clean
recollpython-clean:
rm -rf python/recoll/build
rm -rf python/recoll/__pycache__
rm -f python/recoll/*.pyc
endif
if MAKEQT

View File

@ -523,6 +523,5 @@ AC_SUBST(RCLLIBVERSION)
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(common/rclversion.h)
AC_CONFIG_FILES(python/recoll/setup.py)
AC_CONFIG_FILES(python/recoll/Makefile)
AC_OUTPUT

View File

@ -1,12 +0,0 @@
all:
echo libdir: $(libdir)
test '@srcdir@' = '.' || cp -rp @srcdir@/recoll .
libdir=$(libdir) python setup.py build
install:
sudo python setup.py install
clean:
rm -rf build
rm -f recoll/__init__.pyc
rm -rf recoll/__pycache__
distclean: clean
rm -f setup.py

View File

@ -72,6 +72,7 @@ setup (name = 'Recoll',
author_email = 'jfd@recoll.org',
url = 'http://www.recoll.org',
license = 'GPL',
package_dir = {'' : os.path.join(top, 'python', 'recoll')},
long_description = '''
''',
packages = ['recoll'],