From c11c46a6b116a7a7869009dcc75dfb64dc57e7ac Mon Sep 17 00:00:00 2001 From: Jonas Thiem Date: Sat, 7 Feb 2015 22:31:15 +0100 Subject: [PATCH] * adding warning when both dpkg and rpmbuild are present * check for /usr/bin/dpkg-architecture instead of /usr/bin/dpkg-deb (latter appears to be present on Fedora) * insert python site package path into INSTALLSPEC from current interpreter instead of %{__python} (fixes Python 3) --- makepanda/makepanda.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 8bf4f4c2f6..f80f8519ae 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6184,11 +6184,15 @@ Description: Runtime binary and browser plugin for the Panda3D Game Engine """ +def python_sitepackages_path(): + from distutils.sysconfig import get_python_lib + return get_python_lib(1) +PYTHON_SITEPACKAGES=python_sitepackages_path() + # We're not putting "python" in the "Requires" field, # since the rpm-based distros don't have a common # naming for the Python package. INSTALLER_SPEC_FILE=""" -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Summary: The Panda3D free 3D engine SDK Name: panda3d Version: VERSION @@ -6217,7 +6221,7 @@ This package contains the SDK for development with Panda3D, install panda3d-runt /usr/share/applications/*.desktop /etc/ld.so.conf.d/panda3d.conf /usr/%_lib/panda3d -%{python_sitearch} +""" + PYTHON_SITEPACKAGES + """ /usr/include/panda3d """ @@ -6285,7 +6289,17 @@ def MakeInstallerLinux(): oscmd("rm -rf targetroot data.tar.gz control.tar.gz panda3d.spec") oscmd("mkdir --mode=0755 targetroot") - if os.path.exists("/usr/bin/dpkg-deb"): + dpkg_present = False + if os.path.exists("/usr/bin/dpkg-architecture"): + dpkg_present = True + rpmbuild_present = False + if os.path.exists("/usr/bin/rpmbuild"): + rpmbuild_present = True + + if dpkg_present and rpmbuild_present: + print("Warning: both dpkg-architecture and rpmbuild present.") + + if dpkg_present: # Invoke installpanda.py to install it into a temporary dir lib_dir = GetDebLibDir() if RUNTIME: @@ -6372,7 +6386,7 @@ def MakeInstallerLinux(): oscmd("chmod 644 targetroot/DEBIAN/conffiles targetroot/DEBIAN/symbols") oscmd("fakeroot dpkg-deb -b targetroot %s_%s_%s.deb" % (pkg_name, pkg_version, pkg_arch)) - elif os.path.exists("/usr/bin/rpmbuild"): + elif rpmbuild_present: # Invoke installpanda.py to install it into a temporary dir if RUNTIME: InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())