LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 01-03-2010, 01:54 PM   #1
Alexvader
Member
 
Registered: Oct 2009
Location: Japan
Distribution: Arch, Debian, Slackware
Posts: 994

Rep: Reputation: 94
Hacking into a Slackbuild for Slackware 12.2


Hi Forum

there is this slackbuild from Slackware 12.2 from Slacky EU, which I want to hack extensivly for two purposes :

1) Make it adhere to Slackware64 13 convention ( not /usr/lib but /usr/lib64 )

2) Make it use the Intel Toolchain icc/ifort as c and fortran compilers respectively, instead of the more traditional gcc/gfortran.

The Slackbuild is this :


Code:
#!/bin/sh
# Heavily based on the Slackware 12.2 SlackBuild
# http://www.scilab.org/
# Packager Vincenzi Loris - slacky@slacky.it

CWD=`pwd`
TMP=${TMP:-/tmp/tgz}
PKG=$TMP/package-scilab
NAME=scilab
VERSION=5.1
CHOST=i486
ARCH=${ARCH:-i486}
BUILD=1sl
SOURCE=http://www.scilab.org/download/$VERSION/$NAME-$VERSION-src.tar.gz
PREREQUIREMENTS=http://www.scilab.org/download/$VERSION/prerequirements-$NAME-$VERSION-src.tar.gz
# PVM=http://www.netlib.org/pvm3/pvm3.4.6.tgz


set -e

if [ ! -e prerequirements-$NAME-$VERSION-src.tar.gz ]; then
echo "Downloading prerequirements"
wget -c $PREREQUIREMENTS
fi

# if [ ! -e pvm3.4.6.tgz ]; then
# echo "Downloading PVM"
# wget -c $PVM
# fi

if [ ! -e $NAME-$VERSION-src.tar.gz ]; then
echo "Downloading source"
wget -c $SOURCE
fi

if [ "$ARCH" = "i386" ]; then
  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2"
elif [ "$ARCH" = "s390" ]; then
  SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2"
fi

if [ ! -d $TMP ]; then
 mkdir -p $TMP
fi
if [ ! -d $PKG ]; then
 mkdir -p $PKG
fi

cd $TMP
# tar xzf $CWD/pvm3.4.6.tgz
# export PVM_ROOT=$TMP/pvm3
# (
# echo "Building PVM"
# cd pvm3
# CFLOPTS="$SLKCFLAGS" \
# FFLOPTS="$SLKCFLAGS" \
# make
# make install
# )

echo "Unpacking Prerequirements (this can take several minutes)"
tar xzf $CWD/prerequirements-$NAME-$VERSION-src.tar.gz
tar xzf $CWD/$NAME-$VERSION-src.tar.gz

echo "+=============================================================================="
echo "| Building $NAME-$VERSION"
echo "+=============================================================================="

cd $NAME-$VERSION
find . \( -perm 777 -o -perm 775 -o -perm 711 \) -exec chmod 755 {} \;
find . \( -perm 700 -o -perm 555 -o -perm 511 \) -exec chmod 755 {} \;
find . \( -perm 666 -o -perm 664 -o -perm 600 \) -exec chmod 644 {} \;
find . \( -perm 444 -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
chown -R root:root .
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
FFLABS="$SLKCFLAGS" \
./configure --prefix=/usr \
--sysconfdir=/etc \
--without-ocaml \
--without-pvm \
--with-jdk=$TMP/$NAME-$VERSION/java/jdk \
--without-matio \
--with-ant=/usr/lib/ant \
--with-x \
--enable-build-localization \
--enable-build-help \
--build=$CHOST-slackware-linux
make all
make doc
make install DESTDIR=$PKG

cd $PKG


mv $TMP/$NAME-$VERSION/thirdparty $PKG/usr/share/$NAME
cp $TMP/$NAME-$VERSION/bin/lib* $PKG/usr/lib/$NAME/

sed -i "s/\/tmp\/tgz\/$NAME-$VERSION/\$SCILAB/" $PKG/usr/share/scilab/etc/classpath.xml

find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null
mkdir -p $PKG/usr/share/applications
cp $CWD/scilab.desktop $PKG/usr/share/applications
mkdir -p $PKG/usr/share/pixmaps
cp $CWD/scilab.png $PKG/usr/share/pixmaps

mkdir -p $PKG/usr/doc/$NAME-$VERSION
ln -s /usr/share/$NAME $PKG/usr/doc/$NAME-$VERSION
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc
cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild
requiredbuilder -v -y -s $CWD $PKG
makepkg -l y -c n $CWD/../$NAME-$VERSION-$ARCH-$BUILD.tgz


if [ "$1" = "--cleanup" ]; then
 rm -rf $TMP
fi

Would it be enogh to place

export CC=icc
export FC=ifort

..........

add -fPIC to SLCKFLAGS,

and replace every ocurrence of "/usr/*" by "/usr/local/*" ?

Thanks in advance

ALEX

PS: I just do not want the package to drop stuff into my /usr/lib since I am running 64 bit pure... so I figured it made more sense to have the install tree start at /usr/local/* instead of /usr/*....
 
Old 01-03-2010, 02:01 PM   #2
GooseYArd
Member
 
Registered: Jul 2009
Location: Reston, VA
Distribution: Slackware, Ubuntu, RHEL
Posts: 183

Rep: Reputation: 46
why not leave /usr alone and pass --libdir=/usr/lib64 to ./configure instead?

if you untar the distribution and say "./configure --help", it'll show you all the various boilerplate arguments that autoconf accepts.

You don't need to export $CC, just change this section:

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
FFLABS="$SLKCFLAGS" \
./configure --prefix=/usr \


to

CC="icc" \
CFLAGS="$SLKCFLAGS" \
...


any other variables you need (like FC) you can set the same way. If they're set at ./configure time, they'll make their way into the generated Makefiles for you.
 
1 members found this post helpful.
Old 01-03-2010, 02:02 PM   #3
Alexvader
Member
 
Registered: Oct 2009
Location: Japan
Distribution: Arch, Debian, Slackware
Posts: 994

Original Poster
Rep: Reputation: 94
Thks GooseYard

I will try this...

BRGDS

Alex
 
Old 01-04-2010, 04:48 PM   #4
Alexvader
Member
 
Registered: Oct 2009
Location: Japan
Distribution: Arch, Debian, Slackware
Posts: 994

Original Poster
Rep: Reputation: 94
Hi again...

I tried passing --libdir=/usr/lib64 and in the end, the slackbuild fails to find directories where to mv/cp stuff...

Can someone pls post here where should I hack this slackbuild to make it conform to Slackware64 13... ?

Thanks in advance

Alex

By default this launches the executables in /usr/bin and libraries in /usr/lib...

... not good... but --libdir is not a "master" variable in this slackbuild script...

Last edited by Alexvader; 01-04-2010 at 04:49 PM.
 
Old 01-04-2010, 06:03 PM   #5
halborr
Member
 
Registered: Aug 2009
Posts: 112

Rep: Reputation: 18
Code:
cp $TMP/$NAME-$VERSION/bin/lib* $PKG/usr/lib/$NAME/
If I'm not mistaken, there's your problem. Replacing lib with lib64 in the target should build the package correctly. That way it'll put it in /tmp/$PACKAGE/usr/lib64 instead of /tmp/$PACKAGE/usr/lib.

Last edited by halborr; 01-04-2010 at 06:05 PM.
 
1 members found this post helpful.
Old 01-05-2010, 09:13 AM   #6
Alexvader
Member
 
Registered: Oct 2009
Location: Japan
Distribution: Arch, Debian, Slackware
Posts: 994

Original Poster
Rep: Reputation: 94
Hi Halborr

This change did it...

Thx a lot

BRGDS

Alex
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Skype 2.1 Beta slackbuild for Slackware 13? Ahmed Slackware 14 10-21-2009 11:48 AM
updating slackbuild package in slackware 12.2 jrecortel Slackware 1 02-06-2009 06:23 PM
Slackbuild Opera 9.5 for Slackware 12? TL_CLD Slackware 6 06-28-2008 11:48 AM
Zenwalk Slackware SlackBuild Scripts? bdika Zenwalk 2 06-02-2008 05:09 PM


All times are GMT -5. The time now is 11:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration