VectorLinux
December 22, 2014, 01:38:15 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1] 2
  Print  
Author Topic: Packaging howto  (Read 11743 times)
kidd
Packager
Vectorian
****
Posts: 682


« on: April 10, 2008, 04:16:37 pm »

Hello vectorites,

I've written a little text about packaging as lately some people asked for it in the forums.

It's objective is not giving a full explanations about packaging internals but showing some of the basics to make a package good enough to get the repos.

It has to be polished, but the info is already there.  Feel free to edit it Wink

http://vectorlinux.com/wiki/doku.php?id=howtos:packaging59

HTH
Logged

kc1di
Packager
Vectorian
****
Posts: 1125


Morse Code Early digital mode. John 3:16


« Reply #1 on: April 10, 2008, 05:59:47 pm »

Hello vectorites,

I've written a little text about packaging as lately some people asked for it in the forums.

It's objective is not giving a full explanations about packaging internals but showing some of the basics to make a package good enough to get the repos.

It has to be polished, but the info is already there.  Feel free to edit it Wink

http://vectorlinux.com/wiki/doku.php?id=howtos:packaging59

HTH


Nice write up  thanks for your efforts.

Logged

Dave
( Living Somewhere in Maine USA)
Registered Linux User #462608
Andy Price
Packager
Vectorite
****
Posts: 237


« Reply #2 on: October 09, 2008, 10:48:00 pm »

Hi, this how to seems to have disappeared. Any new address?
Thanks
Logged
lagagnon
Global Moderator
Vectorian
*****
Posts: 1922



WWW
« Reply #3 on: October 10, 2008, 07:40:15 am »

http://forum.vectorlinux.com/index.php?topic=1701.0
Logged

"As people become more intelligent they care less for preachers and more for teachers". Robert G. Ingersoll
kidd
Packager
Vectorian
****
Posts: 682


« Reply #4 on: October 11, 2008, 04:47:12 am »


I don't think this howto is valid anymore.  To package apps for 5.9, you have to provide sources, and slackbuild, so checkinstall is useful only for your private work, but not for publishing.

I'l try to search my document.. Let's see if I have a backup of the text...
Logged

kidd
Packager
Vectorian
****
Posts: 682


« Reply #5 on: October 11, 2008, 10:36:42 am »

I think I definately lost the text... Sad
Logged

kukibl
Guest
« Reply #6 on: December 01, 2008, 11:12:35 am »

Would it be possible to post default VL SlackBuild template with few examples? I would like to try some packaging these days, if nothing else to try to learn something new. Smiley

Thank you in advance!
Logged
kidd
Packager
Vectorian
****
Posts: 682


« Reply #7 on: December 01, 2008, 12:12:00 pm »

Kukibl,

Theese days rbistolfi , uelsk8s and I are creating a helper application to make slackbuilds. If you're interested on trying and betatest it, it'd be great.

Here follows a typical slackbuild for VL6.  helper script will create the correct directory structure, and will fill names where necessary. You'll only have to tweak configure options and fill description

Code:
#!/usr/bin/bash
# This script assumes it will be launched within "/NAME/VERSION/src" dir.
# With all sources in "src" Your Vector Linux .tlz package, slack-desc,
# and slack-required will be found in "VERSION" dir. The extraction and
# build will be in a temp dir created in "NAME" dir, and then removed on exit.
# Comment out second to last line to keep this dir intact.


NAME=""            #Enter package Name!
VERSION=${VERSION:-""}      #Enter package Version!
VL_PACKAGER=${VL_PACKAGER:-""}   #Enter your Name!
LINK=\${LINK:-""}  #Enter URL for package here!

#SYSTEM VARIABLES
#----------------------------------------------------------------------------
BUILDNUM=${BUILDNUM:-"1"}
VL_VERSION=${VL_VERSION:-"$(ls /var/log/packages/|grep vlconfig2|cut -d "-" -f4|cut -c 2-5)"}
BUILD=${BUILD:-"$BUILDNUM""$VL_VERSION"}
ARCH=${ARCH:-$(uname -m)}
CONFIG_OPTIONS=${CONFIG_OPTIONS:-""}
CFLAG_OPTIONS=${CFLAG_OPTIONS:-""}
LDFLAG_OPTIONS=${LDFLAG_OPTIONS:-""}
#----------------------------------------------------------------------------


#SETUP PACKAGING ENVIRONMENT
#--------------------------------------------
CWD=$(pwd)
cd ../
RELEASEDIR=$(pwd)
cd $CWD
mkdir -p $RELEASEDIR/tmp
TMP=$RELEASEDIR/tmp
PKG=$TMP/package-$NAME
#--------------------------------------------


if [ $UID != 0 ]; then
   echo "You are not authorized to run this script. Please login as root"
   exit 1
fi

if [ ! -x /usr/bin/requiredbuilder ]; then
   echo "Requiredbuilder not installed, or not executable."
   exit 1
fi

if [ $VL_PACKAGER = "YOURNAME" ]; then
   echo 'Who are you?
   Please edit VL_PACKAGER=${VL_PACKAGER:-YOURNAME} in this script.
   Change the word "YOURNAME" to your VectorLinux packager name.
   You may also export VL_PACKAGER, or call this script with
   VL_PACKAGER="YOUR NAME HERE"'
   exit 1
fi


#CFLAGS SETUP
#--------------------------------------------
if [[ "$ARCH" = i?86 ]]; then
  ARCH=i586
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  CONFIGURE_TRIPLET="i486-slackware-linux"
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fpic"
  CONFIGURE_TRIPLET="x86_64-pc-linux"
fi

export CFLAGS="$SLKCFLAGS $CFLAG_OPTIONS"
export CXXFLAGS=$CFLAGS
export FFLAGS=$CFLAGS
export FCFLAGS=$CFLAGS
export LDFLAGS="$LDFLAGS $LDFLAG_OPTIONS"
#--------------------------------------------

#GET THE SOURCE
#--------------------------------------------
if [ ! -f $CWD/$NAME-$VERSION.tar.* ]
then
        wget $LINK
fi
#--------------------------------------------

rm -rf $PKG
mkdir -p $PKG
cd $TMP
rm -rf $NAME-$VERSION

#EXTRACT SOURCES
#-----------------------------------------------------
echo "Extracting source..."
tar xvf $CWD/$NAME-$VERSION.tar.* || exit 1
#-----------------------------------------------------


cd $TMP/$NAME-$VERSION


#SET PERMISSIONS
#-----------------------------------------
echo "Setting permissions..."
chown -R root:root .
find . -perm 664 -exec chmod 644 {} \;
find . -perm 777 -exec chmod 755 {} \;
find . -perm 2777 -exec chmod 755 {} \;
find . -perm 775 -exec chmod 755 {} \;
find . -perm 2755 -exec chmod 755 {} \;
find . -perm 774 -exec chmod 644 {} \;
find . -perm 666 -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 511 -exec chmod 755 {} \;
find . -perm 711 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \;
#-----------------------------------------


#CONFIGURE & MAKE
#----------------------------------------------------------------------
# If you are building a KDE-related app, then change the following
# arguments in the script below:
# --prefix=$(kde-config -prefix) \
# --sysconfdir=/etc/kde \
#
# Making these changes will ensure that your package will build in the
# correct path and that it will work seamlessly within the KDE environment.
#
#-----------------------------------------------------------------------
echo "Configuring source..."
./configure --prefix=/usr
  --sysconfdir=/etc
  --localstatedir=/var
  --mandir=/usr/man
  --with-included-gettext
  --disable-debug
  --program-prefix=""
  --program-suffix=""
  --build=$CONFIGURE_TRIPLET
  $CONFIG_OPTIONS || exit 1

make || exit 1

make install DESTDIR=$PKG || exit

#######################################################################
#Miscellenious tweaks and things outside a normal ./configure go here #
#######################################################################

#mkdir -p $PKG/usr/share/applications
#cp $CWD/$NAME.desktop $PKG/usr/share/applications/$NAME.desktop
#mkdir -p $PKG/usr/share/pixmaps
#cp $CWD/$NAME.png $PKG/usr/share/pixmaps/$NAME.png

mkdir -p $PKG/usr/doc/$NAME-$VERSION
cp -a README.txt PKG-INFO \
   $PKG/usr/doc/$NAME-$VERSION
cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild

#----------------------------------------------------------------------

if [ -d $PKG/usr/share/man ] ; then
  mkdir -p $PKG/usr/man
  mv $PKG/usr/share/man/* $PKG/usr/man
  rm -rf $PKG/usr/share/man
fi
find $PKG/usr/man -type f -exec gzip -9 {} \;

if [ -d $PKG/usr/share/info ] ; then
  mkdir -p $PKG/usr/info
  mv $PKG/usr/share/info/* $PKG/usr/info
  rm -rf $PKG/usr/share/info
fi
find $PKG/usr/info -type f -exec gzip -9 {} \;

mkdir -p $PKG/install

           # This creates the white space in front of "handy-ruler" in slack-desc below.

      LENGTH=$(expr length "$NAME")
      SPACES=0
      SHIM=""
      until [ "$SPACES" = "$LENGTH" ]; do
        SHIM="$SHIM "
        let SPACES=$SPACES+1
      done

# Fill in the package summary between the () below.
# Then package the description, License, Author and Website.
# There may be no more then 11 $NAME: lines in a valid slack-desc.

cat > $RELEASEDIR/slack-desc << EOF
# 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 ':'.

$SHIM|-----handy-ruler------------------------------------------------------|
$NAME: $NAME (an enhanced interactive Python shell)
$NAME:
$NAME: An enhanced interactive Python shell.
$NAME:
$NAME:
$NAME:
$NAME:
$NAME:
$NAME: License:
$NAME: Authors:
$NAME: Website: http://


#----------------------------------------
BUILDDATE: $(date)
PACKAGER:  $VL_PACKAGER
HOST:      $(uname -srm)
DISTRO:    $(cat /etc/vector-version)
CFLAGS:    $CFLAGS
CXXFLAGS:  $CXXFLAGS
LDFLAGS:   $LDFLAGS
FFLAGS:    $FFLAGS
FCFLAGS:   $FFLAGS

EOF

cat $RELEASEDIR/slack-desc > $PKG/install/slack-desc


#STRIPPING
#------------------------------------------------------------------------------------------------------------------
cd $PKG
echo " "
echo "Stripping...."
echo " "
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
#------------------------------------------------------------------------------------------------------------------


#FINISH PACKAGE
#--------------------------------------------------------------
echo "Finding dependencies..."
requiredbuilder -v -y -s $RELEASEDIR $PKG
echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.tlz"
makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.tlz

cd $CWD
echo "Cleaning up temp files..." && rm -rf $TMP
echo "Package Complete"
#--------------------------------------------------------------

Our program will make easy to make packages for python,perl or noarch apps. 
« Last Edit: December 01, 2008, 01:16:51 pm by kidd » Logged

kukibl
Guest
« Reply #8 on: December 01, 2008, 12:19:44 pm »

Wow... that was fast.Smiley Thank you very much kidd for your response. I will be glad to help. Just tell me, is it possible to use your app on 5.9.x or is it meant just for VL6 and future releases (I ask because of testing - is it OK to test it on my 5.9.1 SOHO)? Also, where can I download it?
Logged
kidd
Packager
Vectorian
****
Posts: 682


« Reply #9 on: December 02, 2008, 01:13:46 am »

We're now making compatible with 5.9 (perl 5.8 and some other things)... Hopefully, in a few hours we'll have it uploaded somewhere
Logged

player
Member
*
Posts: 6


« Reply #10 on: December 03, 2008, 01:22:14 am »

I've built a kdiff3 package using vpackager on my VL SOHO 5.9.1. Is it not good anymore? If it's good, how I should go about sharing it. I intend to built more packages if everything goes well. Thanks.
Logged
kidd
Packager
Vectorian
****
Posts: 682


« Reply #11 on: December 03, 2008, 02:02:45 am »

Packages built with vpackager are ok to redistribute , but only among your
computers and friends.  That was not this way until 5.9, but from now on, we
*have to* provide sources along with with binaries and a script to build the
binary from sources.  I suppose vpackager does everything internally, and can't
output a slackbuild file, so packages won't be included in the repos this way.

Packaging in VL SOHO is not the best distro to make packages for vl because it
may add extra dependencies of packages that aren't installed in vl std or light.
That happened in vl 5.8. I don't know if now, in 5.9 and 6.0 it's possible to
package in SOHO.

uelsk, hints?
Logged

uelsk8s
Administrator
Vectorian
*****
Posts: 2504



« Reply #12 on: December 03, 2008, 08:57:40 am »

You should build packages on the lightest version possible to avoid adding unneeded deps.
with that said, it may be ok to build kdiff3 on SOHO since it requires kde anyway.

It will be recommended to use the new sbbuilder app to build packages as soon as it is ready
Logged
Joe1962
Administrator
Vectorian
*****
Posts: 2499



WWW
« Reply #13 on: December 03, 2008, 10:27:07 am »

... it may be ok to build kdiff3 on SOHO since it requires kde anyway.

Not really. I've always built kdiff3 as qt-only.
Logged

O'Neill (RE the Asgard): "Usually they ask nicely before they ignore us and do what they damn well please."
http://joe1962.bigbox.info
Running: VL 7 Std 64 + self-cooked XFCE-4.10
kukibl
Guest
« Reply #14 on: December 03, 2008, 02:48:43 pm »

I am currently using sbbuilder and must admit that things are going great so far. Automatic generation of SlackBuild makes things easier a lot, so for classic "configure; make; make install" apps only slight modifications are required. Smiley Worked pretty well for me for openobex, obexftp, kdebluetooth...

I would like to ask one question... What is procedure to join VL's packaging team? I am currently using 5.9.1 soho and since VL6 is quite close to final release, I would like to start packaging some apps after VL6 comes out. So what are conditions and is there any free room in VL's packages team? Smiley

Thanks!

Alex
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!