LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-27-2020, 06:16 AM   #1
burning
Member
 
Registered: Jan 2020
Location: Canada
Distribution: Slackware
Posts: 148

Rep: Reputation: Disabled
First time making a SlackBuild/building a package; Source doesn't have a /configure


So I'm trying to write a SlackBuild script for NsCDE using the file available here as a template. I already posted this to the thread here but I think that thread died and I figured this could potentially warrant it's own thread.

This is my first time attempting to write a SlackBuild script and the source didn't have a /configure file/dir so the whole section to do with setting configuration flags is basically moot, but as this is my first time trying to write one of these, I do worry that it significantly changes the process in ways I'm unfamiliar with so I am sure that I've made plenty of errors in this BASH script.

This is what I have so far:
Code:
#!/bin/sh -e

# Slackware build script for NsCDE

# last revised on: 2020/06/24



# NsCDE  Copyright (C) 2020 burning 
# ----------------------------------
All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.



PRGNAM=NsCDE
VERSION=${VERSION:-1.0rc21}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo} 

# Automatically determines the architecture being built on:
# ----------------------------------------------------------
if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=1586 ;;
    arm*) ARCH=arm ;;
    # Unless $ARCH is already set, use uname -m for all other archs:
       *) ARCH=$( uname -m ) ;;
  esac
fi

# Setting initial variables:
# ---------------------------

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}  #for consistency's sake, use this
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp} # Drop the package in /tmp
fi

if [ "$ARCH" = "i586" ]; then
  SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

set -e # Exit on most errors
# If you prefer to do selective error checking with
# command || exit 1
# Then that's also acceptable.

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

# Instructions from the INSTALL file
# -----------------------------------
umask 0022
cd /tmp
wget https://github.com/NsCDE/NsCDE/archive/1.0rc21.tar.gz
tar xpzf 1.0rc21.tar.gz
cd NsCDE-1.0rc21
./Installer.ksh -w -i
cd /usr/local/bin
ln -s /opt/NsCDE/bin/nscde


# Compile the application and install it into the $PKG directory
make || exit
make install DESTDIR=$PKG || exit

# Strip binaries and libraries - this can be done with 'make install-strip'
# in many source trees, and that's usually acceptable if so, but if not,
# use this:
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 2 -d : | xargs strip --strip-unneeded 2> /dev/null || true

# Compress man pages
# If the man pages are installed to /usr/share/man instead, you'll need to either
# add the --mandir=/usr/man flag to configure or move them manually after the
# make install process is run.
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done

# Compress info pages and remove the package's dir file
# if no info pages are installed by the software, don't leave this in the script
rm -f $PKG/usr/info/dir
gzip -9 $PKG/usr/info/*.info*

# Remove perllocal.pod and other special files that don't need to be installed,
# as they will overwrite what's already on the system. If this is not needed,
# remove it from the script.
# Remove 'special' files
find $PKG -name perllocal.pod \
  -o -name ".packlist" \
  -o -name "*.bs" \
  | xargs rm -f

# Copy program documentation into the package
# The included documentation varies from one application to another, so be sure
# To adjust your script as needed
# Also, include the SlackBuild script in the documentation directory
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
  <documentation> \
  $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

# Copy the slack-desc (and a custom doinst.sh if necessary) into ./install
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

# Make the package; be sure to leave it in $OUTPUT
# If package symlinks need to be created during install *before*
# your custom contetns of doinst.sh runs, then add the -p switch to
# the makepkg command below -- see makepkg(8) for details
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

For reference, I also got the instructions from the INSTALL file here

What would you say this SlackBuild script is missing? Or does it include any unnecessary parts? What, if anything did I do wrong here?

Last edited by burning; 06-28-2020 at 06:37 AM.
 
Old 06-27-2020, 06:43 AM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,920

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Quote:
Originally Posted by burning View Post
Code:
...
cd /tmp
wget https://github.com/NsCDE/NsCDE/archive/1.0rc21.tar.gz
tar xpzf 1.0rc21.tar.gz
cd NsCDE-1.0rc21
./Installer.ksh -w -i
cd /usr/local/bin
ln -s /opt/NsCDE/bin/nscde
...
I have not tried your Slackbuild but the bold part is likely to cause problems because this is the installation script provided by the author. It will install directly to the system and not in /tmp/SBO/ where it is expected to install when generating the final install-package. You need to examine Installer.ksh and see if the installation location can be configured. If yes, then configure it to install into "$PKG". If it cannot be configured then you will probably have to reproduce the steps from Installer.ksh in your own Slackbuild script.

Quote:
Originally Posted by burning View Post
Code:
...
# Compile the application and install it into the $PKG directory
make || exit
make install DESTDIR=$PKG || exit
...
You may not need those instructions, depending on whether Installer.ksh has a means of configuring the installation location or if you have to do it yourself. Some other commands may also be unnecessary but those are the ones that caught my eye first.
 
2 members found this post helpful.
Old 06-27-2020, 07:18 AM   #3
gouttegd
Member
 
Registered: Nov 2019
Location: London, UK
Distribution: Slackware
Posts: 34

Rep: Reputation: 60
You certainly did not choose the easiest project to write your first SlackBuild.

You must understand that the core principle of a SlackBuild is to install everything in a temporary directory (e.g. somewhere under /tmp), and then call makepkg to make a package out of that directory. This is sometimes called a “staged installation”, because you do not install the software directly at its final place on the filesystem.

Unfortunately, according to a quick look into the installer script provided with NsCDE, it does not appear to support staged installation. You can instruct it to install the program elsewhere than the default /opt/NsCDE (with the -p option), but then the program will expect to be run from whatever place you staged it, because at some point during the installation the script bakes the destination directory into the program’s startup script (see lines 253 and 254 of the installer). You will need to patch either the installer script or the installed files to fix that and allow the program to be run from its final place after the package is installed.

I would advise against trying to package that project immediately. Instead, first try to install it somewhere under your own home directory (as a normal user), then inspect the installed files. That should give you an idea of what you will later need to do to build a proper package.
 
3 members found this post helpful.
Old 06-28-2020, 06:57 AM   #4
burning
Member
 
Registered: Jan 2020
Location: Canada
Distribution: Slackware
Posts: 148

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gouttegd View Post
You certainly did not choose the easiest project to write your first SlackBuild.

You must understand that the core principle of a SlackBuild is to install everything in a temporary directory (e.g. somewhere under /tmp), and then call makepkg to make a package out of that directory. This is sometimes called a “staged installation”, because you do not install the software directly at its final place on the filesystem.

Unfortunately, according to a quick look into the installer script provided with NsCDE, it does not appear to support staged installation. You can instruct it to install the program elsewhere than the default /opt/NsCDE (with the -p option), but then the program will expect to be run from whatever place you staged it, because at some point during the installation the script bakes the destination directory into the program’s startup script (see lines 253 and 254 of the installer). You will need to patch either the installer script or the installed files to fix that and allow the program to be run from its final place after the package is installed.

I would advise against trying to package that project immediately. Instead, first try to install it somewhere under your own home directory (as a normal user), then inspect the installed files. That should give you an idea of what you will later need to do to build a proper package.
Thanks. Considering I'm new to BASH scripting in general and I don't have much experience with the Korn shell either, any further advice on how I should tackle this problem? And Would I need to patch all the file destinations in the installer.ksh script to install it in my HOME directory?

Last edited by burning; 06-28-2020 at 07:01 AM.
 
Old 06-28-2020, 07:30 AM   #5
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,920

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Quote:
Originally Posted by burning View Post
Thanks. Considering I'm new to BASH scripting in general and I don't have much experience with the Korn shell either, any further advice on how I should tackle this problem?
I do not mean to be rude, but maybe learn Bash better and get familiar with compiling software. The project you have chosen is far from trivial and should not be done by a beginner. In addition to providing patches that correct the installation location you also need to figure out the dependencies that this program needs.

Quote:
Originally Posted by burning View Post
And Would I need to patch all the file destinations in the installer.ksh script to install it in my HOME directory?
In order to answer this one would need to get familiar with the installer himself. There is no general advice that can be given. And if someone familiarizes himself with the project so he can answer that question it would make more sense for him to build the Slackbuild.

So my advice at this point would be to try and build an easier project, study other slackbuild scripts and try to understand what they are doing.
 
4 members found this post helpful.
Old 06-28-2020, 08:29 AM   #6
burning
Member
 
Registered: Jan 2020
Location: Canada
Distribution: Slackware
Posts: 148

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by crts View Post
I do not mean to be rude, but maybe learn Bash better and get familiar with compiling software. The project you have chosen is far from trivial and should not be done by a beginner. In addition to providing patches that correct the installation location you also need to figure out the dependencies that this program needs.



In order to answer this one would need to get familiar with the installer himself. There is no general advice that can be given. And if someone familiarizes himself with the project so he can answer that question it would make more sense for him to build the Slackbuild.

So my advice at this point would be to try and build an easier project, study other slackbuild scripts and try to understand what they are doing.
No offense taken
That's good advice.
The dependencies are listed already in the INSTALL file though, so that wouldn't have been too much of a problem I don't think. I just wanted to use this Desktop Environment before I installed other things and worked on those respective slackbuilds. Ironically I think the other applications I want to install would probably be easier to build packages for. Would you say it'd be ok for me to install NsCDE using the Installer.ksh script included in the meantime and just running it like that until I get a better grasp on BASH and KORN shell scripting?
Though it's harder to remove a DE if it's not a package isn't it? How'd I go about doing that actually, any idea? If I installed NsCDE using the installer.ksh, what'd I have to do to remove all of it before I build the package in future?
 
Old 06-28-2020, 08:59 AM   #7
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,920

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
It should be OK to install it (DISCLAIMER: I have not installed that package myself so I do not know if it is well crafted by the author). The "Installer.ksh" script provides a deinstallation function. You can call it with "./Installer.ksh -d" or "./Installer.ksh -n -d" for non-interactive mode. If you use the default locations during installation then it will *probably* be fine. But bugs can always happen, of course.

Last edited by crts; 06-28-2020 at 09:00 AM.
 
1 members found this post helpful.
Old 06-28-2020, 01:30 PM   #8
burning
Member
 
Registered: Jan 2020
Location: Canada
Distribution: Slackware
Posts: 148

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by crts View Post
It should be OK to install it (DISCLAIMER: I have not installed that package myself so I do not know if it is well crafted by the author). The "Installer.ksh" script provides a deinstallation function. You can call it with "./Installer.ksh -d" or "./Installer.ksh -n -d" for non-interactive mode. If you use the default locations during installation then it will *probably* be fine. But bugs can always happen, of course.
Thanks, I'll keep that in mind.
 
Old 06-28-2020, 03:06 PM   #9
gouttegd
Member
 
Registered: Nov 2019
Location: London, UK
Distribution: Slackware
Posts: 34

Rep: Reputation: 60
Quote:
Originally Posted by burning View Post
any further advice on how I should tackle this problem?
Firstly, I second crts’ advice to try to “make your teeth” on a simpler project, or at least a project that uses a well-known build system (be it the autotools, CMake, Waf, Meson, etc.) instead of that custom “installer.ksh” script.

Second, to package that particular project, I would suggest to try to package it “manually” first. That is, do not go head-first into writing a SlackBuild. Install the project into a staging tree, then call makepkg to build a package out of it. Once you will have figured out how to do that on the command line, you can then focus on how to automatize the job in a script.

According to the inline help of the Installer.ksh script, a command such as the following should install the software in /tmp/build/opt/NsOCDE:

Code:
./Installer.ksh -n -p /tmp/build/opt/NsOCDE -i
If it works, you can then go to the /tmp/build directory and start trying to make a package (by calling makepkg(8)). It probably wouldn’t be a “proper” package at first, but it does not matter: you are not trying to build the perfect package, you are learning.
 
1 members found this post helpful.
Old 07-02-2020, 08:13 AM   #10
burning
Member
 
Registered: Jan 2020
Location: Canada
Distribution: Slackware
Posts: 148

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gouttegd View Post
Firstly, I second crts’ advice to try to “make your teeth” on a simpler project, or at least a project that uses a well-known build system (be it the autotools, CMake, Waf, Meson, etc.) instead of that custom “installer.ksh” script.

Second, to package that particular project, I would suggest to try to package it “manually” first. That is, do not go head-first into writing a SlackBuild. Install the project into a staging tree, then call makepkg to build a package out of it. Once you will have figured out how to do that on the command line, you can then focus on how to automatize the job in a script.

According to the inline help of the Installer.ksh script, a command such as the following should install the software in /tmp/build/opt/NsOCDE:

Code:
./Installer.ksh -n -p /tmp/build/opt/NsOCDE -i
If it works, you can then go to the /tmp/build directory and start trying to make a package (by calling makepkg(8)). It probably wouldn’t be a “proper” package at first, but it does not matter: you are not trying to build the perfect package, you are learning.
Thanks! Do you know any resources or guides that could help me in understanding how to install it in a staging tree and building packages that way?

Also, do you know how I'd go about installing the korn shell seeing as there doesn't seem to be a slackbuild for it? Would I need to build my own package for it? (The install.txt says that the MIRBSD Korn shell won't work)

The other dependencies are listed:
Code:
software used by NsCDE is:

     *  Korn Shell 93. All shell script routines inside configuration, helper
       scripts and FvwmScript helpers are written with ksh. It is not sure if
       pdksh can be drop in replacement, but in tests on Arch Linux with mksh
       it became clear that mksh cannot replace Korn Shell. Korn Shell is
       available and it is free.

     *  Xorg utils (Fedora/CentOS RPM xorg-x11-utils) - xdpyinfo, xprop ...

     *  Util xdotool - only if FVWM is not patched with WindowName patch for
       the FvwmButtons

     *  ImageMagick - really needed.

     *  Xscreensaver - optional, but Screen Style Manager will not work
       without it. Something needs to be installed for locking the screen.

     *  cpp - C preprocessor for xrdb functionality - for X resources
       integration. Used by xrdb(1).

     *  xorg-x11-server-utils (CentOS, Fedora name) - xrdb, xset, xrefresh
       mandatory for startup, some style managers and menus.

     *  python-yaml - needed for python part of the color theme management
       and for Gtk+Qt integration.

     *  PyQt4, PyQt5 or possibly python3-qt4, python-qt5 or python3-qt5 or ...
       This is unfortunate dependency which is further dependent on Qt
       libraries. NsCDE tries to have as less as possible dependencies,
       specially indirect (dependencies of dependent dependencies of
       dependencies ...). Gtk/Qt integration is borrowed from CDEtheme
       Motif/CDE theme project and adapted for use with FVWM (instead of
       heavy Xfce dependency) or standalone engine. In part of the Theme.py
       code, some png pixmaps are cut and colored with functions from this
       API. With present job and lack of time, there was no time to do this
       without PyQt5 or PyQt4 for the first public release.

     *  Gtk2, Gtk3, Qt4, Qt5, qtconfig-qt4, qt5ct, qt5-qtstyleplugins
       (optional) There is a great chance this libraries and some usefull
       programs using them are already installed on user's system. If Gtk and
       Qt integration is activated in [70]Color Style Manager, there is no
       point not to have it installed.

         Notice about Qt4 and Qt5: qt4-config (or qt-config) and qt5ct:
       Although colors will be applied, for font setting to take effect,
       qtconfig-qt4 (or qtconfig) must be run, something changed back and
       forth, and then applied/saved - no matter that you will see fonts of
       your choice already selected. This can be considered a bug. Same goes
       for Qt5.

         Notice about Qt5: QT_QPA_PLATFORMTHEME environment variable must be
       set, and be set to qt5ct value in order to run qt5ct configurator.

     *  Recommended fonts for as close as possible CDE look are DejaVu Serif
       for variable, and DejaVu Sans Mono for monospaced fonts. Check should
       be made if this fonts are installed on the system. For Solaris CDE
       look, Lucida Sans and monospaced Lucida Sans Typewriter should be
       installed, selected and used instead. (optional)

     *  Open Motif 2 libraries for some programs, although it is not used in
       any part of the NsCDE. (optional)

     *  Stalonetray for "tray" facility (optional)

     *  XSETTINGS xsettingsd daemon for theme and X settings dynamic
        management (optional)

     *  xterm

     *  python3 (FVWM)

     *  python34-pyxdg or python3-pyxdg or python36-pyxdg or ... (FVWM)

     *  libstroke (FVWM)

     *  perl-File-MimeInfo (on some platforms and some fvwm packages)
Do you know where I can get the xorg utils? Or any of the other dependencies that there aren't any slackbuilds for? My understanding was that in order to install something that can be updated along with everything else when updating your system in Slackware, you have to make a slackbuild for it and package it. As far as I know, the only packages available are slackbuilds but I fear I've misunderstood somewhere.

Last edited by burning; 07-02-2020 at 08:37 AM.
 
Old 07-02-2020, 09:23 AM   #11
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 1,029

Rep: Reputation: Disabled
Quote:
Originally Posted by burning View Post
(The install.txt says that the MIRBSD Korn shell won't work)
...
  • Korn Shell 93. All shell script routines inside configuration, helper scripts and FvwmScript helpers are written with ksh. It is not sure if pdksh can be drop in replacement, but in tests on Arch Linux with mksh it became clear that mksh cannot replace Korn Shell. Korn Shell is available and it is free.
Now I wonder if they also tried lksh that comes with mksh?

Quote:
Originally Posted by burning View Post
Do you know where I can get the xorg utils?
I think they all packaged separately by Slackware, i.e. you'll need to install xdpyinfo, xprop, etc.

Last edited by shruggy; 07-02-2020 at 02:47 PM.
 
1 members found this post helpful.
Old 07-02-2020, 01:03 PM   #12
captain_sensible
Member
 
Registered: Apr 2010
Posts: 240

Rep: Reputation: 68
@crts
Quote:
I do not mean to be rude, but maybe learn Bash better and get familiar with compiling software
I think that's a very fair point and alludes to the concept that elements such as :

The approach to a problem
Your objective
Your character in wanting to run before you can walk
Knowing your level

all have a influence ....



For those starting at the bottom with slackbuilds i wrote this:

https://docs.slackware.com/howtos:mi...f_a_slackbuild
 
1 members found this post helpful.
Old 07-02-2020, 02:30 PM   #13
gouttegd
Member
 
Registered: Nov 2019
Location: London, UK
Distribution: Slackware
Posts: 34

Rep: Reputation: 60
Quote:
Originally Posted by burning View Post
Do you know any resources or guides that could help me in understanding how to install it in a staging tree and building packages that way?
To install this package into a staging tree, your best (only, actually) friend is the Installer.ksh script (both its inline help, and the actual code for any question the inline help does not answer—as I’ve said, you have not chosen the easiest project to package; most other projects use well-known build systems for which there is no lack of documentation, but the developers of NsCDE seem to suffer from Not-Invented-Here syndrome).

Once you have a staging tree, no matter how you get there, you are now in an easier territory because the project’s build system is not important anymore. All you have left to do is to learn how to use makepkg, which should not be difficult. Read its man page and experiment.

Quote:
Also, do you know how I'd go about installing the korn shell seeing as there doesn't seem to be a slackbuild for it?
Why would you need a SlackBuild since the Korn shell is already part of Slackware? Just install the ap/ksh93 package.

Quote:
Do you know where I can get the xorg utils? Or any of the other dependencies that there aren't any slackbuilds for?
Most of these dependencies (including the xorg utils) are already part of Slackware or have SlackBuilds on SBo.

The Korn shell, the various Xorg tools, ImageMagick, PyQt4 (even PyQt5 if you are on -current) are all provided by Slackware. xdotool, python-yaml, python-xdg (and Python3, if you are not on -current) all have SlackBuilds on SBo.

From what I can see, you will only be missing "libstroke" and "perl-File-MimeInfo", for which you will indeed have to write your own SlackBuilds.
 
1 members found this post helpful.
Old 07-03-2020, 06:24 AM   #14
burning
Member
 
Registered: Jan 2020
Location: Canada
Distribution: Slackware
Posts: 148

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by gouttegd View Post
To install this package into a staging tree, your best (only, actually) friend is the Installer.ksh script (both its inline help, and the actual code for any question the inline help does not answer—as I’ve said, you have not chosen the easiest project to package; most other projects use well-known build systems for which there is no lack of documentation, but the developers of NsCDE seem to suffer from Not-Invented-Here syndrome).

Once you have a staging tree, no matter how you get there, you are now in an easier territory because the project’s build system is not important anymore. All you have left to do is to learn how to use makepkg, which should not be difficult. Read its man page and experiment.


Why would you need a SlackBuild since the Korn shell is already part of Slackware? Just install the ap/ksh93 package.


Most of these dependencies (including the xorg utils) are already part of Slackware or have SlackBuilds on SBo.

The Korn shell, the various Xorg tools, ImageMagick, PyQt4 (even PyQt5 if you are on -current) are all provided by Slackware. xdotool, python-yaml, python-xdg (and Python3, if you are not on -current) all have SlackBuilds on SBo.

From what I can see, you will only be missing "libstroke" and "perl-File-MimeInfo", for which you will indeed have to write your own SlackBuilds.
Ah, thank you. I had no idea most were already included in Slackware. I suppose I'll try writing a SlackBuild for libstroke as my first SlackBuild then, seeing as I don't think I'd need to make one for the perl module. I'd assume I can just install that by doing cpan <module name>.

Last edited by burning; 07-03-2020 at 06:31 AM.
 
Old 07-03-2020, 04:58 PM   #15
burning
Member
 
Registered: Jan 2020
Location: Canada
Distribution: Slackware
Posts: 148

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by captain_sensible View Post
@crts I think that's a very fair point and alludes to the concept that elements such as :

The approach to a problem
Your objective
Your character in wanting to run before you can walk
Knowing your level

all have a influence ....



For those starting at the bottom with slackbuilds i wrote this:

https://docs.slackware.com/howtos:mi...f_a_slackbuild
Thanks for the link, it's really helpful so far in helping me understand the SlackBuild process. Though I do have a few questions just to make sure I understand a few things.

Code:
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
In this bit, where it says "mkdir -p $TMP $PKG $OUTPUT", because $OUTPUT is /tmp , is it creating a /tmp dir if one is not already present? I thought /tmp was part of the default file structure, I wouldn't have thought it wouldn't already be there?

Quote:
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz : This equated to unpacking of latex2html-2019.2.tar.gz , which would be inside the unpacked slackbuild from slackbuilds.org namely “latex2html”.
This confused me a little, I thought you were explaining the process of making your own slackbuild? Or does this only refer to if you're working with a prebuilt slackbuild from SlackBuilds.org?

And do you think you could explain the "chown -R root:root ." command in a bit more detail? what exactly is the colon and the period a space after the 2nd "root" doing here?

Code:
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
Could you explain this in a bit more detail? You're trying to find the Package...and "separate what it finds with NULL"? What does that mean exactly? And why is it important to do that? I basically don't understand everything in that block of code past "find $PKG " and I take it you're looking for the terms "executable" and "shared object" and "ELF"? Could you explain why?

And final question, though it's slightly unrelated to the above. When installing a perl module, I'd assume it'd be as easy as just running cpan and then installing the module by name, but I see there is a Perl SlackBuild template available here. I was wondering if this is to be used for installing perl related modules or applications and if it'd be recommended to build a SlackBuild for something like perl-File-MimeInfo or if it could just easily be installed through cpan?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No package 'x11' found No package 'xext' found No package 'xdamage' found No package 'xfixes' found No package 'x11-xcb' found Jigsaw Linux From Scratch 12 04-25-2019 07:33 AM
help with building codeblocks package using SlackBuild darkflow Slackware 8 05-31-2014 05:47 AM
[SOLVED] Error when building texlive package from SlackBuild site mariner53 Slackware 4 08-09-2013 06:50 PM
[SOLVED] Building linux-firmware package with Pat's slackbuild script Phorize Slackware 8 10-05-2011 05:54 AM
[SOLVED] ORBit2 Slackbuild fails when building 32 bit package on current multilib damgar Slackware 4 04-10-2010 02:26 PM

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

All times are GMT -5. The time now is 07:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration