LinuxQuestions.org
Visit Jeremy's Blog.
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 11-09-2018, 07:30 AM   #1
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
How to repackage package to Slackware format?


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.

Last edited by igadoter; 11-09-2018 at 07:32 AM.
 
Old 11-09-2018, 07:39 AM   #2
Skaendo
Senior Member
 
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 1,445

Rep: Reputation: Disabled
Like this?:

https://slackbuilds.org/repository/1...oogle-go-lang/
 
Old 11-09-2018, 08:05 AM   #3
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
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
 
Old 11-09-2018, 08:20 AM   #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
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.
 
Old 11-09-2018, 10:18 AM   #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
Quote:
Originally Posted by igadoter View Post
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).
 
Old 11-09-2018, 10:34 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by bassmadrigal View Post
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}

Last edited by BW-userx; 11-09-2018 at 10:42 AM.
 
Old 11-09-2018, 01:26 PM   #7
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,235

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Uh, -current already ships go.

But in general, you'd create a folder tree:

/tmp/package-golang-VERSION/
/tmp/package-golang-VERSION/usr/bin/
/tmp/package-golang-VERSION/usr/usr/doc
/tmp/package-golang-VERSION/etc

And copy the files from the tarball into the correct locations in that folder tree.

Then you'd do:

Code:
cd /tmp/package-golang-VERSION
/sbin/makepkg -l y -c n /tmp/package-golang-VERSION-ARCH-1igdt.tgz
You do all this as root.

Last edited by dugan; 11-09-2018 at 01:30 PM.
 
Old 11-09-2018, 01:28 PM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by dugan View Post
Uh, -current already ships go.
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...

Last edited by BW-userx; 11-09-2018 at 01:58 PM.
 
Old 11-09-2018, 01:33 PM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,235

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
That was funny, but:

Code:
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
 
Old 11-09-2018, 01:50 PM   #10
Skaendo
Senior Member
 
Registered: Dec 2014
Location: West Texas, USA
Distribution: Slackware64-14.2
Posts: 1,445

Rep: Reputation: Disabled
Quote:
Originally Posted by dugan View Post
Uh, -current already ships go.
I don't think that gcc-go is the same as go (google-go-lang).
 
Old 11-09-2018, 02:04 PM   #11
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634

Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
@igadoter
Basically, as hinted above, you need to mimic the creation of a package:
https://docs.slackware.com/howtos:sl...ding_a_package

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
 
Old 11-09-2018, 02:53 PM   #12
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717

Original Poster
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
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.
 
Old 11-09-2018, 03:18 PM   #13
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
you can download that one already up on slackbilds then edit it for your usr/local too you know. fyi
 
Old 11-09-2018, 03:44 PM   #14
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,457
Blog Entries: 7

Rep: Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560Reputation: 2560
How to repackage package to Slackware format?

I use /usr/local for unpackaged items, and copy everything in there to new installations. Works well.
 
Old 11-09-2018, 04:02 PM   #15
jakedp
Member
 
Registered: Oct 2016
Location: Canada
Distribution: Slackware64, Mageia
Posts: 226

Rep: Reputation: 184Reputation: 184
Also, a good idea to follow this standard for where files go: https://refspecs.linuxfoundation.org...fhs/index.html

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.
 
  


Reply

Tags
slackware package how-to



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
SlackBuild to repackage any Debian or Ubuntu icon theme dugan Slackware 7 03-03-2018 12:44 PM
yum repackage bic Red Hat 1 03-13-2014 08:06 AM
rpm repackage option not working rhel6 MANOHARNLINUX Linux - Enterprise 3 11-01-2011 03:02 PM
The perfect package format: No package, but instead revision control Kenny_Strawn Linux - Distributions 2 09-26-2010 11:33 AM
New package format for slackware 13? janhe Slackware 112 05-22-2009 03:39 PM

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

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