LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 08-03-2005, 10:55 PM   #1
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
The perfect gtkpod.SlackBuild


Finally got around to updating my gtkpod installation today. I figured I'd make a SlackBuild script for it. I tried to make it perfect. I figured that I'd post what I came up with. I borrowed heavily from just about everywhere, so it isn't what I'd consider an "original" script.

Anyone, feel free to use this. Also, if you see some bad coding, or think of something I may be missing, please chime in. My goal is for the package to be FDO standards compliant.

I've tried to comment everything pretty well. You'll notice that I still have a couple questions/issues.

So, here it goes.

gtkpod.SlackBuild
Code:
#!/bin/sh

####################
#
# ISSUES:
#
# configure: WARNING: you should use --build, --host, --target
#
# mp4v2 ................: *** no -- will build without aac support
# I assume that ./configure is looking for libmp4v2.  Where do I get that?
#
# Confirm gtkpod.desktop file is correct
#
# Use /usr/share/gtkpod/pixmaps/gtkpod-icon-64x64.png for icon? (place in /usr/share/pixmaps/gtkpod.png?)
#
####################

# Set initial variables:

CWD=`pwd`
if [ "$TMP" = "" ]; then
  TMP=/tmp
fi
NAME=gtkpod
PKG=$TMP/$NAME

rm -rf $PKG
mkdir -p $PKG

VERSION=0.94.0
ARCH=${ARCH:-i686}
BUILD=${BUILD:-1seb}

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

if [ ! -d $TMP ]; then
  mkdir -p $TMP # location to build the source
fi
if [ ! -d $PKG ]; then
  mkdir -p $PKG # place for the package to be built
fi

cd $TMP
rm -rf $NAME-$VERSION
tar xvzf $CWD/$NAME-$VERSION.tar.gz
cd $NAME-$VERSION

# Correct general permissions/ownership:

chown -R root.root .
find . -perm 777 -exec chmod 755 {} \; # From LinuxQuestions.org package guide.
find . -perm 775 -exec chmod 755 {} \; # From Slacky.it gtkpod.SlackBuild.  Good?
find . -perm 711 -exec chmod 755 {} \; # From Slacky.it gtkpod.SlackBuild.  Good?
find . -perm 666 -exec chmod 644 {} \; # From LinuxQuestions.org package guide.
find . -perm 664 -exec chmod 644 {} \; # From LinuxQuestions.org package guide.
find . -perm 600 -exec chmod 644 {} \; # From Slacky.it gtkpod.SlackBuild.  Good?
find . -perm 555 -exec chmod 755 {} \; # From LinuxQuestions.org package guide.
find . -perm 511 -exec chmod 755 {} \; # From Slacky.it gtkpod.SlackBuild.  Good?
find . -perm 444 -exec chmod 644 {} \; # From LinuxQuestions.org package guide.
find . -perm 440 -exec chmod 644 {} \; # From Slacky.it gtkpod.SlackBuild.  Good?
find . -perm 400 -exec chmod 644 {} \; # From Slacky.it gtkpod.SlackBuild.  Good?

CFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --sysconfdir=/etc \
  --localstatedir=/var/lib \
  $ARCH-slackware-linux
make -j3 # What is the -j3 for?  Needed?  Beneficial?
make install DESTDIR=$PKG

# Correct binary ownership:

if ls $PKG/bin &> /dev/null; then
  chown -R root.bin $PKG/bin
fi

if ls $PKG/usr/bin &> /dev/null; then
  chown -R root.bin $PKG/usr/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

if ls $PKG/usr/X11R6/bin &> /dev/null; then
  chown -R root.bin $PKG/usr/X11R6/bin
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
)

# Compress man pages:

find $PKG/usr/man -type f -exec gzip -9 {} \;

# Create package docs:

mkdir -p $PKG/usr/doc/$NAME-$VERSION
cp -a \
  AUTHORS COPYING ChangeLog INSTALL NEWS README TODOandBUGS.txt TROUBLESHOOTING \
  $PKG/usr/doc/$NAME-$VERSION
chmod 644 $PKG/usr/doc/$NAME-$VERSION/*

# Add package description:

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

# Add install script:

cat $CWD/doinst.sh > $PKG/install/doinst.sh

# Add desktop file:

mkdir -p $PKG/usr/share/applications
cat $CWD/$NAME.desktop > $PKG/usr/share/applications/$NAME.desktop

# Build the package:
cd $PKG
makepkg -l y -c n $TMP/$NAME-$VERSION-$ARCH-$BUILD.tgz

# Clean up the extra stuff:
if [ "$1" = "--cleanup" ]; then
  rm -rf $PKG
fi
gtkpod.desktop
Code:
[Desktop Entry]
Encoding=UTF-8
Name=Apple iPod Interface
Comment=Manage songs and playlists on your Apple iPod
Exec=gtkpod
Terminal=false
Type=Application
Icon=/usr/share/gtkpod/pixmaps/gtkpod-icon-64x64.png
Categories=GNOME;Application;AudioVideo;X-Ximian-Main;X-Red-Hat-Base;
MimeType=application/x-ogg;application/ogg;audio/x-mp3;audio/x-scpls;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-mpegurl;application/x-flac
StartupNotify=true
doinst.sh
Code:
if [ -x usr/bin/update-desktop-database -a -x usr/bin/chroot ]; then
  usr/bin/chroot /$ROOT /usr/bin/update-desktop-database &> /dev/null
fi

if [ -x usr/bin/update-mime-database -a -x usr/bin/chroot ]; then
  usr/bin/chroot /$ROOT /usr/bin/update-mime-database /usr/share/mime &> /dev/null
fi
slack-desc
Code:
# 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------------------------------------------------------|
gtkpod: gtkpod (Apple iPod Interface)
gtkpod:
gtkpod: gtkpod is a platform independent Graphical User Interface for Apple's
gtkpod: iPod using GTK2.  It allows you to upload songs and playlists to your
gtkpod: iPod. It supports ID3 tag editing, multiple charsets for ID3 tags,
gtkpod: detects duplicate songs, allows offline modification of the database
gtkpod: with later synchronisation, and more.
gtkpod:
gtkpod: It supports the first to fourth Generation as well as the iPod mini,
gtkpod: iPod Photo, and the iPod shuffle.
gtkpod:
 
Old 08-04-2005, 05:16 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Re: The perfect gtkpod.SlackBuild

Quote:
Originally posted by shilo
# configure: WARNING: you should use --build, --host, --target
i see this warning quite often, sometimes even when using stock slackware build scripts... i assume it's a harmless warning but i'm not 100% sure...

Quote:
# mp4v2 ................: *** no -- will build without aac support
# I assume that ./configure is looking for libmp4v2. Where do I get that?
try here: http://www.mpeg4ip.net/

Quote:
# What is the -j3 for? Needed? Beneficial?
from "man make":
Quote:
-j jobs
Specifies the number of jobs (commands) to run simultaneously. If there is more than one -j option, the last one is effective. If the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously.
personally, i always eliminate the -j option cuz my computer sucks (850Mhz) and i get the feeling it's best for it to not handle more than one job at a time, especially considering i'm never in a hurry... having said that, i've never actually had any problems when i've used -j3 by accident... i guess it's just a psychological thing for me...

just my ...


Last edited by win32sux; 08-04-2005 at 05:17 AM.
 
Old 08-04-2005, 02:04 PM   #3
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Original Poster
Rep: Reputation: 50
Re: Re: The perfect gtkpod.SlackBuild

Thanks for replying, win32sux.

Quote:
Originally posted by win32sux
i see this warning quite often, sometimes even when using stock slackware build scripts... i assume it's a harmless warning but i'm not 100% sure...
You and me both.

Quote:
Originally posted by win32sux
try here: http://www.mpeg4ip.net/
I saw that. Do you know for sure if this is what is needed?

Quote:
Originally posted by win32sux
from "man make":
personally, i always eliminate the -j option cuz my computer sucks (850Mhz) and i get the feeling it's best for it to not handle more than one job at a time, especially considering i'm never in a hurry... having said that, i've never actually had any problems when i've used -j3 by accident... i guess it's just a psychological thing for me...
So if I'm understanding correctly, this can improve compile time on a faster processor? It seems that this is a good thing, as those who have a slower system can just change that (similar to those with non-i686 systems.

Thanks again,
 
Old 08-04-2005, 06:31 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Re: Re: Re: The perfect gtkpod.SlackBuild

Quote:
Originally posted by shilo
I saw that. Do you know for sure if this is what is needed?
no, i'm not 100% sure, i mean i didn't even know what gtkpod was until i googled it last night but mpeg4ip.net seems to be what you want... this is from the documentation page:

Quote:
lib - project wide libraries
|-> SDLAudio - Simple DirectMedia Layer(modified audio only)
|-> audio - audio format conversions
|-> avi - AVI file format
|-> config_file - Configuration file utility
|-> gnu
|--> getopt - gnu getopt routines
|-> ismacryp - API library for ISMACrypt functions
|-> mp4 - MP4 (aka MOV/Quicktime) file format library
|-> mp4v2 - new MP4 library written from scratch
|--> test - contains some test programs
|--> util - contains new mp4dump and mp4extract utilities
|-> mpeg2ps - mpeg program stream library/utilites
|-> mpeg2t - mpeg2 transport stream utilities
|-> msg_queue - SDL based Inter-thread messages utlity
|-> rtp - UCL RTP
|-> sdp - Our own SDP
|-> win32 - libary files need for MS Windows
Quote:
So if I'm understanding correctly, this can improve compile time on a faster processor?
yeah, i would think so... but check this out:
Quote:
Parallel Execution

GNU make knows how to execute several commands at once. Normally, make will execute only one command at a time, waiting for it to finish before executing the next. However, the `-j' or `--jobs' option tells make to execute many commands simultaneously.

On MS-DOS, the `-j' option has no effect, since that system doesn't support multi-processing.

If the `-j' option is followed by an integer, this is the number of commands to execute at once; this is called the number of job slots. If there is nothing looking like an integer after the `-j' option, there is no limit on the number of job slots. The default number of job slots is one, which means serial execution (one thing at a time).

One unpleasant consequence of running several commands simultaneously is that output generated by the commands appears whenever each command sends it, so messages from different commands may be interspersed.

Another problem is that two processes cannot both take input from the same device; so to make sure that only one command tries to take input from the terminal at once, make will invalidate the standard input streams of all but one running command. This means that attempting to read from standard input will usually be a fatal error (a `Broken pipe' signal) for most child processes if there are several.

It is unpredictable which command will have a valid standard input stream (which will come from the terminal, or wherever you redirect the standard input of make). The first command run will always get it first, and the first command started after that one finishes will get it next, and so on.

We will change how this aspect of make works if we find a better alternative. In the mean time, you should not rely on any command using standard input at all if you are using the parallel execution feature; but if you are not using this feature, then standard input works normally in all commands.

Finally, handling recursive make invocations raises issues. For more information on this, see section Communicating Options to a Sub-make.

If a command fails (is killed by a signal or exits with a nonzero status), and errors are not ignored for that command (see section Errors in Commands), the remaining command lines to remake the same target will not be run. If a command fails and the `-k' or `--keep-going' option was not given (see section Summary of Options), make aborts execution. If make terminates for any reason (including a signal) with child processes running, it waits for them to finish before actually exiting.

When the system is heavily loaded, you will probably want to run fewer jobs than when it is lightly loaded. You can use the `-l' option to tell make to limit the number of jobs to run at once, based on the load average. The `-l' or `--max-load' option is followed by a floating-point number. For example,

-l 2.5

will not let make start more than one job if the load average is above 2.5. The `-l' option with no following number removes the load limit, if one was given with a previous `-l' option.

More precisely, when make goes to start up a job, and it already has at least one job running, it checks the current load average; if it is not lower than the limit given with `-l', make waits until the load average goes below that limit, or until all the other jobs finish.

By default, there is no load limit.
http://docs.linux.cz/programming/too...e_5.html#SEC50
 
  


Reply



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
a generic SlackBuild shilo Slackware 46 06-19-2008 11:45 PM
GNOME.SlackBuild jmdlcar Slackware 1 06-03-2005 04:52 PM
KDE.SlackBuild spaceballs Slackware 8 04-01-2005 08:42 AM
gtkpod error: relocation error: gtkpod: undefined symbol: gtk_tool_button_new dlj2 Linux - Software 6 01-29-2005 07:51 AM
SlackBuild system thegeekster Slackware 7 06-01-2004 06:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:57 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration