Script to make Slackware Compliant package of xz, deb

Post tutorials, HOWTO's and other useful resources here.
Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Script to make Slackware Compliant package of xz, deb

Post#31 by Bogomips » 08 Oct 2016, 21:19

@FURRY_NOVA Thanks for clarification. There's more than one way to skin a cat! :)
FURRY_NOVA wrote:In the File System, that contains bin, dev, etc and home and stuff. It has a node-v4.6.0-linux-x86 folder. The contents of that folder should be outside in the File System.

Current:

Code: Select all

/node-v4.6.0-linux-x86/include/
/node-v4.6.0-linux-x86/bin/
/node-v4.6.0-linux-x86/share/
/node-v4.6.0-linux-x86/README.md
/node-v4.6.0-linux-x86/lib/
/node-v4.6.0-linux-x86/CHANGELOG.md
/node-v4.6.0-linux-x86/LICENSE
Should be:

Code: Select all

/include/
/bin/
/share/
/README.md
/lib/
/CHANGELOG.md
/LICENSE
Starting back at the tar.xz. I made the file structure look like the last code area above this paragraph with Xarchiver application. I deleted README.md, CHANGELOG.md and LICENSE since those aren't created in File System when activating other modules. I don't know if they supposed to be places somewhere else though.
The story so far (Have to do better job of renaming. So far sorted the debs.):
  • Code: Select all

    guest@porteus:~$ sh xz2txz.sh -nv node-v4.6.0-linux-x86.tar.xz
    ->  node-v4.6.0-linux-x86.x-z-z-.txz
    <slack-desc>
    node-v4.6.0-linux-x86.tar.x: (node-v4.6.0-linux-x86.tar.xz)
    
    Slackware package maker, version 3.141593.
    
    Searching for symbolic links:
    node-v4.6.0-linux-x86/bin/npm	../lib/node_modules/npm/bin/npm-cli.js
    
    Making symbolic link creation script:
    ( cd node-v4.6.0-linux-x86/bin ; rm -rf npm )
    ( cd node-v4.6.0-linux-x86/bin ; ln -sf ../lib/node_modules/npm/bin/npm-cli.js npm )
    ...
    Removing symbolic links:
    removed './node-v4.6.0-linux-x86/bin/npm'
    ...
    Slackware package /home/guest/node-v4.6.0-linux-x86.x-z-z-.txz created.
    
    Installation Files List: /tmp/Sat_21:50/xz_5845.lst
    ______________________________________________________________________________
    root@porteus:/home/guest# txz2xzm node-v4.6.0-linux-x86.x-z-z-.txz
    Verifying package node-v4.6.0-linux-x86.x-z-z-.txz.
    Installing package node-v4.6.0-linux-x86.x-z-z-.txz:
    PACKAGE DESCRIPTION:
    Executing install script for node-v4.6.0-linux-x86.x-z-z-.txz.
    Package node-v4.6.0-linux-x86.x-z-z-.txz installed.
    
    Creating /home/guest/node-v4.6.0-linux-x86.x-z-z-.xzm
    
    root@porteus:/home/guest# activate node-v4.6.0-linux-x86.x-z-z-.xzm
    Quiet mode: off
    Adding 10 new loop devices
    Updating shared library links:  /sbin/ldconfig
    
  • Code: Select all

    guest@porteus:~$ which node
    which: no node in (/usr/local/bin:/usr/bin:/bin:/usr/games:/opt/porteus-scripts:/usr/lib/qt/bin:/usr/lib/qt/bin:/usr/lib/qt/bin)
    
    guest@porteus:~$ ls /
    M/    etc/   media/                  opt/   run/   sys/  var/
    bin/  home/  mnt/                    proc/  sbin/  tmp/
    dev/  lib/   node-v4.6.0-linux-x86/  root/  srv/   usr/
    
    guest@porteus:~$ PATH+=:/node-v4.6.0-linux-x86/bin/
    guest@porteus:~$ which node
    /node-v4.6.0-linux-x86/bin/node
    
    guest@porteus:~$ node
    > console.log("hi");
    hi
    undefined
    > guest@porteus:~$
    
    or

    Code: Select all

    guest@porteus:~$ which node
    which: no node in (/usr/local/bin:/usr/bin:/bin:/usr/games:/opt/porteus-scripts:/usr/lib/qt/bin:/usr/lib/qt/bin:/usr/lib/qt/bin)
    
    guest@porteus:~$ /node-v4.6.0-linux-x86/bin/node 
    > console.log("hi");
    hi
    undefined
    > guest@porteus:~$ 
    
    :wink:
FURRY_NOVA wrote:Then used your script to convert to txz where it shows:

Code: Select all

/install/
/include/
/bin/
/share/
/lib/
/./
Then I txz2xzm it, activated xzm and tried it again:

Code: Select all

guest@porteus:~$ node
> console.log("hi");
hi
undefined
>  
Last edited by Bogomips on 09 Oct 2016, 01:10, edited 1 time in total.
Reason: Alt invoke
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
brokenman
Site Admin
Site Admin
Posts: 6104
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil
Contact:

Re: Script to make Slackware Compliant package of xz, deb

Post#32 by brokenman » 08 Oct 2016, 21:26

I read no malice in Bogomips post at all. Just neutral facts. In fact, if EVERYBODY followed his advice development would come much easier and faster.

It is one thing to just report a bug. (Hey man, XYZ don't work. I tried to start it and it gave an error.)
It is quite another thing to dig deeper, find the error and give advice about fixing it. This is what helps the community more. It is the way Bogomips reports bugs and, for the most part, FURRY_NOVA usually does too. Thanks guys!

PS: I usually don't like to make noise in threads, however, I felt the need here to reinforce correct bug reporting procedure.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
francois
Contributor
Contributor
Posts: 6019
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: Script to make Slackware Compliant package of xz, deb

Post#33 by francois » 11 Oct 2016, 10:18

@brokenman and bogomips:
Agreed upon that topic of being more constructive. This saves work to the developper and help forum members to get a bigger IT IQ. :twisted:
Prendre son temps, profiter de celui qui passe.

User avatar
Rava
Contributor
Contributor
Posts: 3578
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0rc3 x86_64 + 4.0 i586
Location: Forests of Germany
Contact:

Re: Script to make Slackware Compliant package of xz, deb

Post#34 by Rava » 07 Jan 2019, 16:23

Bogomips wrote:
28 Apr 2015, 18:06
Paste above script into text editor. Save once as xz2txz.sh. Save again as deb2txz.sh. Save once more as rpm2txz.sh.
I presume having one version of the script (the newest one of course) in $PATH and the others just softlinks to that one copy will work as well?
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 6932
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0rc3 ISOs
Location: Western NY, USA

Re: Script to make Slackware Compliant package of xz, deb

Post#35 by Ed_P » 07 Jan 2019, 22:28

So, how did your testing turn out?
Ed

User avatar
Rava
Contributor
Contributor
Posts: 3578
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0rc3 x86_64 + 4.0 i586
Location: Forests of Germany
Contact:

Script to make Slackware Compliant package of xz, deb

Post#36 by Rava » 06 Dec 2021, 02:45

I managed to convert windscribe-cli-1.4_51-1-x86_64.pkg.tar.xz into windscribe-cli-1.4_51.x86.64-pkg-1.txz and that into an module.

Code: Select all

# xz2txz.shV2016-09-27 windscribe-cli-1.4_51-1-x86_64.pkg.tar.xz 
->  windscribe-cli-1.4_51.x86.64-pkg-1.txz
<slack-desc>
windscribe-cli: 1.4_51 (windscribe-cli-1.4_51-1-x86_64.pkg.tar.xz)

Slackware package maker, version 3.14159265.

Searching for symbolic links:

No symbolic links were found, so we won't make an installation script.
You can make your own later in ./install/doinst.sh and rebuild the
package if you like.

This next step is optional - you can set the directories in your package
to some sane permissions. If any of the directories in your package have
special permissions, then DO NOT reset them here!

Would you like to reset all directory permissions to 755 (drwxr-xr-x) and
directory ownerships to root.root ([y]es, [n]o)? n

Creating Slackware package:  /mnt/sdb4/bin/linux/windscribe/windscribe-cli-1.4_51.x86.64-pkg-1.txz

./
.BUILDINFO
.INSTALL
.MTREE
.PKGINFO
etc/
etc/bash_completion.d/
etc/bash_completion.d/windscribe_complete
etc/windscribe/
install/
install/slack-desc
usr/
usr/bin/
usr/bin/windscribe
usr/lib/
usr/lib/systemd/
usr/lib/systemd/system/
usr/lib/systemd/system/windscribe.service
usr/share/
usr/share/licenses/
usr/share/licenses/windscribe-cli/
usr/share/licenses/windscribe-cli/LICENSE

Slackware package /mnt/sdb4/bin/linux/windscribe/windscribe-cli-1.4_51.x86.64-pkg-1.txz created.

->  windscribe-cli-1.4_51.x86.64-pkg-1.txz
<slack-desc>
windscribe-cli: 1.4_51 (windscribe-cli-1.4_51-1-x86_64.pkg.tar.xz)

Slackware package maker, version 3.14159265.

Searching for symbolic links:

No symbolic links were found, so we won't make an installation script.
You can make your own later in ./install/doinst.sh and rebuild the
package if you like.

This next step is optional - you can set the directories in your package
to some sane permissions. If any of the directories in your package have
special permissions, then DO NOT reset them here!

Would you like to reset all directory permissions to 755 (drwxr-xr-x) and
directory ownerships to root.root ([y]es, [n]o)? n

Creating Slackware package:  /mybin/linux/windscribe/windscribe-cli-1.4_51.x86.64-pkg-1.txz

./
.BUILDINFO
.INSTALL
.MTREE
.PKGINFO
etc/
etc/bash_completion.d/
etc/bash_completion.d/windscribe_complete
etc/windscribe/
install/
install/slack-desc
usr/
usr/bin/
usr/bin/windscribe
usr/lib/
usr/lib/systemd/
usr/lib/systemd/system/
usr/lib/systemd/system/windscribe.service
usr/share/
usr/share/licenses/
usr/share/licenses/windscribe-cli/
usr/share/licenses/windscribe-cli/LICENSE

Slackware package /mybin/linux/windscribe/windscribe-cli-1.4_51.x86.64-pkg-1.txz created.
The issue: these files in windscribe-cli-1.4_51-1-x86_64.pkg/ 's root are ignored:

Code: Select all

root@porteus:/mybin/linux/windscribe/windscribe-cli-1.4_51-1-x86_64_xz# ls -o .[BIMP]*
-rw-r--r-- 1 guest 36264 Feb  2  2020 .BUILDINFO
-rw-r--r-- 1 guest   509 Feb  2  2020 .INSTALL
-rw-r--r-- 1 guest   745 Feb  2  2020 .MTREE
-rw-r--r-- 1 guest   342 Feb  2  2020 .PKGINFO

root@porteus:/mybin/linux/windscribe/windscribe-cli-1.4_51-1-x86_64_xz# file .[BIMP]*
.BUILDINFO: ASCII text
.INSTALL:   ASCII text
.MTREE:     gzip compressed data, from Unix, original size modulo 2^32 1796
.PKGINFO:   ASCII text
.BUILDINFO and .PKGINFO holds info that could be used for the slack-desc.

Excerpt from the above full output

Code: Select all

No symbolic links were found, so we won't make an installation script.
You can make your own later in ./install/doinst.sh and rebuild the
package if you like.
And .INSTALL seems to be the equivalent of what slackware would put into ./install/doinst.sh ?
Or into var/log/scripts/windscribe-cli-1.4_51-1-x86_64 ?

.INSTALL is this

Code: Select all

post_install() {
  . /etc/bash_completion.d/windscribe_complete
  systemctl daemon-reload
}

post_upgrade() {
  systemctl daemon-reload  
}

pre_remove() {
  /usr/bin/windscribe firewall off
  /usr/bin/windscribe logout
  systemctl stop windscribe
}

post_remove() {
  rm -rf /etc/windscribe
  rm -rf /usr/share/doc/windscribe-cli
  rm -rf /usr/share/licenses/windscribe-cli
  rm -rf /etc/bash_completion.d/windscribe_complete
  rm -rf /var/log/windscribe
  systemctl daemon-reload
  systemctl reset-failed
}
I am sure Slackware not supports these functions as defined here.
Do I have to manually create a ./install/doinst.sh out of .INSTALL ?

If so, is there a wiki explaining me the details of the procedure?

And all systemctl must be changed since Porteus has no systemd. A /rc.d/rc.windscribe (or better a etc/rc.d/rc.windscribe_cli ) is needed me thinks.

But there is no etc/rc.d/rc.windscribe (or better a etc/rc.d/rc.windscribe_cli ) so I would have to create that one as well…
:juggler:

This is new territory for me. All help and suggestions very welcome. And Bogomips not active here since Jan 2018 (unless he always hides his online status) is less helpful, but seemingly we have to manage without him.

beny
Full of knowledge
Full of knowledge
Posts: 1314
Joined: 02 Jan 2011, 11:33
Location: italy

Script to make Slackware Compliant package of xz, deb

Post#37 by beny » 06 Dec 2021, 11:05

hi Rava you have to try alien...not bob but a software that allow you a lot of packages conversions,the debian and arch packages do not have the rc.files like slackware and porteus.

User avatar
Rava
Contributor
Contributor
Posts: 3578
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0rc3 x86_64 + 4.0 i586
Location: Forests of Germany
Contact:

Script to make Slackware Compliant package of xz, deb

Post#38 by Rava » 06 Dec 2021, 11:14

beny wrote:
06 Dec 2021, 11:05
you have to try alien...not bob but a software
Where do I find this alien software?

I presume if alienbob made a tgz out of windscribe-cli-1.4_51-1-x86_64 I would have found it via https://pkgs.org .
Cheers!
Yours Rava

beny
Full of knowledge
Full of knowledge
Posts: 1314
Joined: 02 Jan 2011, 11:33
Location: italy

Script to make Slackware Compliant package of xz, deb

Post#39 by beny » 06 Dec 2021, 11:24

is a sbopkg slackbuild:
bash-5.1# alien
You must specify a file to convert.

Usage: alien [options] file [...]
file [...] Package file or files to convert.
-d, --to-deb Generate a Debian deb package (default).
Enables these options:
--patch=<patch> Specify patch file to use instead of automatically
looking for patch in /var/lib/alien.
--nopatch Do not use patches.
--anypatch Use even old version os patches.
-s, --single Like --generate, but do not create .orig
directory.
--fixperms Munge/fix permissions and owners.
--test Test generated packages with lintian.
-r, --to-rpm Generate a Red Hat rpm package.
--to-slp Generate a Stampede slp package.
-l, --to-lsb Generate a LSB package.
-t, --to-tgz Generate a Slackware tgz package.
Enables these options:
--description=<desc> Specify package description.
--version=<version> Specify package version.
-p, --to-pkg Generate a Solaris pkg package.
-i, --install Install generated package.
-g, --generate Generate build tree, but do not build package.
-c, --scripts Include scripts in package.
--target=<arch> Set architecture of the generated package.
-v, --verbose Display each command alien runs.
--veryverbose Be verbose, and also display output of run commands.
-k, --keep-version Do not change version of generated package.
--bump=number Increment package version by this number.
-h, --help Display this help message.
-V, --version Display alien's version number.

bash-5.1#

User avatar
Rava
Contributor
Contributor
Posts: 3578
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0rc3 x86_64 + 4.0 i586
Location: Forests of Germany
Contact:

Script to make Slackware Compliant package of xz, deb

Post#40 by Rava » 06 Dec 2021, 17:08

Port 4.0:

Code: Select all

root@porteus:~# alien
-su: alien: command not found
:(

Added in 3 hours 38 minutes 56 seconds:
Found it via the other thread, made a module out of it:

Code: Select all

root@porteus:/mybin/linux/windscribe# alien windscribe-cli-1.4_51-1-x86_64.pkg.tar.xz 
Unknown type of package, windscribe-cli-1.4_51-1-x86_64.pkg.tar.xz.
root@porteus:/mybin/linux/windscribe# alien windscribe-cli-1.4_51-1-x86_64.pkg.tar.zst 
Unknown type of package, windscribe-cli-1.4_51-1-x86_64.pkg.tar.zst.
Seems it's not that easly.
man alien says

Code: Select all

       pkg To manipulate packages in the Solaris pkg format (which is really
           the SV datastream package format), you will need the Solaris
           pkginfo and pkgtrans tools.
I have no clue if the packages are Solaris pkg format / SV datastream package format…
Cheers!
Yours Rava

Post Reply