SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
For compiling in Slackware, it's also reccommended that you install 'checkinstall' from /extra (from either an FTP mirror or the 3rd CD). Then where you see 'make install' in any tutorial, etc..., replace it with 'checkinstall' to generate a Slackware package that can then be installed using 'installpkg' and easily removed later using 'removepkg'.
Originally posted by cathectic For compiling in Slackware, it's also reccommended that you install 'checkinstall' from /extra (from either an FTP mirror or the 3rd CD). Then where you see 'make install' in any tutorial, etc..., replace it with 'checkinstall' to generate a Slackware package that can then be installed using 'installpkg' and easily removed later using 'removepkg'.
Althought TBH, although checkinstall is all well and good, you may benefit from learning to write SlackBuild scripts, just check a few on the slackware repositry (under /source).
I used to use checkinstall, but i now massively prefer this method, once you get the script sorted it's just downright better, everything in the slackapproved place, all binaries/libs stripped, docs sorted out, etc.
Give it a try, you may like it.
I'm working on a Generic script, that will work for most packages with a few tweaks, if people are interested i'll post a Work in Progress
Checkinstall is recomended? Says who? Sometimes I wonder if I'm the only person who has a problem with Checkinstall. It always corrupts my hostname after I use it and then nothing will open. It also likes to screw up symlinks in the doinst.sh.... Anyway...
I'll agree, it's much better to write your own scripts. I installed pkgtools on LFS 6.0 and wrote build scripts for every package... Damn does it run nice.... I've stopped using Slackware is has such a nice vibe to it... Anyway....
./configure
make
make install
is basically it. Most times you'll want to do a "./configure --prefix=/usr". First do a "./configure --help" and it will tell you all the options that are available... Pretty easy stuff.....
I've never really had any problems with checkinstall. That said, I often then take the package, untar it, poke around and tweak it a bit, and then put it back together with makepkg.
Originally posted by -0- I'm working on a Generic script, that will work for most packages with a few tweaks, if people are interested i'll post a Work in Progress
Please do! I recently created my own generic script that works for most packages out-of-the-box (as it were), and will work for others with minor tweaks (when there are unusual configure options, or no configure script at all, for example). Would be interesting to compare...
I'll post it up later on, i'll just play with it a bit.
It doesn't nessecerily work right out of the box (it has 3 make options, but the default is DESTDIR, things like that).
EDIT, here you go:
Code:
#!/bin/sh
#build script for sqlite package
#owain Ainsworth 15/04/2005
#set up env
APP=
CWD=`pwd`
PKG=/tmp/package-$APP
VERSION=9.7
#change if you don't have an athlon, default slack is 486
ARCH=athlonxp
BUILD=1
#i could put generic cflags. or the slack standard ones, but i didn't for now, these are mine
SLKCFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer -Wall"
CONFIGOPTS=""
MKINSTALLAPPEND="DESTDIR=$PKG"
#MKINSTALLAPPEND="ROOT=$PKG""
#MKINSTALLAPPEND="prefix=$PKG/bin"
# clean up after old builds
rm -rf $PKG
mkdir -p "PKG"
cd /tmp
rm -rf $APP-$VERSION
if ls $CWD/$APP-$VERSION.tar.gz &>/dev/null
then tar xzvf $CWD/$APP-$VERSION.tar.gz
elif ls $CWD/$APP-$VERSION.tar.bz2 &>/dev/null
then tar xjvf $CWD/$APP-$VERSION.tar.bz2
else echo "source tarball not found"
fi
if [ ! -e $APP-$VERSION]
then echo "cannot find directory, quitting"
exit
fi
cd $APP-$VERSION
#fix perms of source so docs etc are correctly permissioned when copied
chown -R root.root .
find . -perm 777 -exec chmod 755 {} \;
find . -perm 666 -exec chmod 644 {} \;
find . -perm 664 -exec chmod 644 {} \;
find . -perm 555 -exec chmod 755 {} \;
find . -perm 444 -exec chmod 644 {} \;
#configure and make the package
./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var $CONFIGOPTS
make
make install $MKINSTALLAPPEND
#set owners of bin directories
if ls $PKG/usr/bin &> /dev/null
then chown -R root.bin $PKG/usr/bin
fi
if ls $PKG/bin &> /dev/null
then chown -R root.bin ~$PKG/bin
fi
if ls $PKG/sbin &> /dev/null
then chown -R root.bin ~$PKG/sbin
fi
if ls $PKG/usr/sbin &> /dev/null
then chown -R root.bin $PKG/usr/sbin
fi
#strip binaries and libs
( cd $PKG
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
)
#sort docs out
# if any docs in your tarball are missing add them to the list below, and email them to me too
mkdir -p $PKG/usr/doc/$APP-$VERSION
cp -a \
ANNOUNCE AUTHORS BUGS COPYING* INSTALL NEWS README README.boot THANKS TODO VERSION \
$PKG/usr/doc/$APP-$VERSION
#gzip man and info pages
gzip -9 $PKG/usr/man/man?/*.?
rm -f $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*
#make the install dir
mkdir -p $PKG/install
#create slack-desc
cat << _EOF_ > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
# |-----handy-ruler------------------------------------------------------|
$APP: $APP-$VERSION
$APP:
$APP:
$APP:
$APP:
$APP:
$APP:
$APP:
$APP:
$APP:
$APP:
_EOF_
#make doinst.sh add any special modifications to do when installed between the cat
#line and the _EOF_ and uncomment the aforementioned
#cat << _EOF_ > $PKG/install/doinst.sh
#_EOF_
#Create the package
cd $PKG
makepkg -l y -c n ../$APP-$VERSION-$ARCH-$BUILD.tgz
It reminds me that I haven't yet bothered doing "strip binaries" and "chown -R root.bin blah" stuff yet in my script. I was concentrating on making it generic enough to compile and package anything with the minimum amount of tweaking first. Time for me to get scripting again...
It reminds me that I haven't yet bothered doing "strip binaries" and "chown -R root.bin blah" stuff yet in my script. I was concentrating on making it generic enough to compile and package anything with the minimum amount of tweaking first. Time for me to get scripting again...
I think i started with the script for SED, or similar, and edited it, made it more general, added bits, etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.