[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
howtos:misc:anatomy_of_a_slackbuild [2019/12/17 16:23 (UTC)] – [Anatomy Of a Slackbuild] captain_sensible | howtos:misc:anatomy_of_a_slackbuild [2020/01/05 16:36 (UTC)] – [Anatomy Of a Slackbuild] captain_sensible | ||
---|---|---|---|
Line 19: | Line 19: | ||
That way we are talking about a contemporary working SlackBuild script that you can actually download, use and hopefully relate to after reading this. | That way we are talking about a contemporary working SlackBuild script that you can actually download, use and hopefully relate to after reading this. | ||
+ | The other thing to mention is that the **context** of this page, when you read it, regarding a latex2html script is that a whole " | ||
+ | |||
+ | Also that you have kick started the script : | ||
+ | |||
+ | < | ||
+ | bash-5.0# chmod a+x latex2html.SlackBuild | ||
+ | bash-5.0# ./ | ||
+ | |||
+ | </ | ||
== Bash == | == Bash == | ||
Line 145: | Line 154: | ||
</ | </ | ||
- | Before we go into this let me have a look in my slackware file system and see whats there at / | + | Before we go into this let me have a look in my slackware file system and see whats there at / |
TMP is going to be set to /tmp/SBo. | TMP is going to be set to /tmp/SBo. | ||
Line 182: | Line 191: | ||
Historically computer software is installed | Historically computer software is installed | ||
- | You can from the command line install software just using configure, make and make install. A slackbuild does the job of creating a package so that the process of installing is more manageable.Computer program source | + | You can from the command line install software just using configure, make and make install. A slackbuild does the job of creating a package so that the process of installing is more manageable |
+ | |||
+ | |||
+ | Computer program source | ||
The whole goal of any system | The whole goal of any system | ||
Line 191: | Line 203: | ||
CFLAGS and CXXFLAGS are variables holding values that can be passed in at compile time. We will see later that the variable SLKFLAGS will be used to set them. | CFLAGS and CXXFLAGS are variables holding values that can be passed in at compile time. We will see later that the variable SLKFLAGS will be used to set them. | ||
+ | Next block of code: | ||
+ | < | ||
+ | set -e | ||
+ | rm -rf $PKG | ||
+ | mkdir -p $TMP $PKG $OUTPUT | ||
+ | cd $TMP | ||
+ | rm -rf $PRGNAM-$VERSION | ||
+ | tar xvf $CWD/ | ||
+ | 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 {} \; | ||
+ | </ | ||
+ | set -e: this stops the execution of the script if there is an error executing this code following this command \\ | ||
+ | rm -rf $PKG: this deletes any previous directory (and contents) | ||
+ | mkdir -p $TMP $PKG $OUTPUT :mkdir with the " -p " flag creates | ||
+ | |||
+ | that would be /tmp/SBo , / | ||
+ | |||
+ | |||
+ | Its unlikely that the SBo directory doesn' | ||
+ | cd $tmp : moves location where bash is working from to /tmp/SBo \\ | ||
+ | |||
+ | rm -rf $PRGNAM-$VERSION will get rid of any previous directory entries(maybe failed) | ||
+ | |||
+ | tar xvf $CWD/ | ||
+ | |||
+ | cd $PRGNAM-$VERSION : This is a " | ||
+ | |||
+ | chown -R root:root . : Notice the dot , with a space at the end of the line; this means all in current directory. -R is permission recursive. So here we are giving ownership to root and group 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 {} \; | ||
+ | </ | ||
+ | |||
+ | If i understand the above block of code correctly its using the " | ||
+ | < | ||
+ | -type d -exec chmod 775 {} | ||
+ | </ | ||
+ | |||
+ | For directories | ||
+ | < | ||
+ | -type f -exec chmod 644 {} | ||
+ | |||
+ | </ | ||
+ | For files. | ||
+ | Next block of code: | ||
+ | < | ||
+ | CFLAGS=" | ||
+ | CXXFLAGS=" | ||
+ | ./configure \ | ||
+ | --prefix=/ | ||
+ | --libdir=/ | ||
+ | --sysconfdir=/ | ||
+ | --localstatedir=/ | ||
+ | | ||
+ | --enable-eps \ | ||
+ | --enable-gif \ | ||
+ | --enable-png \ | ||
+ | --build=$ARCH-slackware-linux \ | ||
+ | --host=$ARCH-slackware-linux | ||
+ | |||
+ | make | ||
+ | make install DESTDIR=$PKG | ||
+ | </ | ||
+ | |||
+ | A couple of things to say here , the use of " | ||
+ | |||
+ | In this latex2html slackbuild script we also utilize a three step process of configure, make, make install. | ||
+ | But what about the likes of --enable-eps , where does that come from ? | ||
+ | |||
+ | Well if you take the source code [[https:// | ||
+ | |||
+ | |||
+ | < | ||
+ | ./configure --help | ||
+ | </ | ||
+ | |||
+ | Then you will get some useful information from the developers. It tells you the option and how you can enable some of them. | ||
+ | |||
+ | < | ||
+ | make | ||
+ | make install DESTDIR=$PKG | ||
+ | </ | ||
+ | |||
+ | Here, make, make install are carried out.Note DESTDIR is a flag to say where the package will go. \\ | ||
+ | $PKG equates to / | ||
+ | |||
+ | Next Block of code:\\ | ||
+ | |||
+ | < | ||
+ | |||
+ | find $PKG -print0 | xargs -0 file | grep -e " | ||
+ | | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true | ||
+ | |||
+ | mkdir -p $PKG/ | ||
+ | cp -a \ | ||
+ | FAQ INSTALL LICENSE MANIFEST README.md TODO \ | ||
+ | $PKG/ | ||
+ | cat $CWD/ | ||
+ | cp $CWD/ | ||
+ | |||
+ | mkdir -p $PKG/ | ||
+ | cat $CWD/ | ||
+ | |||
+ | cd $PKG | ||
+ | / | ||
+ | |||
+ | </ | ||
+ | |||
+ | The first two lines of this block are a bit of a mouth-full: | ||
+ | < | ||
+ | find $PKG -print0 | xargs -0 file | grep -e " | ||
+ | | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true | ||
+ | </ | ||
+ | |||
+ | We can however pick out key words that are commands and that can help to make some sense of it. | ||
+ | ind" located at / | ||
+ | |||
+ | The " | ||
+ | |||
+ | To give a succinct answer the two lines are removing debugging symbols and other unnecessary stuff to make the binaries smaller, faster and take up less memory. | ||
+ | |||
+ | < | ||
+ | mkdir -p $PKG/ | ||
+ | </ | ||
+ | |||
+ | Here we are preparing a directory which will be called " | ||
+ | The next lines put files such as README.md into the / | ||
+ | |||
+ | < | ||
+ | cat $CWD/ | ||
+ | </ | ||
+ | |||
+ | That line goes back to the original directory that Latex2html.SlackBuild was run from ( i previously quoted Desktop) opens up the SlackBuild with " | ||
+ | Now before I submitted latex2html to slackbuilds obviously I did some testing and found that when the package was installed it had a fairly comprehensive output of what it could do just using: | ||
+ | |||
+ | < | ||
+ | $ latex2html --help | ||
+ | </ | ||
+ | |||
+ | Also I had access to a comprehensive manual in pdf format; so in my case I did not write code for man pages. Instead I simply put a copy of " | ||
+ | |||
+ | |||
+ | --- // | ||
+ | |||
+ | //If you teach maths it doesn' | ||
+ | |||
- | \\ | ||
- | --- // | ||
====== Sources ====== | ====== Sources ====== | ||
Line 202: | Line 366: | ||
<!-- * Original source: [[http:// | <!-- * Original source: [[http:// | ||
- | I am using a SlackBuild script that i submitted to slackbuilds.org: | + | I am using a SlackBuild script that i submitted to slackbuilds.org: |
<!-- Authors are allowed to give credit to themselves! --> | <!-- Authors are allowed to give credit to themselves! --> | ||
* Originally written by [[wiki: | * Originally written by [[wiki: |