Changeset: 0804919b6b69 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0804919b6b69 Modified Files: MonetDB.spec NT/rules.msc buildtools/autogen/autogen/am.py buildtools/autogen/autogen/msc.py clients/Makefile.ag clients/python3/Makefile.ag configure.ag Branch: default Log Message:
Merge with Oct2012 branch. diffs (truncated from 332 to 300 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -43,7 +43,8 @@ BuildRequires: libxml2-devel BuildRequires: openssl-devel BuildRequires: pcre-devel >= 4.5 BuildRequires: perl -BuildRequires: python +BuildRequires: python-devel +BuildRequires: python3-devel # BuildRequires: raptor-devel >= 1.4.16 BuildRequires: readline-devel BuildRequires: ruby @@ -57,7 +58,9 @@ BuildRequires: zlib-devel Obsoletes: %{name}-devel %define perl_libdir %(perl -MConfig -e '$x=$Config{installvendorarch}; $x =~ s|$Config{vendorprefix}/||; print $x;') -%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) +# need to define python_sitelib on RHEL 5 and older +# no need to define python3_sitelib: it's defined by python3-devel +%if 0%{?rhel} && 0%{?rhel} <= 5 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %endif %{!?gem_dir: %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)} @@ -475,10 +478,8 @@ fi Summary: MonetDB5 SQL server modules Group: Applications/Databases Requires: MonetDB5-server = %{version}-%{release} -%if (0%{?fedora} > 14) # for systemd-tmpfiles Requires: systemd-units -%endif Obsoletes: MonetDB-SQL-devel Obsoletes: %{name}-SQL @@ -491,24 +492,16 @@ accelerators. It also has an SQL fronte This package contains the SQL frontend for MonetDB5. If you want to use SQL with MonetDB, you will need to install this package. -%if (0%{?fedora} > 14) %post SQL-server5 systemd-tmpfiles --create %{_sysconfdir}/tmpfiles.d/monetdbd.conf -%endif %files SQL-server5 %defattr(-,root,root) %{_bindir}/monetdb %{_bindir}/monetdbd %dir %attr(775,monetdb,monetdb) %{_localstatedir}/log/monetdb -%if (0%{?fedora} > 14) # Fedora 15 and newer %{_sysconfdir}/tmpfiles.d/monetdbd.conf -%else -# Fedora 14 and older -%dir %attr(775,monetdb,monetdb) %{_localstatedir}/run/monetdb -%exclude %{_sysconfdir}/tmpfiles.d/monetdbd.conf -%endif %config(noreplace) %{_localstatedir}/monetdb5/dbfarm/.merovingian_properties %{_libdir}/monetdb5/autoload/*_sql.mal %{_libdir}/monetdb5/lib_sql.so @@ -548,6 +541,28 @@ program. %{python_sitelib}/python_monetdb-*.egg-info %doc clients/python/README.rst +%package -n python3-monetdb +Summary: Native MonetDB client Python3 API +Group: Applications/Databases +Requires: python3 +BuildArch: noarch + +%description -n python3-monetdb +MonetDB is a database management system that is developed from a +main-memory perspective with use of a fully decomposed storage model, +automatic index management, extensibility of data types and search +accelerators. It also has an SQL frontend. + +This package contains the files needed to use MonetDB from a Python3 +program. + +%files -n python3-monetdb +%defattr(-,root,root) +%dir %{python3_sitelib}/monetdb +%{python3_sitelib}/monetdb/* +%{python3_sitelib}/python_monetdb-*.egg-info +%doc clients/python3/README.rst + %package testing Summary: MonetDB - Monet Database Management System Group: Applications/Databases @@ -637,6 +652,7 @@ developer, but if you do want to test, t --with-perl=yes \ --with-pthread=yes \ --with-python=yes \ + --with-python3=yes \ --with-readline=yes \ --with-rubygem=yes \ --with-rubygem-dir="%{gem_dir}" \ diff --git a/NT/rules.msc b/NT/rules.msc --- a/NT/rules.msc +++ b/NT/rules.msc @@ -82,6 +82,14 @@ PYTHONLIB=python27.lib !ENDIF PYTHON_LIBDIR=share\MonetDB\python +!IFNDEF PYTHON3BASE +PYTHON3BASE=C:\Python32 +!ENDIF +!IFNDEF PYTHON3LIB +PYTHON3LIB=python32.lib +!ENDIF +PYTHON3_LIBDIR=share\MonetDB\python3 + !IFDEF HAVE_PERL !IFNDEF LIBPERL !IF $(bits) == 32 @@ -362,6 +370,11 @@ create_winconfig_conds_new_py: !ELSE $(ECHO) HAVE_PYTHON_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py" !ENDIF +!IFDEF HAVE_PYTHON3 + $(ECHO) HAVE_PYTHON3_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py" +!ELSE + $(ECHO) HAVE_PYTHON3_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py" +!ENDIF !IFDEF HAVE_RAPTOR $(ECHO) HAVE_RAPTOR_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py" !ELSE @@ -424,6 +437,8 @@ CONFIGURE=$(PYTHON) $(CONFIGURE_PY) \ "PERL_LIBDIR=$(PERL_LIBDIR)" \ "PYTHON=$(PYTHON)" \ "PYTHON_LIBDIR=$(PYTHON_LIBDIR)" \ + "PYTHON3=$(PYTHON3)" \ + "PYTHON3_LIBDIR=$(PYTHON3_LIBDIR)" \ "RUBY_DIR=$(RUBY_DIR)" \ "TOPDIR=$(TOPDIR)" \ "VERSION=$(VERSION)" \ diff --git a/buildtools/autogen/autogen/am.py b/buildtools/autogen/autogen/am.py --- a/buildtools/autogen/autogen/am.py +++ b/buildtools/autogen/autogen/am.py @@ -985,7 +985,7 @@ def am_gem(fd, var, gem, am): fd.write('uninstall-local-%s:\n' % sf) fd.write('endif\n') -def am_python(fd, var, python, am): +def am_python_generic(fd, var, python, am, PYTHON): pyre = re.compile(r'packages *= *\[ *(.*[^ ]) *\]') pynmre = re.compile('name *= *([\'"])([^\'"]+)\\1') fd.write('all-local-%s:\n' % var) @@ -1005,21 +1005,27 @@ def am_python(fd, var, python, am): fd.write("\t[ '$(srcdir)' -ef . ] || mkdir -p '%s'\n" % pkgdir) fd.write("\t[ '$(srcdir)' -ef . ] || cp -p '$(srcdir)/%s'/*.py '%s'\n" % (pkgdir, pkgdir)) fd.write("\t[ '$(srcdir)' -ef . ] || cp -p '$(srcdir)/README.rst' .\n") - fd.write("\t$(PYTHON) '%s' build\n" % f) + fd.write("\t$(%s) '%s' build\n" % (PYTHON, f)) fd.write('install-exec-local-%s:\n' % var) for f in python['FILES']: # see buildtools/conf/rules.mk for PY_INSTALL_LAYOUT # it is needed to install into dist-packages on Debian/Ubuntu - fd.write("\t$(PYTHON) '%s' install $(PY_INSTALL_LAYOUT) --prefix='$(DESTDIR)$(prefix)'\n" % f) + fd.write("\t$(%s) '%s' install $(PY_INSTALL_LAYOUT) --prefix='$(DESTDIR)$(prefix)'\n" % (PYTHON, f)) fd.write('uninstall-local-%s:\n' % var) for pkgdir in sorted(pkgdirs, reverse = True): - fd.write("\trm -r '$(DESTDIR)$(prefix)/$(PYTHON_LIBDIR)/%s'\n" % pkgdir) + fd.write("\trm -r '$(DESTDIR)$(prefix)/$(%s_LIBDIR)/%s'\n" % (PYTHON, pkgdir)) for name in pkgnams: - fd.write("\trm '$(DESTDIR)$(prefix)/$(PYTHON_LIBDIR)'/%s-*.egg-info\n" % name.replace('-', '_')) + fd.write("\trm '$(DESTDIR)$(prefix)/$(%s_LIBDIR)'/%s-*.egg-info\n" % (PYTHON, name.replace('-', '_'))) fd.write('mostlyclean-local:\n') for pkgdir in sorted(pkgdirs, reverse = True): fd.write("\t[ '$(srcdir)' -ef . ] || rm -r '%s'\n" % pkgdir) +def am_python(fd, var, python, am): + am_python_generic(fd, var, python, am, 'PYTHON') + +def am_python3(fd, var, python3, am): + am_python_generic(fd, var, python3, am, 'PYTHON3') + def am_ant(fd, var, ant, am): target = var[4:] # the ant target to call @@ -1149,6 +1155,7 @@ output_funcs = {'SUBDIRS': am_subdirs, 'ANT': am_ant, 'GEM': am_gem, 'PYTHON': am_python, + 'PYTHON3': am_python3, } def output(tree, cwd, topdir, automake, conditional): diff --git a/buildtools/autogen/autogen/msc.py b/buildtools/autogen/autogen/msc.py --- a/buildtools/autogen/autogen/msc.py +++ b/buildtools/autogen/autogen/msc.py @@ -1009,14 +1009,14 @@ def msc_gem(fd, var, gem, msc): fd.write('install_%s:\n' % f) fd.write('!ENDIF\n') -def msc_python(fd, var, python, msc): +def msc_python_generic(fd, var, python, msc, PYTHON): pyre = re.compile(r'packages *= *\[ *(.*[^ ]) *\]') for f in python['FILES']: msc['SCRIPTS'].append('target_python_%s' % f) srcs = map(lambda x: x.strip('\'" ').replace('.', '\\'), pyre.search(open(os.path.join(msc['cwd'], f)).read()).group(1).split(', ')) fd.write('target_python_%s: %s README.rst %s\n' % (f, ' '.join(srcs), f)) - fd.write('\t$(PYTHON) %s build\n' % f) + fd.write('\t$(%s) %s build\n' % (PYTHON, f)) for src in srcs: fd.write('%s: "$(srcdir)\\%s"\n' % (src, src)) fd.write('\tif not exist "%s" $(MKDIR) "%s"\n' % (src, src)) @@ -1027,7 +1027,13 @@ def msc_python(fd, var, python, msc): fd.write('\t$(INSTALL) "$(srcdir)\\README.rst" "README.rst"\n') msc['INSTALL'][f] = f, '', '', '', '' fd.write('install_%s:\n' % f) - fd.write('\t$(PYTHON) %s install --prefix "$(prefix)"\n' % f) + fd.write('\t$(%s) %s install --prefix "$(prefix)"\n' % (PYTHON, f)) + +def msc_python(fd, var, python, msc): + msc_python_generic(fd, var, python, msc, 'PYTHON') + +def msc_python3(fd, var, python3, msc): + msc_python_generic(fd, var, python3, msc, 'PYTHON3') callantno = 0 def msc_ant(fd, var, ant, msc): @@ -1100,6 +1106,7 @@ output_funcs = {'SUBDIRS': msc_subdirs, 'ANT': msc_ant, 'GEM': msc_gem, 'PYTHON': msc_python, + 'PYTHON3': msc_python3, } def output(tree, cwd, topdir): diff --git a/clients/Makefile.ag b/clients/Makefile.ag --- a/clients/Makefile.ag +++ b/clients/Makefile.ag @@ -15,6 +15,6 @@ # Copyright August 2008-2012 MonetDB B.V. # All Rights Reserved. -SUBDIRS = mapilib mapiclient HAVE_ODBC?odbc HAVE_PERL?perl php HAVE_RUBYGEM?ruby examples HAVE_PYTHON?python HAVE_PYTHON?python3 NATIVE_WIN32?NT +SUBDIRS = mapilib mapiclient HAVE_ODBC?odbc HAVE_PERL?perl php HAVE_RUBYGEM?ruby examples HAVE_PYTHON?python HAVE_PYTHON3?python3 NATIVE_WIN32?NT EXTRA_DIST_DIR = Tests diff --git a/clients/python3/Makefile.ag b/clients/python3/Makefile.ag --- a/clients/python3/Makefile.ag +++ b/clients/python3/Makefile.ag @@ -15,7 +15,7 @@ # Copyright August 2008-2012 MonetDB B.V. # All Rights Reserved. -python_setup = { +python3_setup = { FILES = setup.py } diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -1185,6 +1185,74 @@ AC_SUBST(PYTHON) AM_CONDITIONAL(HAVE_PYTHON, test x"$have_python" != xno) AC_SUBST(PYTHON_LIBDIR) +have_python3=auto +PYTHON3=python3 + +AC_ARG_WITH(python3, + AS_HELP_STRING([--with-python3=FILE], [python3 is installed as FILE]), + have_python3="$withval") + +case "$have_python3" in + yes|no|auto) ;; + *) + PYTHON3="$have_python3" + have_python3=yes + ;; +esac + +if test "x$have_python3" != xno; then + if test x$cross_compiling != xyes; then + AC_PATH_PROG(PYTHON3,$PYTHON3,no,$PATH) + if test "x$PYTHON3" = xno; then + if test "x$have_python3" != xauto; then + AC_MSG_ERROR([No Python3 executable found]) + fi + have_python3=no + fi + fi +fi + +if test "x$have_python3" != xno; then + have_python3_libdir=auto + + AC_ARG_WITH(python3-libdir, + AS_HELP_STRING([--with-python3-libdir=DIR], + [relative path for Python3 library directory (where Python3 modules should be installed)]), + have_python3_libdir="$withval") + + case "$have_python3_libdir" in + yes|auto) + if test x$cross_compiling = xyes; then + AC_MSG_ERROR([Must specify --with-python3-libdir when cross compiling]) _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list