LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 10-16-2019, 03:16 AM   #16
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763

Quote:
Originally Posted by ruario View Post
or `bzgrep usr/local MANIFEST.bz2` also works
This means you could do the following as an alternative way of re-creating the Slackware provided “/usr/local” sub-directory structure.

Code:
bzcat MANIFEST.bz2 | sed -n '/usr\/local.*\//s/.* //p' | xargs -I{} mkdir -vp /{}

Last edited by ruario; 10-16-2019 at 03:34 AM.
 
Old 10-17-2019, 03:46 PM   #17
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763
Quote:
Originally Posted by ruario View Post
It is actually not that bad these days. With modern `find` you can easily locate all files associated with a package, if you know just one file provided by the package. The following is a shell script that will automate finding files that are likely to be related to your reference file, based on common install time. Just run it as root providing a single argument, that being the path to the chosen reference file.

Code:
#!/bin/sh -eu
c=$(stat -c%Z "$1")
r=${2:-10}
find /etc /opt /usr -newerct @$(($c-$r)) ! -newerct @$(($c+$r)) ! -type d
I forgot I once extended this idea and created a little shell script I called f2sb ("Forgot 2 SlackBuild"). It can make a Slackware package out of your manually installed package by finding all the files using change timestamps in a range governed by a reference file from within the package.

You provide it options like so:

Code:
./f2sb.sh name-version /path/to/reference/file [seconds]
For example, say I installed Zstandard version 1.4.3 manually via `make install`. Then at any time in the future, I could simply issue the following (as root):

Code:
./f2sb.sh zstd-1.4.3 /usr/local/bin/zstd
and it would produce "/tmp/zstd-1.4.3-x86_64-1.tgz" (assuming a 64bit system). This would allow me to (re)install it on top via installpkg and have it tracked alongside all other packages, which also simplifies removal should I ever need that.
 
1 members found this post helpful.
Old 10-17-2019, 03:50 PM   #18
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763
Quote:
Originally Posted by abga View Post
This is what I've been doing for more than 2 decades on Slackware, /usr/local is my "parallel world" where I put my own compilations. Never managed to break something, nor failed to clean something.
You could try my little example script against one of the files from one of the packages you make installed into /usr/local and see if it accurately finds all the sibling files from the package in question. It is still a nice way of listing files in a package, even if you don't personally need it.
 
Old 10-18-2019, 01:15 PM   #19
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634

Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
Quote:
Originally Posted by ruario View Post
You could try my little example script against one of the files from one of the packages you make installed into /usr/local and see if it accurately finds all the sibling files from the package in question. It is still a nice way of listing files in a package, even if you don't personally need it.
Just tried f2sb.sh on unbound and it worked just fine, got all the files that were part of the unbound package - compared the package your script generated with the one I created when I compiled it.
I used to make && make install back in the day and then archive the whole compilation directory, but moved to creating packages, it's cleaner & more efficient.
Saved your little script in my /kit/tools directory for when/if I'll need it. Thanks!
 
1 members found this post helpful.
Old 10-18-2019, 04:57 PM   #20
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763
Quote:
Originally Posted by abga View Post
Just tried f2sb.sh on unbound and it worked just fine, got all the files that were part of the unbound package - compared the package your script generated with the one I created when I compiled it.
I used to make && make install back in the day and then archive the whole compilation directory, but moved to creating packages, it's cleaner & more efficient.
Saved your little script in my /kit/tools directory for when/if I'll need it. Thanks!
Thanks for checking it. I have used these tricks quite a bit but always interesting to hear that it actually works for someone else!
 
Old 10-18-2019, 07:54 PM   #21
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
If you have some app to compile - just tell us. Such general discussion is not much of worth without working example. First of all developer usually provides information about how to install. So this is the first point to start with.
 
Old 10-18-2019, 08:20 PM   #22
abga
Senior Member
 
Registered: Jul 2017
Location: EU
Distribution: Slackware
Posts: 1,634

Rep: Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929Reputation: 929
@igadoter

OP already opened a thread for a specific app:
https://www.linuxquestions.org/quest...er-4175662129/
 
Old 10-18-2019, 11:17 PM   #23
thirdm
Member
 
Registered: May 2013
Location: Massachusetts
Distribution: Slackware, NetBSD, Debian, 9front
Posts: 327

Rep: Reputation: Disabled
Quote:
Originally Posted by Firerat View Post
one way round this ( ugly )

( less ugly )
Really the Makefile is just a shell script, so it wouldn't take much to "reverse engineer" the install target(function)
I'm probably being too literal minded here, but for people not knowledgeable about Unix this statement is misleading. Perhaps you meant they have some similar syntax and use snippets in their target recipes that are sequences of shell commands, so learning about Makefiles may feel similar to learning about shell. Or maybe you meant that you can take the commands out of the recipes and put them in shell scripts.

But a Makefile is a very different beast than a shell script. First there are key syntax differences that will trip you up if you're writing a Makefile thinking of it as a shell script, e.g. $(dmesg) means something entirely different as a Makefile macro than it does as a shell expression. More fundamentally, a Makefile is processed in two passes, one that reads all the directives, variable definitions, and rules followed by a second one that picks a rule and recursively processes each rule needed to satisfy prerequisites down a chain leading back down to the starting rule, followed by processing of that rule itself. Shell scripts run in one pass top to bottom.
 
Old 10-18-2019, 11:27 PM   #24
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by thirdm View Post
I'm probably being too literal minded here, but for people not knowledgeable about Unix this statement is misleading. Perhaps you meant they have some similar syntax and use snippets in their target recipes that are sequences of shell commands, so learning about Makefiles may feel similar to learning about shell. Or maybe you meant that you can take the commands out of the recipes and put them in shell scripts.

But a Makefile is a very different beast than a shell script. First there are key syntax differences that will trip you up if you're writing a Makefile thinking of it as a shell script, e.g. $(dmesg) means something entirely different as a Makefile macro than it does as a shell expression. More fundamentally, a Makefile is processed in two passes, one that reads all the directives, variable definitions, and rules followed by a second one that picks a rule and recursively processes each rule needed to satisfy prerequisites down a chain leading back down to the starting rule, followed by processing of that rule itself. Shell scripts run in one pass top to bottom.
https://maex.me/2018/02/dont-fear-the-makefile/
 
Old 10-19-2019, 01:19 AM   #25
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by abga View Post
@igadoter

OP already opened a thread for a specific app:
https://www.linuxquestions.org/quest...er-4175662129/
The OP needs to be more specific. The only true portable version I understand is statically linked application. And then reconfigure Geany to look for plugins in specified folder. The other solution is Docker. Maybe Geany already has a Docker container. But I confess I failed miserably trying to build Docker myself.

Edit: putting binaries into user home directory is just how Unix worked, common users were not allowed to install system-wide, for custom builds $HOME is place to put binaries.

Last edited by igadoter; 10-19-2019 at 01:22 AM.
 
  


Reply

Tags
configure, installation, makefile, package, programs



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
Doubt regarding mysql or postg for a very simple application g_paschoal Programming 12 04-15-2014 09:40 AM
Simple Slackware vs simple Arch vs simple Frugalware punchy71 Linux - Distributions 2 08-28-2012 02:30 PM
[SOLVED] simple curl syntax doubt sl33p Linux - General 1 07-06-2009 04:18 PM
Doubt in a simple basic C program.... thefountainhead100 Programming 9 03-15-2008 01:01 AM
doubt with "make check" of gcc in chapter 6 lfs_rocks Linux From Scratch 1 02-13-2008 12:15 AM

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

All times are GMT -5. The time now is 05:48 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
Open Source Consulting | Domain Registration