LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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
 
LinkBack Search this Thread
Old 03-27-2006, 03:49 AM   #16
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52

I think Pat's openssl relink function will work on any package. Just use for i in man* instead of for i in man1 man3 man7... Give it a test run and see. It should be universal.
 
Old 03-27-2006, 04:27 AM   #17
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,112

Rep: Reputation: Disabled
Quote:
Originally Posted by elyk
I have a similar script that I use when packaging programs. When I use it to package mplayer, gzipping the man pages will break a symlink. It looks like this script will have the same problem.

If I remember correctly...
mencoder.1 -> mplayer.1

After gzipping mplayer.1, the mencoder.1 symlink is broken (it should point to mplayer.1.gz instead). Does anyone have a good solution for detecting and fixing this type of problem, rather than explicitly removing and recreating that specific symlink?
Slackware's openldap-client package faced that same problem. Pat solved it by explicitly handling every man page in the package, but the generic way is this
Code:
( cd $PKG/usr/man
  # gzip the man pages:
  find . -type f -name *.? -exec gzip -9 {} \;
  # re-do the symlinks:
  for i in `find . -type l` ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
)
Btw a diff to the openldap-client.SlackBuild script which implements this is here: http://www.slackware.com/~alien/slac...lackBuild.diff


Eric
 
Old 03-27-2006, 06:49 AM   #18
danieldk
Member
 
Registered: Aug 2002
Posts: 150

Rep: Reputation: 15
Hi Eric, looks like a useful approach. BTW, I see that you use two different notations for command substitution in one line,

Code:
for i in $(find . -type l) ; do ln -s $( readlink $i ).gz $i.gz ; rm -f $i ; done
would probably be neater, but it is nitpicking .
 
Old 03-27-2006, 07:31 AM   #19
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,112

Rep: Reputation: Disabled
Quote:
Originally Posted by danieldk
Hi Eric, looks like a useful approach. BTW, I see that you use two different notations for command substitution in one line,

Code:
for i in $(find . -type l) ; do ln -s $( readlink $i ).gz $i.gz ; rm -f $i ; done
would probably be neater, but it is nitpicking .
My approach in writing scripts that are to be used by others is to put in as much variety as possible. That way, you have maximum education :-). It can produce ugly scripts sometimes.

Cheers, Eric
 
Old 03-29-2006, 07:28 AM   #20
CrEsPo
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware 12
Posts: 184

Rep: Reputation: 30
Hey guys, I just started having problems with this.

Code:
i686-slackware-linux-clamav-config*
i686-slackware-linux-clamdscan*
i686-slackware-linux-clamscan*
i686-slackware-linux-freshclam*
I'm getting the 'i686-slackware-linux-' infront of the executables in /usr/bin. I tried looking through the SlackBuild script, but couldn't find anything myself. I'm using the one from the original post with the modified compression of the man pages.

Wait, I just noticed this line in ./configure

Code:
$ARCH-slackware-linux
Could this be my problem and would it be advisable to remove this?
 
Old 03-29-2006, 07:41 AM   #21
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,112

Rep: Reputation: Disabled
Quote:
Originally Posted by CrEsPo
Wait, I just noticed this line in ./configure

Code:
$ARCH-slackware-linux
Could this be my problem and would it be advisable to remove this?
Not all configure programs will deal correctly with the $ARCH-slackware-linux stanza at the end. In fact, you will see a complaint almost always when you run configure that way.
Getting rid of those ugly filenames is easy by the way, even if you keep the $ARCH-slackware-linux in. Add this to the ./configure :
Code:
--program-prefix=""
Eric
 
Old 03-29-2006, 02:23 PM   #22
MariuszK
LQ Newbie
 
Registered: Jan 2006
Location: Brooklyn, NY
Distribution: Slackware 12.0
Posts: 18

Rep: Reputation: 0
I always put 'set -e' command in the begining of my slackbuilds. In result of this when an error occurs, during compilation for example, processing of the slackbuild is stopped and I'm able to see what went wrong.

Mariusz
 
Old 03-29-2006, 08:41 PM   #23
CrEsPo
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware 12
Posts: 184

Rep: Reputation: 30
Thanks Alien Bob, just tried that and it works perfectly, I appreciate it.
 
Old 03-31-2006, 01:52 AM   #24
elyk
Member
 
Registered: Jun 2004
Distribution: Slackware
Posts: 160

Rep: Reputation: 23
Quote:
Originally Posted by CrEsPo
Wait, I just noticed this line in ./configure

Code:
$ARCH-slackware-linux
Could this be my problem and would it be advisable to remove this?
Different configure scripts handle the build option differently (or not at all). Most newer packages will use something like "--build=$ARCH-slackware-linux" instead.

You can check which way the configure script works by running "./configure --help". Look for the usage information at the beginning, and also look for the section that describes the --build, --host, and --target options.
 
Old 03-31-2006, 09:30 AM   #25
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
shilo, as far as I see you use slackware-current.
Do you still do the "chown -R root.bin" thing?

Pat started using root.root for the binaries:
Quote:
Anyway, my first thought was to simply move the "chmod 4711" on Xorg to after the last "chown" in the build script, but decided that the best way to handle this is to begin phasing out the use of the "bin" group on binaries and binary directories. There was never any use to this ever, so far as I can tell. I think someone working on the FHS just thought that root:bin looked nicer, or something. ;-)
 
Old 03-31-2006, 04:16 PM   #26
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
personally, i shall continue to do the root:bin thing...
 
Old 04-02-2006, 11:57 PM   #27
kite
Member
 
Registered: Aug 2003
Location: Shenzhen, China
Distribution: Slackware
Posts: 296

Rep: Reputation: 47
www.slackmatic.org

How do you guys think about this www.slackmatic.org ? It is a package build system for Slackware. I found it very easy to share build.

Kite
 
Old 12-25-2006, 03:35 PM   #28
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 33
Here are some routines I like to use to make life easier :
Code:
 ## Fix perms and ownership in the source, just in case:
chown -R root:root $SRC
find ${SRC} \( -perm 664 -o -perm 600 -o -perm 444 -o -perm 400 -o -perm 440 -o -perm 666 \) |
  xargs chmod 644
find ${SRC} \( -perm 777 -o -perm 775 -o -perm 511 -o -perm 711 -o -perm 555 \) |
  xargs chmod 755


 ## Copy the docs:
DOCDIR=${PKG}/usr/doc/$NAME-$VERSION
test ! -d $DOCDIR  &&  install -d $DOCDIR
cd $SRC/
ls -UA | egrep '(.*[A-Z][A-Z].+|change.+|license.*|docs?.*|index\.ht.+)' |
  while read; do  cp -dpLR $REPLY $DOCDIR;  done


 ## Search for manpages and read results:
find $PKG \( -type f -o -type l \) -path '*/man/man*/*' | while read; do
     ## If not already gzip'd, then test if it's a symlink
    if [ "$REPLY" = "`basename $REPLY .gz`" ]; then
         ## If a symlink, we need to point the link to a gzip'd target:
        if [ -L "$REPLY" ]; then
            rm -f "$REPLY"; ln -sf "`readlink "${REPLY}"`.gz" "$REPLY.gz"
        else
            gzip -9 "$REPLY"
        fi
    fi
done

 ## Might as well do the info pages while we're at it:
find $PKG -type f -path '*/info/*' | while read; do gzip -9 $REPLY; done


 ## Strip the binary/lib files:
find $PKG | xargs file | egrep 'ELF .* (executable|shared object)' |
  cut -f1 -d: | xargs strip --strip-unneeded  2> /dev/null
find $PKG | xargs file | grep "current ar archive" |
  cut -f1 -d: | xargs strip --strip-debug  2> /dev/null

 ## Set group "bin" for bin and sbin dirs:
cd $PKG
ls -d {,s}bin usr/{,s}bin usr/local/{,s}bin usr/X11R6/bin opt/kde/bin 2>/dev/null |
  while read; do  chown -R root:bin $REPLY  &&  chmod -R 755 $REPLY;  done
When changing perms in the source tree, I use only one find command for each change (755 and 644), for efficiency....

The "copy docs" routine will find any file or directory that contains an uppercase letter anywhere in it, and those with all lowercase as specified in egrep's search term, in the source tree's top level. If a file or directory is copied and not wanted, then it's a matter of removing it from the $DOCDIR directory...

For the one's with the 'find' command that only makes changes in certain directories and not the whole source tree, I use the "-path" option so I won't miss any directories in unusual places say, somewhere in /opt......

The "-d" option for 'ls', when changing group to "bin", means not to descend into the directories, just read the directory name, if found...And the 'chmod' command, while not necessary, makes sure the executables are just that, executable....

All these should work for almost *all* SlackBuild scripts......There might be one or two that need special attention, but that can't be helped, and only those will need special attention for the above routines.....


@ danieldk,
FWIW, there is a Savannah project by the name of buildpkg, which is also a shell script but aims to be a universal build tool for the various package formats.....

Last edited by thegeekster; 12-25-2006 at 03:46 PM.
 
Old 12-26-2006, 12:55 PM   #29
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 488
Blog Entries: 1

Rep: Reputation: 55
SlackBuilds

Alien Bob wrote:

Quote:
TMP=${TMP:-/tmp} # Location to compile the source

......

########################
#
# Why use this? Already covered above, right?
#
########################
#
#if [ ! -d $TMP ]; then
# mkdir -p $TMP # location to build the source
#fi
#
########################

The first line is just the definition of the environment variable "TMP", but that does not mean it exists as a directory already. If I run the SlackBuild script as
Code:

TMP=/home/alien/temp ./template.SlackBuild

then execution would fail if the directory /home/alien/temp does not exist.
So the commented-out lines really should be uncommented.
Eric, I tend to agree with shilo on this one. The value of "PKG" is '$TMP/package name' & it makes no difference what value TMP has, once you have run "mkdir -p $PKG", thanks to the "-p" the entire path is built, whether the value of TMP exists as a directory or not.
As a side note, I use "TMP=/tmp/tmp-$PKGNAM" & "PKG=$TMP/package-$PKGNAM", just to keep from littering the /tmp dir too much cruft. I also define a variable, OUTPUT (lifted from the SlackBuilds.org template) & define it as my slackbuild repository location, keeping me from having to move it later.
I have copied all the tips in this thread. I will try to absorb some of the info & I appreciate everyones contributions.
Regards,
Bill

Last edited by TSquaredF; 12-26-2006 at 12:57 PM.
 
Old 12-26-2006, 04:54 PM   #30
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Was unpacking of source code talked about here or was it another thread? I plan on switching my scripts over to use:

tar xf $CWD/$PKGNAME-$VERSION.tar.*

That should work (as long as it's not a zip or tgz). As of 1.15, we should stop calling tar with a j or z switch.. It's a pain in the butt when you've downloaded a new tarball but it's in the wrong format from what your script wants...

I also don't use the create-TMP thing. Too crufty and very redundant as TSquaredF has pointed out.

Last edited by jong357; 12-26-2006 at 04:56 PM.
 
  


Reply

Tags
slackbuild


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The perfect gtkpod.SlackBuild shilo Slackware 3 08-04-2005 06:31 PM
GNOME.SlackBuild jmdlcar Slackware 1 06-03-2005 04:52 PM
KDE.SlackBuild spaceballs Slackware 8 04-01-2005 08:42 AM
GSB [Gnome Slackbuild] Xian Slackware 27 03-12-2005 07:53 PM
SlackBuild system thegeekster Slackware 7 06-01-2004 06:59 PM


All times are GMT -5. The time now is 10:21 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