diff --git a/doc/makepanda/makepanda.py b/doc/makepanda/makepanda.py index 44bf26dc55..374359a859 100755 --- a/doc/makepanda/makepanda.py +++ b/doc/makepanda/makepanda.py @@ -4672,7 +4672,12 @@ def MakeInstallerLinux(): import compileall PYTHONV=os.path.basename(PYTHONSDK) if (os.path.isdir("linuxroot")): oscmd("chmod -R 755 linuxroot") - oscmd("rm -rf linuxroot data.tar.gz control.tar.gz rpmarch.txt panda3d.spec") + if (os.path.exists("/usr/bin/dpkg-deb")): + oscmd("dpkg --print-architecture > built/tmp/architecture.txt") + if (os.path.exists("/usr/bin/rpmbuild")): + oscmd("rpm -E '{%_arch}' > built/tmp/architecture.txt") + ARCH=ReadFile("built/tmp/architecture.txt") + oscmd("rm -rf linuxroot data.tar.gz control.tar.gz panda3d.spec "+ARCH) oscmd("mkdir -p linuxroot/usr/bin") oscmd("mkdir -p linuxroot/usr/include") oscmd("mkdir -p linuxroot/usr/share/panda3d") @@ -4712,22 +4717,18 @@ def MakeInstallerLinux(): oscmd("cd linuxroot ; (find etc -type f -exec md5sum {} \;) >> DEBIAN/md5sums") WriteFile("linuxroot/DEBIAN/conffiles","/etc/Config.prc\n") WriteFile("linuxroot/DEBIAN/control",txt) - oscmd("dpkg-deb -b linuxroot panda3d_"+VERSION+"_i386.deb") + oscmd("dpkg-deb -b linuxroot panda3d_"+VERSION+"_"+ARCH+".deb") oscmd("chmod -R 755 linuxroot") if (os.path.exists("/usr/bin/rpmbuild")): - oscmd("rpm -E '{%_arch}' > rpmarch.txt") - arch=ReadFile("rpmarch.txt") - oscmd("rm -rf "+arch) txt = INSTALLER_SPEC_FILE[1:].replace("VERSION",VERSION).replace("PANDASOURCE",PANDASOURCE) WriteFile("panda3d.spec", txt) oscmd("rpmbuild --define '_rpmdir "+PANDASOURCE+"' -bb panda3d.spec") - if (os.path.exists(arch+"/panda3d-"+VERSION+"-1."+arch+".rpm")): - oscmd("mv "+arch+"/panda3d-"+VERSION+"-1."+arch+".rpm .") - oscmd("rm -rf rpmarch.txt "+arch) + if (os.path.exists(ARCH+"/panda3d-"+VERSION+"-1."+ARCH+".rpm")): + oscmd("mv "+ARCH+"/panda3d-"+VERSION+"-1."+ARCH+".rpm .") oscmd("chmod -R 755 linuxroot") - oscmd("rm -rf linuxroot data.tar.gz control.tar.gz panda3d.spec") + oscmd("rm -rf linuxroot data.tar.gz control.tar.gz panda3d.spec "+ARCH) if (INSTALLER != 0):