LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 12-15-2016, 10:09 AM   #1
FTIO
Member
 
Registered: Mar 2015
Location: Las Vegas, NV
Distribution: Slackware 15.0, Slackware 14.2_x64, Slackware 14.1 x86
Posts: 609

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Trying to make a pkg of 'convertall'


Hi folks,

Not being a programmer in any way, shape or form and even unable to write a bash script of any kind, I *have* been able over the years to open a SlackBuild file and change things here and there once in a great while to make it work on/better for my system, simply through a lot of guessing and saves and re-saves over and over in my editor.

I'd really like to have this program of 'ConvertAll' be in the SlackBuilds repository as I honestly believe it's a very helpful program.

Here's my problem though - it's written in python and I'm having a hell of a time getting my SlackBuild to work. At the present point, the build keeps stopping with...

Code:
cp: missing destination file operand after '/tmp/SBo/package-convertall/usr/doc/ConvertAll'
I'm at a loss as to how to fix this, as I've looked at other SlackBuild files in other programs for comparison and I can't find any problem(s).

Here is my SlackBuild for this program below. I've added 'PRGNAM2' because the uncompressed tarball directory isn't the same as the 'PRGNAM' in the tarball name itself (in other words, the tarball is 'convertall-version', but the uncompressed directory name is 'ConvertAll').

If anyone has a moment to look it over and offer a/some suggestions, I'd really be appreciative. As I said, I honestly believe this program could be useful to many people and I simply wanted to try and be able to offer it up in the SlackBuilds repository...I just suck at getting it working is all.

Also, for this project I used the 'python-template.SlackBuild' template, believing this would be best for a 'python' program.

I also commented out line 53 because then it always ended with this...

Code:
Usage:
    python install.py [-h] [-p dir] [-d dir] [-t dir] [-i dir] [-b dir] [-x]
where:
    -h         display this help message
    -p dir     install prefix [default: /usr/local]
    -d dir     documentaion dir [default: <prefix>/share/doc/convertall]
    -i dir     icon dir [default: <prefix>/share/icons/convertall]
    -b dir     temporary build root for packagers [default: /]
    -x         skip all dependency checks (risky)
...which confused me even more even though I *did* try some of the different commands such as the 'p' and 'd' which didn't help any.

Anyway, here's my build file...

Code:
PRGNAM=convertall
PRGNAM2=ConvertAll
VERSION=${VERSION:-0.5.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

DOCS=$PRGNAM2/doc "INSTALL LICENSE README.html"

# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i586 ;;
    arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
       *) ARCH=$( uname -m ) ;;
  esac
fi

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

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

set -e 

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

#python install.py --root=$PKG

# Strip binaries and libraries.
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

mkdir -p $PKG/usr/doc/$PRGNAM2
cp -a $DOCS $PKG/usr/doc/$PRGNAM2
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.${PKGTYPE:-tgz}
 
Old 12-15-2016, 10:26 AM   #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
The cp error is because your DOCS variable is screwed up. Something like this should work:

Code:
DOCS="$PRGNAM2/doc/INSTALL $PRGNAM2/doc/LICENSE $PRGNAM2/doc/README.html"
There might be a shortcut way to specify the same thing. The python error is because you've tried to give it an option (--root) that it doesn't recognize. I'm guessing you want to use:

Code:
python install.py -p $PKG
 
1 members found this post helpful.
Old 12-15-2016, 10:42 AM   #3
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
In the past, how I've dealt with different source folders is using SRCNAM instead of PRGNAM2, but it results in the same end, so whatever works for you.

montagdude already hit your issue. It is the DOCS variable not being set up properly. I would probably either use his method or you could try the following (I'm not on a Linux computer now, so I can't test it).

Also, you don't want $PRGNAM2 before the source doc folders as you're already in that directory and it would try to get files from /tmp/SBo/ConvertAll/ConvertAll/doc/ rather than just /tmp/SBo/ConvertAll/doc/.

Code:
DOCS="doc/{INSTALL,LICENSE,README.html}"
Or you could just remove the DOCS variable and just copy everything from the doc directory over.

Code:
mkdir -p $PKG/usr/doc/$PRGNAM2
cp -r doc/* $PKG/usr/doc/$PRGNAM2
As for the python install section, I believe you'll want to use -p to specify the /usr/ directory as the eventual destination and then -b to specify the $PKG directory.

Code:
python install.py -p /usr -b $PKG
 
Old 12-15-2016, 10:44 AM   #4
hitest
Guru
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware, Void
Posts: 7,341

Rep: Reputation: 3743Reputation: 3743Reputation: 3743Reputation: 3743Reputation: 3743Reputation: 3743Reputation: 3743Reputation: 3743Reputation: 3743Reputation: 3743Reputation: 3743
You can give this program a try. It will take your source and attempt to build a Slackware package. If it errors out it will give you clues as to dependency issues.
Source to package is a nifty utility.
I know this isn't the solution you asked for, but, it may help if you're stuck. Best wishes!

http://distro.ibiblio.org/amigolinux/download/src2pkg/
 
Old 12-15-2016, 11:08 AM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,044

Rep: Reputation: Disabled
Quote:
Originally Posted by FTIO View Post
I'd really like to have this program of 'ConvertAll' be in the SlackBuilds
It is: https://slackbuilds.org/repository/1...ic/convertall/
Attached Thumbnails
Click image for larger version

Name:	convertall.png
Views:	21
Size:	41.6 KB
ID:	23775  

Last edited by Didier Spaier; 12-15-2016 at 11:13 AM.
 
1 members found this post helpful.
Old 12-15-2016, 03:22 PM   #6
FTIO
Member
 
Registered: Mar 2015
Location: Las Vegas, NV
Distribution: Slackware 15.0, Slackware 14.2_x64, Slackware 14.1 x86
Posts: 609

Original Poster
Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Quote:
Originally Posted by Didier Spaier View Post
Well crud. Well, at least someone else was on the ball faster than I.

Thanks everyone for all the suggestions and assistance, and thanks Didier for actually looking if it was actually in the repository, lol. (sheesh, how simple that would have been in the first place, eh?)

Best wishes to all this holiday season. Stay warm out there!
 
  


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
[SOLVED] Ok I,m having problems with Make Depend and pkg-config spiky0011 Linux From Scratch 7 12-12-2011 12:36 PM
How to make a ARCH pkg from a local folder? linus72 Arch 6 07-01-2010 10:40 AM
Torcs and make pkg mlangdn Slackware 11 12-31-2009 01:09 PM
pkg-config - how do I make a .pc file? needlern32724 Linux - Software 2 07-19-2006 10:33 AM
kernel: make deb-pkg coax1984 Linux - Software 0 10-27-2004 08:08 AM

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

All times are GMT -5. The time now is 01:32 AM.

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