LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   building a slack package? (http://www.linuxquestions.org/questions/slackware-14/building-a-slack-package-337384/)

mrchaos 06-26-2005 03:00 PM

building a slack package?
 
can someone teach me how to compile a slack package from a binary source file? I've found that programs are easier to maintain and remove if they are in the *tgz slack form. Don't be afraid to use coding language, I know a little programming. Thanks!

Tinkster 06-26-2005 03:16 PM

http://www.slackware.com/book/index....rce=x4132.html

[eidt]
OK - that was a bit curt :)
Have a look at the diverse build-scripts in any
of slacks source-packages.

Or, if that's all too much hassle, use checkinstall.
[/edit]


win32sux 06-26-2005 07:28 PM

http://www.linuxpackages.net/howto.p...=Package+Howto

http://www.linuxpackages.net/howto.p...erfect+Package

and like tinkster said, really the best way to learn this is to read the actual slackware build scripts... you can find the ones for 10.1 here:

ftp://ftp.slackware.com/pub/slackwar...e-10.1/source/

here's an example script, the one for XMMS:
Code:

#!/bin/sh
CWD=`pwd`

VERSION=1.2.10
ARTSPLUG=0.7.1
ARCH=${ARCH:-i486}
BUILD=${BUILD:-2}

PKG=/tmp/package-xmms
rm -rf $PKG
mkdir -p $PKG

cd /tmp
rm -rf xmms-$VERSION
tar xjvf $CWD/xmms-$VERSION.tar.bz2
cd xmms-$VERSION
chown -R root:root .
find . -perm 664 -exec chmod 644 {} \;
find . -perm 600 -exec chmod 644 {} \;
find . -perm 444 -exec chmod 644 {} \;
find . -perm 400 -exec chmod 644 {} \;
find . -perm 440 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 511 -exec chmod 755 {} \;
find . -perm 711 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \;
CFLAGS=-O2 \
CXXFLAGS=-O2 \
  ./configure \
  --prefix=/usr \
  --localstatedir=/var/lib \
  --disable-static \
  --enable-simd \
  --with-ipv6 \
  $ARCH-slackware-linux
make -j3
# This needs to go to the system so the arts plugin can build:
make install
# Next, install to $PKG:
make install DESTDIR=$PKG
mkdir -p $PKG/usr/doc/xmms-$VERSION
cp -a ABOUT-NLS AUTHORS COPYING FAQ INSTALL NEWS README TODO \
  $PKG/usr/doc/xmms-$VERSION

# Install the arts plugin:
cd /tmp
rm -rf arts_output-$ARTSPLUG
tar xzf $CWD/arts_output-${ARTSPLUG}.tar.gz
cd arts_output-$ARTSPLUG
chown -R root:root .
find . -perm 664 -exec chmod 644 {} \;
find . -perm 600 -exec chmod 644 {} \;
find . -perm 444 -exec chmod 644 {} \;
find . -perm 400 -exec chmod 644 {} \;
find . -perm 440 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 511 -exec chmod 755 {} \;
find . -perm 711 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \;
CFLAGS=-O2 \
CXXFLAGS=-O2 \
./configure \
  --prefix=/usr \
  $ARCH-slackware-linux
  make -j3
  make install DESTDIR=$PKG
mkdir -p $PKG/usr/doc/xmms-$VERSION/arts_output-$ARTSPLUG
cp -a \
  AUTHORS COPYING INSTALL NEWS README \
  $PKG/usr/doc/xmms-$VERSION/arts_output-$ARTSPLUG

# Finish up...
chown -R root.bin $PKG/usr/bin
gzip -9 $PKG/usr/man/*/*
( 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
)
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
makepkg -l y -c n /tmp/xmms-$VERSION-$ARCH-$BUILD.tgz

you can find the files needed in the source/xap/xmms directory (you need to have all the needed files in the same directory as the script when you execute it):

ftp://ftp.slackware.com/pub/slackwar...urce/xap/xmms/

have fun... ;)


PS: slackware build scripts are meant to be run as root...

mdarby 06-26-2005 08:57 PM

checkinstall is the easiest way. I use it all the time.

ingvildr 06-27-2005 05:46 AM

checkinstall is a good tool, i've used it to install several xfce4 plugins, but if your really serious about slack and like learning i would suggest you try making your own scripts.

egag 06-27-2005 08:56 AM

i also use checkinstall, but only to register self compiled software in /var/log/packages
so they can be easily removed if needed.
if you use pkgtool to install a package made by checkinstall ,then things go wrong.
the buildscripit that creates the needed symlinks, makes them in the wrong place,
most of the time in the root dir.

if you want to build packages meant to be installed on other pc.'s it's best to write ( mostly edit existing ) buildscripts.
if you know a little about programming, that shouldn't be to hard.

egag

uselpa 06-27-2005 01:47 PM

Quote:

Originally posted by egag
if you use pkgtool to install a package made by checkinstall ,then things go wrong.
the buildscripit that creates the needed symlinks, makes them in the wrong place,
most of the time in the root dir.

Is this a systematic behaviour? If so, has anybody posted it to the checkinstall mailing list already?
It seems like an easy-to-fix bug to me, why not ask the author to correct it?

win32sux 06-27-2005 03:31 PM

honestly, from the posts i've seen here at LQ and other sites, i think it's fair to say that checkinstall has many issues that affect the final package's quality... i think that's just the nature of these kinda tools, they let you "easily" create a package - but there's a price to pay, and it seems the price is your package will never be as high quality as one that was made using a finely-tuned build script... anyone that is SERIOUS about making their own slackware packages should stay away from checkinstall IMHO...

AxXium 06-27-2005 04:15 PM

Here is a very detailed guide.

33 pages !!!!

Amazing read :D

http://www.interlude.org.uk/unix/sla...on.pdf#search='how%20to%20build%20slackware%20packages'

win32sux 06-27-2005 04:39 PM

mianve, i downloaded that PDF but the text i get is all a bunch of boxes and stuff... is it written in english?? do i need some special fonts or something to see that?? :confused:

AxXium 06-27-2005 04:43 PM

I'm at work on a windows box when I opened it. I have no idea why it doesn't work for you.

try this link

http://www.interlude.org.uk/unix/sla...esentation.pdf

if it still don't work, email me.

I will mail you back a text file

slackwarepkgs.txt

win32sux 06-27-2005 04:48 PM

seems like i have problems with it only if i open it with the gnome pdf viewer...

i just opened it using xpdf and it's displaying properly...

thanks man... ;)

AxXium 06-27-2005 04:50 PM

I opened it with firefox and it worked fine :)

win32sux 06-27-2005 04:51 PM

Quote:

Originally posted by mianve
I opened it with firefox and it worked fine :)
with firefox?? i can use firefox to view PDFs??

AxXium 06-27-2005 04:52 PM

I do everyday!!:D


All times are GMT -5. The time now is 07:36 AM.