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 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? |
Quote:
Quote:
|
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. |
Quote:
|
Quote:
Quote:
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. |
Quote:
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? |
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.
|
Quote:
:) |
Quote:
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 |
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? 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: |
Quote:
Quote:
|
@crts
Quote:
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 |
Quote:
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:
Quote:
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. |
Quote:
|
Quote:
Code:
set -e Quote:
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 \ 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? |
All times are GMT -5. The time now is 02:31 AM. |