SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am just downloading go binaries (no way to build from source). Default way of install is just 'tar xvf'. I started to think to repackage it to say go-lang*igdt-txz. So to add nice description. I am scratching my head - essentially it is to create go.SlackBuild plus remaning files: info, etc. Is there a way to generate such script starting from binaries package? I mean some template.
yep, it helps if you check slackbuilds first, to see if it is already there, and look in there 'submissions' to see if anyone beat you to it. see 'the pending queue' and ' the ready queue' , but hey! thanks
The basic process is to create a directory with a subdirectory called 'install' plus whatever other directories are needed for your package (usually at least 'usr' or sometimes 'opt' for binary repackages). install should include slack-desc and doinst.sh (if applicable), while the other subdirectories include the files to be installed for the package. Then use makepkg to create the package rather than tarring it up manually.
The templates on slackbuilds.org will probably be useful to you. (The makepkg command is there last thing in each SlackBuild script.)
Last edited by montagdude; 11-09-2018 at 08:21 AM.
I am just downloading go binaries (no way to build from source). Default way of install is just 'tar xvf'. I started to think to repackage it to say go-lang*igdt-txz. So to add nice description. I am scratching my head - essentially it is to create go.SlackBuild plus remaning files: info, etc. Is there a way to generate such script starting from binaries package? I mean some template.
To go back to your original question, to create your own package from pre-compiled binaries, you need to mimic the folder structure of how they would be installed. If this is already a package for another distro, you should just be able to extract it into a new directory, create a folder in that directory called install/ and add your slack-desc file and optionally a doinst.sh file if it's needed and then run makepkg on it (ideally, you should also do some permission checking and stripping binaries).
To go back to your original question, to create your own package from pre-compiled binaries, you need to mimic the folder structure of how they would be installed. If this is already a package for another distro, you should just be able to extract it into a new directory, create a folder in that directory called install/ and add your slack-desc file and optionally a doinst.sh file if it's needed and then run makepkg on it (ideally, you should also do some permission checking and stripping binaries).
2 OP
to expand on that I got a few slackbuilds that I could post one to give you a good idea on how that goes, but you still got a figure out yours.
like bassmadrigal said you have to mimic the dir struct it would install into, then make any changes to permissions , links, and alike too if needed within the script. Just as if it was being installed via a MakeFile minus the slackbuid.
the PkgTo within my loops are the directories they will be installed into when installpkg is applied.
Code:
PRGNAM=e16.theme.pack
VERSION=${VERSION:-1.0.4}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
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
[[ "$ARCH" != 'x86_64' ]] && ( echo "System is not x86_64. These will not work in your system." ; exit )
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
while read dir ; do
while read subdir ; do
case "$subdir" in
Eterm)
ThemePkgName="$dir"
appName="$subdir"
Pkgto="$PKG/usr/share/Eterm/themes/$ThemePkgName"
if [[ -d /usr/share/Eterm ]] ; then
{
mkdir -p $Pkgto
cp -r $ThemePkgName/$appName/* "$Pkgto"
}
fi
;;
e16)
ThemePkgName="$dir"
appName="$subdir"
Pkgto="$PKG/usr/share/e16/themes/$ThemePkgName"
if [[ -d /usr/share/e16 ]] ; then
{
mkdir -p $Pkgto
cp -r $ThemePkgName/$appName/* "$Pkgto"
}
fi
;;
audacious)
ThemePkgName="$dir"
appName="$subdir"
Pkgto="$PKG/usr/share/audacious/Skins/$ThemePkgName"
if [[ -d /usr/share/audacious ]] ; then
{
mkdir -p $Pkgto
cp -r $ThemePkgName/$appName/* "$Pkgto"
}
fi
;;
gkrellm2)
ThemePkgName="$dir"
appName="$subdir"
Pkgto="$PKG/usr/share/gkrellm2/themes/$ThemePkgName"
if [[ -d /usr/lib64/gkrellm2 ]] ;
then
{
mkdir -p /usr/share/gkrellm2/themes
mkdir -p $Pkgto
cp -r $ThemePkgName/$appName/* "$Pkgto"
}
fi
;;
plugins)
ThemePkgName="$dir"
appName="$subdir"
Pkgto="$PKG/usr/lib64/gkrellm2/plugins"
if [[ -d /usr/lib64/gkrellm2 ]] ;
then
mkdir -p $Pkgto
cp -r $ThemePkgName/$appName/* "$Pkgto"
fi
;;
esac
done <<< "$(ls $(pwd)/$dir)"
done <<<"$(ls)"
mkdir -p $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
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
uh..you mean I got go in here already? go go go gooooo gooogle
wow, it worked, I see it is picky with its syntax and unconventional use of printf. Printf mind you
yeah
Code:
$ go build
# _/media/projects/go/src/hello
./hello.go:6:1: error: unexpected semicolon or newline before ‘{’
{
^
userx@Slack-O-Lantern.org:/media/projects/go/src/hello
$ nano hello.go
userx@Slack-O-Lantern.org:/media/projects/go/src/hello
$ go build
userx@Slack-O-Lantern.org:/media/projects/go/src/hello
$ ls
hello hello.go
userx@Slack-O-Lantern.org:/media/projects/go/src/hello
$ ./hello
GO Stupid... GO!
so OP I'd say your work is done here, just "up grade" to current...
PACKAGE NAME: gcc-go-8.2.0-x86_64-1.txz
PACKAGE LOCATION: ./slackware64/d
PACKAGE SIZE (compressed): 12132 K
PACKAGE SIZE (uncompressed): 57030 K
PACKAGE DESCRIPTION:
gcc-go: gcc-go (Go support for GCC)
gcc-go:
gcc-go: Go is a compiled, garbage-collected, concurrent programming language
gcc-go: developed by Google Inc. The initial design of Go was started in
gcc-go: September 2007 by Robert Griesemer, Rob Pike, and Ken Thompson.
gcc-go: Rob Pike has stated that Go is being used "for real stuff" at Google.
gcc-go: Go's "gc" compiler targets the Linux, Mac OS X, FreeBSD, OpenBSD and
gcc-go: Microsoft Windows operating systems, and the i386, amd64, and ARM
gcc-go: processor architectures.
gcc-go:
gcc-go: Homepage: http://golang.org
Just for the sake of simplicity, keep the folder naming from the guide above and instead of instructing make to install in /tmp/build, manually put your existing (and exact) folders structure in /tmp/build, make a subfolder /tmp/build/install where you need to create the slack-desc file. Once done, move to the "I don't have time" section, "cd $(pwd)/PACKAGE" will be:
Code:
cd /tmp/build
and issue (change "app-version-arch-tag.tgz" accordingly):
Code:
makepkg -l y -c n ../app-version-arch-tag.tgz
Your package "app-version-arch-tag.tgz" will be available in /tmp
Last edited by abga; 11-09-2018 at 02:40 PM.
Reason: cd /tmp/build
Thanks guys. I need go because it is dependency for docker - and in fact I am interested in running docker. As I posted tarball essentially contains all needed directory structure. By default installation is under /usr/locale/. I think that tarball is just shot of generic installation. Essentially SlackBuild script should extract archive but with different leading directory path usr/ instead of usr/local. And probably /go sub directory is not needed - it is just for encapsulation. I want to see on my own eyes capabilities of docker.
I have used the SlackBuild server and desktop and installs correctly, so I would check it for file locations and permissions. Golang is pretty flexible, all it wants really is a proper GOPATH if in non-standard locations.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.