LinuxQuestions.org
Visit the LQ Articles and Editorials 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
 
Search this Thread
Old 11-26-2005, 11:33 PM   #1
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Question question about the XFCE build script


i'd like to know why there's a "make install" used before doing a "make install DESTDIR=$PKG"... shouldn't the "make install DESTDIR=$PKG" be all that's needed?? i mean, won't the "make install" actually mess with my system, instead of staying in the package's build directory??

Code:
#!/bin/sh
# Copyright 2003  Slackware Linux, Inc., Concord, CA, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

TMP=/tmp/xfce-build-dir
rm -rf $TMP
mkdir -p $TMP
PKG=$TMP/package-xfce
rm -rf $PKG
mkdir -p $PKG
CWD=`pwd`

VERSION=4.2.2
PKGVER=4.2.2
ARCH=${ARCH:-i486}
BUILD=1

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

for file in \
dbh-1.0.24.tar.bz2 \
libxfce4util-$VERSION.tar.bz2 \
libxfcegui4-$VERSION.tar.bz2 \
libxfce4mcs-$VERSION.tar.bz2 \
xfce-mcs-manager-$VERSION.tar.bz2 \
xfce4-panel-$VERSION.tar.bz2 \
gtk-xfce-engine-2.2.7.tar.bz2 \
xfce-mcs-plugins-$VERSION.tar.bz2 \
xfce-utils-$VERSION.tar.bz2 \
xfce4-appfinder-$VERSION.tar.bz2 \
xfce4-iconbox-$VERSION.tar.bz2 \
xfce4-icon-theme-$VERSION.tar.bz2 \
xfce4-mixer-$VERSION.tar.bz2 \
xfce4-systray-$VERSION.tar.bz2 \
xfce4-session-$VERSION.tar.bz2 \
xfce4-toys-$VERSION.tar.bz2 \
xfce4-trigger-launcher-$VERSION.tar.bz2 \
xfdesktop-$VERSION.tar.bz2 \
xffm-$VERSION.tar.bz2 \
xfprint-$VERSION.tar.bz2 \
xfwm4-$VERSION.tar.bz2 \
xfwm4-themes-$VERSION.tar.bz2 \
xfcalendar-$VERSION.tar.bz2 \
; do
  ( cd $TMP
    tar xjf $CWD/$file
    cd `basename $file .tar.bz2`

    # Strengthen resistance to /tmp attacks (low risk, but might as well...).
    if [ "$file" = "xfce-utils-$VERSION.tar.bz2" ]; then
      zcat $CWD/xfce-utils-xinitrc.diff.gz | patch -p1 --verbose
    fi

    chown -R root.root .
    find . -perm 777 -exec chmod 755 {} \;
    find . -perm 775 -exec chmod 755 {} \;
    find . -perm 666 -exec chmod 644 {} \;
    find . -perm 664 -exec chmod 644 {} \;
    # From the COMPOSITOR file in xfwm4:
    #
    # xfwm4 now features a compositing manager. This code is new and has received only
    # a moderate amount of testing, so it's disabled by default.
    # 
    # So, if you want to stay safe, keep the compositor disabled...
    # 
    # If you still want to try the compositor extensions with xfwm4, here follows how
    # to enable the compositing manager in xfwm4.
    # 
    # 1) Enabling the compositor manager in xfwm4
    # -------------------------------------------
    # 
    # To enable the compositing manager in xfwm4, add --enable-compositor when running
    # the configure script.
    # 
    CFLAGS="$SLKCFLAGS" \
    CXXFLAGS="$SLKCFLAGS" \
    ./configure --prefix=/usr \
      --sysconfdir=/etc/X11 \
      --enable-static=no \
      --enable-xinerama
    make -j6
    make install
    make install DESTDIR=$PKG
    mkdir -p $PKG/usr/doc/`basename $file .tar.bz2`
    cp -a \
      AUTHORS COPYING INSTALL NEWS README TODO \
      $PKG/usr/doc/`basename $file .tar.bz2` 
    ( 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
      for mandir in `find . -name man -type d` ; do
        if [ -d $mandir ]; then
          ( cd $mandir
            find . -type f -name "*.?" -exec gzip -9 {} \;
          )
        fi
      done
    )
  )
done
( cd $PKG/usr/bin
  ln -sf xffm xffstab4
  ln -sf xffm xfapps
  ln -sf xffm xfbook
  ln -sf xffm xfsamba4
  ln -sf xffm xftrash4
  ln -sf xffm xfapps4
  ln -sf xffm xfbook4
  ln -sf xffm xffstab
  ln -sf xffm xfglob4
  ln -sf xffm xftree4
)
chown -R root.bin $PKG/usr/bin
( mkdir -p $PKG/etc/X11/xinit
  cd $PKG/etc/X11/xinit
  ln -sf ../xdg/xfce4/xinitrc xinitrc.xfce
  chmod 755 ../xdg/xfce4/xinitrc
)

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

cd $PKG
makepkg -l y -c n $TMP/xfce-$PKGVER-$ARCH-$BUILD.tgz
 
Old 11-27-2005, 12:55 AM   #2
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Well, there are 23 individual packages that make up the xfce Slack pak. Most of them are deps for one another. If you didn't spam the system so the next package in line could find it, then it wouldn't build.... It all gets overwritten when you install the actuall package. The only thing that annoys me when Pat does this, is that he doesn't gzip the man pages on the system... man directories on slack are really a mess IMO...

So after installing the package you have 2 sets of man pages. One compressed and one not. Other than that, you can't avoid spamming the system like that. I suppose it's the same as trying to make all of KDE into one giant package.
 
Old 11-27-2005, 01:07 AM   #3
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Original Poster
Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
thanks for the reply jong357!! it all makes sense now...

PS: also thanks a lot for the info about the non-gzipped man pages which won't get overwritten when the package falls-in...
 
Old 11-27-2005, 01:14 AM   #4
LiNuCe
Member
 
Registered: Apr 2004
Location: France
Distribution: Slackware Linux 10.2
Posts: 119

Rep: Reputation: 15
Quote:
jong357: (...) Other than that, you can't avoid spamming the system like that. (...)
Sure you can ! Instead of using:
Code:
make install
make DESTDIR=$PKG install
You should use:
Code:
make DESTDIR=$PKG install
(...)
# Build the package here 
(...)
installpkg $NAME-$VERSION-$ARCH-$BUILD.tgz
--
LiNuCe
 
Old 11-27-2005, 01:22 AM   #5
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Original Poster
Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
hello linuce,

are you saying that you could just delete the "make install" line??
 
Old 11-27-2005, 01:26 AM   #6
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Yea, good point. I do that myself on some of my build scripts but it's so much easier to just type 'make install'.... For some reason, when I use installpkg from within a script to satisfy dependencies that are next in line, I feel obligated to do a removepkg on all of them at the end of the script... Don't know why. I'm just wierd like that. That drags out the script considerably....
 
Old 11-27-2005, 01:40 AM   #7
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Original Poster
Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
okay i think i had misunderstood linuce's post. i'm trying to figure out what you guys mean about using installpkg inside the script. i don't know if it's the sleepyness or maybe i need Ritalin or something but i don't get it yet... what exactly is going on with the installpkg there?? also, could you please post an actual edited part of the script which i could perhaps use to try to understand this better?? thanks for all your help guys!!


Last edited by win32sux; 11-27-2005 at 01:44 AM.
 
Old 11-27-2005, 01:54 AM   #8
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Man, how did the page width on this thread get so long? I'm going to insert breaks. Sorry

If you take out make install then you'll need to add installpkg. You could do something like this:
Code:
      for mandir in `find . -name man -type d` ; do
        if [ -d $mandir ]; then
          ( cd $mandir
            find . -type f -name "*.?" -exec gzip -9 {} \;
          )
        fi
      done
    )
  )
# Install in increments to satisfy deps:
removepkg /tmp/temp-xfce.tgz
makepkg -l y -c n /tmp/temp-xfce.tgz
installpkg /tmp/temp-xfce.tgz
done
Linuce's approach has problems here because you would almost have to re-write the script to incorporate $NAME into the script.
You could use basename as well... But if your going to do that then you might as well just keep them all as individual packages.
There doesn't seem to be an obvious easy way other than what I've listed above. Unless you want to type alot more stuff...

And at the very end of the script you would have to do another "removepkg /tmp/temp-xfce.tgz"
I'm on a Mac right now otherwise I might mess around with it some. I'm sure I might be over looking something but the above
should work out...
 
Old 11-27-2005, 02:13 AM   #9
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Ah crap. I put that stuff outside of where it should be. That would make a temp package of $CWD 23 times

Don't think that would satisfy any deps....

Last edited by jong357; 11-27-2005 at 02:39 AM.
 
Old 11-27-2005, 02:20 AM   #10
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Code:
#!/bin/sh
# Copyright 2003  Slackware Linux, Inc., Concord, CA, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

TMP=/tmp/xfce-build-dir
rm -rf $TMP
mkdir -p $TMP
PKG=$TMP/package-xfce
rm -rf $PKG
mkdir -p $PKG
CWD=`pwd`

VERSION=4.2.2
PKGVER=4.2.2
ARCH=${ARCH:-i486}
BUILD=1

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

for file in \
dbh-1.0.24.tar.bz2 \
libxfce4util-$VERSION.tar.bz2 \
libxfcegui4-$VERSION.tar.bz2 \
libxfce4mcs-$VERSION.tar.bz2 \
xfce-mcs-manager-$VERSION.tar.bz2 \
xfce4-panel-$VERSION.tar.bz2 \
gtk-xfce-engine-2.2.7.tar.bz2 \
xfce-mcs-plugins-$VERSION.tar.bz2 \
xfce-utils-$VERSION.tar.bz2 \
xfce4-appfinder-$VERSION.tar.bz2 \
xfce4-iconbox-$VERSION.tar.bz2 \
xfce4-icon-theme-$VERSION.tar.bz2 \
xfce4-mixer-$VERSION.tar.bz2 \
xfce4-systray-$VERSION.tar.bz2 \
xfce4-session-$VERSION.tar.bz2 \
xfce4-toys-$VERSION.tar.bz2 \
xfce4-trigger-launcher-$VERSION.tar.bz2 \
xfdesktop-$VERSION.tar.bz2 \
xffm-$VERSION.tar.bz2 \
xfprint-$VERSION.tar.bz2 \
xfwm4-$VERSION.tar.bz2 \
xfwm4-themes-$VERSION.tar.bz2 \
xfcalendar-$VERSION.tar.bz2 \
; do
  ( cd $TMP
    tar xjf $CWD/$file
    cd `basename $file .tar.bz2`

    # Strengthen resistance to /tmp attacks (low risk, but might as well...).
    if [ "$file" = "xfce-utils-$VERSION.tar.bz2" ]; then
      zcat $CWD/xfce-utils-xinitrc.diff.gz | patch -p1 --verbose
    fi

    chown -R root.root .
    find . -perm 777 -exec chmod 755 {} \;
    find . -perm 775 -exec chmod 755 {} \;
    find . -perm 666 -exec chmod 644 {} \;
    find . -perm 664 -exec chmod 644 {} \;
    # From the COMPOSITOR file in xfwm4:
    #
    # xfwm4 now features a compositing manager. This code is new and has received only
    # a moderate amount of testing, so it's disabled by default.
    # 
    # So, if you want to stay safe, keep the compositor disabled...
    # 
    # If you still want to try the compositor extensions with xfwm4, here follows how
    # to enable the compositing manager in xfwm4.
    # 
    # 1) Enabling the compositor manager in xfwm4
    # -------------------------------------------
    # 
    # To enable the compositing manager in xfwm4, add --enable-compositor when running
    # the configure script.
    # 
    CFLAGS="$SLKCFLAGS" \
    CXXFLAGS="$SLKCFLAGS" \
    ./configure --prefix=/usr \
      --sysconfdir=/etc/X11 \
      --enable-static=no \
      --enable-xinerama
    make -j6
    make install DESTDIR=$PKG
    mkdir -p $PKG/usr/doc/`basename $file .tar.bz2`
    cp -a \
      AUTHORS COPYING INSTALL NEWS README TODO \
      $PKG/usr/doc/`basename $file .tar.bz2` 
    ( 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
      for mandir in `find . -name man -type d` ; do
        if [ -d $mandir ]; then
          ( cd $mandir
            find . -type f -name "*.?" -exec gzip -9 {} \;
          )
        fi
      done
     # Install in increments to satisfy deps:
     removepkg /tmp/temp-xfce.tgz
     makepkg -l y -c n /tmp/temp-xfce.tgz
     installpkg /tmp/temp-xfce.tgz
    )
  )
done
( cd $PKG/usr/bin
  ln -sf xffm xffstab4
  ln -sf xffm xfapps
  ln -sf xffm xfbook
  ln -sf xffm xfsamba4
  ln -sf xffm xftrash4
  ln -sf xffm xfapps4
  ln -sf xffm xfbook4
  ln -sf xffm xffstab
  ln -sf xffm xfglob4
  ln -sf xffm xftree4
)
chown -R root.bin $PKG/usr/bin
( mkdir -p $PKG/etc/X11/xinit
  cd $PKG/etc/X11/xinit
  ln -sf ../xdg/xfce4/xinitrc xinitrc.xfce
  chmod 755 ../xdg/xfce4/xinitrc
)

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

# Remove the last temp package:
removepkg /tmp/temp-xfce.tgz

cd $PKG
makepkg -l y -c n $TMP/xfce-$PKGVER-$ARCH-$BUILD.tgz
That should do it... It's 2am here... I'm not entirely alert at the moment...
 
Old 11-27-2005, 03:21 AM   #11
LiNuCe
Member
 
Registered: Apr 2004
Location: France
Distribution: Slackware Linux 10.2
Posts: 119

Rep: Reputation: 15
Quote:
win32sux: okay i think i had misunderstood linuce's post. i'm trying to figure out what you guys mean about using installpkg inside the script. i don't know if it's the sleepyness or maybe i need Ritalin or something but i don't get it yet... :) what exactly is going on with the installpkg there?? also, could you please post an actual edited part of the script which i could perhaps use to try to understand this better?? :study: thanks for all your help guys!!
In fact, you can not just remove the make install line in the SlackBuild for Xfce, unless you use a separate package to install each Xfce software (but you need to modify others lines accordingly) as I always do. Once I have build all Xfce packages, I extract them in a custom Xfce-PkgRoot/ directory which will hold the big Xfce package (I cat each install/doinst.sh in a install/doinst.sh.xfce that I copy at the end to install/doinst.sh before build the big Xfce package).

--
LiNuCe

Last edited by LiNuCe; 11-27-2005 at 03:23 AM.
 
Old 11-27-2005, 06:24 PM   #12
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Original Poster
Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
thanks for the great info, guys!
 
Old 11-28-2005, 12:29 PM   #13
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
One last thing, I was assuming that there were going to be alot of man pages. I just looked at the package and there are only 4 man pages. If I were you, I'd just use the original build script and then just remove the 4 man pages from the system at the end of the script.... ;-)

If there were 100's of man pages like perl has, then you might want to use installpkg in the script, but for xfce, it doesn't really make much sense.


rm -f /usr/man/man1/{fgr,xfce4-session,xfce4-session-logout,xfdesktop}.1
 
Old 11-28-2005, 04:58 PM   #14
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Original Poster
Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
yup, that's precisely what i did...

i am however doing it the installpkg way also, for educational purposes...

i guess i should try with perl once i have this method down pat... hehe...


Last edited by win32sux; 11-28-2005 at 05:00 PM.
 
  


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
vsftpd build script 0.o Slackware 4 06-06-2005 12:58 PM
a xfce question... marsques Slackware 6 04-11-2005 07:11 PM
quick xfce question... pld Linux - General 2 11-07-2004 01:21 PM
Script to build Virtualusers lapthorn Linux - Software 0 10-19-2004 06:39 AM
Build Passwd for personal access script, I want to solution. somphob Linux - General 2 08-01-2004 05:25 PM


All times are GMT -5. The time now is 08:43 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration