Browse Source

New way to build RPMs

Josh Yelon 19 years ago
parent
commit
1ca070aeab
3 changed files with 26 additions and 48 deletions
  1. 13 15
      doc/makepanda/makepanda.py
  2. 0 18
      panda/src/glgsg/glgsg.h
  3. 13 15
      panda/src/glstuff/glstuff_src.h

+ 13 - 15
doc/makepanda/makepanda.py

@@ -4699,21 +4699,13 @@ Version: VERSION
 Release: 1
 Release: 1
 License: Panda3D License
 License: Panda3D License
 Group: Development/Libraries
 Group: Development/Libraries
-BuildRoot: linuxroot
+BuildRoot: PANDASOURCE/linuxroot
 %description
 %description
 The Panda3D engine.
 The Panda3D engine.
-%prep
-%setup -q
-%build
-true
-%install
-true
 %post
 %post
 /sbin/ldconfig
 /sbin/ldconfig
 %postun
 %postun
 /sbin/ldconfig
 /sbin/ldconfig
-%clean
-true
 %files
 %files
 %defattr(-,root,root)
 %defattr(-,root,root)
 /etc/Confauto.prc
 /etc/Confauto.prc
@@ -4730,13 +4722,13 @@ def MakeInstallerLinux():
     import compileall
     import compileall
     PYTHONV=os.path.basename(PYTHONSDK)
     PYTHONV=os.path.basename(PYTHONSDK)
     if (os.path.isdir("linuxroot")): oscmd("chmod -R 755 linuxroot")
     if (os.path.isdir("linuxroot")): oscmd("chmod -R 755 linuxroot")
-    oscmd("rm -rf linuxroot data.tar.gz control.tar.gz ")
+    oscmd("rm -rf linuxroot data.tar.gz control.tar.gz i386 panda3d.spec")
     oscmd("mkdir -p linuxroot/usr/bin")
     oscmd("mkdir -p linuxroot/usr/bin")
     oscmd("mkdir -p linuxroot/usr/include")
     oscmd("mkdir -p linuxroot/usr/include")
     oscmd("mkdir -p linuxroot/usr/share/panda3d")
     oscmd("mkdir -p linuxroot/usr/share/panda3d")
     oscmd("mkdir -p linuxroot/usr/lib/"+PYTHONV+"/lib-dynload")
     oscmd("mkdir -p linuxroot/usr/lib/"+PYTHONV+"/lib-dynload")
     oscmd("mkdir -p linuxroot/usr/lib/"+PYTHONV+"/site-packages")
     oscmd("mkdir -p linuxroot/usr/lib/"+PYTHONV+"/site-packages")
-    oscmd("mkdir -p linuxroot/etc")
+    oscmd("mkdir -p linuxroot/etc/ld.so.conf.d")
     oscmd("sed -e 's@$THIS_PRC_DIR/[.][.]@/usr/share/panda3d@' < built/etc/Config.prc > linuxroot/etc/Config.prc")
     oscmd("sed -e 's@$THIS_PRC_DIR/[.][.]@/usr/share/panda3d@' < built/etc/Config.prc > linuxroot/etc/Config.prc")
     oscmd("cp built/etc/Confauto.prc  linuxroot/etc/Confauto.prc")
     oscmd("cp built/etc/Confauto.prc  linuxroot/etc/Confauto.prc")
     oscmd("cp --recursive built/include linuxroot/usr/include/panda3d")
     oscmd("cp --recursive built/include linuxroot/usr/include/panda3d")
@@ -4750,6 +4742,7 @@ def MakeInstallerLinux():
     oscmd("cp doc/LICENSE               linuxroot/usr/share/panda3d/LICENSE")
     oscmd("cp doc/LICENSE               linuxroot/usr/share/panda3d/LICENSE")
     oscmd("cp doc/LICENSE               linuxroot/usr/include/panda3d/LICENSE")
     oscmd("cp doc/LICENSE               linuxroot/usr/include/panda3d/LICENSE")
     oscmd("cp doc/ReleaseNotes          linuxroot/usr/share/panda3d/ReleaseNotes")
     oscmd("cp doc/ReleaseNotes          linuxroot/usr/share/panda3d/ReleaseNotes")
+    oscmd("echo '/usr/lib/panda3d'   >  linuxroot/etc/ld.so.conf.d/panda3d.conf")
     oscmd("echo '/usr/share/panda3d' >  linuxroot/usr/lib/"+PYTHONV+"/site-packages/panda3d.pth")
     oscmd("echo '/usr/share/panda3d' >  linuxroot/usr/lib/"+PYTHONV+"/site-packages/panda3d.pth")
     oscmd("cp built/bin/*               linuxroot/usr/bin/")
     oscmd("cp built/bin/*               linuxroot/usr/bin/")
     for base in os.listdir("built/lib"):
     for base in os.listdir("built/lib"):
@@ -4773,10 +4766,15 @@ def MakeInstallerLinux():
         oscmd("chmod -R 755 linuxroot")
         oscmd("chmod -R 755 linuxroot")
 
 
     if (os.path.exists("/usr/bin/rpmbuild")):
     if (os.path.exists("/usr/bin/rpmbuild")):
-        txt = INSTALLER_SPEC_FILE[1:].replace("VERSION",str(VERSION)).replace("PYTHONV",PYTHONV)
-        WriteFile("panda3d.spec", SPEC)
-
-
+        txt = INSTALLER_SPEC_FILE[1:].replace("VERSION",VERSION).replace("PANDASOURCE",PANDASOURCE)
+        WriteFile("panda3d.spec", txt)
+        oscmd("rpmbuild --define '_rpmdir "+PANDASOURCE+"' -bb panda3d.spec")
+        oscmd("mv i386/panda3d-"+VERSION+"-1.i386.rpm .")
+        
+    oscmd("chmod -R 755 linuxroot")
+    oscmd("rm -rf linuxroot data.tar.gz control.tar.gz i386 panda3d.spec")
+    
+        
 if (INSTALLER != 0):
 if (INSTALLER != 0):
     if (sys.platform == "win32"):
     if (sys.platform == "win32"):
         MakeInstallerNSIS("Panda3D-"+VERSION+".exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION)
         MakeInstallerNSIS("Panda3D-"+VERSION+".exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION)

+ 0 - 18
panda/src/glgsg/glgsg.h

@@ -37,24 +37,6 @@
 #define EXPCL_GL EXPCL_PANDAGL
 #define EXPCL_GL EXPCL_PANDAGL
 #define EXPTP_GL EXPTP_PANDAGL
 #define EXPTP_GL EXPTP_PANDAGL
 
 
-
-#ifdef WIN32_VC
-// Must include windows.h before gl.h on NT
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
-#ifdef  IS_OSX
-#define __glext_h_
-#include <OpenGL/gl.h>
-#include <OpenGL/glu.h>
-#else
-#include <GL/gl.h>
-#ifdef HAVE_GLU
-#include <GL/glu.h>
-#endif
-#endif 
-
 #include "glstuff_src.h"
 #include "glstuff_src.h"
 
 
 #endif  // GLGSG_H
 #endif  // GLGSG_H

+ 13 - 15
panda/src/glstuff/glstuff_src.h

@@ -37,26 +37,24 @@
 // This file is not protected from multiple inclusion; it may need to
 // This file is not protected from multiple inclusion; it may need to
 // be included multiple times.
 // be included multiple times.
 
 
-// This forces the stuff in panda_glext.h to be reloaded,
-// if it was already loaded.
-#if defined(GL_GLEXT_VERSION) && GL_GLEXT_VERSION < 29
-  #undef GL_GLEXT_VERSION
-  #undef GL_GLEXT_PROTOTYPES
-#ifndef IS_OSX
-  #undef GL_VERSION_1_2
-  #undef GL_VERSION_1_3
-  #undef GL_VERSION_1_4
-  #undef GL_VERSION_1_5
-#endif
-#endif
 
 
-#ifdef IS_OSX
-  #undef GL_GLEXT_VERSION
-  #undef GL_GLEXT_PROTOTYPES
+// This prevents glext.h from getting included by gl.h
+// That way, we can provide our own, better version.
+#define __glext_h_
+#define GL_GLEXT_VERSION 0
+
+#include <GL/gl.h>
+#ifdef HAVE_GLU
+#include <GL/glu.h>
 #endif
 #endif
 
 
+#undef GL_GLEXT_VERSION
 #include "panda_glext.h"
 #include "panda_glext.h"
 
 
+#ifndef GL_VERSION_1_5
+#error "hey, where's 1.5"
+#endif
+
 #include "glmisc_src.h"
 #include "glmisc_src.h"
 #include "glTextureContext_src.h"
 #include "glTextureContext_src.h"
 #include "glVertexBufferContext_src.h"
 #include "glVertexBufferContext_src.h"