Build and install the python module by default

This commit is contained in:
Jean-Francois Dockes 2012-03-24 16:26:56 +01:00
parent 5bcf17a224
commit 1b9cb605f2
14 changed files with 160 additions and 44 deletions

View File

@ -67,6 +67,8 @@ src/lib/alldeps
src/lib/librcl.a src/lib/librcl.a
src/mk/localdefs src/mk/localdefs
src/mk/sysconf src/mk/sysconf
src/python/recoll/build
src/python/recoll/setup.py
src/qtgui/.moc/* src/qtgui/.moc/*
src/qtgui/.obj/* src/qtgui/.obj/*
src/qtgui/.ui/* src/qtgui/.ui/*

View File

@ -5,7 +5,7 @@
# sudo apt-get install pkg-kde-tools cdbs # sudo apt-get install pkg-kde-tools cdbs
RCLVERS=1.17.0 RCLVERS=1.17.0
PPAVERS=1 PPAVERS=0
case $RCLVERS in case $RCLVERS in
[23]*) PPANAME=recollexp-ppa;; [23]*) PPANAME=recollexp-ppa;;
@ -18,7 +18,7 @@ debdir=debianrclqt4
series4="lucid maverick natty oneiric precise" series4="lucid maverick natty oneiric precise"
rm -rf recoll-${RCLVERS}/debian rm -rf recoll-${RCLVERS}/debian
cp -rp $debdir recoll-${RCLVERS}/debian cp -rp ${debdir}/ recoll-${RCLVERS}/debian
for series in $series4 ; do for series in $series4 ; do
if test -f $debdir/control-$series ; then if test -f $debdir/control-$series ; then
@ -42,7 +42,7 @@ seriesk=""
debdir=debiankio debdir=debiankio
rm -rf recoll-${RCLVERS}/debian rm -rf recoll-${RCLVERS}/debian
cp -rp $debdir recoll-${RCLVERS}/debian cp -rp ${debdir}/ recoll-${RCLVERS}/debian
for series in $seriesk ; do for series in $seriesk ; do
sed -e s/SERIES/$series/g < ${debdir}/changelog > \ sed -e s/SERIES/$series/g < ${debdir}/changelog > \
recoll-${RCLVERS}/debian/changelog ; recoll-${RCLVERS}/debian/changelog ;

View File

@ -5,17 +5,19 @@ Maintainer: Jean-Francois Dockes <jf@dockes.org>
Build-Depends: debhelper (>= 7), Build-Depends: debhelper (>= 7),
autotools-dev, autotools-dev,
libqt4-dev, libqt4-dev,
libqtwebkit-dev, libqtwebkit-dev,
libxapian-dev (>= 1.0.15), libxapian-dev (>= 1.0.15),
libx11-dev, libx11-dev,
libz-dev libz-dev,
python-dev,
quilt
Standards-Version: 3.8.3 Standards-Version: 3.8.3
Package: recoll Package: recoll
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends} Depends: ${shlibs:Depends}, ${misc:Depends}
Recommends: aspell, python Recommends: aspell, python, xsltproc
Suggests: antiword, catdoc, ghostscript, libimage-exiftool-perl, poppler-utils, unrtf, python-mutagen, xsltproc Suggests: antiword, catdoc, ghostscript, libimage-exiftool-perl, poppler-utils, unrtf, python-mutagen
Description: a personal full text search package with a QT GUI Description: a personal full text search package with a QT GUI
The Recoll personal full text search package is based on a very strong The Recoll personal full text search package is based on a very strong
backend (Xapian), for which it provides an easy to use and feature-rich backend (Xapian), for which it provides an easy to use and feature-rich

View File

@ -7,14 +7,16 @@ Build-Depends: debhelper (>= 7),
libqt4-dev, libqt4-dev,
libxapian-dev (>= 1.0.15), libxapian-dev (>= 1.0.15),
libx11-dev, libx11-dev,
libz-dev libz-dev,
python-dev,
quilt
Standards-Version: 3.8.3 Standards-Version: 3.8.3
Package: recoll Package: recoll
Architecture: any Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends} Depends: ${shlibs:Depends}, ${misc:Depends}
Recommends: aspell, python Recommends: aspell, python, xsltproc
Suggests: antiword, catdoc, ghostscript, libimage-exiftool-perl, poppler-utils, unrtf, python-mutagen, xsltproc Suggests: antiword, catdoc, ghostscript, libimage-exiftool-perl, poppler-utils, unrtf, python-mutagen
Description: a personal full text search package with a QT GUI Description: a personal full text search package with a QT GUI
The Recoll personal full text search package is based on a very strong The Recoll personal full text search package is based on a very strong
backend (Xapian), for which it provides an easy to use and feature-rich backend (Xapian), for which it provides an easy to use and feature-rich

View File

@ -0,0 +1,12 @@
setup.py --root and --user options interfer with debian wanting a dist-packages,
not site-packages installation for python modules
--- a/recollinstall.in
+++ b/recollinstall.in
@@ -139,5 +139,4 @@
${datadir}/recoll/translations/recoll_zh.qm || exit 1
-@NOPYTHON@(cd python/recoll;python setup.py install \
- --prefix=${REALPREFIX} ${ROOTFORPYTHON})
+#@NOPYTHON@(cd python/recoll;python setup.py install \
+# --prefix=${REALPREFIX} ${ROOTFORPYTHON})

View File

@ -0,0 +1 @@
fix-python-install.patch

View File

@ -1,5 +1,7 @@
#!/usr/bin/make -f #!/usr/bin/make -f
include /usr/share/quilt/quilt.make
# Uncomment this to turn on verbose mode. # Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1 #export DH_VERBOSE=1
@ -7,7 +9,7 @@ DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CFLAGS = -Wall -g CFLAGS = -Wall -g
LDFLAGS = -Wl,-z,defs #LDFLAGS = -Wl,-z,defs
#build qt4 UI only #build qt4 UI only
export QMAKE=qmake-qt4 export QMAKE=qmake-qt4
@ -27,12 +29,12 @@ config.status: configure
--prefix=/usr --prefix=/usr
build: build-stamp build: build-stamp
build-stamp: config.status build-stamp: $(QUILT_STAMPFN) config.status
dh_testdir dh_testdir
$(MAKE) $(MAKE)
touch $@ touch $@
clean: clean: unpatch
dh_testdir dh_testdir
dh_testroot dh_testroot
rm -f build-stamp config.log rm -f build-stamp config.log
@ -44,8 +46,8 @@ install:
dh_testroot dh_testroot
dh_prep dh_prep
dh_installdirs dh_installdirs
$(MAKE) prefix=$(CURDIR)/debian/recoll/usr install $(MAKE) prefix=$(CURDIR)/debian/recoll/usr install
(cd python/recoll;python setup.py install --install-layout=deb --root=$(CURDIR)/debian/recoll/ )
binary-arch: build install binary-arch: build install
dh_testdir dh_testdir

View File

@ -15,7 +15,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
License: GPL License: GPL
# libxapian-devel or xapian-core-devel? # libxapian-devel or xapian-core-devel?
BuildRequires: libqt4-devel zlib-devel xapian-core-devel libuuid-devel BuildRequires: libqt4-devel zlib-devel libxapian-devel libuuid-devel python-devel
%description %description
Recoll is a personal full text search package for Linux, FreeBSD and Recoll is a personal full text search package for Linux, FreeBSD and
@ -51,6 +51,7 @@ rm -rf $RPM_BUILD_ROOT
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{_bindir}/* %{_bindir}/*
%{python_sitearch}/
%{_datadir}/%{name} %{_datadir}/%{name}
%{_datadir}/applications/recoll-searchgui.desktop %{_datadir}/applications/recoll-searchgui.desktop
%{_datadir}/icons/hicolor/48x48/apps/recoll.png %{_datadir}/icons/hicolor/48x48/apps/recoll.png

View File

@ -16,6 +16,7 @@ all: mk/sysconf
${MAKE} -C index recollindex ${MAKE} -C index recollindex
@NOQTMAKE@(cd $(QTGUI); ${QMAKE} recoll.pro) @NOQTMAKE@(cd $(QTGUI); ${QMAKE} recoll.pro)
@NOQTMAKE@${MAKE} -C $(QTGUI) depth=.. @NOQTMAKE@${MAKE} -C $(QTGUI) depth=..
@NOPYTHON@${MAKE} -C python/recoll
${MAKE} -C query recollq ${MAKE} -C query recollq
mk/sysconf: mk/sysconf:
@ -40,6 +41,8 @@ clean:
${MAKE} -C lib clean ${MAKE} -C lib clean
${MAKE} -C query clean ${MAKE} -C query clean
${MAKE} -C utils clean ${MAKE} -C utils clean
-${MAKE} -C desktop/unity-lens-recoll clean
-${MAKE} -C python/recoll clean
@NOQTMAKE@@-${MAKE} -C $(QTGUI) clean @NOQTMAKE@@-${MAKE} -C $(QTGUI) clean
rm -f qtgui/Makefile qtgui/confgui/Makefile qtgui/recoll rm -f qtgui/Makefile qtgui/confgui/Makefile qtgui/recoll
rm -f filters/rclexecm.pyc rm -f filters/rclexecm.pyc
@ -51,6 +54,8 @@ clean:
# Note: we don't remove the top Makefile, to keep the "clean" targets # Note: we don't remove the top Makefile, to keep the "clean" targets
# available but a "Make" won't work without a configure anyway # available but a "Make" won't work without a configure anyway
distclean: clean distclean: clean
-${MAKE} -C desktop/unity-lens-recoll distclean
-${MAKE} -C python/recoll distclean
rm -f mk/sysconf mk/localdefs sampleconf/recoll.conf \ rm -f mk/sysconf mk/localdefs sampleconf/recoll.conf \
qtgui/recoll.pro \ qtgui/recoll.pro \
config.log config.status \ config.log config.status \

53
src/configure vendored
View File

@ -602,6 +602,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS ac_subst_vars='LTLIBOBJS
LIBOBJS LIBOBJS
RCLVERSION RCLVERSION
NOPYTHON
NOPIC NOPIC
LIBQZEITGEIST LIBQZEITGEIST
QMAKE_DISABLE_ZEITGEIST QMAKE_DISABLE_ZEITGEIST
@ -692,6 +693,7 @@ with_inotify
with_fam with_fam
enable_xattr enable_xattr
enable_camelcase enable_camelcase
enable_python_module
enable_pic enable_pic
enable_qtgui enable_qtgui
enable_webkit enable_webkit
@ -1341,9 +1343,10 @@ Optional Features:
manual" and "my sql manual" are the same, but not manual" and "my sql manual" are the same, but not
the same as "mysql manual" (in phrases only and you the same as "mysql manual" (in phrases only and you
could raise the phrase slack to get a match). could raise the phrase slack to get a match).
--enable-pic Compile library objects as position independant --disable-python-module Do not build the Python module.
code. This is necessary for building the php --enable-pic Do not compile library objects as position
extension. independant code. This is incompatible with the php
or python extensions.
--disable-qtgui Disable the QT-based graphical user interface. --disable-qtgui Disable the QT-based graphical user interface.
--disable-webkit Disable use of qt-webkit. --disable-webkit Disable use of qt-webkit.
--disable-x11mon Disable recollindex support for X11 session --disable-x11mon Disable recollindex support for X11 session
@ -4343,21 +4346,43 @@ $as_echo "#define RCL_SPLIT_CAMELCASE 1" >>confdefs.h
fi fi
# Build PIC objects for the library. This is necessary when building the # Disable building the python module. This is built by default, because
# php extension, would be useful for the others, and costs little. I wonder # it's really the easiest way to interface and extend recoll. It forces PIC
# if this should be made the default. # objects for everything (indexing performance impact: 1%), because it's
# Not by default as these are little used for now. # just not worth building the lib twice
# You can still have a non-pic recoll with:
# configure --disable-python-module; make; make install;make clean
# configure; make; cd python/recoll; make install
#
# Check whether --enable-python-module was given.
if test "${enable_python_module+set}" = set; then :
enableval=$enable_python_module; pythonEnabled=$enableval
else
pythonEnabled=yes
fi
if test X$pythonEnabled = Xyes ; then
NOPYTHON=""
else
NOPYTHON="#"
fi
# Build PIC objects for the library ?
# Check whether --enable-pic was given. # Check whether --enable-pic was given.
if test "${enable_pic+set}" = set; then : if test "${enable_pic+set}" = set; then :
enableval=$enable_pic; picEnabled=$enableval enableval=$enable_pic; picEnabled=$enableval
else else
picEnabled=no picEnabled=forpython
fi fi
if test X$picEnabled = Xyes ; then case $picEnabled in
NOPIC="" forpython) picEnabled=$pythonEnabled; NOPIC=$NOPYTHON;;
else yes) NOPIC="";;
NOPIC="#" *) NOPIC="#";;
esac
if test X$pythonEnabled = Xyes -a X$picEnabled != Xyes; then
as_fn_error $? "Python build needs PIC library" "$LINENO" 5
fi fi
for ac_func in mkdtemp for ac_func in mkdtemp
@ -5644,6 +5669,7 @@ RCLVERSION='1.17.0'
# All object files depend on localdefs which has the cc flags. Avoid # All object files depend on localdefs which has the cc flags. Avoid
@ -5658,6 +5684,8 @@ ac_config_files="$ac_config_files sampleconf/recoll.conf"
ac_config_files="$ac_config_files common/rclversion.h" ac_config_files="$ac_config_files common/rclversion.h"
ac_config_files="$ac_config_files python/recoll/setup.py"
for d in bincimapmime index lib query for d in bincimapmime index lib query
do do
@ -6375,6 +6403,7 @@ do
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"sampleconf/recoll.conf") CONFIG_FILES="$CONFIG_FILES sampleconf/recoll.conf" ;; "sampleconf/recoll.conf") CONFIG_FILES="$CONFIG_FILES sampleconf/recoll.conf" ;;
"common/rclversion.h") CONFIG_FILES="$CONFIG_FILES common/rclversion.h" ;; "common/rclversion.h") CONFIG_FILES="$CONFIG_FILES common/rclversion.h" ;;
"python/recoll/setup.py") CONFIG_FILES="$CONFIG_FILES python/recoll/setup.py" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac esac

View File

@ -194,19 +194,38 @@ if test X$camelcaseEnabled = Xyes ; then
AC_DEFINE(RCL_SPLIT_CAMELCASE, 1, [Split camelCase words]) AC_DEFINE(RCL_SPLIT_CAMELCASE, 1, [Split camelCase words])
fi fi
# Build PIC objects for the library. This is necessary when building the # Disable building the python module. This is built by default, because
# php extension, would be useful for the others, and costs little. I wonder # it's really the easiest way to interface and extend recoll. It forces PIC
# if this should be made the default. # objects for everything (indexing performance impact: 1%), because it's
# Not by default as these are little used for now. # just not worth building the lib twice
# You can still have a non-pic recoll with:
# configure --disable-python-module; make; make install;make clean
# configure; make; cd python/recoll; make install
#
AC_ARG_ENABLE(python-module,
AC_HELP_STRING([--disable-python-module],
[Do not build the Python module.]),
pythonEnabled=$enableval, pythonEnabled=yes)
if test X$pythonEnabled = Xyes ; then
NOPYTHON=""
else
NOPYTHON="#"
fi
# Build PIC objects for the library ?
AC_ARG_ENABLE(pic, AC_ARG_ENABLE(pic,
AC_HELP_STRING([--enable-pic], AC_HELP_STRING([--enable-pic],
[Compile library objects as position independant code. This is necessary [Do not compile library objects as position independant code.
for building the php extension.]), This is incompatible with the php or python extensions.]),
picEnabled=$enableval, picEnabled=no) picEnabled=$enableval, picEnabled=forpython)
if test X$picEnabled = Xyes ; then case $picEnabled in
NOPIC="" forpython) picEnabled=$pythonEnabled; NOPIC=$NOPYTHON;;
else yes) NOPIC="";;
NOPIC="#" *) NOPIC="#";;
esac
if test X$pythonEnabled = Xyes -a X$picEnabled != Xyes; then
AC_MSG_ERROR([Python build needs PIC library])
fi fi
AC_CHECK_FUNCS(mkdtemp) AC_CHECK_FUNCS(mkdtemp)
@ -500,6 +519,7 @@ AC_SUBST(QMAKE_ENABLE_ZEITGEIST)
AC_SUBST(QMAKE_DISABLE_ZEITGEIST) AC_SUBST(QMAKE_DISABLE_ZEITGEIST)
AC_SUBST(LIBQZEITGEIST) AC_SUBST(LIBQZEITGEIST)
AC_SUBST(NOPIC) AC_SUBST(NOPIC)
AC_SUBST(NOPYTHON)
AC_SUBST(RCLVERSION) AC_SUBST(RCLVERSION)
# All object files depend on localdefs which has the cc flags. Avoid # All object files depend on localdefs which has the cc flags. Avoid
@ -509,6 +529,7 @@ AC_CONFIG_FILES(recollinstall)
AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(sampleconf/recoll.conf) AC_CONFIG_FILES(sampleconf/recoll.conf)
AC_CONFIG_FILES(common/rclversion.h) AC_CONFIG_FILES(common/rclversion.h)
AC_CONFIG_FILES(python/recoll/setup.py)
for d in bincimapmime index lib query for d in bincimapmime index lib query
do do

View File

@ -60,6 +60,31 @@ desktop/recoll-searchgui.desktop
desktop/recoll.png desktop/recoll.png
desktop/recoll.xcf desktop/recoll.xcf
desktop/recollindex.desktop desktop/recollindex.desktop
desktop/unity-lens-recoll/
desktop/unity-lens-recoll/AUTHORS
desktop/unity-lens-recoll/COPYING
desktop/unity-lens-recoll/ChangeLog
desktop/unity-lens-recoll/INSTALL
desktop/unity-lens-recoll/Makefile.am
desktop/unity-lens-recoll/Makefile.in
desktop/unity-lens-recoll/NEWS
desktop/unity-lens-recoll/README
desktop/unity-lens-recoll/acinclude.m4
desktop/unity-lens-recoll/aclocal.m4
desktop/unity-lens-recoll/bin/
desktop/unity-lens-recoll/bin/unity-recoll-daemon.in
desktop/unity-lens-recoll/configure
desktop/unity-lens-recoll/configure.ac
desktop/unity-lens-recoll/data/
desktop/unity-lens-recoll/data/recoll.lens.in
desktop/unity-lens-recoll/data/recollbg24.png
desktop/unity-lens-recoll/data/unity-lens-recoll.service.in
desktop/unity-lens-recoll/install-sh
desktop/unity-lens-recoll/missing
desktop/unity-lens-recoll/py-compile
desktop/unity-lens-recoll/recollscope/
desktop/unity-lens-recoll/recollscope/__init__.py
desktop/unity-lens-recoll/recollscope/rclsearch.py
desktop/xdg-utils-1.0.1/ desktop/xdg-utils-1.0.1/
desktop/xdg-utils-1.0.1/LICENSE desktop/xdg-utils-1.0.1/LICENSE
desktop/xdg-utils-1.0.1/scripts/ desktop/xdg-utils-1.0.1/scripts/
@ -247,8 +272,9 @@ php/sample/shell.php
python/ python/
python/README.txt python/README.txt
python/recoll/ python/recoll/
python/recoll/Makefile
python/recoll/pyrecoll.cpp python/recoll/pyrecoll.cpp
python/recoll/setup.py python/recoll/setup.py.in
python/samples/ python/samples/
python/samples/rcldlkp.py python/samples/rcldlkp.py
python/samples/rclmbox.py python/samples/rclmbox.py
@ -298,6 +324,10 @@ qtgui/i18n/recoll_uk.qm
qtgui/i18n/recoll_uk.ts qtgui/i18n/recoll_uk.ts
qtgui/i18n/recoll_xx.qm qtgui/i18n/recoll_xx.qm
qtgui/i18n/recoll_xx.ts qtgui/i18n/recoll_xx.ts
qtgui/i18n/recoll_zh.qm
qtgui/i18n/recoll_zh.ts
qtgui/i18n/recoll_zh_CN.qm
qtgui/i18n/recoll_zh_CN.ts
qtgui/idxsched.h qtgui/idxsched.h
qtgui/idxsched.ui qtgui/idxsched.ui
qtgui/images/ qtgui/images/
@ -348,6 +378,8 @@ qtgui/rclhelp.h
qtgui/rclmain.ui qtgui/rclmain.ui
qtgui/rclmain_w.cpp qtgui/rclmain_w.cpp
qtgui/rclmain_w.h qtgui/rclmain_w.h
qtgui/rclzg.cpp
qtgui/rclzg.h
qtgui/recoll.h qtgui/recoll.h
qtgui/recoll.pro.in qtgui/recoll.pro.in
qtgui/recoll.qrc qtgui/recoll.qrc

View File

@ -1,10 +1,6 @@
all: all:
python setup.py build python setup.py build
clean: clean:
rm -rf build rm -rf build
distclean: clean distclean: clean
rm -f setup.py
install:
python setup.py install

View File

@ -32,11 +32,14 @@ if test -z "$mandir" ; then
fi fi
fi fi
REALPREFIX=$PREFIX
ROOTFORPYTHON=""
if test -n "$DESTDIR" ; then if test -n "$DESTDIR" ; then
PREFIX=$DESTDIR/$PREFIX PREFIX=$DESTDIR/$PREFIX
bindir=$DESTDIR/$bindir bindir=$DESTDIR/$bindir
datadir=$DESTDIR/$datadir datadir=$DESTDIR/$datadir
mandir=$DESTDIR/$mandir mandir=$DESTDIR/$mandir
ROOTFORPYTHON="--root=${DESTDIR}"
fi fi
echo "Installing to $PREFIX" echo "Installing to $PREFIX"
@ -130,3 +133,11 @@ ${INSTALL} -m 0755 index/rclmon.sh ${datadir}/recoll/examples/ || exit 1
${INSTALL} -m 0444 qtgui/mtpics/*.png ${datadir}/recoll/images || exit 1 ${INSTALL} -m 0444 qtgui/mtpics/*.png ${datadir}/recoll/images || exit 1
${INSTALL} -m 0444 ${I18N}/recoll*.qm ${datadir}/recoll/translations || exit 1 ${INSTALL} -m 0444 ${I18N}/recoll*.qm ${datadir}/recoll/translations || exit 1
# Install the simplified chinese file as just chinese until I can understand
# if it's possible to have both. zh_CN doesn't seem to work
${INSTALL} -m 0444 ${I18N}/recoll_zh_CN.qm \
${datadir}/recoll/translations/recoll_zh.qm || exit 1
@NOPYTHON@(cd python/recoll;python setup.py install \
--prefix=${REALPREFIX} ${ROOTFORPYTHON})