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: 2563
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Script to make Slackware Compliant package of xz, deb

Post#1 by Bogomips » 28 Apr 2015, 18:06

Quick and dirty scripts for when there are many fiddly packages, which just need to be lumped together into a module. These scripts just provide a one-line description containing just the name of the originating package, whether it be xz, deb or rpm. When a description of the package is superfluous, and one just needs the types of the packages which went into the construction of a module, these will be documented upon their installation (into a fakeroot directory).

Code: Select all

#!/bin/sh
# xz2txz.sh deb2txz.sh rpm2txz.sh	2015-04-28 18:18:09
ren()		# Rename to be Slackware Compliant
{
n=$(awk '{print match($0,"[_-][0-9]+[.]")-1;}'<<< $1)
r=${1:n}; 
v=$(expr "${1:n}" : '\([0-9._-]*[0-9]\)');
r=${1:n}; r=${r#$v}; r=${r//-/.}; r=${r//_/.}; r=${r%.*};
a=${r##*.}; r=${r%.*}; 
[[ ${v%-*} ]] && t=${v##*-}; v=${v%-${t:=1}};
f=${1:0:n}-${v:1}$r-$a-$t.txz; echo "->  $f"
}
sld()		# Create very brief one-liner in 'slack-desc'
{
[[ ! -d $fr/install ]] && mkdir $fr/install
sd=$fr/install/slack-desc
l=${1:0:n}:" ${v:1} ($1)"; l=${l:0:79};
echo $l > $sd
for ((i=0; i<10; i++)); do echo ${1:0:n}: >> $sd; done
echo "<slack-desc>"
head -n1 $sd
}
deb2tgz()
{
    # Convert .deb. packages to .tgz.   2014-11-13 19:45:33
    # Whittled Down Version	2015-04-28 00:32:11
    # Variables
    c='\e[36m'
    r='\e[31m'
    e=`tput sgr0`

    # Let's start
    if [ "$1" = "" ]; then
        echo -e "${c}need a deb package as an argument, example: $0 /mnt/sda2/debian_packages/package.deb"$e | fmt -w 80
        return 1;
    fi

    # Work only on deb packages:

    # Create module:
	y=$1
        mod=`readlink -f $y | sed s/.deb$/.xzm/`
        pkg=`echo $mod | awk -F/ '{print$NF}' | sed s/.xzm//g`
        dataname=`ar t $y | grep data`
    echo dataname = $dataname
    # echo mod = $mod
    echo Creating Package: ${mod%.xzm}.tgz
    pushd .  > /dev/null
       case $dataname in
       data.tar.gz)
       mkdir /tmp/deb2xzm$$ && cp $y /tmp/deb2xzm$$ && cd /tmp/deb2xzm$$ && /usr/bin/ar x * data.tar.gz && mv data.tar.gz $pkg.tgz && mv /tmp/deb2xzm$$/$pkg.tgz ${mod%.xzm}.tgz
       ;;
       data.tar.lzma)
       mkdir /tmp/deb2xzm$$ && cp $y /tmp/deb2xzm$$ && cd /tmp/deb2xzm$$ && /usr/bin/ar x * data.tar.lzma && unxz data.tar.lzma && gzip data.tar && mv data.tar.gz $pkg.tgz  && mv /tmp/deb2xzm$$/$pkg.tgz ${mod%.xzm}.tgz
       ;;
       data.tar.xz)
       mkdir /tmp/deb2xzm$$ && cp $y /tmp/deb2xzm$$ && cd /tmp/deb2xzm$$ && /usr/bin/ar x * data.tar.xz && unxz data.tar.xz && gzip data.tar && mv data.tar.gz $pkg.tgz  && mv /tmp/deb2xzm$$/$pkg.tgz ${mod%.xzm}.tgz
       ;;
       esac
       rm -rf /tmp/deb2xzm$$
    popd  > /dev/null
}
rpm2txz()
{
  [[ ${1##*.} != rpm ]] && { echo Not rpm; return 1; }
  pg=${1##*/}; can=$(readlink -f $1)
  fr=/tmp/fke$$
  pushd .  > /dev/null
  mkdir $fr && cd $fr
  rpm2cpio $can | cpio -dim
  popd  > /dev/null
  ren $pg
  sld $pg
  pushd .  > /dev/null
  cd $fr
  /sbin/makepkg -l y -c n  ${can%/*}/$f
  popd  > /dev/null
  rm -rf $fr
}
deb2txz()
{
  [[ ${1##*.} != deb ]] && { echo Not deb; return 1; }
  pg=${1##*/}; can=$(readlink -f $1)
  deb2tgz $can
  fr=/tmp/fke$$
  mkdir $fr && tar xzf ${can%.*}.tgz -C $fr
  ren $pg
  sld $pg
  pushd .  > /dev/null
  cd $fr
  /sbin/makepkg -l y -c n  ${can%/*}/$f
  popd  > /dev/null
  rm -rf $fr
}
xz2txz()
{
  [[ ${1##*.} != xz ]] && { echo Not xz; return 1; }
  pg=${1##*/}; can=$(readlink -f $1)
  fr=/tmp/fke$$
  mkdir $fr && tar xJf $can -C $fr
  ren ${pg/.tar/}
  sld $pg
  pushd .  > /dev/null
  cd $fr
  /sbin/makepkg -l y -c n  ${can%/*}/$f
  popd  > /dev/null
  rm -rf $fr
}
s=${0##*/}
[[ ! -f $1 ]] && { ls $1; exit; }
$(eval echo ${s%.*}) $1
Paste above script into text editor. Save once as xz2txz.sh. Save again as deb2txz.sh. Save once more as rpm2txz.sh. Invocation
  • sh xz2txz.sh [/path to package/]<package>.xz
    e.g. sh xz2txz.sh libcl-1.1-4-i686.pkg.tar.xz
  • sh deb2txz.sh [/path to package/]<package>.deb
    e,g. sh deb2txz.sh /tmp/tst/libmono2.0-cil_2.10.8.1-5ubuntu2_all.deb
  • sh rpm2txz.sh [/path to package/]<package>.rpm
    e.g. sh p10/Por/rpm2txz.sh libicuuc54-54.1-1-omv2015.0.i586.rpm
Although there is a system rpm2txz, have included rpm2txz.sh here for completeness. rpm2txz -nd <filename> will result in a full-blown description as well as making the resulting package name Slackware compatible.

The quick script here makes a quick analysis of the package name in order to give the resultant package a Slackware acceptable name, which should work most of the time. :)

Invocation Example

Code: Select all

guest@porteus:~$ sh xz2txz.sh libcl-1.1-4-i686.pkg.tar.xz 
->  libcl-1.1.i686-pkg-4.txz
<slack-desc>
libcl: 1.1 (libcl-1.1-4-i686.pkg.tar.xz)

Searching for symbolic links:
usr/lib/libOpenCL.so.1 -> /usr/lib/libOpenCL.so.1.0.0
usr/lib/libOpenCL.so -> /usr/lib/libOpenCL.so.1

Making symbolic link creation script:
( cd usr/lib ; rm -rf libOpenCL.so.1 )
( cd usr/lib ; ln -sf /usr/lib/libOpenCL.so.1.0.0 libOpenCL.so.1 )
( cd usr/lib ; rm -rf libOpenCL.so )
( cd usr/lib ; ln -sf /usr/lib/libOpenCL.so.1 libOpenCL.so )

./
install/
install/doinst.sh
install/slack-desc
usr/
usr/share/
usr/share/licenses/
usr/share/licenses/libcl/
usr/share/licenses/libcl/LICENSE
usr/lib/
usr/lib/libOpenCL.so.1.0.0
.MTREE
.PKGINFO
Slackware package /home/guest/libcl-1.1.i686-pkg-4.txz created.
Verify Example

Code: Select all

guest@porteus:~$ mkdir id
guest@porteus:~$ /sbin/installpkg -root id libcl-1.1.i686-pkg-4.txz 
Verifying package libcl-1.1.i686-pkg-4.txz.
Installing package libcl-1.1.i686-pkg-4.txz:
PACKAGE DESCRIPTION:
# 1.1 (libcl-1.1-4-i686.pkg.tar.xz)
#
/sbin/ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
Executing install script for libcl-1.1.i686-pkg-4.txz.
Package libcl-1.1.i686-pkg-4.txz installed.
Script Update: viewtopic.php?f=39&t=4577#p36115
Last edited by Bogomips on 27 Sep 2016, 19:13, edited 1 time in total.
Reason: Updates Pointer
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
francois
Contributor
Contributor
Posts: 5068
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

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

Post#2 by francois » 29 Apr 2015, 02:10

Félicitations! Your scripts worked well to transform a xz package gimp (archlinux) and a deb package fotoxx (debian). :D

What is left now for me is a simple resolution of the dependencies. :(

I imagine that your answer bogomips would be: look here:
https://forum.porteus.org/viewtopic.php?t=4497&p=33026
Voltaire: Le mieux est l'ennemi du bien.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2563
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#3 by Bogomips » 29 Apr 2015, 12:25

Exactement! 8)

That's why I dunnit :) (the scripts I mean)
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
francois
Contributor
Contributor
Posts: 5068
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

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

Post#4 by francois » 30 Apr 2015, 00:54

Oh! I see. These are promoting tools for your dependencies resolution strategies tools for pkgs.org.

I will come back to report on my dependency resolution for these two packages above gimp and fotoxx. :D
Voltaire: Le mieux est l'ennemi du bien.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2563
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#5 by Bogomips » 30 Apr 2015, 02:14

There is only one tool for pkgs.org. The other day I got so many small package dependencies that it crossed my mind to write these quick scripts, in a way anticipating a future demand should someone happen to use pakorg script. Anyway it's no skin off my nose if you don't use what's in front of your nose. :D . As already mentioned it's a back burner project of mine, which I have gone to some trouble to bring to an almost finished state, in order to make available for general use to the Community. 8)
francois wrote:I will come back to report on my dependency resolution for these two packages above gimp and fotoxx. :D
I hope you will do both the recommended test runs first, and and not go off half-cocked into just looking for the two aforementioned dependencies. :evil:
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

Bogomips
Full of knowledge
Full of knowledge
Posts: 2563
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#6 by Bogomips » 04 Jul 2015, 21:23

Script Update

Enhancements
  • Zips through all of a specified type (xz,deb,rpm)
  • Non-verbose Option -nv, if specified creates an Installation Files List in /tmp
Invocation Example

Code: Select all

guest@porteus:~$ ls -sh dfd/*.xz
9.9M dfd/dwarffortress-0.40.24-2-i686.pkg.tar.xz
440K dfd/freetype2-2.6-1-i686.pkg.tar.xz
5.3M dfd/gcc-libs-5.1.0-5-i686.pkg.tar.xz
324K dfd/openal-1.16.0-1-i686.pkg.tar.xz
 28K dfd/sdl_image-1.2.12-3-i686.pkg.tar.xz
 16K dfd/sdl_ttf-2.0.11-3-i686.pkg.tar.xz

guest@porteus:~$ sh xz2txz.sh -nv dfd/*.xz
->  dwarffortress-0.40.24.i686-pkg-2.txz
<slack-desc>
dwarffortress: 0.40.24 (dwarffortress-0.40.24-2-i686.pkg.tar.xz)

Slackware package maker, version 3.14159.

Searching for symbolic links:
opt/dwarffortress/libs/libpng.so.3 -> /usr/lib/libpng.so

Making symbolic link creation script:
( cd opt/dwarffortress/libs ; rm -rf libpng.so.3 )
( cd opt/dwarffortress/libs ; ln -sf /usr/lib/libpng.so libpng.so.3 )

It is recommended that you make these lines your new installation script.

Would you like to make this stuff the install script for this package
and remove the symbolic links ([y]es, [n]o)? y


Removing symbolic links:
removed ‘./opt/dwarffortress/libs/libpng.so.3’

Creating your new ./install/doinst.sh...

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:  /home/guest/dfd/dwarffortress-0.40.24.i686-pkg-2.txz


Slackware package /home/guest/dfd/dwarffortress-0.40.24.i686-pkg-2.txz created.

->  freetype2-2.6.i686-pkg-1.txz
<slack-desc>
freetype2: 2.6 (freetype2-2.6-1-i686.pkg.tar.xz)

Slackware package maker, version 3.14159.

Searching for symbolic links:
usr/lib/libfreetype.so -> libfreetype.so.6.12.0
usr/lib/libfreetype.so.6 -> libfreetype.so.6.12.0

Making symbolic link creation script:
( cd usr/lib ; rm -rf libfreetype.so )
( cd usr/lib ; ln -sf libfreetype.so.6.12.0 libfreetype.so )
( cd usr/lib ; rm -rf libfreetype.so.6 )
( cd usr/lib ; ln -sf libfreetype.so.6.12.0 libfreetype.so.6 )

It is recommended that you make these lines your new installation script.

Would you like to make this stuff the install script for this package
and remove the symbolic links ([y]es, [n]o)? y


Removing symbolic links:
removed ‘./usr/lib/libfreetype.so’
removed ‘./usr/lib/libfreetype.so.6’

Creating your new ./install/doinst.sh...

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:  /home/guest/dfd/freetype2-2.6.i686-pkg-1.txz

WARNING:  /usr/share/man (with possibly not gzipped man pages) detected

Slackware package /home/guest/dfd/freetype2-2.6.i686-pkg-1.txz created.

->  gcc-libs-5.1.0.i686-pkg-5.txz
<slack-desc>
gcc-libs: 5.1.0 (gcc-libs-5.1.0-5-i686.pkg.tar.xz)

Slackware package maker, version 3.14159.

Searching for symbolic links:
usr/lib/libmpxwrappers.so -> libmpxwrappers.so.0.0.0
usr/lib/libmpxwrappers.so.0 -> libmpxwrappers.so.0.0.0
usr/lib/libmpx.so -> libmpx.so.0.0.0
usr/lib/libmpx.so.0 -> libmpx.so.0.0.0
usr/lib/libobjc.so -> libobjc.so.4.0.0
usr/lib/libobjc.so.4 -> libobjc.so.4.0.0
usr/lib/libvtv.so -> libvtv.so.0.0.0
usr/lib/libvtv.so.0 -> libvtv.so.0.0.0
usr/lib/libstdc++.so -> libstdc++.so.6.0.21
usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.21
usr/lib/libubsan.so -> libubsan.so.0.0.0
usr/lib/libubsan.so.0 -> libubsan.so.0.0.0
usr/lib/libasan.so -> libasan.so.2.0.0
usr/lib/libasan.so.2 -> libasan.so.2.0.0
usr/lib/libquadmath.so -> libquadmath.so.0.0.0
usr/lib/libquadmath.so.0 -> libquadmath.so.0.0.0
usr/lib/libitm.so -> libitm.so.1.0.0
usr/lib/libitm.so.1 -> libitm.so.1.0.0
usr/lib/libgomp-plugin-host_nonshm.so -> libgomp-plugin-host_nonshm.so.1.0.0
usr/lib/libgomp-plugin-host_nonshm.so.1 -> libgomp-plugin-host_nonshm.so.1.0.0
usr/lib/libgomp.so -> libgomp.so.1.0.0
usr/lib/libgomp.so.1 -> libgomp.so.1.0.0
usr/lib/libgfortran.so -> libgfortran.so.3.0.0
usr/lib/libgfortran.so.3 -> libgfortran.so.3.0.0
usr/lib/libcilkrts.so -> libcilkrts.so.5.0.0
usr/lib/libcilkrts.so.5 -> libcilkrts.so.5.0.0
usr/lib/libatomic.so -> libatomic.so.1.1.0
usr/lib/libatomic.so.1 -> libatomic.so.1.1.0
usr/lib/libgcc_s.so -> libgcc_s.so.1

Making symbolic link creation script:
( cd usr/lib ; rm -rf libmpxwrappers.so )
( cd usr/lib ; ln -sf libmpxwrappers.so.0.0.0 libmpxwrappers.so )
( cd usr/lib ; rm -rf libmpxwrappers.so.0 )
( cd usr/lib ; ln -sf libmpxwrappers.so.0.0.0 libmpxwrappers.so.0 )
( cd usr/lib ; rm -rf libmpx.so )
( cd usr/lib ; ln -sf libmpx.so.0.0.0 libmpx.so )
( cd usr/lib ; rm -rf libmpx.so.0 )
( cd usr/lib ; ln -sf libmpx.so.0.0.0 libmpx.so.0 )
( cd usr/lib ; rm -rf libobjc.so )
( cd usr/lib ; ln -sf libobjc.so.4.0.0 libobjc.so )
( cd usr/lib ; rm -rf libobjc.so.4 )
( cd usr/lib ; ln -sf libobjc.so.4.0.0 libobjc.so.4 )
( cd usr/lib ; rm -rf libvtv.so )
( cd usr/lib ; ln -sf libvtv.so.0.0.0 libvtv.so )
( cd usr/lib ; rm -rf libvtv.so.0 )
( cd usr/lib ; ln -sf libvtv.so.0.0.0 libvtv.so.0 )
( cd usr/lib ; rm -rf libstdc++.so )
( cd usr/lib ; ln -sf libstdc++.so.6.0.21 libstdc++.so )
( cd usr/lib ; rm -rf libstdc++.so.6 )
( cd usr/lib ; ln -sf libstdc++.so.6.0.21 libstdc++.so.6 )
( cd usr/lib ; rm -rf libubsan.so )
( cd usr/lib ; ln -sf libubsan.so.0.0.0 libubsan.so )
( cd usr/lib ; rm -rf libubsan.so.0 )
( cd usr/lib ; ln -sf libubsan.so.0.0.0 libubsan.so.0 )
( cd usr/lib ; rm -rf libasan.so )
( cd usr/lib ; ln -sf libasan.so.2.0.0 libasan.so )
( cd usr/lib ; rm -rf libasan.so.2 )
( cd usr/lib ; ln -sf libasan.so.2.0.0 libasan.so.2 )
( cd usr/lib ; rm -rf libquadmath.so )
( cd usr/lib ; ln -sf libquadmath.so.0.0.0 libquadmath.so )
( cd usr/lib ; rm -rf libquadmath.so.0 )
( cd usr/lib ; ln -sf libquadmath.so.0.0.0 libquadmath.so.0 )
( cd usr/lib ; rm -rf libitm.so )
( cd usr/lib ; ln -sf libitm.so.1.0.0 libitm.so )
( cd usr/lib ; rm -rf libitm.so.1 )
( cd usr/lib ; ln -sf libitm.so.1.0.0 libitm.so.1 )
( cd usr/lib ; rm -rf libgomp-plugin-host_nonshm.so )
( cd usr/lib ; ln -sf libgomp-plugin-host_nonshm.so.1.0.0 libgomp-plugin-host_nonshm.so )
( cd usr/lib ; rm -rf libgomp-plugin-host_nonshm.so.1 )
( cd usr/lib ; ln -sf libgomp-plugin-host_nonshm.so.1.0.0 libgomp-plugin-host_nonshm.so.1 )
( cd usr/lib ; rm -rf libgomp.so )
( cd usr/lib ; ln -sf libgomp.so.1.0.0 libgomp.so )
( cd usr/lib ; rm -rf libgomp.so.1 )
( cd usr/lib ; ln -sf libgomp.so.1.0.0 libgomp.so.1 )
( cd usr/lib ; rm -rf libgfortran.so )
( cd usr/lib ; ln -sf libgfortran.so.3.0.0 libgfortran.so )
( cd usr/lib ; rm -rf libgfortran.so.3 )
( cd usr/lib ; ln -sf libgfortran.so.3.0.0 libgfortran.so.3 )
( cd usr/lib ; rm -rf libcilkrts.so )
( cd usr/lib ; ln -sf libcilkrts.so.5.0.0 libcilkrts.so )
( cd usr/lib ; rm -rf libcilkrts.so.5 )
( cd usr/lib ; ln -sf libcilkrts.so.5.0.0 libcilkrts.so.5 )
( cd usr/lib ; rm -rf libatomic.so )
( cd usr/lib ; ln -sf libatomic.so.1.1.0 libatomic.so )
( cd usr/lib ; rm -rf libatomic.so.1 )
( cd usr/lib ; ln -sf libatomic.so.1.1.0 libatomic.so.1 )
( cd usr/lib ; rm -rf libgcc_s.so )
( cd usr/lib ; ln -sf libgcc_s.so.1 libgcc_s.so )

It is recommended that you make these lines your new installation script.

Would you like to make this stuff the install script for this package
and remove the symbolic links ([y]es, [n]o)? y


Removing symbolic links:
removed ‘./usr/lib/libmpxwrappers.so’
removed ‘./usr/lib/libmpxwrappers.so.0’
removed ‘./usr/lib/libmpx.so’
removed ‘./usr/lib/libmpx.so.0’
removed ‘./usr/lib/libobjc.so’
removed ‘./usr/lib/libobjc.so.4’
removed ‘./usr/lib/libvtv.so’
removed ‘./usr/lib/libvtv.so.0’
removed ‘./usr/lib/libstdc++.so’
removed ‘./usr/lib/libstdc++.so.6’
removed ‘./usr/lib/libubsan.so’
removed ‘./usr/lib/libubsan.so.0’
removed ‘./usr/lib/libasan.so’
removed ‘./usr/lib/libasan.so.2’
removed ‘./usr/lib/libquadmath.so’
removed ‘./usr/lib/libquadmath.so.0’
removed ‘./usr/lib/libitm.so’
removed ‘./usr/lib/libitm.so.1’
removed ‘./usr/lib/libgomp-plugin-host_nonshm.so’
removed ‘./usr/lib/libgomp-plugin-host_nonshm.so.1’
removed ‘./usr/lib/libgomp.so’
removed ‘./usr/lib/libgomp.so.1’
removed ‘./usr/lib/libgfortran.so’
removed ‘./usr/lib/libgfortran.so.3’
removed ‘./usr/lib/libcilkrts.so’
removed ‘./usr/lib/libcilkrts.so.5’
removed ‘./usr/lib/libatomic.so’
removed ‘./usr/lib/libatomic.so.1’
removed ‘./usr/lib/libgcc_s.so’

Creating your new ./install/doinst.sh...

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:  /home/guest/dfd/gcc-libs-5.1.0.i686-pkg-5.txz

WARNING:  /usr/share/info (with possibly not gzipped info pages) detected

Slackware package /home/guest/dfd/gcc-libs-5.1.0.i686-pkg-5.txz created.

->  openal-1.16.0.i686-pkg-1.txz
<slack-desc>
openal: 1.16.0 (openal-1.16.0-1-i686.pkg.tar.xz)

Slackware package maker, version 3.14159.

Searching for symbolic links:
usr/lib/libopenal.so -> libopenal.so.1
usr/lib/libopenal.so.1 -> libopenal.so.1.16.0

Making symbolic link creation script:
( cd usr/lib ; rm -rf libopenal.so )
( cd usr/lib ; ln -sf libopenal.so.1 libopenal.so )
( cd usr/lib ; rm -rf libopenal.so.1 )
( cd usr/lib ; ln -sf libopenal.so.1.16.0 libopenal.so.1 )

It is recommended that you make these lines your new installation script.

Would you like to make this stuff the install script for this package
and remove the symbolic links ([y]es, [n]o)? y


Removing symbolic links:
removed ‘./usr/lib/libopenal.so’
removed ‘./usr/lib/libopenal.so.1’

Creating your new ./install/doinst.sh...

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:  /home/guest/dfd/openal-1.16.0.i686-pkg-1.txz


Slackware package /home/guest/dfd/openal-1.16.0.i686-pkg-1.txz created.

->  sdl_image-1.2.12.i686-pkg-3.txz
<slack-desc>
sdl_image: 1.2.12 (sdl_image-1.2.12-3-i686.pkg.tar.xz)

Slackware package maker, version 3.14159.

Searching for symbolic links:
usr/lib/libSDL_image.so -> libSDL_image-1.2.so.0.8.4
usr/lib/libSDL_image-1.2.so.0 -> libSDL_image-1.2.so.0.8.4

Making symbolic link creation script:
( cd usr/lib ; rm -rf libSDL_image.so )
( cd usr/lib ; ln -sf libSDL_image-1.2.so.0.8.4 libSDL_image.so )
( cd usr/lib ; rm -rf libSDL_image-1.2.so.0 )
( cd usr/lib ; ln -sf libSDL_image-1.2.so.0.8.4 libSDL_image-1.2.so.0 )

It is recommended that you make these lines your new installation script.

Would you like to make this stuff the install script for this package
and remove the symbolic links ([y]es, [n]o)? y


Removing symbolic links:
removed ‘./usr/lib/libSDL_image.so’
removed ‘./usr/lib/libSDL_image-1.2.so.0’

Creating your new ./install/doinst.sh...

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:  /home/guest/dfd/sdl_image-1.2.12.i686-pkg-3.txz


Slackware package /home/guest/dfd/sdl_image-1.2.12.i686-pkg-3.txz created.

->  sdl_ttf-2.0.11.i686-pkg-3.txz
<slack-desc>
sdl_ttf: 2.0.11 (sdl_ttf-2.0.11-3-i686.pkg.tar.xz)

Slackware package maker, version 3.14159.

Searching for symbolic links:
usr/lib/libSDL_ttf.so -> libSDL_ttf-2.0.so.0.10.1
usr/lib/libSDL_ttf-2.0.so.0 -> libSDL_ttf-2.0.so.0.10.1

Making symbolic link creation script:
( cd usr/lib ; rm -rf libSDL_ttf.so )
( cd usr/lib ; ln -sf libSDL_ttf-2.0.so.0.10.1 libSDL_ttf.so )
( cd usr/lib ; rm -rf libSDL_ttf-2.0.so.0 )
( cd usr/lib ; ln -sf libSDL_ttf-2.0.so.0.10.1 libSDL_ttf-2.0.so.0 )

It is recommended that you make these lines your new installation script.

Would you like to make this stuff the install script for this package
and remove the symbolic links ([y]es, [n]o)? y


Removing symbolic links:
removed ‘./usr/lib/libSDL_ttf.so’
removed ‘./usr/lib/libSDL_ttf-2.0.so.0’

Creating your new ./install/doinst.sh...

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:  /home/guest/dfd/sdl_ttf-2.0.11.i686-pkg-3.txz


Slackware package /home/guest/dfd/sdl_ttf-2.0.11.i686-pkg-3.txz created.

Installation Files List: /tmp/Sat_22:29/mpg_26655.lst

guest@porteus:~$ ls -sh dfd/*.txz
9.9M dfd/dwarffortress-0.40.24.i686-pkg-2.txz  328K dfd/openal-1.16.0.i686-pkg-1.txz
440K dfd/freetype2-2.6.i686-pkg-1.txz           28K dfd/sdl_image-1.2.12.i686-pkg-3.txz
5.3M dfd/gcc-libs-5.1.0.i686-pkg-5.txz          16K dfd/sdl_ttf-2.0.11.i686-pkg-3.txz
Installation Files List: /tmp/Sat_22:29/mpg_26655.lst

Code: Select all

./
install/
install/doinst.sh
install/slack-desc
usr/
usr/share/
usr/share/licenses/
usr/share/licenses/dwarffortress/
usr/share/licenses/dwarffortress/readme.txt
usr/share/pixmaps/
usr/share/pixmaps/dwarffortress.png
usr/share/applications/
usr/share/applications/dwarffortress.desktop
usr/bin/
usr/bin/dwarffortress
opt/
opt/dwarffortress/
opt/dwarffortress/README.linux
opt/dwarffortress/libs/
opt/dwarffortress/libs/libgraphics.so
opt/dwarffortress/libs/Dwarf_Fortress
opt/dwarffortress/sdl/
opt/dwarffortress/sdl/sdl license.txt
opt/dwarffortress/release notes.txt
opt/dwarffortress/raw/
opt/dwarffortress/raw/objects/
opt/dwarffortress/raw/objects/text/
opt/dwarffortress/raw/objects/text/book_art.txt
opt/dwarffortress/raw/objects/text/book_instruction.txt
opt/dwarffortress/raw/objects/text/secret_death.txt
opt/dwarffortress/raw/objects/creature_birds.txt
opt/dwarffortress/raw/objects/inorganic_other.txt
opt/dwarffortress/raw/objects/creature_reptiles.txt
opt/dwarffortress/raw/objects/inorganic_metal.txt
opt/dwarffortress/raw/objects/descriptor_pattern_special.txt
opt/dwarffortress/raw/objects/c_variation_default.txt
opt/dwarffortress/raw/objects/language_HUMAN.txt
opt/dwarffortress/raw/objects/inorganic_stone_soil.txt
opt/dwarffortress/raw/objects/descriptor_pattern_iris_eye.txt
opt/dwarffortress/raw/objects/creature_large_mountain.txt
opt/dwarffortress/raw/objects/creature_large_riverlake.txt
opt/dwarffortress/raw/objects/creature_ocean_new.txt
opt/dwarffortress/raw/objects/item_pants.txt
opt/dwarffortress/raw/objects/creature_insects.txt
opt/dwarffortress/raw/objects/creature_fanciful.txt
opt/dwarffortress/raw/objects/creature_small_ocean.txt
opt/dwarffortress/raw/objects/creature_large_tundra.txt
opt/dwarffortress/raw/objects/building_custom.txt
opt/dwarffortress/raw/objects/entity_default.txt
opt/dwarffortress/raw/objects/creature_large_temperate.txt
opt/dwarffortress/raw/objects/language_ELF.txt
opt/dwarffortress/raw/objects/item_armor.txt
opt/dwarffortress/raw/objects/b_detail_plan_default.txt
opt/dwarffortress/raw/objects/item_shield.txt
opt/dwarffortress/raw/objects/body_default.txt
opt/dwarffortress/raw/objects/creature_small_mammals.txt
opt/dwarffortress/raw/objects/creature_birds_new.txt
opt/dwarffortress/raw/objects/creature_subterranean.txt
opt/dwarffortress/raw/objects/item_shoes.txt
opt/dwarffortress/raw/objects/descriptor_shape_standard.txt
opt/dwarffortress/raw/objects/item_siegeammo.txt
opt/dwarffortress/raw/objects/creature_small_mammal_new.txt
opt/dwarffortress/raw/objects/tissue_template_default.txt
opt/dwarffortress/raw/objects/creature_amphibians.txt
opt/dwarffortress/raw/objects/creature_other.txt
opt/dwarffortress/raw/objects/plant_garden.txt
opt/dwarffortress/raw/objects/creature_large_tropical.txt
opt/dwarffortress/raw/objects/creature_domestic.txt
opt/dwarffortress/raw/objects/item_food.txt
opt/dwarffortress/raw/objects/language_words.txt
opt/dwarffortress/raw/objects/plant_crops.txt
opt/dwarffortress/raw/objects/body_rcp.txt
opt/dwarffortress/raw/objects/item_toy.txt
opt/dwarffortress/raw/objects/creature_bug_slug_new.txt
opt/dwarffortress/raw/objects/creature_tropical_new.txt
opt/dwarffortress/raw/objects/plant_standard.txt
opt/dwarffortress/raw/objects/language_SYM.txt
opt/dwarffortress/raw/objects/material_template_default.txt
opt/dwarffortress/raw/objects/language_DWARF.txt
opt/dwarffortress/raw/objects/notes/
opt/dwarffortress/raw/objects/notes/gaits.txt
opt/dwarffortress/raw/objects/creature_mountain_new.txt
opt/dwarffortress/raw/objects/creature_large_ocean.txt
opt/dwarffortress/raw/objects/creature_annelids.txt
opt/dwarffortress/raw/objects/reaction_smelter.txt
opt/dwarffortress/raw/objects/item_ammo.txt
opt/dwarffortress/raw/objects/creature_riverlakepool_new.txt
opt/dwarffortress/raw/objects/inorganic_stone_gem.txt
opt/dwarffortress/raw/objects/creature_temperate_new.txt
opt/dwarffortress/raw/objects/creature_next_underground.txt
opt/dwarffortress/raw/objects/plant_grasses.txt
opt/dwarffortress/raw/objects/creature_desert_new.txt
opt/dwarffortress/raw/objects/descriptor_pattern_pupil_eye.txt
opt/dwarffortress/raw/objects/language_GOBLIN.txt
opt/dwarffortress/raw/objects/inorganic_stone_layer.txt
opt/dwarffortress/raw/objects/item_gloves.txt
opt/dwarffortress/raw/objects/creature_small_riverlake.txt
opt/dwarffortress/raw/objects/interaction_standard.txt
opt/dwarffortress/raw/objects/item_weapon.txt
opt/dwarffortress/raw/objects/descriptor_color_standard.txt
opt/dwarffortress/raw/objects/item_tool.txt
opt/dwarffortress/raw/objects/creature_standard.txt
opt/dwarffortress/raw/objects/item_trapcomp.txt
opt/dwarffortress/raw/objects/creature_tundra_taiga_new.txt
opt/dwarffortress/raw/objects/creature_savage_tropical.txt
opt/dwarffortress/raw/objects/item_instrument.txt
opt/dwarffortress/raw/objects/inorganic_stone_mineral.txt
opt/dwarffortress/raw/objects/reaction_other.txt
opt/dwarffortress/raw/objects/item_helm.txt
opt/dwarffortress/raw/objects/plant_new_trees.txt
opt/dwarffortress/raw/objects/creature_equipment.txt
opt/dwarffortress/raw/interaction examples/
opt/dwarffortress/raw/interaction examples/interaction_vampire.txt
opt/dwarffortress/raw/interaction examples/interaction_werebeast.txt
opt/dwarffortress/raw/interaction examples/interaction_region.txt
opt/dwarffortress/raw/interaction examples/interaction_secret.txt
opt/dwarffortress/raw/interaction examples/interaction_underground_special.txt
opt/dwarffortress/raw/interaction examples/interaction_disturbance.txt
opt/dwarffortress/raw/graphics/
opt/dwarffortress/raw/graphics/graphics_example.txt
opt/dwarffortress/raw/graphics/example/
opt/dwarffortress/raw/graphics/example/dwarves.bmp
opt/dwarffortress/file changes.txt
opt/dwarffortress/data/
opt/dwarffortress/data/sound/
opt/dwarffortress/data/sound/song_title.ogg
opt/dwarffortress/data/sound/baybeyond.ogg
opt/dwarffortress/data/sound/DFINTRO.ogg
opt/dwarffortress/data/sound/DFPICK.ogg
opt/dwarffortress/data/sound/bayend.ogg
opt/dwarffortress/data/sound/DFINTROEND.ogg
opt/dwarffortress/data/sound/DFRUBBLE.ogg
opt/dwarffortress/data/sound/baystart.ogg
opt/dwarffortress/data/sound/bayquality.ogg
opt/dwarffortress/data/sound/song_game.ogg
opt/dwarffortress/data/initial_movies/
opt/dwarffortress/data/initial_movies/toadyone.cmv
opt/dwarffortress/data/initial_movies/bay12games.cmv
opt/dwarffortress/data/initial_movies/dwarf_fortress.cmv
opt/dwarffortress/data/speech/
opt/dwarffortress/data/speech/goodbye_worship_2.txt
opt/dwarffortress/data/speech/family_relationship_no_spec.txt
opt/dwarffortress/data/speech/curse.txt
opt/dwarffortress/data/speech/temple_already_member.txt
opt/dwarffortress/data/speech/lair_hunter_minotaur.txt
opt/dwarffortress/data/speech/thief_profession_year.txt
opt/dwarffortress/data/speech/arch_info_justification.txt
opt/dwarffortress/data/speech/greet.txt
opt/dwarffortress/data/speech/justification_experience.txt
opt/dwarffortress/data/speech/family_relationship_additional.txt
opt/dwarffortress/data/speech/scouting_profession.txt
opt/dwarffortress/data/speech/family_relationship_additional_dead.txt
opt/dwarffortress/data/speech/past_wandering_profession.txt
opt/dwarffortress/data/speech/threat.txt
opt/dwarffortress/data/speech/greet_reply_after_hero.txt
opt/dwarffortress/data/speech/scouting_profession_year.txt
opt/dwarffortress/data/speech/same_site_specific_hf_seeker.txt
opt/dwarffortress/data/speech/thief_profession.txt
opt/dwarffortress/data/speech/mercenary_profession.txt
opt/dwarffortress/data/speech/current_profession_year.txt
opt/dwarffortress/data/speech/greet_baby.txt
opt/dwarffortress/data/speech/hist_fig_slayer.txt
opt/dwarffortress/data/speech/justification_antithetical.txt
opt/dwarffortress/data/speech/past_scouting_profession.txt
opt/dwarffortress/data/speech/justification_representation.txt
opt/dwarffortress/data/speech/past_thief_profession.txt
opt/dwarffortress/data/speech/family_relationship_no_spec_dead.txt
opt/dwarffortress/data/speech/past_profession_no_year.txt
opt/dwarffortress/data/speech/justification_reminder.txt
opt/dwarffortress/data/speech/guard_profession.txt
opt/dwarffortress/data/speech/greet_reply_diff_language.txt
opt/dwarffortress/data/speech/past_hunting_profession.txt
opt/dwarffortress/data/speech/snatcher_profession_year.txt
opt/dwarffortress/data/speech/mercenary_profession_year.txt
opt/dwarffortress/data/speech/no_family.txt
opt/dwarffortress/data/speech/greet_reply.txt
opt/dwarffortress/data/speech/hunting_profession.txt
opt/dwarffortress/data/speech/ab_specific_hf_seeker.txt
opt/dwarffortress/data/speech/unknown_hf_seeker.txt
opt/dwarffortress/data/speech/snatcher_profession.txt
opt/dwarffortress/data/speech/dwarf.txt
opt/dwarffortress/data/speech/temple_become_member.txt
opt/dwarffortress/data/speech/past_mercenary_profession.txt
opt/dwarffortress/data/speech/slayer.txt
opt/dwarffortress/data/speech/family_relationship_spec_dead.txt
opt/dwarffortress/data/speech/task_recommendation.txt
opt/dwarffortress/data/speech/goodbye_worship_3.txt
opt/dwarffortress/data/speech/justification_proximity.txt
opt/dwarffortress/data/speech/past_snatcher_profession.txt
opt/dwarffortress/data/speech/child_age_proclamation.txt
opt/dwarffortress/data/speech/current_profession_no_year.txt
opt/dwarffortress/data/speech/soldier_profession.txt
opt/dwarffortress/data/speech/greet_worship.txt
opt/dwarffortress/data/speech/goodbye_worship_1.txt
opt/dwarffortress/data/speech/animal_slayer.txt
opt/dwarffortress/data/speech/site_specific_hf_seeker.txt
opt/dwarffortress/data/speech/wandering_profession_year.txt
opt/dwarffortress/data/speech/greet_reply_unusual_first.txt
opt/dwarffortress/data/speech/wandering_profession.txt
opt/dwarffortress/data/speech/past_profession_year.txt
opt/dwarffortress/data/speech/general.txt
opt/dwarffortress/data/speech/hunting_profession_year.txt
opt/dwarffortress/data/speech/guard_warning.txt
opt/dwarffortress/data/speech/positive.txt
opt/dwarffortress/data/speech/family_relationship_spec.txt
opt/dwarffortress/data/speech/elf.txt
opt/dwarffortress/data/speech/same_site_ab_specific_hf_seeker.txt
opt/dwarffortress/data/help/
opt/dwarffortress/data/help/icons_items
opt/dwarffortress/data/help/menu_wages
opt/dwarffortress/data/help/menu_buildjob
opt/dwarffortress/data/help/r_intro
opt/dwarffortress/data/help/r_main
opt/dwarffortress/data/help/menu_jobunitlist
opt/dwarffortress/data/help/icons
opt/dwarffortress/data/help/text_viewer3
opt/dwarffortress/data/help/menu_status_animals
opt/dwarffortress/data/help/icons_terrain
opt/dwarffortress/data/help/menu_designations
opt/dwarffortress/data/help/menu_nobles
opt/dwarffortress/data/help/mining
opt/dwarffortress/data/help/outpost
opt/dwarffortress/data/help/menu_stockpiles
opt/dwarffortress/data/help/menu_status_stone
opt/dwarffortress/data/help/menu_buildjob_farmplot
opt/dwarffortress/data/help/menu_look
opt/dwarffortress/data/help/main
opt/dwarffortress/data/help/menu_status_currency
opt/dwarffortress/data/help/menu_make_buildings
opt/dwarffortress/data/help/menu_status_prices
opt/dwarffortress/data/help/icons_creature
opt/dwarffortress/data/help/practice
opt/dwarffortress/data/help/new_region
opt/dwarffortress/data/help/technical
opt/dwarffortress/data/help/menus
opt/dwarffortress/data/help/menu_buildjob_siege
opt/dwarffortress/data/help/trading
opt/dwarffortress/data/help/menu_status_kitchen
opt/dwarffortress/data/help/menu_buildjob_shop
opt/dwarffortress/data/help/menu_status_stocks
opt/dwarffortress/data/help/menu_status_justice
opt/dwarffortress/data/help/menu_buildjob_door
opt/dwarffortress/data/help/menu_buildjob_lever
opt/dwarffortress/data/help/menu_buildjob_depot
opt/dwarffortress/data/help/menu_buildjob_animaltrap
opt/dwarffortress/data/help/wood
opt/dwarffortress/data/help/menu_buildjob_stockpile
opt/dwarffortress/data/help/defense
opt/dwarffortress/data/help/a_first
opt/dwarffortress/data/help/menu_orders
opt/dwarffortress/data/help/menu_activity_zones
opt/dwarffortress/data/help/intro
opt/dwarffortress/data/help/machines
opt/dwarffortress/data/help/a_keys
opt/dwarffortress/data/help/menu_professions
opt/dwarffortress/data/help/menu_status
opt/dwarffortress/data/help/storage
opt/dwarffortress/data/help/menu_viewunit
opt/dwarffortress/data/help/menu_military
opt/dwarffortress/data/help/tables
opt/dwarffortress/data/help/building_clutter
opt/dwarffortress/data/help/a_main
opt/dwarffortress/data/help/a_intro
opt/dwarffortress/data/help/menu_builditem
opt/dwarffortress/data/help/icons_dwarf
opt/dwarffortress/data/help/text_viewer2
opt/dwarffortress/data/help/living_quarters
opt/dwarffortress/data/help/food
opt/dwarffortress/data/help/menu_rooms
opt/dwarffortress/data/help/text_viewer
opt/dwarffortress/data/help/menu_manager
opt/dwarffortress/data/help/menu_roomlist
opt/dwarffortress/data/help/setup_game
opt/dwarffortress/data/help/menu_civlist
opt/dwarffortress/data/help/crafts
opt/dwarffortress/data/help/a_icons
opt/dwarffortress/data/help/table_item_designations
opt/dwarffortress/data/help/unit_profile
opt/dwarffortress/data/help/accounts
opt/dwarffortress/data/help/water
opt/dwarffortress/data/help/menu_squads
opt/dwarffortress/data/index
opt/dwarffortress/data/dipscript/
opt/dwarffortress/data/dipscript/text/
opt/dwarffortress/data/dipscript/text/human_standard1
opt/dwarffortress/data/dipscript/text/elves_firstcontact1
opt/dwarffortress/data/dipscript/text/human_trade_bye
opt/dwarffortress/data/dipscript/text/human_trade1
opt/dwarffortress/data/dipscript/text/elves_standard1
opt/dwarffortress/data/dipscript/text/dwarf_liaison_bye
opt/dwarffortress/data/dipscript/text/elves_standard_bye
opt/dwarffortress/data/dipscript/text/elves_firstcontact2
opt/dwarffortress/data/dipscript/text/dwarf_liaison1
opt/dwarffortress/data/dipscript/text/human_standard_bye
opt/dwarffortress/data/dipscript/elves_standard
opt/dwarffortress/data/dipscript/dwarf_liaison
opt/dwarffortress/data/dipscript/human_standard
opt/dwarffortress/data/dipscript/human_trade
opt/dwarffortress/data/dipscript/elves_firstcontact
opt/dwarffortress/data/announcement/
opt/dwarffortress/data/announcement/hastyking
opt/dwarffortress/data/announcement/end3
opt/dwarffortress/data/announcement/unretire
opt/dwarffortress/data/announcement/end2
opt/dwarffortress/data/announcement/merchantexit
opt/dwarffortress/data/announcement/end5
opt/dwarffortress/data/announcement/kingarrival
opt/dwarffortress/data/announcement/diplomatrebuffed
opt/dwarffortress/data/announcement/merchantintro
opt/dwarffortress/data/announcement/end4
opt/dwarffortress/data/announcement/fortressintro
opt/dwarffortress/data/announcement/semiend
opt/dwarffortress/data/art/
opt/dwarffortress/data/art/curses_640x300.png
opt/dwarffortress/data/art/curses_square_16x16.bmp
opt/dwarffortress/data/art/font license.txt
opt/dwarffortress/data/art/curses_square_16x16.png
opt/dwarffortress/data/art/mouse.bmp
opt/dwarffortress/data/art/font.ttf
opt/dwarffortress/data/art/curses_800x600.png
opt/dwarffortress/data/art/curses_800x600.bmp
opt/dwarffortress/data/art/curses_640x300.bmp
opt/dwarffortress/data/art/mouse.png
opt/dwarffortress/data/shader.vs
opt/dwarffortress/data/init/
opt/dwarffortress/data/init/interface.txt
opt/dwarffortress/data/init/world_gen.txt
opt/dwarffortress/data/init/init.txt
opt/dwarffortress/data/init/macros/
opt/dwarffortress/data/init/arena.txt
opt/dwarffortress/data/init/d_init.txt
opt/dwarffortress/data/init/colors.txt
opt/dwarffortress/data/init/announcements.txt
opt/dwarffortress/data/movies/
opt/dwarffortress/data/shader.fs
opt/dwarffortress/readme.txt
opt/dwarffortress/command line.txt
.MTREE
.INSTALL
.PKGINFO
./
install/
install/doinst.sh
install/slack-desc
usr/
usr/share/
usr/share/man/
usr/share/man/man1/
usr/share/man/man1/freetype-config.1.gz
usr/share/aclocal/
usr/share/aclocal/freetype2.m4
usr/bin/
usr/bin/freetype-config
usr/include/
usr/include/freetype2/
usr/include/freetype2/ftimage.h
usr/include/freetype2/fttrigon.h
usr/include/freetype2/fterrdef.h
usr/include/freetype2/ttunpat.h
usr/include/freetype2/tttags.h
usr/include/freetype2/ftsnames.h
usr/include/freetype2/ftgxval.h
usr/include/freetype2/ftgasp.h
usr/include/freetype2/ftmoderr.h
usr/include/freetype2/ftcffdrv.h
usr/include/freetype2/ftbbox.h
usr/include/freetype2/ftadvanc.h
usr/include/freetype2/ftmm.h
usr/include/freetype2/ftautoh.h
usr/include/freetype2/ftotval.h
usr/include/freetype2/freetype.h
usr/include/freetype2/ftwinfnt.h
usr/include/freetype2/fttypes.h
usr/include/freetype2/ftmac.h
usr/include/freetype2/ftgzip.h
usr/include/freetype2/ttnameid.h
usr/include/freetype2/ftcache.h
usr/include/freetype2/ftbdf.h
usr/include/freetype2/ftchapters.h
usr/include/freetype2/ftincrem.h
usr/include/freetype2/ftlist.h
usr/include/freetype2/ftbzip2.h
usr/include/freetype2/ftoutln.h
usr/include/freetype2/ftlzw.h
usr/include/freetype2/ftrender.h
usr/include/freetype2/ftsizes.h
usr/include/freetype2/ftpfr.h
usr/include/freetype2/ftlcdfil.h
usr/include/freetype2/ftsynth.h
usr/include/freetype2/ftttdrv.h
usr/include/freetype2/ftsystem.h
usr/include/freetype2/ftmodapi.h
usr/include/freetype2/ftbitmap.h
usr/include/freetype2/ftcid.h
usr/include/freetype2/ftglyph.h
usr/include/freetype2/ft2build.h
usr/include/freetype2/fterrors.h
usr/include/freetype2/t1tables.h
usr/include/freetype2/ftstroke.h
usr/include/freetype2/ftfntfmt.h
usr/include/freetype2/tttables.h
usr/include/freetype2/config/
usr/include/freetype2/config/ftmodule.h
usr/include/freetype2/config/ftconfig.h
usr/include/freetype2/config/ftheader.h
usr/include/freetype2/config/ftoption.h
usr/include/freetype2/config/ftstdlib.h
usr/lib/
usr/lib/libfreetype.so.6.12.0
usr/lib/pkgconfig/
usr/lib/pkgconfig/freetype2.pc
.MTREE
.INSTALL
.PKGINFO
./
install/
install/doinst.sh
install/slack-desc
usr/
usr/share/
usr/share/licenses/
usr/share/licenses/gcc-libs/
usr/share/licenses/gcc-libs/RUNTIME.LIBRARY.EXCEPTION
usr/share/info/
usr/share/info/libquadmath.info.gz
usr/share/info/libitm.info.gz
usr/share/info/libgomp.info.gz
usr/share/locale/
usr/share/locale/fr/
usr/share/locale/fr/LC_MESSAGES/
usr/share/locale/fr/LC_MESSAGES/libstdc++.mo
usr/share/locale/de/
usr/share/locale/de/LC_MESSAGES/
usr/share/locale/de/LC_MESSAGES/libstdc++.mo
usr/lib/
usr/lib/libmpxwrappers.so.0.0.0
usr/lib/libmpx.so.0.0.0
usr/lib/libobjc.so.4.0.0
usr/lib/libvtv.so.0.0.0
usr/lib/libstdc++.so.6.0.21
usr/lib/libubsan.so.0.0.0
usr/lib/libasan.so.2.0.0
usr/lib/libquadmath.so.0.0.0
usr/lib/libitm.so.1.0.0
usr/lib/libgomp-plugin-host_nonshm.so.1.0.0
usr/lib/libgomp.so.1.0.0
usr/lib/libgfortran.so.3.0.0
usr/lib/libcilkrts.so.5.0.0
usr/lib/libatomic.so.1.1.0
usr/lib/libgcc_s.so.1
.MTREE
.INSTALL
.PKGINFO
./
install/
install/doinst.sh
install/slack-desc
usr/
usr/bin/
usr/bin/alsoft-config
usr/bin/makehrtf
usr/bin/openal-info
usr/share/
usr/share/openal/
usr/share/openal/hrtf.txt
usr/share/openal/env-vars.txt
usr/share/openal/hrtf/
usr/share/openal/hrtf/default-48000.mhr
usr/share/openal/hrtf/default-44100.mhr
usr/share/openal/alsoftrc.sample
usr/include/
usr/include/AL/
usr/include/AL/efx-presets.h
usr/include/AL/efx-creative.h
usr/include/AL/efx.h
usr/include/AL/alext.h
usr/include/AL/alc.h
usr/include/AL/al.h
usr/lib/
usr/lib/libopenal.so.1.16.0
usr/lib/pkgconfig/
usr/lib/pkgconfig/openal.pc
.MTREE
.PKGINFO
./
install/
install/doinst.sh
install/slack-desc
usr/
usr/lib/
usr/lib/libSDL_image-1.2.so.0.8.4
usr/lib/pkgconfig/
usr/lib/pkgconfig/SDL_image.pc
usr/include/
usr/include/SDL/
usr/include/SDL/SDL_image.h
usr/share/
usr/share/licenses/
usr/share/licenses/sdl_image/
usr/share/licenses/sdl_image/LICENSE
.MTREE
.PKGINFO
./
install/
install/doinst.sh
install/slack-desc
usr/
usr/share/
usr/share/licenses/
usr/share/licenses/sdl_ttf/
usr/share/licenses/sdl_ttf/LICENSE
usr/include/
usr/include/SDL/
usr/include/SDL/SDL_ttf.h
usr/lib/
usr/lib/libSDL_ttf-2.0.so.0.10.1
usr/lib/pkgconfig/
usr/lib/pkgconfig/SDL_ttf.pc
.MTREE
.PKGINFO
Enhanced Script

Code: Select all

#!/bin/sh
# xz2txz.sh deb2txz.sh rpm2txz.sh	2015-04-28 18:18:09
# -nv Non-Verbose Option: Std. Error redirected to list file in /tmp	2015-07-02 22:32:52
# Looping through all appropriate files		2015-07-02 22:47:50
ren()		# Rename to be Slackware Compliant
{
n=$(awk '{print match($0,"[_-][0-9]+[.]")-1;}'<<< $1)
r=${1:n}; 
v=$(expr "${1:n}" : '\([0-9._-]*[0-9]\)');
r=${1:n}; r=${r#$v}; r=${r//-/.}; r=${r//_/.}; r=${r%.*};
a=${r##*.}; r=${r%.*}; 
[[ ${v%-*} ]] && t=${v##*-}; v=${v%-${t:=1}};
f=${1:0:n}-${v:1}$r-$a-$t.txz; echo "->  $f"
}
sld()		# Create very brief one-liner in 'slack-desc'
{
[[ ! -d $fr/install ]] && mkdir $fr/install
sd=$fr/install/slack-desc
l=${1:0:n}:" ${v:1} ($1)"; l=${l:0:79};
echo $l > $sd
for ((i=0; i<10; i++)); do echo ${1:0:n}: >> $sd; done
echo "<slack-desc>"
head -n1 $sd
}
deb2tgz()
{
    # Convert .deb. packages to .tgz.   2014-11-13 19:45:33
    # Whittled Down Version	2015-04-28 00:32:11
    # Variables
    c='\e[36m'
    r='\e[31m'
    e=`tput sgr0`

    # Let's start
    if [ "$1" = "" ]; then
        echo -e "${c}need a deb package as an argument, example: $0 /mnt/sda2/debian_packages/package.deb"$e | fmt -w 80
        return 1;
    fi

    # Work only on deb packages:

    # Create module:
	y=$1
        mod=`readlink -f $y | sed s/.deb$/.xzm/`
        pkg=`echo $mod | awk -F/ '{print$NF}' | sed s/.xzm//g`
        dataname=`ar t $y | grep data`
    echo dataname = $dataname
    # echo mod = $mod
    echo Creating Package: ${mod%.xzm}.tgz
    pushd .  > /dev/null
       case $dataname in
       data.tar.gz)
       mkdir /tmp/deb2xzm$$ && cp $y /tmp/deb2xzm$$ && cd /tmp/deb2xzm$$ && /usr/bin/ar x * data.tar.gz && mv data.tar.gz $pkg.tgz && mv /tmp/deb2xzm$$/$pkg.tgz ${mod%.xzm}.tgz
       ;;
       data.tar.lzma)
       mkdir /tmp/deb2xzm$$ && cp $y /tmp/deb2xzm$$ && cd /tmp/deb2xzm$$ && /usr/bin/ar x * data.tar.lzma && unxz data.tar.lzma && gzip data.tar && mv data.tar.gz $pkg.tgz  && mv /tmp/deb2xzm$$/$pkg.tgz ${mod%.xzm}.tgz
       ;;
       data.tar.xz)
       mkdir /tmp/deb2xzm$$ && cp $y /tmp/deb2xzm$$ && cd /tmp/deb2xzm$$ && /usr/bin/ar x * data.tar.xz && unxz data.tar.xz && gzip data.tar && mv data.tar.gz $pkg.tgz  && mv /tmp/deb2xzm$$/$pkg.tgz ${mod%.xzm}.tgz
       ;;
       esac
       rm -rf /tmp/deb2xzm$$
    popd  > /dev/null
}
rpm2txz()
{
  local s; local t;	# 2015-07-02 22:08:54
  [[ ${1##*.} != rpm ]] && { echo Not rpm; return 1; }
  pg=${1##*/}; can=$(readlink -f $1)
  fr=/tmp/fke$$
  pushd .  > /dev/null
  mkdir $fr && cd $fr
  rpm2cpio $can | cpio -dim
  popd  > /dev/null
  ren $pg
  sld $pg
  pushd .  > /dev/null
  cd $fr
  rst=${can%/*}/$f; [[ $lst ]] && rst+=" 2>>$lst";	# 2015-07-03 14:58:59
  eval /sbin/makepkg -l y -c n $rst;			# 2015-07-03 14:58:59
#  /sbin/makepkg -l y -c n  ${can%/*}/$f 2>>$lst	Comout # 2015-07-03 14:58:59		# 2015-07-02 22:30:18
  popd  > /dev/null
  rm -rf $fr
}
deb2txz()
{
  local s; local t;	# 2015-07-02 22:08:54
  [[ ${1##*.} != deb ]] && { echo Not deb; return 1; }
  pg=${1##*/}; can=$(readlink -f $1)
  deb2tgz $can
  fr=/tmp/fke$$
  mkdir $fr && tar xzf ${can%.*}.tgz -C $fr
  ren $pg
  sld $pg
  pushd .  > /dev/null
  cd $fr
  rst=${can%/*}/$f; [[ $lst ]] && rst+=" 2>>$lst";	# 2015-07-03 14:58:59
  eval /sbin/makepkg -l y -c n $rst;			# 2015-07-03 14:58:59
#  /sbin/makepkg -l y -c n  ${can%/*}/$f	2>>$lst		# 2015-07-02 22:30:18
  popd  > /dev/null
  rm -rf $fr
}
xz2txz()
{
  local s; local t;	# 2015-07-02 22:08:54
  [[ ${1##*.} != xz ]] && { echo Not xz; return 1; }
  pg=${1##*/}; can=$(readlink -f $1)
  fr=/tmp/fke$$
  mkdir $fr && tar xJf $can -C $fr
  ren ${pg/.tar/}
  sld $pg
  pushd .  > /dev/null
  cd $fr
  rst=${can%/*}/$f; [[ $lst ]] && rst+=" 2>>$lst";	# 2015-07-03 14:58:59
  eval /sbin/makepkg -l y -c n $rst;			# 2015-07-03 14:58:59
#  /sbin/makepkg -l y -c n  ${can%/*}/$f	2>>$lst		# 2015-07-02 22:30:18
  popd  > /dev/null
  rm -rf $fr
}
# Create 'temporary' Installation Files List if requested.
[[ $1 == -nv ]] && { dd=/tmp/$(date +%a)_$(date +%R); lst=$dd/mpg_$$.lst;
  mkdir $dd && echo -n > $lst && shift; (($?)) && echo Error: Creating Files List File && exit; }
s=${0##*/}; t=${s%%2*};		# Type required: rpm/deb/xz	2015-07-02 22:35:40
while [[ $1 ]];
do
  [[ ! -f $1 ]] && { ls $1; exit; }
  [[ ${1##*.} != $t ]] && { echo Error: Incorrect Type $1; break; }
  $(eval echo ${s%.*}) $1
  shift;
done  
[[ $lst ]] && echo Installation Files List: $lst
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

Bogomips
Full of knowledge
Full of knowledge
Posts: 2563
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#7 by Bogomips » 20 Aug 2015, 23:14

Script Update

Enhancements
  • Apart from individual files
  • Directories also Processed
Invocation Example

Code: Select all

guest@porteus:~$ ls cld
colord-1.2.11-1-i686.pkg.tar.xz  glabels_2.txt  glabels_su.txt                   tru.lst
exempi-2.1.0-5.el6.i686.rpm      glabels_3.txt  libgudev-230-1-i686.pkg.tar.xz
glabels_0.txt                    glabels_4.txt  libgusb-0.2.6-1-i686.pkg.tar.xz
glabels_1.txt                    glabels_5.txt  syd.lst
porteus:~$ sh xz2txz.sh -nv p10/Por/Nemo/cinnamon-desktop-2.4.2-1-i686.pkg.tar.xz cld p10/Por/Nemo/gcc-libs-4.9.2-1-i686.pkg.tar.xz p10/Por/Nemo/libtiff-4.0.3-5-i686.pkg.tar.xz  ->  cinnamon-desktop-2.4.2.i686-pkg-1.txz
<slack-desc>
cinnamon-desktop: 2.4.2 (cinnamon-desktop-2.4.2-1-i686.pkg.tar.xz)
...
Slackware package /home/guest/p10/Por/Nemo/cinnamon-desktop-2.4.2.i686-pkg-1.txz created.

->  colord-1.2.11.i686-pkg-1.txz
<slack-desc>
colord: 1.2.11 (colord-1.2.11-1-i686.pkg.tar.xz)
...
Slackware package /home/guest/cld/colord-1.2.11.i686-pkg-1.txz created.

->  libgudev-230-1-i686.pkg.x-z-z-.txz
<slack-desc>
libgudev-230-1-i686.pkg.tar.x: (libgudev-230-1-i686.pkg.tar.xz)
...
Slackware package /home/guest/cld/libgudev-230-1-i686.pkg.x-z-z-.txz created.

->  libgusb-0.2.6.i686-pkg-1.txz
<slack-desc>
libgusb: 0.2.6 (libgusb-0.2.6-1-i686.pkg.tar.xz)
...
Slackware package /home/guest/cld/libgusb-0.2.6.i686-pkg-1.txz created.

->  gcc-libs-4.9.2.i686-pkg-1.txz
<slack-desc>
gcc-libs: 4.9.2 (gcc-libs-4.9.2-1-i686.pkg.tar.xz)
...
Slackware package /home/guest/p10/Por/Nemo/gcc-libs-4.9.2.i686-pkg-1.txz created.

->  libtiff-4.0.3.i686-pkg-5.txz
<slack-desc>
libtiff: 4.0.3 (libtiff-4.0.3-5-i686.pkg.tar.xz)
...
Slackware package /home/guest/p10/Por/Nemo/libtiff-4.0.3.i686-pkg-5.txz created.

Installation Files List: /tmp/Thu_21:18/mpg_9110.lst

guest@porteus:~$ ls -sh cld
total 1.9M
552K colord-1.2.11-1-i686.pkg.tar.xz   32K glabels_5.txt
552K colord-1.2.11.i686-pkg-1.txz     8.0K glabels_su.txt
344K exempi-2.1.0-5.el6.i686.rpm       40K libgudev-230-1-i686.pkg.tar.xz
 24K glabels_0.txt                     40K libgudev-230-1-i686.pkg.x-z-z-.txz
 28K glabels_1.txt                     48K libgusb-0.2.6-1-i686.pkg.tar.xz
 32K glabels_2.txt                     48K libgusb-0.2.6.i686-pkg-1.txz
 28K glabels_3.txt                     44K syd.lst
 28K glabels_4.txt                     40K tru.lst

guest@porteus:~$ ls -sh p10/Por/Nemo/{cinnamon-desktop*,gcc-libs*,libtiff*}
192K p10/Por/Nemo/cinnamon-desktop-2.4.2-1-i686.pkg.tar.xz
192K p10/Por/Nemo/cinnamon-desktop-2.4.2.i686-pkg-1.txz
2.1M p10/Por/Nemo/gcc-libs-4.9.2-1-i686.pkg.tar.xz
2.1M p10/Por/Nemo/gcc-libs-4.9.2.i686-pkg-1.txz
176K p10/Por/Nemo/libtiff-4.0.3-14.el7.i686.rpm
800K p10/Por/Nemo/libtiff-4.0.3-5-i686.pkg.tar.xz
800K p10/Por/Nemo/libtiff-4.0.3.i686-pkg-5.txz
Enhanced Script

Code: Select all

#!/bin/sh
# xz2txz.sh deb2txz.sh rpm2txz.sh	2015-04-28 18:18:09
#	<-	rpm2txz_190815.sh
# -nv Non-Verbose Option: Std. Error redirected to list file in /tmp	2015-07-02 22:32:52
# Looping through all appropriate files		2015-07-02 22:47:50
# Doing in Directories the Required File Type 	2015-08-20 00:56:59
# Arguments: [-nv] <file/s> and/or <folder/s>		2015-08-20
ren()		# Rename to be Slackware Compliant
{
n=$(awk '{print match($0,"[_-][0-9]+[.]")-1;}'<<< $1)
r=${1:n}; 
v=$(expr "${1:n}" : '\([0-9._-]*[0-9]\)');
r=${1:n}; r=${r#$v}; r=${r//-/.}; r=${r//_/.}; r=${r%.*};
a=${r##*.}; r=${r%.*}; 
[[ ${v%-*} ]] && t=${v##*-}; v=${v%-${t:=1}};
f=${1:0:n}-${v:1}$r-$a-$t.txz; echo "->  $f"
}
sld()		# Create very brief one-liner in 'slack-desc'
{
[[ ! -d $fr/install ]] && mkdir $fr/install
sd=$fr/install/slack-desc
l=${1:0:n}:" ${v:1} ($1)"; l=${l:0:79};
echo $l > $sd
for ((i=0; i<10; i++)); do echo ${1:0:n}: >> $sd; done
echo "<slack-desc>"
head -n1 $sd
}
deb2tgz()
{
    # Convert .deb. packages to .tgz.   2014-11-13 19:45:33
    # Whittled Down Version	2015-04-28 00:32:11
    # Variables
    c='\e[36m'
    r='\e[31m'
    e=`tput sgr0`

    # Let's start
    if [ "$1" = "" ]; then
        echo -e "${c}need a deb package as an argument, example: $0 /mnt/sda2/debian_packages/package.deb"$e | fmt -w 80
        return 1;
    fi

    # Work only on deb packages:

    # Create module:
	y=$1
        mod=`readlink -f $y | sed s/.deb$/.xzm/`
        pkg=`echo $mod | awk -F/ '{print$NF}' | sed s/.xzm//g`
        dataname=`ar t $y | grep data`
    echo dataname = $dataname
    # echo mod = $mod
    echo Creating Package: ${mod%.xzm}.tgz
    pushd .  > /dev/null
       case $dataname in
       data.tar.gz)
       mkdir /tmp/deb2xzm$$ && cp $y /tmp/deb2xzm$$ && cd /tmp/deb2xzm$$ && /usr/bin/ar x * data.tar.gz && mv data.tar.gz $pkg.tgz && mv /tmp/deb2xzm$$/$pkg.tgz ${mod%.xzm}.tgz
       ;;
       data.tar.lzma)
       mkdir /tmp/deb2xzm$$ && cp $y /tmp/deb2xzm$$ && cd /tmp/deb2xzm$$ && /usr/bin/ar x * data.tar.lzma && unxz data.tar.lzma && gzip data.tar && mv data.tar.gz $pkg.tgz  && mv /tmp/deb2xzm$$/$pkg.tgz ${mod%.xzm}.tgz
       ;;
       data.tar.xz)
       mkdir /tmp/deb2xzm$$ && cp $y /tmp/deb2xzm$$ && cd /tmp/deb2xzm$$ && /usr/bin/ar x * data.tar.xz && unxz data.tar.xz && gzip data.tar && mv data.tar.gz $pkg.tgz  && mv /tmp/deb2xzm$$/$pkg.tgz ${mod%.xzm}.tgz
       ;;
       esac
       rm -rf /tmp/deb2xzm$$
    popd  > /dev/null
}
rpm2txz()
{
  local s; local t;	# 2015-07-02 22:08:54
  [[ ${1##*.} != rpm ]] && { echo Not rpm; return 1; }
  pg=${1##*/}; can=$(readlink -f $1)
  fr=/tmp/fke$$
  pushd .  > /dev/null
  mkdir $fr && cd $fr
  rpm2cpio $can | cpio -dim
  popd  > /dev/null
  ren $pg
  sld $pg
  pushd .  > /dev/null
  cd $fr
  rst=${can%/*}/$f; [[ $lst ]] && rst+=" 2>>$lst";	# 2015-07-03 14:58:59
  eval /sbin/makepkg -l y -c n $rst;			# 2015-07-03 14:58:59
#  /sbin/makepkg -l y -c n  ${can%/*}/$f 2>>$lst	Comout # 2015-07-03 14:58:59		# 2015-07-02 22:30:18
  popd  > /dev/null
  rm -rf $fr
}
deb2txz()
{
  local s; local t;	# 2015-07-02 22:08:54
  [[ ${1##*.} != deb ]] && { echo Not deb; return 1; }
  pg=${1##*/}; can=$(readlink -f $1)
  deb2tgz $can
  fr=/tmp/fke$$
  mkdir $fr && tar xzf ${can%.*}.tgz -C $fr
  ren $pg
  sld $pg
  pushd .  > /dev/null
  cd $fr
  rst=${can%/*}/$f; [[ $lst ]] && rst+=" 2>>$lst";	# 2015-07-03 14:58:59
  eval /sbin/makepkg -l y -c n $rst;			# 2015-07-03 14:58:59
#  /sbin/makepkg -l y -c n  ${can%/*}/$f	2>>$lst		# 2015-07-02 22:30:18
  popd  > /dev/null
  rm -rf $fr
}
xz2txz()
{
  local s; local t;	# 2015-07-02 22:08:54
  [[ ${1##*.} != xz ]] && { echo Not xz; return 1; }
  pg=${1##*/}; can=$(readlink -f $1)
  fr=/tmp/fke$$
  mkdir $fr && tar xJf $can -C $fr
  ren ${pg/.tar/}
  sld $pg
  pushd .  > /dev/null
  cd $fr
  rst=${can%/*}/$f; [[ $lst ]] && rst+=" 2>>$lst";	# 2015-07-03 14:58:59
  eval /sbin/makepkg -l y -c n $rst;			# 2015-07-03 14:58:59
#  /sbin/makepkg -l y -c n  ${can%/*}/$f	2>>$lst		# 2015-07-02 22:30:18
  popd  > /dev/null
  rm -rf $fr
}
# Create 'temporary' Installation Files List if requested.
[[ $1 == -nv ]] && { dd=/tmp/$(date +%a)_$(date +%R); lst=$dd/mpg_$$.lst;
  mkdir $dd && echo -n > $lst && shift; (($?)) && echo Error: Creating Files List File && exit; }
s=${0##*/}; t=${s%%2*};		# Type required: rpm/deb/xz	2015-07-02 22:35:40
while [[ $1 ]];
do
  # Do Directories		2015-08-20 00:56:59
  en=""; [[ -d $1 ]] && en=$1/*.$t; en=${en:-$1}
  for f in $en;
  do
    [[ ! -f $f ]] && { ls $f; exit; }
    [[ ${f##*.} != $t ]] && { echo Error: Incorrect Type $f; break; }
    $(eval echo ${s%.*}) $f
  done
  shift;
done  
[[ $lst ]] && echo Installation Files List: $lst
Script Update 5th Jan 2016

Enhancements
  • All Binary Types Sharing Same Directory (enables invocation from a script)
  • Output message if files of designated type non-existent (go on to process next argument)
Enhanced Script

Code: Select all

#!/bin/sh
# xz2txz.sh deb2txz.sh rpm2txz.sh	2015-04-28 18:18:09
#	<-	rpm2txz_190815.sh
# -nv Non-Verbose Option: Std. Error redirected to list file in /tmp	2015-07-02 22:32:52
# Looping through all appropriate files		2015-07-02 22:47:50
# Doing in Directories the Required File Type 	2015-08-20 00:56:59
# Enhancement: All Binary Types Sharing Directory	2016-01-04 13:50:27
# Refinement. Testing for the glob '*'  Non-existent files of designated type	2016-01-04 02:26:29
# Arguments: [-nv] <file/s> and/or <folder/s>		2015-08-20
ren()		# Rename to be Slackware Compliant
{
n=$(awk '{print match($0,"[_-][0-9]+[.]")-1;}'<<< $1)
r=${1:n}; 
v=$(expr "${1:n}" : '\([0-9._-]*[0-9]\)');
r=${1:n}; r=${r#$v}; r=${r//-/.}; r=${r//_/.}; r=${r%.*};
a=${r##*.}; r=${r%.*}; 
[[ ${v%-*} ]] && t=${v##*-}; v=${v%-${t:=1}};
f=${1:0:n}-${v:1}$r-$a-$t.txz; echo "->  $f"
}
sld()		# Create very brief one-liner in 'slack-desc'
{
[[ ! -d $fr/install ]] && mkdir $fr/install
sd=$fr/install/slack-desc
l=${1:0:n}:" ${v:1} ($1)"; l=${l:0:79};
echo $l > $sd
for ((i=0; i<10; i++)); do echo ${1:0:n}: >> $sd; done
echo "<slack-desc>"
head -n1 $sd
}
deb2tgz()
{
    # Convert .deb. packages to .tgz.   2014-11-13 19:45:33
    # Whittled Down Version	2015-04-28 00:32:11
    # Variables
    c='\e[36m'
    r='\e[31m'
    e=`tput sgr0`

    # Let's start
    if [ "$1" = "" ]; then
        echo -e "${c}need a deb package as an argument, example: $0 /mnt/sda2/debian_packages/package.deb"$e | fmt -w 80
        return 1;
    fi

    # Work only on deb packages:

    # Create module:
	y=$1
        mod=`readlink -f $y | sed s/.deb$/.xzm/`
        pkg=`echo $mod | awk -F/ '{print$NF}' | sed s/.xzm//g`
        dataname=`ar t $y | grep data`
    echo dataname = $dataname
    # echo mod = $mod
    echo Creating Package: ${mod%.xzm}.tgz
    pushd .  > /dev/null
       case $dataname in
       data.tar.gz)
       mkdir /tmp/deb2xzm$$ && cp $y /tmp/deb2xzm$$ && cd /tmp/deb2xzm$$ && /usr/bin/ar x * data.tar.gz && mv data.tar.gz $pkg.tgz && mv /tmp/deb2xzm$$/$pkg.tgz ${mod%.xzm}.tgz
       ;;
       data.tar.lzma)
       mkdir /tmp/deb2xzm$$ && cp $y /tmp/deb2xzm$$ && cd /tmp/deb2xzm$$ && /usr/bin/ar x * data.tar.lzma && unxz data.tar.lzma && gzip data.tar && mv data.tar.gz $pkg.tgz  && mv /tmp/deb2xzm$$/$pkg.tgz ${mod%.xzm}.tgz
       ;;
       data.tar.xz)
       mkdir /tmp/deb2xzm$$ && cp $y /tmp/deb2xzm$$ && cd /tmp/deb2xzm$$ && /usr/bin/ar x * data.tar.xz && unxz data.tar.xz && gzip data.tar && mv data.tar.gz $pkg.tgz  && mv /tmp/deb2xzm$$/$pkg.tgz ${mod%.xzm}.tgz
       ;;
       esac
       rm -rf /tmp/deb2xzm$$
    popd  > /dev/null
}
rpm2txz()
{
  local s; local t;	# 2015-07-02 22:08:54
  [[ ${1##*.} != rpm ]] && { echo Not rpm; return 1; }
  pg=${1##*/}; can=$(readlink -f $1)
  fr=/tmp/fke$$
  pushd .  > /dev/null
  mkdir $fr && cd $fr
  rpm2cpio $can | cpio -dim
  popd  > /dev/null
  ren $pg
  sld $pg
  pushd .  > /dev/null
  cd $fr
  rst=${can%/*}/$f; [[ $lst ]] && rst+=" 2>>$lst";	# 2015-07-03 14:58:59
  eval /sbin/makepkg -l y -c n $rst;			# 2015-07-03 14:58:59
#  /sbin/makepkg -l y -c n  ${can%/*}/$f 2>>$lst	Comout # 2015-07-03 14:58:59		# 2015-07-02 22:30:18
  popd  > /dev/null
  rm -rf $fr
}
deb2txz()
{
  local s; local t;	# 2015-07-02 22:08:54
  [[ ${1##*.} != deb ]] && { echo Not deb; return 1; }
  pg=${1##*/}; can=$(readlink -f $1)
  deb2tgz $can
  fr=/tmp/fke$$
  mkdir $fr && tar xzf ${can%.*}.tgz -C $fr
  ren $pg
  sld $pg
  pushd .  > /dev/null
  cd $fr
  rst=${can%/*}/$f; [[ $lst ]] && rst+=" 2>>$lst";	# 2015-07-03 14:58:59
  eval /sbin/makepkg -l y -c n $rst;			# 2015-07-03 14:58:59
#  /sbin/makepkg -l y -c n  ${can%/*}/$f	2>>$lst		# 2015-07-02 22:30:18
  popd  > /dev/null
  rm -rf $fr
}
xz2txz()
{
  local s; local t;	# 2015-07-02 22:08:54
  [[ ${1##*.} != xz ]] && { echo Not xz; return 1; }
  pg=${1##*/}; can=$(readlink -f $1)
  fr=/tmp/fke$$
  mkdir $fr && tar xJf $can -C $fr
  ren ${pg/.tar/}
  sld $pg
  pushd .  > /dev/null
  cd $fr
  rst=${can%/*}/$f; [[ $lst ]] && rst+=" 2>>$lst";	# 2015-07-03 14:58:59
  eval /sbin/makepkg -l y -c n $rst;			# 2015-07-03 14:58:59
#  /sbin/makepkg -l y -c n  ${can%/*}/$f	2>>$lst		# 2015-07-02 22:30:18
  popd  > /dev/null
  rm -rf $fr
}
# Ascertain Binary Type
s=${0##*/}; t=${s%%2*};		# Type required: rpm/deb/xz	2015-07-02 22:35:40
# Create 'temporary' Installation Files List if requested.
# Enhancement: All Types to Share Directory	2016-01-04 13:50:27
if [[ $1 == -nv ]]; then dd=/tmp/$(date +%a)_$(date +%R); lst=$dd/${t}_$$.lst;
  [[ ! -d $dd ]] && { mkdir $dd || exit; }; echo -n > $lst || { echo Error: Creating Files List File; exit; }
  h=${s%.*}; echo ${h^^} >> $lst; shift;	# Upper Case Heading
fi
while [[ $1 ]];
do
  # Do Directories		2015-08-20 00:56:59
  en=""; [[ -d $1 ]] && en=$1/*.$t; en=${en:-$1}
  for f in $en;
  do
    # Test for the Glob			2016-01-04 02:26:29
    [[ ${f##*/} =~ ^[*] ]] && { echo -e "\e[1mNone Found for '$f'"'!\e[0m';  continue; }	# No such files  2016-01-04 02:34:03
    [[ ! -f $f ]] && { ls $f; exit; }
    [[ ${f##*.} != $t ]] && { echo Error: Incorrect Type $f; break; }
    $(eval echo ${s%.*}) $f
  done
  shift;
done  
[[ $lst ]] && echo Installation Files List: $lst
Script Update 27.09.2016

Enhancement Names of packages with deb origin made more meaningful.

Enhanced Script
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
francois
Contributor
Contributor
Posts: 5068
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

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

Post#8 by francois » 21 Aug 2015, 13:06

I will try it this weekend. "Je le jure". :)
Voltaire: Le mieux est l'ennemi du bien.

Jack
Contributor
Contributor
Posts: 1176
Joined: 09 Aug 2013, 14:25
Distribution: Porteus 3.2.rc5 Mate 64 bit
Location: Marysville, OHIO USA

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

Post#9 by Jack » 21 Aug 2015, 15:59

How I found my dependencies for gLabels is I ran glabels-3 in LXTerminal when I got the error then I went to pkgs.org and found the dependencies needed. I did it tell I found them all and yes it took a long time to do it.
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2563
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#10 by Bogomips » 21 Aug 2015, 19:44

@Jack
Although your post is off-topic, I'm glad to hear you managed it :) . The next step is for you to upload your module to a file-sharing site or to the cloud, and post a link to it in i486 xzm modules :beer:
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

Jack
Contributor
Contributor
Posts: 1176
Joined: 09 Aug 2013, 14:25
Distribution: Porteus 3.2.rc5 Mate 64 bit
Location: Marysville, OHIO USA

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

Post#11 by Jack » 21 Aug 2015, 21:19

Sorry about being "off topic". I uploaded from Dropbox and MediaFire. Here where they are.

viewtopic.php?f=51&t=4946
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.

User avatar
francois
Contributor
Contributor
Posts: 5068
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

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

Post#12 by francois » 22 Aug 2015, 11:43

@jack:
Resolution of dependencies by bogomips is here:
https://forum.porteus.org/viewtopic.php?t=4497&p=33026

Maybe the best option would be to start a new thread from here on for your specific problem.
Voltaire: Le mieux est l'ennemi du bien.

Jack
Contributor
Contributor
Posts: 1176
Joined: 09 Aug 2013, 14:25
Distribution: Porteus 3.2.rc5 Mate 64 bit
Location: Marysville, OHIO USA

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

Post#13 by Jack » 25 Aug 2015, 03:53

I was going to use pkgs.org to get what I need. Which is better to use xz, deb or rpm? Or are they about the same?
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2563
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#14 by Bogomips » 25 Aug 2015, 11:29

^ My preference: xz (Default in pakorg procedure, mentioned above by francois)
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

Jack
Contributor
Contributor
Posts: 1176
Joined: 09 Aug 2013, 14:25
Distribution: Porteus 3.2.rc5 Mate 64 bit
Location: Marysville, OHIO USA

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

Post#15 by Jack » 25 Aug 2015, 16:26

Thanks Bogomips, I will do some more testing with your script. What I did so works great.
I just like Slackware because I think it teach you about Linux to build packages where Ubuntu is like Windows you just install programs you want.

Post Reply