LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Package Manager For LFS (https://www.linuxquestions.org/questions/linux-from-scratch-13/package-manager-for-lfs-4175443147/)

Keith Hedger 12-27-2012 12:55 PM

Package Manager For LFS
 
Pretty soon after starting to build LFS/BLFS I realized I needed some sort of package manager to keep track of what had been installed and where and having come from slackware I was used to the slackpkg package manager so I decided to write my own - This is the result, just download the tarball from here:
http://keithhedger.hostingsiteforfre...g-0.1.9.tar.gz

Unpack it somewhere, cd into the unpacked folder and run the install script as root ie;
Code:

sudo ./LFSPkg.LFSBuild
If you use the template script when you want to update a package just place the new archive in the same folder as the script alter the version number in the script and run ( using wget for instance )
Code:

sudo ./wget.LFSBuild upgrade
The package will be rebuilt and you will be asked which package to upgrade.

A number of package scripts can be found here:
http://keithhedger.hostingsiteforfre...fspkg/packages
Download a single folder (alsa-lib for instance) with:
wget --recursive --no-host-directories --cut-dirs=2 -np --level=1 http://keithhedger.hostingsiteforfre...kages/alsa-lib

Just download the folder and its contents cd into it and run the build script.
These packages including scripts, patches and archives are supplied "AS IS" and you use them at your own risk.

A number of files/folders are used these are:
Installed with lfspkg:

/usr/bin/lfspkg - The main bash script.
/usr/share/LFSPkg/LFSFunctions - helper functions.
/usr/share/man/man1/lfspkg.1 - manpage.

~/.config/lfspkg.rc - Local config file, should contain only the following:

TMP=${TMP:-/tmp/LFS}
OUTPUT=${OUTPUT:-/path/to/store/packages}

Where TMP is the location for tempory files ( defaults to /tmp if not set )
OUTPUT is the location to save built packages ( defaults to /tmp if not set )

/var/lib/LFSPackages - Folder contains gziped lists containg package information.

EXAMPLES

Build and install a package from the current directory:
lfspkg -n "SomePackage" -p "6.6.6" -d "DEV" -b 34 -c

Build a package from the current directory and save to /some/other/tmp:
OUTPUT=/some/other/tmp lfspkg -n "SomePackage" -p "6.6.6" -m

Install a package:
lfspkg "/media/SkyNet/UpdatedPakckages/wget-1.14-1_NET_LFSPKG.tar.gz" -i

Create a template script based on an archive file name:
lfspkg -t wget-1.14.tar.gz

Find a file in an installed package:
lfspkg -f wget
...
wget Found in package: wget-1.14-2_NET_LFSPKG
At these locations:
./etc/wgetrc
./usr/share/man/man1/wget.1
./usr/share/locale/nl/LC_MESSAGES/wget.mo
...
./usr/share/info/wget.info
./usr/bin/wget
...

Find an installed package:
lfspkg wget

Matches for:wget
wget-1.14-1_NET_LFSPKG

Remove a package:
lfspkg -r wget

When removing a package or listing the contents of a package you will be asked to choose from a list of possible matches.
You must have admin priviliges to install or remove files but you do not need to be root to just build a package.

Have a look at the LSFBuild scripts and the man page for more info, hope some of you find this helpful, any suggestions etc please let me know.

stoat 12-30-2012 07:38 AM

Maybe it's just me, but those links aren't working. Never have.

Keith Hedger 12-30-2012 08:57 AM

Must be you works fine in firefox and links

spiky0011 12-30-2012 09:17 AM

Works for me

McZ 01-08-2013 02:19 AM

Quote:

Originally Posted by Keith Hedger (Post 4857864)
...

Install a package:
lfspkg "/media/SkyNet/UpdatedPakckages/wget-1.14-1_NET_LFSPKG.tar.gz" -i
...

"My" network name! or maybe it is from Terminator ;)

Anyway, the package manager looks nice. Very similar script as I once had, maybe because I was inspired by slackware tools ;) But now I have changed all that into Makefiles like FreeBSD ports system and I call them Builds. Not really a package manager because I can only install the packages so far no un-install, altough they do create a tar.bz2 file for each package.

Keith Hedger 01-08-2013 03:49 AM

Glad you like it, it too was inspired by slackware! The ability to quickly install/uninstall when testing software was my main concern and also being able to search for a specific installed file.

I've also got "Blue Midget", "Deep Thought", "Tardis", "Stargate" etc I'm such a geek!

McZ 01-08-2013 05:33 AM

Quote:

Originally Posted by Keith Hedger (Post 4865250)
Glad you like it, it too was inspired by slackware! The ability to quickly install/uninstall when testing software was my main concern and also being able to search for a specific installed file.

I've also got "Blue Midget", "Deep Thought", "Tardis", "Stargate" etc I'm such a geek!

Yes, but very annoying. Because now I want to redo my repo and packaga manager again! :p

Keith Hedger 01-08-2013 06:11 AM

Quote:

Originally Posted by McZ (Post 4865290)
Yes, but very annoying. Because now I want to redo my repo and packaga manager again! :p

Oh the joys of rolling your own!

Keith Hedger 08-28-2013 10:47 AM

I have just updated the package manager if any one is interested!
http://keithhedger.hostingsiteforfre...-0.1.14.tar.gz

Keith Hedger 08-03-2016 07:14 PM

Please note the above links are out of date and you should use the git versions here:

https://github.com/KeithDHedger/LFSPkg
https://github.com/KeithDHedger/LFSPkgBuilds

challengersky 09-12-2017 08:38 AM

When to install LFSPkg during LFS build?
 
Hello,

After reading through the thread and the directions I'm still confused as to when to install and start using LFSPkg Manager?

I'm now at the beginning of Chapter 6 of the LFS book. Do I install LFSPkg now and use it to install every package in chapter 6? Or wait until the end, then install LFSPkg and use it only for the specified packages mentioned in the 'how-to' and 'README' files?

Thanks for the help.

Keith Hedger 09-12-2017 09:04 AM

Basically you can start using the package manager at any time from the beginning of chapter six, I use right from the start of the chapter, but you can start using it at any time, of course any packages installed manually outside of the package manager will not be available to the manager to update/remove etc.

Check the readme's from the git repo here:
https://github.com/KeithDHedger/LFSP...SScripts/HowTo

Keith Hedger 08-16-2020 01:47 PM

Just updated builds scripts and package manager to build a basic systemd OS, will be working on the systemd BLFS bits shortly.


All times are GMT -5. The time now is 01:12 PM.