Hi folks,<br><br>While I was taking train this afternoon, a thought came up in my mind -- SlackBuilds for python modules and many programs that written in pure python (say, <font size="2">decorator</font>, pysetuptools, logilab-common etc) should be arch dependent. Maybe most of them are installed via "distutils", if you see something like "python setup.py install --root=$PKG", it will be the case.<br>
<br>I think setup.py just do what "./configure && make && make install" do -- detect the python installation structure, compile .py files to .pyc bytecodes. The bytecodes is platorm independent but the installation structure is not. So in slackware64, things will be installed into /usr/lib64/python2.6/site-packages/xxx but in slackware, things will be installed into /usr/lib/python2.6/site-packages/xxx. The conclusion is the files in the package in arch indenpendent but the direcory structure is arch dependent.<br>
<br>After some hack, I found a solution for this: write the SlackBuilds like this:<br>....<br>if [ "$ARCH" = "i486" ]; then<br> SLKCFLAGS="-O2 -march=i486 -mtune=i686"<br> LIBDIRSUFFIX=""<br>
elif [ "$ARCH" = "i686" ]; then<br> SLKCFLAGS="-O2 -march=i686 -mtune=i686"<br> LIBDIRSUFFIX=""<br>elif [ "$ARCH" = "x86_64" ]; then<br> SLKCFLAGS="-O2 -fPIC"<br>
LIBDIRSUFFIX="64"<br>fi<br>....<br>....<br>python setup.py install --prefix=/usr --install-lib=/usr/lib${LIBDIRSUFFIX}/python2.6/site-packages/ --root=$PKG<br>....<br><br clear="all">Thus the package will install files to /usr/lib for 32bit slack and /usr/lib64 for slackware64.(note python in slackware12.2 is still 2.5.x you may need to adjust the install command for 12.2)<br>
<br>Saying so much, I hope I have expressed my idea clearly and it will do some help.<br><br>-- <br>Cheers,<br>Grissiom<br>