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 05-24-2017, 01:13 PM   #1
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Rep: Reputation: Disabled
Creating Slackbuilds


I'm having a issue trying to run a slackbuild. This is the error
Code:
./l2tp-ipsec-vpn.SlackBuild: line 38: cd: l2tp-ipsec-vpn-client_1.0.9: No such file or directory
Code:
#!/bin/sh

# Slackware build script for l2tp-ipsec-vpn

# Copyright 2017 PROBLEMCHYLD <blahblah@gmail.com>, USA
# All rights reserved.

PRGNAM=l2tp-ipsec-vpn
VERSION=${VERSION:-client_1.0.9}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i386" ]; then
  SLKCFLAGS="-O2 -march=i386 -mtune=i686"
elif [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
fi

set -e 

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvfz $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find . \
 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
 -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 -exec chmod 644 {} \;

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \

./configure \
  --prefix=/usr \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/man \
  --docdir=/usr/doc/$PRGNAM-$VERSION \
  --build=$ARCH-slackware-linux

make
make install DESTDIR=$PKG

( cd $PKG
  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
    xargs strip --strip-unneeded 2> /dev/null || true
  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
    xargs strip --strip-unneeded 2> /dev/null || true
)

( cd $PKG/usr/man
  find . -type f -exec gzip -9 {} \;
  for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
)

rm -f $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*.info*

( cd $PKG
  find . -name perllocal.pod \
    -o -name ".packlist" \
    -o -name "*.bs" \
    | xargs rm -f
)

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
  $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

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

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
 
Old 05-24-2017, 01:26 PM   #2
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Quote:
Originally Posted by PROBLEMCHYLD View Post
I'm having a issue trying to run a slackbuild. This is the error
Code:
./l2tp-ipsec-vpn.SlackBuild: line 38: cd: l2tp-ipsec-vpn-client_1.0.9: No such file or directory
Code:
#!/bin/sh

# Slackware build script for l2tp-ipsec-vpn

# Copyright 2017 PROBLEMCHYLD <blahblah@gmail.com>, USA
# All rights reserved.

PRGNAM=l2tp-ipsec-vpn
VERSION=${VERSION:-client_1.0.9}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i386" ]; then
  SLKCFLAGS="-O2 -march=i386 -mtune=i686"
elif [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
fi

set -e 

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvfz $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find . \
 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
 -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 -exec chmod 644 {} \;

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \

./configure \
  --prefix=/usr \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/man \
  --docdir=/usr/doc/$PRGNAM-$VERSION \
  --build=$ARCH-slackware-linux

make
make install DESTDIR=$PKG

( cd $PKG
  find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
    xargs strip --strip-unneeded 2> /dev/null || true
  find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
    xargs strip --strip-unneeded 2> /dev/null || true
)

( cd $PKG/usr/man
  find . -type f -exec gzip -9 {} \;
  for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
)

rm -f $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*.info*

( cd $PKG
  find . -name perllocal.pod \
    -o -name ".packlist" \
    -o -name "*.bs" \
    | xargs rm -f
)

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
  $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

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

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz
The error is due to this line (line 38):

Code:
cd $PRGNAM-$VERSION
Apparently, when the source tarball is untarred in line 37, the resulting directory is not called l2tp-ipsec-vpn-client_1.0.9. Try untarring it yourself from the command line to find out the name of the resulting directory.
 
Old 05-24-2017, 01:51 PM   #3
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Original Poster
Rep: Reputation: Disabled
The folder name is l2tp-ipsec-vpn after extraction. So, how would I add it?
 
Old 05-24-2017, 01:56 PM   #4
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
In that case, you can change line 38 to:

Code:
cd $PRGNAM
or, even more explicitly:
Code:
cd l2tp-ipsec-vpn
 
1 members found this post helpful.
Old 05-24-2017, 02:51 PM   #5
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
The naming convention in the original SlackBuild is a common one that is seen when extracting source. Most of the time, it will be the program name with a dash, then the version, so $PRGNAM-$VERSION usually works. However, not all projects use that naming convention, so sometimes you need to handle it differently in the SlackBuild. In this case, montagdude is correct, you can just simply use cd $PRGNAM to enter the directory. Make sure you update the rm section as well (two lines above), so it can clear out the old folder before it tries extracting again.

There are other times when the source folder is named completely different, or the version might be incompatible with Slackware standards (maybe it has a dash in the version) or maybe it is really long (if you're using a git commit). In those cases, you can either hardcode the values or use different variables (the latter is my personal choice). In those cases, I'll use $SRCNAM and/or $SRCVER, depending on what is needed.
 
Old 05-24-2017, 04:29 PM   #6
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Original Poster
Rep: Reputation: Disabled
Error
Code:
./l2tp-ipsec-vpn.SlackBuild: line 50: ./configure: No such file or directory
Code:
./configure \
  --prefix=/usr \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/man \
  --docdir=/usr/doc/$PRGNAM-$VERSION \
  --build=$ARCH-slackware-linux
 
Old 05-24-2017, 04:55 PM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
This is because there is no configure file in the source archive. Type "make help" to know the options, and see in https://sourceforge.net/projects/l2t...sec-vpn/1.0.9/ the prerequisites and installation instructions. In this case a SlackBuild template can't be used as is but needs an adaptation as autotools is not used by upstream.
 
1 members found this post helpful.
Old 05-24-2017, 05:51 PM   #8
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
Before or while in the process of creating a SlackBuild script, it's a good idea to build the software manually first. Read any included documentation, like the README and INSTALL files, to see what the authors say about how to build it. Then, once you have a good handle on the process and have built it successfully by just entering the commands on the command line, you can capture the steps in the SlackBuild script. As you are finding, the templates often need adjustment to work with different software. They're not meant to be automatic for the person creating the script.

Also, if you post a link to the source code you are working with, I'm sure people would be able to help you better. I did a quick search but didn't find it.

Edit: actually, on that last point, it looks like Didier found it already. I'll have a look later if I get the chance.

Last edited by montagdude; 05-24-2017 at 05:53 PM.
 
2 members found this post helpful.
Old 05-25-2017, 08:25 AM   #9
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Didier Spaier View Post
This is because there is no configure file in the source archive. Type "make help" to know the options, and see in https://sourceforge.net/projects/l2t...sec-vpn/1.0.9/ the prerequisites and installation instructions. In this case a SlackBuild template can't be used as is but needs an adaptation as autotools is not used by upstream.
This is what got me started.

https://beej.us/slackware/mksb/

I let the tool do the work and tried to edit it myself and got errors. I will follow you and montagdude advice.
Thanks
 
Old 05-25-2017, 09:02 AM   #10
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 2,011

Rep: Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619Reputation: 1619
I looked at what's in the tarball, and unfortunately in this case there isn't any documentation other than what's on the Sourceforge page and `make help` as Didier suggested. It looks like the basic build process will be something like:

Code:
make
make INSTALL_ROOT=$PKG
(While you are testing from the command line, you might want to instead make a local directory to set as INSTALL_ROOT.) From the list of requirements on Sourceforge, it appears that you will need to have ctemplate and cppunit installed from SBo. The rest should be already in Slackware, except I'm not sure about libengine-pkcs11-openssl. Good luck!

Last edited by montagdude; 05-25-2017 at 09:06 AM.
 
  


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
creating local repository of slackbuilds with dependency resolution travis82 Slackware 10 06-02-2015 03:40 AM
[SOLVED] Slackbuilds. stf92 Slackware 8 08-08-2010 01:20 PM
why slackbuilds? icecubeflower Slackware 12 04-11-2010 12:17 PM
Useradd not creating home directory when creating newuser meneedham Linux - Newbie 4 10-05-2007 12:11 PM
Use SlackBuilds.org or my own hosting to offer up SlackBuilds? hollywoodb Slackware 6 11-30-2006 08:56 PM

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

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