[HOWTO] (CLI) Slackware Package RPM/DEB, tar.xz, etc.

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

[HOWTO] (CLI) Slackware Package RPM/DEB, tar.xz, etc.

Post#1 by Bogomips » 18 Nov 2014, 21:49

At some point one has to write up what has been done and how. About to do write up in text file on PC, when thought came of writing this up in forum as reminder to self, and as guide for any one else who might like to try it. Especially with rising significance of usm:
brokenman wrote:I am not familiar with arch packages but USM relies on a valid slackware style /var//log/packages file for dependency resolution.
Prerequisite: familiarity with the material. here
  1. Convert and Explode into Fakeroot Directory
    1. RPM

      Code: Select all

      mkdir <fakeroot>
      cd <fakeroot>
      rpm2cpio  ../<package>.rpm | cpio -dim
      cd ..
      
      Example

      Code: Select all

      guest@porteus:~$ rpm2cpio libgomp-4.9.2-1.fc21.i686.rpm | cpio -it
      ./usr/lib/libgomp.so.1
      ./usr/lib/libgomp.so.1.0.0
      ./usr/share/doc/libgomp
      ./usr/share/doc/libgomp/ChangeLog.bz2
      ./usr/share/doc/libgomp/ChangeLog.graphite.bz2
      ./usr/share/info/libgomp.info.gz
      318 blocks
      guest@porteus:~$ mkdir gomp
      guest@porteus:~$ cd gomp/
      guest@porteus:~/gomp$ rpm2cpio ../libgomp-4.9.2-1.fc21.i686.rpm | cpio -dim
      318 blocks
      guest@porteus:~/gomp$ cd ..
      guest@porteus:~$ tree gomp
      gomp
      └── usr
          ├── lib
          │   ├── libgomp.so.1 -> libgomp.so.1.0.0
          │   └── libgomp.so.1.0.0
          └── share
              ├── doc
              │   └── libgomp
              │       ├── ChangeLog.bz2
              │       └── ChangeLog.graphite.bz2
              └── info
                  └── libgomp.info.gz
      6 directories, 5 files
      
      guest@porteus:~$ ls -lh gomp/usr/lib/
      total 100K
      lrwxrwxrwx 1 guest guest  16 Nov 16 21:26 libgomp.so.1 -> libgomp.so.1.0.0*
      -rwxr-xr-x 1 guest guest 98K Nov  1 19:00 libgomp.so.1.0.0*
      
      • DEB, tar.xz (Arch), etc.
        1. DEB
          • Code: Select all

            sh  deb2tgz.sh  <package>.deb
            • deb2tgz.sh (Straight lift from deb2xzm)

              Code: Select all

              #!/bin/sh
              # Convert .deb. packages to .tgz.	2014-11-13 19:45:33
              
              # Variables
              c='\e[36m'
              r='\e[31m'
              e=`tput sgr0`
              
              # Let's start
              if [ "$1" = "" ]; then
                  echo -e "${c}nead a deb package as an argument, example: $0 /mnt/sda2/debian_packages/package.deb"$e | fmt -w 80
                  exit
              fi
              
              # Work only on deb packages:
              for x in $*; do
                  ext=`echo $x | rev | cut -d. -f1 | rev`
                  if [ "$ext" = deb ]; then
                      mod=`readlink -f $x`
                      MOD=`echo $MOD $mod`
                  fi
              done
              
              # Create module:
              for y in $MOD; do
                  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 pkg = $pkg
              echo Creating Package: ${mod%.xzm}.tgz
                  if [ "$DISPLAY" ]; then
              	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
              	if [ $? -eq 0 ]; then
              	    Xdialog --title "success" --no-close --no-buttons --infobox "Packagee created as ${mod%.xzm}.tgz" 0 0 2000 &
              	else
              	    Xdialog --title "error" --msgbox "${mod%.xzm}.tgz creation failed!" 0 0 &
              	fi
              	;;
              	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
              	if [ $? -eq 0 ]; then
              	    Xdialog --title "success" --no-close --no-buttons --infobox "Packagee created as ${mod%.xzm}.tgz" 0 0 2000 &
              	else
              	    Xdialog --title "error" --msgbox "${mod%.xzm}.tgz creation failed!" 0 0 &
              	fi
              	;;
              	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
              	if [ $? -eq 0 ]; then
              	    Xdialog --title "success" --no-close --no-buttons --infobox "Packagee created as ${mod%.xzm}.tgz" 0 0 2000 &
              	else
              	    Xdialog --title "error" --msgbox "${mod%.xzm}.tgz creation failed!" 0 0 &
              	fi
              	;;
              	esac
                  fi
                  rm -rf /tmp/deb2xzm$$
              done
              
              • Example

                Code: Select all

                guest@porteus:~$ sh deb2tgz.sh libcurl3_7.22.0-3ubuntu4_i386.deb 
                dataname = data.tar.gz
                pkg = libcurl3_7.22.0-3ubuntu4_i386
                Creating Package: /home/guest/libcurl3_7.22.0-3ubuntu4_i386.tgz
                
              • DEB, tar.xz, etc
                • Code: Select all

                  mkdir  <fakeroot>
                  tar  xvvf  <package>.{tgz txz etc}  -C <fakeroot>
                  OR

                  Code: Select all

                  mkdir  <fakeroot>
                  cd  <fakeroot>
                  /sbin/explodpkg ../<package>.{tgz txz etc}
                  cd ..
                  
                  tar+{gzip,bzip2,lzma (7-zip),xz (lzma2) archive}
                • Example

                  Code: Select all

                  guest@porteus:~$ mkdir curl
                  guest@porteus:~$ tar xzf libcurl3_7.22.0-3ubuntu4_i386.tgz -C curl
                  guest@porteus:~$ tree -d curl
                  curl
                  └── usr
                      ├── lib
                      │   └── i386-linux-gnu
                      └── share
                          ├── doc
                          │   └── libcurl3
                          └── lintian
                              └── overrides
                  8 directories
                  guest@porteus:~$ tree curl/usr/lib/
                  curl/usr/lib/
                  └── i386-linux-gnu
                      ├── libcurl.so.3 -> libcurl.so.4
                      ├── libcurl.so.4 -> libcurl.so.4.2.0
                      └── libcurl.so.4.2.0
                  1 directory, 3 files
                  guest@porteus:~$ ls -lh curl/usr/lib/i386-linux-gnu/
                  total 368K
                  lrwxrwxrwx 1 guest guest   12 Mar 23  2012 libcurl.so.3 -> libcurl.so.4
                  lrwxrwxrwx 1 guest guest   16 Mar 23  2012 libcurl.so.4 -> libcurl.so.4.2.0
                  -rw-r--r-- 1 guest guest 367K Mar 23  2012 libcurl.so.4.2.0
                  guest@porteus:~$ tree curl
                  curl
                  └── usr
                      ├── lib
                      │   └── i386-linux-gnu
                      │       ├── libcurl.so.3 -> libcurl.so.4
                      │       ├── libcurl.so.4 -> libcurl.so.4.2.0
                      │       └── libcurl.so.4.2.0
                      └── share
                          ├── doc
                          │   └── libcurl3
                          │       ├── BINDINGS.gz
                          │       ├── BUGS.gz
                          │       ├── FAQ.gz
                          │       ├── FEATURES
                          │       ├── KNOWN_BUGS.gz
                          │       ├── README
                          │       ├── THANKS.gz
                          │       ├── TODO.gz
                          │       ├── VERSIONS
                          │       ├── changelog.Debian.gz
                          │       └── copyright
                          └── lintian
                              └── overrides
                                  └── libcurl3
                  8 directories, 15 files
                  
            • Preferable to place non-distro libraries, executables in usr/local/lib, usr/local/bin respectively.
              Example
              1. RPM

                Code: Select all

                ADJUSTING LIBS
                
                guest@porteus:~$ mkdir gomp/usr/local
                guest@porteus:~$ mv gomp/usr/lib/ gomp/usr/local
                guest@porteus:~$ tree -d gomp
                gomp
                └── usr
                    ├── local
                    │   └── lib
                    └── share
                        ├── doc
                        │   └── libgomp
                        └── info
                7 directories
                guest@porteus:~$ tree gomp/usr/local/
                gomp/usr/local/
                └── lib
                    ├── libgomp.so.1 -> libgomp.so.1.0.0
                    └── libgomp.so.1.0.0
                1 directory, 2 files
                
              2. DEB etc.

                Code: Select all

                ADJUSTING LIBS
                
                guest@porteus:~$ mkdir curl/usr/local
                guest@porteus:~$ mv curl/usr/lib/i386-linux-gnu/ curl/usr/local/lib
                guest@porteus:~$ rmdir curl/usr/lib/
                guest@porteus:~$ tree -d curl
                curl
                └── usr
                    ├── local
                    │   └── lib
                    └── share
                        ├── doc
                        │   └── libcurl3
                        └── lintian
                            └── overrides
                8 directories
                guest@porteus:~$ tree curl/usr/local/
                curl/usr/local/
                └── lib
                    ├── libcurl.so.3 -> libcurl.so.4
                    ├── libcurl.so.4 -> libcurl.so.4.2.0
                    └── libcurl.so.4.2.0
                1 directory, 3 files
                
            • SLACK-DESC & DOINST.SH (Going the whole hog here :) )
                • Package Description using slackdesc
                  1. Install or xzm slackdesc-all-0.02-1spn.tgz
                    • Create install directory to hold files slack-desc and doinst.sh

                      Code: Select all

                      mkdir  <fakeroot>/install
                      
                      /sbin/slackdesc "< package name >" ["< version >"] "< Short description >"
                      
                       "< Long description >" "< http://homepage >" [ -r ] [ -n ] | tee 
                      
                      <fakeroot>/install/slack-desc
                  2. Example
                    1. RPM
                      1. Code: Select all

                        DESCRIPTION (pkgs.org)
                        ===========
                        libgomp - GCC OpenMP v3.0 shared support library
                        Distribution: Fedora 21
                        Repository: Fedora i386
                        Package name: libgomp
                        Package version: 4.9.2
                        Package architecture: i686
                        Package type: rpm
                        Download size: 125,25 KB
                        Installed size: 158,00 KB
                        Official mirror: dl.fedoraproject.org
                        This package contains GCC shared support library which is needed for OpenMP v3.0 support.
                        Binary package:
                        libgomp-4.9.2-1.fc21.i686.rpm
                        Source package:
                        gcc-4.9.2-1.fc21.src.rpm
                        • Code: Select all

                          guest@porteus:~$ mkdir gomp/install
                          guest@porteus:~$ /sbin/slackdesc "libgomp" "4.9.2" "GCC OpenMP v3.0 shared support library" "This package contains GCC shared support library which is needed for OpenMP v3.0 support." "dl.fedoraproject.org" | tee gomp/install/slack-desc
                          libgomp: libgomp 4.9.2 GCC OpenMP v3.0 shared support library  
                          libgomp:  
                          libgomp: This package contains GCC shared support library which is needed for 
                          libgomp: OpenMP v3.0 support.  
                          libgomp: 
                          libgomp: 
                          libgomp: 
                          libgomp: 
                          libgomp: 
                          libgomp: 
                          libgomp: dl.fedoraproject.org  
                          guest@porteus:~$ ls -lh gomp/install/slack-desc 
                          -rw-r--r-- 1 guest guest 278 Nov 17 22:04 gomp/install/slack-desc
                          
                      2. DEB
                        1. Code: Select all

                          DESCRIPTION (pkgs.org)
                          ===========
                          libcurl3 - Multi-protocol file transfer library (OpenSSL)
                          
                          Distribution: Ubuntu 12.04 LTS
                          Repository: Ubuntu Main i386
                          Package name: libcurl3
                          Package version: 7.22.0
                          Package architecture: i386
                          Package type: deb
                          Download size: 235,90 KB
                          Installed size: 540 B
                          Official mirror: archive.ubuntu.com
                          libcurl is designed to be a solid, usable, reliable and portable multi-protocol file transfer library.
                          SSL support is provided by OpenSSL.
                          This is the shared version of libcurl.
                          Binary package:
                          libcurl3_7.22.0-3ubuntu4_i386.deb
                          
                          • Code: Select all

                            guest@porteus:~$ mkdir curl/install
                            guest@porteus:~$ /sbin/slackdesc "libcurl3" "7.22.0" "Multi-protocol file transfer library (OpenSSL)" "libcurl is designed to be a solid, usable, reliable and portable multi-protocol file transfer library.
                            > SSL support is provided by OpenSSL.
                            > This is the shared version of libcurl." "archive.ubuntu.com" | tee curl/install/slack-desc
                            libcurl3: libcurl3 7.22.0 Multi-protocol file transfer library (OpenSSL)  
                            libcurl3:  
                            libcurl3: libcurl is designed to be a solid, usable, reliable and portable 
                            libcurl3: multi-protocol file transfer library. SSL support is provided by 
                            libcurl3: OpenSSL. This is the shared version of libcurl.  
                            libcurl3: 
                            libcurl3: 
                            libcurl3: 
                            libcurl3: 
                            libcurl3: 
                            libcurl3: archive.ubuntu.com
                            guest@porteus:~$ ls -l curl/install/slack-desc 
                            -rw-r--r-- 1 guest guest 385 Nov 16 18:48 curl/install/slack-desc
                            
                        2. RPM
                          1. Code: Select all

                            DESCRIPTION (pkgs.org)
                            ===========
                            libldap-2.4.32-alt2.1.i586.rpm
                            
                            libldap - OpenLDAP libraries
                            
                                Distribution: ALT Linux Sisyphus
                                Repository: Classic i586
                                Package name: libldap
                                Package version: 2.4.32
                                Package architecture: i586
                                Package type: rpm
                                Installed size: 669,92 KB
                                Download size: 669,92 KB
                                Binary package: libldap-2.4.32-alt2.1.i586.rpm
                                Source package: openldap-2.4.32-alt2.1.src.rpm
                            
                            OpenLDAP is an open source suite of LDAP (Lightweight Directory Access Protocol) applications and development tools. LDAP is a set of protocols for accessing directory services (usually phone book style information, but other information is possible) over the Internet, similar to the way DNS (Domain Name System) information is propagated over the Internet. The suite includes a stand-alone LDAP server (slapd), libraries for implementing the LDAP protocol, utilities, tools, and sample clients.
                            
                            This package contains shared libraries needed for make works openldap-based softare.
                            
                            • Code: Select all

                              guest@porteus:~$ mkdir ldap/install
                              guest@porteus:~$ /sbin/slackdesc "libldap" "2.4.32" "OpenLDAP libraries" "OpenLDAP is an open source suite of LDAP (Lightweight Directory Access Protocol) applications and development tools. LDAP is a set of protocols for accessing directory services (usually phone book style information, but other information is possible) over the Internet, similar to the way DNS (Domain Name System) information is propagated over the Internet. The suite includes a stand-alone LDAP server (slapd), libraries for implementing the LDAP protocol, utilities, tools, and sample clients." "ALT Linux Sisyphus" | tee ldap/install/slack-desc
                              libldap: libldap 2.4.32 OpenLDAP libraries  
                              libldap:  
                              libldap: OpenLDAP is an open source suite of LDAP (Lightweight Directory 
                              libldap: Access Protocol) applications and development tools. LDAP is a set of 
                              libldap: protocols for accessing directory services (usually phone book style 
                              libldap: information, but other information is possible) over the Internet, 
                              libldap: similar to the way DNS (Domain Name System) information is propagated 
                              libldap: over the Internet. The suite includes a stand-alone LDAP server 
                              libldap: (slapd), libraries for implementing the LDAP protocol, utilities, 
                              libldap: tools, and sample clients.  
                              libldap: ALT Linux Sisyphus
                              guest@porteus:~$ ls -lh ldap/install/slack-desc 
                              -rw-r--r-- 1 guest guest 664 Nov 17 22:28 ldap/install/slack-desc
                              
                      3. Slackware Package Name Acceptance
                        Apparently if Package Description Shows on Installation then Package Name Accepted.
                        • Code: Select all

                          cd  <fakeroot>
                          /sbin/makepkg -l y -c n  ../<tentative package name>.txz
                          cd ..
                          mkdir  <fakeroot (install description)>
                          /sbin/installpkg --root  <fakeroot (install description)> <tentative package name>.txz
                          
                          • Example
                            1. RPM

                              Code: Select all

                              guest@porteus:~$ tree gomp/
                              gomp/
                              ├── install
                              │   └── slack-desc
                              └── usr
                                  ├── local
                                  │   └── lib
                                  │       ├── libgomp.so.1 -> libgomp.so.1.0.0
                                  │       └── libgomp.so.1.0.0
                                  └── share
                                      ├── doc
                                      │   └── libgomp
                                      │       ├── ChangeLog.bz2
                                      │       └── ChangeLog.graphite.bz2
                                      └── info
                                          └── libgomp.info.gz
                              8 directories, 6 files
                              FIRST NAMING ATTEMPT
                              guest@porteus:~$ cd gomp/
                              guest@porteus:~/gomp$ makepkg -l y -c n  ../libgomp-4.9.2-1.fc21.i686.txz
                              bash: makepkg: command not found
                              guest@porteus:~/gomp$ /sbin/makepkg -l y -c n  ../libgomp-4.9.2-1.fc21.i686.txz
                              ...
                              Searching for symbolic links:
                              usr/local/lib/libgomp.so.1 -> libgomp.so.1.0.0
                              
                              Making symbolic link creation script:
                              ( cd usr/local/lib ; rm -rf libgomp.so.1 )
                              ( cd usr/local/lib ; ln -sf libgomp.so.1.0.0 libgomp.so.1 )
                              ...
                              Removing symbolic links:
                              removed ‘./usr/local/lib/libgomp.so.1’
                              
                              Creating your new ./install/doinst.sh...
                              ./
                              install/
                              install/doinst.sh
                              install/slack-desc
                              usr/
                              usr/local/
                              usr/local/lib/
                              usr/local/lib/libgomp.so.1.0.0
                              usr/share/
                              usr/share/info/
                              usr/share/info/libgomp.info.gz
                              usr/share/doc/
                              usr/share/doc/libgomp/
                              usr/share/doc/libgomp/ChangeLog.graphite.bz2
                              usr/share/doc/libgomp/ChangeLog.bz2
                              WARNING:  /usr/share/info (with possibly not gzipped info pages) detected
                              Slackware package ../libgomp-4.9.2-1.fc21.i686.txz created.
                              guest@porteus:~/gomp$ cd ..
                              guest@porteus:~$ mkdir gompd
                              guest@porteus:~$ /sbin/installpkg --root gompd libgomp-4.9.2-1.fc21.i686.txz 
                              Verifying package libgomp-4.9.2-1.fc21.i686.txz.
                              Installing package libgomp-4.9.2-1.fc21.i686.txz:
                              PACKAGE DESCRIPTION:
                              Executing install script for libgomp-4.9.2-1.fc21.i686.txz.
                              Package libgomp-4.9.2-1.fc21.i686.txz installed.
                              
                              guest@porteus:~$ tree -d gompd
                              gompd
                              ├── usr
                              │   ├── local
                              │   │   └── lib
                              │   └── share
                              │       ├── doc
                              │       │   └── libgomp
                              │       └── info
                              └── var
                                  └── log
                                      ├── packages
                                      ├── removed_packages
                                      ├── removed_scripts
                                      ├── scripts
                                      └── setup
                                          └── tmp
                              15 directories
                              
                              SUBSEQUENT ATTEMPTS
                              guest@porteus:~$ rm -r gompd/*
                              guest@porteus:~$ cd gomp
                              guest@porteus:~/gomp$ /sbin/makepkg -l y -c n  ../libgomp-4.9.2.fc21.i686-1.txz
                              ...
                              guest@porteus:~/gomp$ cd ..
                              guest@porteus:~$ /sbin/installpkg --root gompd libgomp-4.9.2.fc21.i686-1.txz 
                              ..
                              PACKAGE DESCRIPTION:
                              Package libgomp-4.9.2.fc21.i686-1.txz installed
                              ...
                              guest@porteus:~/gomp$ /sbin/makepkg -l y -c n  ../libgomp-4.9.2.1-fc21.i686.txz
                              ...
                              guest@porteus:~$ /sbin/installpkg --root gompd libgomp-4.9.2.1-fc21.i686.txz 
                              Verifying package libgomp-4.9.2.1-fc21.i686.txz.
                              Installing package libgomp-4.9.2.1-fc21.i686.txz:
                              PACKAGE DESCRIPTION:
                              Package libgomp-4.9.2.1-fc21.i686.txz installed.
                              ...
                              SUCCESS
                              guest@porteus:~/gomp$ /sbin/makepkg -l y -c n  ../libgomp-4.9.2.1-fc21-i686.txz
                              ...
                              Searching for symbolic links:
                              No symbolic links were found, so we won't make an installation script.
                              ...
                              Slackware package ../libgomp-4.9.2.1-fc21-i686.txz created.
                              
                              guest@porteus:~/gomp$ cd ..
                              guest@porteus:~$ /sbin/installpkg --root gompd libgomp-4.9.2.1-fc21-i686.txz 
                              Verifying package libgomp-4.9.2.1-fc21-i686.txz.
                              Installing package libgomp-4.9.2.1-fc21-i686.txz:
                              PACKAGE DESCRIPTION:
                              # libgomp 4.9.2 GCC OpenMP v3.0 shared support library  
                              #  
                              # This package contains GCC shared support library which is needed for 
                              # OpenMP v3.0 support.  
                              # 
                              # dl.fedoraproject.org  
                              Executing install script for libgomp-4.9.2.1-fc21-i686.txz.
                              Package libgomp-4.9.2.1-fc21-i686.txz installed
                              guest@porteus:~$ tree -d gompd
                              gompd
                              ├── usr
                              │   ├── local
                              │   │   └── lib
                              │   └── share
                              │       ├── doc
                              │       │   └── libgomp
                              │       └── info
                              └── var
                                  └── log
                                      ├── packages
                                      ├── removed_packages
                                      ├── removed_scripts
                                      ├── scripts
                                      └── setup
                                          └── tmp
                              15 directories
                              guest@porteus:~$ tree gompd/usr/local/
                              gompd/usr/local/
                              └── lib
                                  ├── libgomp.so.1 -> libgomp.so.1.0.0
                                  └── libgomp.so.1.0.0
                              1 directory, 2 files
                              
                              • DEB

                                Code: Select all

                                guest@porteus:~$ cd curl
                                guest@porteus:~/curl$ PATH=$PATH:/sbin
                                guest@porteus:~/curl$ makepkg -l y -c n  ../libcurl3-7.22.0-3ubuntu4-i386.txz
                                ...
                                Searching for symbolic links:
                                usr/local/lib/libcurl.so.3 -> libcurl.so.4
                                usr/local/lib/libcurl.so.4 -> libcurl.so.4.2.0
                                
                                Making symbolic link creation script:
                                ( cd usr/local/lib ; rm -rf libcurl.so.3 )
                                ( cd usr/local/lib ; ln -sf libcurl.so.4 libcurl.so.3 )
                                ( cd usr/local/lib ; rm -rf libcurl.so.4 )
                                ( cd usr/local/lib ; ln -sf libcurl.so.4.2.0 libcurl.so.4 )
                                ...
                                Removing symbolic links:
                                removed ‘./usr/local/lib/libcurl.so.3’
                                removed ‘./usr/local/lib/libcurl.so.4’
                                Creating your new ./install/doinst.sh...
                                
                                ./
                                install/
                                install/doinst.sh
                                install/slack-desc
                                usr/
                                usr/local/
                                usr/local/lib/
                                usr/local/lib/libcurl.so.4.2.0
                                usr/share/
                                usr/share/doc/
                                usr/share/doc/libcurl3/
                                usr/share/doc/libcurl3/changelog.Debian.gz
                                usr/share/doc/libcurl3/FAQ.gz
                                usr/share/doc/libcurl3/BINDINGS.gz
                                usr/share/doc/libcurl3/copyright
                                usr/share/doc/libcurl3/VERSIONS
                                usr/share/doc/libcurl3/TODO.gz
                                usr/share/doc/libcurl3/THANKS.gz
                                usr/share/doc/libcurl3/FEATURES
                                usr/share/doc/libcurl3/KNOWN_BUGS.gz
                                usr/share/doc/libcurl3/BUGS.gz
                                usr/share/doc/libcurl3/README
                                usr/share/lintian/
                                usr/share/lintian/overrides/
                                usr/share/lintian/overrides/libcurl3
                                Slackware package ../libcurl3-7.22.0-3ubuntu4-i386.txz created.
                                
                                guest@porteus:~/curl$ cd ..
                                guest@porteus:~$ mkdir curld
                                guest@porteus:~$ installpkg --root curld libcurl3-7.22.0-3ubuntu4-i386.txz 
                                Verifying package libcurl3-7.22.0-3ubuntu4-i386.txz.
                                Installing package libcurl3-7.22.0-3ubuntu4-i386.txz:
                                PACKAGE DESCRIPTION:
                                # libcurl3 7.22.0 Multi-protocol file transfer library (OpenSSL)  
                                #  
                                # libcurl is designed to be a solid, usable, reliable and portable 
                                # multi-protocol file transfer library. SSL support is provided by 
                                # OpenSSL. This is the shared version of libcurl.  
                                # 
                                # archive.ubuntu.com  
                                Executing install script for libcurl3-7.22.0-3ubuntu4-i386.txz.
                                Package libcurl3-7.22.0-3ubuntu4-i386.txz installed.
                                guest@porteus:~$ tree -d curld
                                curld
                                ├── usr
                                │   ├── local
                                │   │   └── lib
                                │   └── share
                                │       ├── doc
                                │       │   └── libcurl3
                                │       └── lintian
                                │           └── overrides
                                └── var
                                    └── log
                                        ├── packages
                                        ├── removed_packages
                                        ├── removed_scripts
                                        ├── scripts
                                        └── setup
                                            └── tmp
                                16 directories
                                guest@porteus:~$ ls -lh curld/var/log/packages/libcurl3-7.22.0-3ubuntu4-i386 
                                -rw-r--r-- 1 guest guest 1.2K Nov 17 23:36 curld/var/log/packages/libcurl3-7.22.0-3ubuntu4-i386
                                
                                • RPM

                                  Code: Select all

                                  UNSUCCESSFUL PACKAGE NAMES
                                  guest@porteus:~$ cd ldap
                                  guest@porteus:~/ldap$ /sbin/makepkg -l y -c n  ../libldap-2.4.32-alt2.1.i586.txz
                                  ...
                                  Searching for symbolic links:
                                  usr/local/lib/libldap_r-2.4.so.2 -> libldap_r-2.4.so.2.8.4
                                  
                                  Making symbolic link creation script:
                                  ( cd usr/local/lib ; rm -rf libldap_r-2.4.so.2 )
                                  ( cd usr/local/lib ; ln -sf libldap_r-2.4.so.2.8.4 libldap_r-2.4.so.2 )
                                  ...
                                  Removing symbolic links:
                                  removed ‘./usr/local/lib/libldap_r-2.4.so.2’
                                  Creating your new ./install/doinst.sh...
                                  ...
                                  Creating Slackware package:  ../libldap-2.4.32-alt2.1.i586.txz
                                  
                                  ./
                                  install/
                                  install/doinst.sh
                                  install/slack-desc
                                  usr/
                                  usr/local/
                                  usr/local/lib/
                                  usr/local/lib/libldap_r-2.4.so.2.8.4
                                  Slackware package ../libldap-2.4.32-alt2.1.i586.txz created
                                  
                                  guest@porteus:~$ /sbin/installpkg --root ldapd libldap-2.4.32-alt2.1.i586.txz 
                                  ...
                                  PACKAGE DESCRIPTION:
                                  Executing install script for libldap-2.4.32-alt2.1.i586.txz.
                                  Package libldap-2.4.32-alt2.1.i586.txz installed.
                                  
                                  
                                  guest@porteus:~$ rm -r ldapd/*
                                  guest@porteus:~$ cd ldap
                                  guest@porteus:~/ldap$ /sbin/makepkg -l y -c n  ../libldap-2.4.32-alt2-1-i586.txz
                                  ...
                                  guest@porteus:~$ /sbin/installpkg --root ldapd libldap-2.4.32-alt2-1-i586.txz 
                                  ...
                                  PACKAGE DESCRIPTION:
                                  Package libldap-2.4.32-alt2-1-i586.txz installed.
                                  
                                  guest@porteus:~/ldap$ /sbin/makepkg -l y -c n  ../libldap-2.4.32-alt2-i586-1.txz
                                  ...
                                  guest@porteus:~$ /sbin/installpkg --root ldapd libldap-2.4.32-alt2-i586-1.txz   
                                  ...
                                  PACKAGE DESCRIPTION:
                                  Package libldap-2.4.32-alt2-i586-1.txz installed.
                                  
                                  guest@porteus:~/ldap$ /sbin/makepkg -l y -c n  ../libldap-2.4.32-1-alt2-i586.txz
                                  ...
                                  guest@porteus:~$ /sbin/installpkg --root ldapd libldap-2.4.32-1-alt2-i586.txz 
                                  ...
                                  PACKAGE DESCRIPTION:
                                  Package libldap-2.4.32-1-alt2-i586.txz installed.
                                  
                                  SUCCESS
                                  guest@porteus:~$ cd ldap
                                  guest@porteus:~/ldap$ /sbin/makepkg -l y -c n  ../libldap-2.4.32-alt2-i586.txz  
                                  Slackware package ../libldap-2.4.32-alt2-i586.txz created.
                                  ...
                                  guest@porteus:~$ /sbin/installpkg --root ldapd libldap-2.4.32-alt2-i586.txz   
                                  Verifying package libldap-2.4.32-alt2-i586.txz.
                                  Installing package libldap-2.4.32-alt2-i586.txz:
                                  PACKAGE DESCRIPTION:
                                  # libldap 2.4.32 OpenLDAP libraries  
                                  #  
                                  # OpenLDAP is an open source suite of LDAP (Lightweight Directory 
                                  # ...
                                  # tools, and sample clients.  
                                  # ALT Linux Sisyphus  
                                  Executing install script for libldap-2.4.32-alt2-i586.txz.
                                  Package libldap-2.4.32-alt2-i586.txz installed.
                                  
                              Package Name is supposed to be parsed from right to left, but not been able to find out exact format required.
                            Package now ready to install/bundle or xzm.
                            Last edited by Bogomips on 19 Nov 2014, 15:56, edited 1 time in total.
                            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: 6434
                            Joined: 28 Dec 2010, 14:25
                            Distribution: xfce plank porteus nemesis
                            Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

                            Re: [HOWTO] (CLI) Slackware Package RPM/DEB, tar.xz, etc.

                            Post#2 by francois » 18 Nov 2014, 23:43

                            This is a very interesting howto. I will get into it more toroughly when I will have time.

                            Did you consider to give some example to convert archlinux packages too?

                            Thanks a lot bogomips.
                            Prendre son temps, profiter de celui qui passe.

                            Bogomips
                            Full of knowledge
                            Full of knowledge
                            Posts: 2564
                            Joined: 25 Jun 2014, 15:21
                            Distribution: 3.2.2 Cinnamon & KDE5
                            Location: London

                            Re: [HOWTO] (CLI) Slackware Package RPM/DEB, tar.xz, etc.

                            Post#3 by Bogomips » 19 Nov 2014, 20:13

                            francois, am pleased write-up has been of further interest. The Arch folk seem to be pretty much on the ball. They packaged the latest version from ImageMagick, which I then used for bundle I put up, and which just happen to have already documented. :)
                            1. pkgs.org

                              Code: Select all

                              DESCRIPTION
                              ===========
                              imagemagick - An image viewing/manipulation program
                              
                              Distribution: Arch Linux
                              Repository: Arch Linux Extra i686
                              Package name: imagemagick
                              Package version: 6.8.9.8
                              Package architecture: i686
                              Package type: xz
                              Download size: 2,17 MB
                              Installed size: 10,17 MB
                              Official mirror: ftp5.gwdg.de
                              
                              • Fakeroot

                                Code: Select all

                                guest@porteus:~$ mkdir imk
                                guest@porteus:~$ tar xvvf imagemagick-6.8.9.8-1-i686.pkg.tar.xz -C imk
                                guest@porteus:~$ tree -d imk
                                imk
                                ├── etc
                                │   └── ImageMagick-6
                                └── usr
                                    ├── bin
                                    ├── include
                                    │   └── ImageMagick-6
                                    │       ├── Magick++
                                    │       ├── magick
                                    │       └── wand
                                    ├── lib
                                    │   ├── ImageMagick-6.8.9
                                    │   │   ├── config-Q16HDRI
                                    │   │   └── modules-Q16HDRI
                                    │   │       ├── coders
                                    │   │       └── filters
                                    │   ├── perl5
                                    │   │   └── vendor_perl
                                    │   │       ├── Image
                                    │   │       │   └── Magick
                                    │   │       └── auto
                                    │   │           └── Image
                                    │   │               └── Magick
                                    │   │                   └── Q16HDRI
                                    │   └── pkgconfig
                                    └── share
                                        ├── ImageMagick-6
                                        ├── licenses
                                        │   └── imagemagick
                                        └── man
                                            ├── man1
                                            └── man3
                                31 directories
                                
                                • slack-desc

                                  Code: Select all

                                  PATH=$PATH:/sbin
                                  guest@porteus:~$ slackdesc "imagemagick" "6.8.9.8" "An image viewing/manipulation program" "An image viewing/manipulation program" "ftp://ftp5.gwdg.de" > slack-desc
                                  guest@porteus:~$ mkdir imk/install
                                  guest@porteus:~$ cp slack-desc imk/install/
                                  
                                  • Package

                                    Code: Select all

                                    guest@porteus:~$ cd imk
                                    guest@porteus:~/imk$ makepkg -l y -c n  ../imagemagick-6.8.9.8-1-i686.txz
                                    
                                    Slackware package maker, version 3.14159.
                                    
                                    Searching for symbolic links:
                                    usr/lib/libMagickWand-6.Q16HDRI.so -> libMagickWand-6.Q16HDRI.so.2.0.0
                                    usr/lib/libMagick++-6.Q16HDRI.so.5 -> libMagick++-6.Q16HDRI.so.5.0.0
                                    usr/lib/libMagick++-6.Q16HDRI.so -> libMagick++-6.Q16HDRI.so.5.0.0
                                    usr/lib/libMagickWand-6.Q16HDRI.so.2 -> libMagickWand-6.Q16HDRI.so.2.0.0
                                    usr/lib/libMagickCore-6.Q16HDRI.so -> libMagickCore-6.Q16HDRI.so.2.0.0
                                    usr/lib/libMagickCore-6.Q16HDRI.so.2 -> libMagickCore-6.Q16HDRI.so.2.0.0
                                    
                                    Making symbolic link creation script:
                                    ( cd usr/lib ; rm -rf libMagickWand-6.Q16HDRI.so )
                                    ( cd usr/lib ; ln -sf libMagickWand-6.Q16HDRI.so.2.0.0 libMagickWand-6.Q16HDRI.so )
                                    ( cd usr/lib ; rm -rf libMagick++-6.Q16HDRI.so.5 )
                                    ( cd usr/lib ; ln -sf libMagick++-6.Q16HDRI.so.5.0.0 libMagick++-6.Q16HDRI.so.5 )
                                    ( cd usr/lib ; rm -rf libMagick++-6.Q16HDRI.so )
                                    ( cd usr/lib ; ln -sf libMagick++-6.Q16HDRI.so.5.0.0 libMagick++-6.Q16HDRI.so )
                                    ( cd usr/lib ; rm -rf libMagickWand-6.Q16HDRI.so.2 )
                                    ( cd usr/lib ; ln -sf libMagickWand-6.Q16HDRI.so.2.0.0 libMagickWand-6.Q16HDRI.so.2 )
                                    ( cd usr/lib ; rm -rf libMagickCore-6.Q16HDRI.so )
                                    ( cd usr/lib ; ln -sf libMagickCore-6.Q16HDRI.so.2.0.0 libMagickCore-6.Q16HDRI.so )
                                    ( cd usr/lib ; rm -rf libMagickCore-6.Q16HDRI.so.2 )
                                    ( cd usr/lib ; ln -sf libMagickCore-6.Q16HDRI.so.2.0.0 libMagickCore-6.Q16HDRI.so.2 )
                                    
                                    Removing symbolic links:
                                    removed ‘./usr/lib/libMagickWand-6.Q16HDRI.so’
                                    removed ‘./usr/lib/libMagick++-6.Q16HDRI.so.5’
                                    removed ‘./usr/lib/libMagick++-6.Q16HDRI.so’
                                    removed ‘./usr/lib/libMagickWand-6.Q16HDRI.so.2’
                                    removed ‘./usr/lib/libMagickCore-6.Q16HDRI.so’
                                    removed ‘./usr/lib/libMagickCore-6.Q16HDRI.so.2’
                                    ...
                                    .MTREE
                                    .PKGINFO
                                    WARNING:  /usr/share/man (with possibly not gzipped man pages) detected
                                    
                                    Slackware package ../imagemagick-6.8.9.8-1-i686.txz created.
                                    
                                    • Package Name Validation

                                      Code: Select all

                                      guest@porteus:~/imk$ cd ..
                                      guest@porteus:~$ mkdir imd
                                      guest@porteus:~$ installpkg --root imd imagemagick-6.8.9.8-1-i686.txz 
                                      Verifying package imagemagick-6.8.9.8-1-i686.txz.
                                      Installing package imagemagick-6.8.9.8-1-i686.txz:
                                      PACKAGE DESCRIPTION:
                                      # imagemagick 6.8.9.8 An image viewing/manipulation program  
                                      #  
                                      # An image viewing/manipulation program  
                                      # 
                                      # Arch Linux Extra i686
                                      # 
                                      # i686
                                      # 
                                      # Arch Linux
                                      # 
                                      # ftp://ftp5.gwdg.de  
                                      Executing install script for imagemagick-6.8.9.8-1-i686.txz.
                                      Package imagemagick-6.8.9.8-1-i686.txz installed.
                                      
                                    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: 2564
                                    Joined: 25 Jun 2014, 15:21
                                    Distribution: 3.2.2 Cinnamon & KDE5
                                    Location: London

                                    Re: [HOWTO] (CLI) Slackware Package RPM/DEB, tar.xz, etc.

                                    Post#4 by Bogomips » 14 Dec 2014, 20:53

                                    Quick and dirty method with Arch :roll:

                                    Code: Select all

                                    guest@porteus:~$ mkdir wayd
                                    guest@porteus:~$ /sbin/installpkg -root wayd/ p10/Por/Nemo/wayland-1.6.0-1-i686.pkg.tar.xz 
                                    Cannot install p10/Por/Nemo/wayland-1.6.0-1-i686.pkg.tar.xz:  file does not end in .tgz, .tbz, .tlz, or .txz
                                    
                                    guest@porteus:~$ cp p10/Por/Nemo/wayland-1.6.0-1-i686.pkg.tar.xz .
                                    guest@porteus:~$ mv wayland-1.6.0-1-i686.pkg.tar.xz wayland-1.6.0-1-i686.pkg.txz
                                    
                                    guest@porteus:~$ /sbin/installpkg -root wayd/ wayland-1.6.0-1-i686.pkg.txz
                                    Verifying package wayland-1.6.0-1-i686.pkg.txz.
                                    Installing package wayland-1.6.0-1-i686.pkg.txz:
                                    PACKAGE DESCRIPTION:
                                    WARNING:  Package has not been created with 'makepkg'
                                    /sbin/ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
                                    Package wayland-1.6.0-1-i686.pkg.txz installed.
                                    
                                    Update (8/1/15)

                                    Package Name Format
                                    makepkg ../app-version-arch-tag.tgz

                                    (The dashes should appear as above, so if the version has a subversion like say "1.0 RC2" make sure you use 1.0_RC2 not 1.0-RC2. The arch should be something like "i486" for example. The tag should consist of the build number and your initals, e.g. 1zb for Zaphod Beeblebrox's first build, 2zb for his second build, etc. Official slackware packages have only numbers as tags.)
                                    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

                                    Post Reply