LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   building slackware packages: optimum file structure (https://www.linuxquestions.org/questions/slackware-14/building-slackware-packages-optimum-file-structure-4175462555/)

psionl0 05-19-2013 10:50 AM

Quote:

Originally Posted by textillis (Post 4954260)
I'm trying to work out why I can't make the following an executable:

i give the commmand: chmod +* <*.SlackBuild>

and it returns no error message, but then when I check the directory, I see no yellow, nor any * marking the file as executable.

It might be and xterm setting problem.

Try ls -l to see the attributes of each file.

Didier Spaier 05-19-2013 11:20 AM

I don't know what "chmod +* <*.SlackBuild>" could mean. To make a file executable type either "chmod +x <*.SlackBuild>" or "chmod 755 <*.SlackBuild>"

EDIT. Maybe you meant chmod +rwxXst. That would be an overkill, doesn't make sense to set both x and X bits in the same command, and s and t are not needed.

textillis 05-20-2013 07:08 AM

Quote:

Originally Posted by Didier Spaier (Post 4954305)
I don't know what "chmod +* <*.SlackBuild>" could mean. To make a file executable type either "chmod +x <*.SlackBuild>" or "chmod 755 <*.SlackBuild>"

EDIT. Maybe you meant chmod +rwxXst. That would be an overkill, doesn't make sense to set both x and X bits in the same command, and s and t are not needed.

Merci beaucoup pour l'explication; c'est gentil de vous m'avoir repondu.

(I love French but can't get accents on my keyboard, not yet at least)

cheers Didier,
Tex

irgunII 05-20-2013 08:31 AM

1 Attachment(s)
I do my builds completely in an single krusader instance (I hate Dolphin! Been using krusader at least 5 or 6 years minimum).

I have a dir for the 'building' of packages, a dir for keeping the 'built_srcs' (a holdover thing from when I was stuck with dialup only, not necessary really with anything faster), and a dir for the finished/built packages called 'installed'.

I open up the konsole from the bottom-half of krusader and 'su -' to get to root control there.

I download the build package to my 'build' dir and in krusader I right-click on it to extract the tarball in that dir (I've bad carpal tunnel so I cannot touch-type and being a two-finger typist it's way, way too slow looking up and down from keyboard to monitor just to type 'tar -xvf' etc when it's just as fast and easy for me with the mouse and krusader).

I now have a dir with all the components needed for the build of a particular package. Download the source tarball into the extracted dir in 'build'.

Click on the extracted package dir and in krusader the konsole prompt automatically follows the working directory.

Do 'ls' and then type in konsole './package_name' and let it build.

When it's done, I have /tmp/package_name.txz ready to install. I simply double-click on the '/tmp/package_name.txz to highlight it to klipper, type in 'installpkg then click to paste, hit enter and it's installed.

Next, I simply type in 'mv (click to paste again) /home/me/installed' and all my built packages are in one single dir on my home partition where I own them and don't have to become root to do anything with them - other than install them again if need be.

This is my way that I learned to do through experimenting and which I've stuck with now for over a year or so (I've only been using Slackware for a year plus, used to be a SuSE user for 11 or so years). It's fast (for me, heh), simple (again, for me), and is easy to backup to a bd-r to have in an emergency. Hopefully this is something you were also hoping to see/read/try and not just a waste of everyone's time.

textillis 05-20-2013 09:11 AM

Irgun, this is most excellent and I thank you very much.
As it happens, I am not a fan of KDE and don't have it on my install of Slack.
However, I am very new to all this, so, just to let you know:
I am so desperate to "get a leg up" as far as configuring my system is concerned (and, at the core of that, finding a way I can safely build up some favorite programs that don't come with slack, like Geogebra, for instance) that I am considering geting KDE back and having a play along the lines you suggest.

Whatever the outcome, please know that your post was in no way "a waste of [my] time"

cheers,
Tex
PS very cool setup

Quote:

Originally Posted by irgunII (Post 4954898)
I do my builds completely in an single krusader instance (I hate Dolphin! Been using krusader at least 5 or 6 years minimum).

I have a dir for the 'building' of packages, a dir for keeping the 'built_srcs' (a holdover thing from when I was stuck with dialup only, not necessary really with anything faster), and a dir for the finished/built packages called 'installed'.

I open up the konsole from the bottom-half of krusader and 'su -' to get to root control there.

I download the build package to my 'build' dir and in krusader I right-click on it to extract the tarball in that dir (I've bad carpal tunnel so I cannot touch-type and being a two-finger typist it's way, way too slow looking up and down from keyboard to monitor just to type 'tar -xvf' etc when it's just as fast and easy for me with the mouse and krusader).

I now have a dir with all the components needed for the build of a particular package. Download the source tarball into the extracted dir in 'build'.

Click on the extracted package dir and in krusader the konsole prompt automatically follows the working directory.

Do 'ls' and then type in konsole './package_name' and let it build.

When it's done, I have /tmp/package_name.txz ready to install. I simply double-click on the '/tmp/package_name.txz to highlight it to klipper, type in 'installpkg then click to paste, hit enter and it's installed.

Next, I simply type in 'mv (click to paste again) /home/me/installed' and all my built packages are in one single dir on my home partition where I own them and don't have to become root to do anything with them - other than install them again if need be.

This is my way that I learned to do through experimenting and which I've stuck with now for over a year or so (I've only been using Slackware for a year plus, used to be a SuSE user for 11 or so years). It's fast (for me, heh), simple (again, for me), and is easy to backup to a bd-r to have in an emergency. Hopefully this is something you were also hoping to see/read/try and not just a waste of everyone's time.


Didier Spaier 05-20-2013 09:21 AM

You are welcome, Tex.

Quote:

Originally Posted by textillis (Post 4954835)
(I love French but can't get accents on my keyboard, not yet at least)Tex

Yes you can!

In fact you can even type every character you want on your keyoard.

You just have to:
(1) know the UTF-8 code of the character you want to reproduce (four hexadecimal digits)
(2) type and hold together Ctrl+Shift+u => this will output an underlined "u", telling you that your keyboard just entered in UTF-8 mode
(3) release these three keys
(4) type the four hexadecimal digits
(5) press Enter

Let's take an example. On this page I see that the UTF-8 code for the Euro symbol is "20ac" so if you type Ctrl+Shift+u (release the keys) 20ac [Enter] you get: €

Tip: if you type in your Slackware system:
Code:

  cat /usr/share/i18n/charmaps/UTF-8.gz|gunzip|less
you will see a list of characters with their UTF-8 encoding (left column) and their name (right column).

You can navigate in the list with the down and up arrows, just type "q" to quit when you are done.

chess 05-20-2013 09:31 AM

I'll also throw in a suggestion of installing slackware into a chroot and then building your packages in the chroot to prevent stuff getting polluted in your main environment. I have done this for years and it has served me well.

textillis 05-20-2013 09:45 AM

Quote:

Originally Posted by chess (Post 4954939)
I'll also thrown in a suggestion of installing slackware into a chroot and then building your packages in the chroot to prevent stuff getting polluted in your main environment. I have done this for years and it has served me well.

Thanks Chess.
I'm filing away all these suggestions so as to open them up and look into them 2mro and in coming days.
Just had a quick read of man chroot; seems like the way to go.

cheers,
Tex

tronayne 05-20-2013 10:34 AM

OK, here's a monkey wrench in the works...

I long ago developed rules for file systems, mostly based upon AT&T Unix System V Release 3 supplemented by Release 4 (SVR4 is the usual abbreviation for that).

Yes, I am well aware that Linux is Not Unix (as in GNU is Not Unix) but Slackware, in particular, is sorta-kinda the most like SVR4 of the Linux distributions and I have, for some 12+ years (don't remember exactly) set up my mounted file systems like this:
  • root 10-20 G (used to be 10, now 20 looks better)
  • /home 20 G
  • /usr/local 20 G
  • /opt 20 G
  • /var/lib/psql 150 G (that's a little overkill)
  • /var/lib/mysql 50 G (so's that)
  • /var/lib/virtual 100 G
  • /spares 100 G
Now, those are all mounted file systems on one or more drives and, of course, you may or may not need a large PostgreSQL partition or a largish MySQL partition bu I do.

/usr/local looks like this:
Code:

tree -L 1 /usr/local
/usr/local
|-- bin
|-- cvsroot
|-- doc
|-- etc
|-- games
|-- include
|-- info
|-- lib
|-- lib64
|-- lost+found
|-- man
|-- openils
|-- opt
|-- packages
|-- patches
|-- sbin
|-- share
|-- src
|-- tmp
|-- usr
`-- var

Look familiar? Ought to: it's a duplicate of the system tree (mostly).

When I build software, be it SlackBuilds, non-SlackBuild source or whatever, it gets built in /usr/local/packages/src; e.g.,
Code:

tree -L 1 /usr/local/packages/src
/usr/local/packages/src
|-- Evergreen
|-- GMT
|-- KDevelop
|-- Misc
|-- Opensrf
|-- Python
|-- academic
|-- ap
|-- audio
|-- database
|-- development
|-- games
|-- gimp-help-2
|-- graphics
|-- hdf5
|-- hplip
|-- hplip-3.12.10a
|-- hplip-3.12.11
|-- hplip-3.13.2
|-- hplip-3.13.3
|-- hplip-3.13.4
|-- index.html
|-- java
|-- jdk
|-- jdk.old
|-- jre
|-- koha-3.10.03
|-- libraries
|-- lifelines
|-- multimedia
|-- netcdf
|-- network
|-- office
|-- openjava
|-- phoronix
|-- system
|-- xap
`-- zoom

Most of those directory names are the sections of SlackBuilds; e.g.,
Code:

tree -L 1 /usr/local/packages/src/libraries
/usr/local/packages/src/libraries
|-- FreeImage
|-- GConf
|-- GeoIP
|-- GraphicsMagick
|-- ORBit2
|-- atkmm
|-- atlas
|-- blas
|-- cairomm
|-- ctemplate
|-- eigen3
|-- exempi
|-- ftgl
|-- gdal
|-- geos
|-- gl2ps
|-- glibmm
|-- gsl
|-- gtkmm
|-- idzebra
|-- lapack
|-- libbonobo
|-- libdvdcss
|-- libdvdnav
|-- libevent
|-- libglademm
|-- libgnome
|-- libgsasl
|-- libircclient
|-- libmemcached
|-- libsigc++
|-- libtxc_dxtn
|-- libv4l
|-- muParser
|-- pangomm
|-- paramiko
|-- pexpect
|-- pycrypto
|-- reportlab
|-- rrdtool
|-- tbb
|-- tinyxml
|-- wxGTK
|-- wxPython
|-- xerces-c
|-- yaz
`-- yaz-4.1.2

For some reason, SlackBuilds seem to want to install in the root tree -- which I just flat do not like, I want locally-added software in the /usr/local tree (that's what it's there for) or, in the case of things like LibreOffice, in /opt (optional software). I tend to edit the SlackBuild files so that things do install in /usr/local (which is a pain in the butt to do most of the time). That keeps church and state separate and distinct.

I'm running four servers, two 64-bit and two 32-bit (the 32-bit boxes are data base servers, no window managers, administered with SSH from my main work station). There are all kept up to date with patches, there are all kept at Slackware stable; I don't do fiddling with kernel or any of that sort of thing; the patches are all kept in /usr/local/patches.

When a new release of Slackware comes along, it's really easy to do a clean install (takes about 20 minutes per box) -- because there is nothing in the root tree that is not on the distribution DVD (that's why the root can be 10 G -- you start adding stuff the root tree and you'll need 20 G).

As you step through the installation where you're adding file systems, you just format root but don't format any of the other partitions and you haven't lost everything that was there. 99-44/100% of the time, everything just works. You copy /etc off to, in my case, /spares and you get back in business real quick by merging the saved /etc with the newly installed /etc. I'm serious, 20 minutes from start to running server, configured the way I need it to be (and no recovering add-on stuff).

The virtual partition is where Win7 lives (I have to have it, so I hold my nose and keep it up to date every Patch Tuesday but otherwise it sits there unused). It's also where I play with Linux every now and again but not all that often. If you think about what a royal pain in the ass it is to install Win7 (then sit for house while it does a couple of hundred critical updates, you'll know why it's a separate partition).

Is there any problem with /usr/local? Nope, works just fine, already in your PATH environment, no problem. Over the long haul, you do not want to build stuff in your home directory and you do not want to run virtual machines from your home directory. Trust me on this, it'll byte you in the butt someday.

Works for me, might work for you.

Hope this helps some.

textillis 05-20-2013 11:08 AM

Hey Tron,
Thanks heaps for a thorough and engaging response.
I hope this attracts some divergent opinion.

It is wayyyy past where I'm at (if you look at my emended initial post you will understand why I say this) but I am determined to keep reading and doing and learning, so that, soon, the stuff you have offered will become a real matter of choice for me.

In the meantime, as i say, I hope the posts keep coming: I find it a fundamentally interesting question (it is almost tautological to observe: you know, like: laying in the foundations of a system or a structure; planting a tree; laying out lines of development; setting plumb and line for the first line of bricks and then building up the corners etc)

Cheers,
Tex


All times are GMT -5. The time now is 07:19 AM.