Fixed an RPM uninstall problem

This commit is contained in:
Josh Yelon 2005-04-02 23:40:37 +00:00
parent bde5b3f976
commit 8bd6db44da

View File

@ -51,6 +51,28 @@ if ((os.path.exists(os.path.join(PANDASOURCE,"makepanda/makepanda.py"))==0) or
os.chdir(PANDASOURCE)
########################################################################
##
## Locate the Python SDK
##
########################################################################
if sys.platform == "win32":
PythonSDK="python2.2"
if 0: # Needs testing:
if (os.path.isdir("C:/Python22")): PythonSDK = "C:/Python22"
elif (os.path.isdir("C:/Python23")): PythonSDK = "C:/Python23"
elif (os.path.isdir("C:/Python24")): PythonSDK = "C:/Python24"
elif (os.path.isdir("C:/Python25")): PythonSDK = "C:/Python25"
else: sys.exit("Cannot find the python SDK")
else:
if (os.path.isdir("/usr/include/python2.5")): PythonSDK = "/usr/include/python2.5"
elif (os.path.isdir("/usr/include/python2.4")): PythonSDK = "/usr/include/python2.4"
elif (os.path.isdir("/usr/include/python2.3")): PythonSDK = "/usr/include/python2.3"
elif (os.path.isdir("/usr/include/python2.2")): PythonSDK = "/usr/include/python2.2"
else: sys.exit("Cannot find the python SDK")
# this is so that the user can find out which version of python was used.
########################################################################
##
## Read the default version number from dtool/PandaVersion.pp
@ -100,14 +122,13 @@ The Panda3D engine.
%build
makepanda/makepanda.py --version VERSION --everything MOREARGUMENTS
%install
PYTHONV=`cat built/tmp/pythonversion`
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/bin
mkdir -p $RPM_BUILD_ROOT/usr/include
mkdir -p $RPM_BUILD_ROOT/usr/lib
mkdir -p $RPM_BUILD_ROOT/usr/share/panda3d
mkdir -p $RPM_BUILD_ROOT/usr/lib/$PYTHONV/lib-dynload
mkdir -p $RPM_BUILD_ROOT/usr/lib/$PYTHONV/site-packages
mkdir -p $RPM_BUILD_ROOT/usr/lib/PYTHONV/lib-dynload
mkdir -p $RPM_BUILD_ROOT/usr/lib/PYTHONV/site-packages
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
mkdir -p $RPM_BUILD_ROOT/usr/bin
@ -130,12 +151,12 @@ cp doc/LICENSE $RPM_BUILD_ROOT/usr/lib/panda3d/LICENSE
cp doc/LICENSE $RPM_BUILD_ROOT/usr/share/panda3d/LICENSE
cp doc/LICENSE $RPM_BUILD_ROOT/usr/include/panda3d/LICENSE
echo "/usr/lib/panda3d" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/panda3d.conf
echo "/usr/share/panda3d" > $RPM_BUILD_ROOT/usr/lib/$PYTHONV/site-packages/panda3d.pth
echo "/usr/share/panda3d" > $RPM_BUILD_ROOT/usr/lib/PYTHONV/site-packages/panda3d.pth
cp built/bin/* $RPM_BUILD_ROOT/usr/bin/
for x in built/lib/* ; do
base=`basename $x`
ln -sf /usr/lib/panda3d/$base $RPM_BUILD_ROOT/usr/lib/$PYTHONV/lib-dynload/$base
ln -sf /usr/lib/panda3d/$base $RPM_BUILD_ROOT/usr/lib/PYTHONV/lib-dynload/$base
done
for x in $RPM_BUILD_ROOT/usr/share/panda3d/direct/src/* ; do
if [ `basename $x` != extensions ] ; then
@ -143,8 +164,12 @@ for x in $RPM_BUILD_ROOT/usr/share/panda3d/direct/src/* ; do
fi
done
chmod -R 555 $RPM_BUILD_ROOT/usr/share/panda3d
%post
/sbin/ldconfig
rm -rf /usr/lib/PYTHONV/direct
rm -rf /usr/lib/PYTHONV/SceneEditor
%postun
/sbin/ldconfig
%clean
@ -164,7 +189,8 @@ MORE=''
for x in sys.argv[2:]: MORE=MORE+x+' '
SPEC=SPEC.replace("VERSION",str(VERSION))
SPEC=SPEC.replace("MOREARGUMENTS",MORE)
SPEC=SPEC.replace("PYTHONV",os.path.basename(PythonSDK))
########################################################################
##
## Build the Zip-file and Tar-File