From c11c46a6b116a7a7869009dcc75dfb64dc57e7ac Mon Sep 17 00:00:00 2001 From: Jonas Thiem Date: Sat, 7 Feb 2015 22:31:15 +0100 Subject: [PATCH 1/3] * 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()) From 76ca80dcd5cff1364ab25deb1349930581d59a53 Mon Sep 17 00:00:00 2001 From: Jonas Thiem Date: Sat, 7 Feb 2015 22:37:40 +0100 Subject: [PATCH 2/3] Moving over PYTHON_SITEPACKAGES definition from makepanda.py to installpanda.py --- makepanda/installpanda.py | 5 +++++ makepanda/makepanda.py | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/makepanda/installpanda.py b/makepanda/installpanda.py index c35ad8abd3..b1804942d8 100644 --- a/makepanda/installpanda.py +++ b/makepanda/installpanda.py @@ -17,6 +17,11 @@ from distutils.sysconfig import get_python_lib from optparse import OptionParser from makepandacore import * +def python_sitepackages_path(): + from distutils.sysconfig import get_python_lib + return get_python_lib(1) +PYTHON_SITEPACKAGES=python_sitepackages_path() + MIME_INFO = ( ("egg", "model/x-egg", "EGG model file", "pview"), ("bam", "model/x-bam", "Panda3D binary model file", "pview"), diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index f80f8519ae..e3ceecb3b0 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6184,10 +6184,6 @@ 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 From 9a96809fa5506540490bbbf060d2e9631f23cb79 Mon Sep 17 00:00:00 2001 From: Jonas Thiem Date: Sat, 7 Feb 2015 22:47:14 +0100 Subject: [PATCH 3/3] Adding additional check for /usr/bin/dpkg-deb back in --- makepanda/makepanda.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index e3ceecb3b0..ddb29a8c93 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -6286,14 +6286,14 @@ def MakeInstallerLinux(): oscmd("mkdir --mode=0755 targetroot") dpkg_present = False - if os.path.exists("/usr/bin/dpkg-architecture"): + if os.path.exists("/usr/bin/dpkg-architecture") and os.path.exists("/usr/bin/dpkg-deb"): 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.") + print("Warning: both dpkg and rpmbuild present.") if dpkg_present: # Invoke installpanda.py to install it into a temporary dir