SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need to patch Openssh with a sftp logging utility. The only way that I have been able to apply the patch is to the raw source code of Openssh. I can configure and make it after that, but am having problems getting it to install in the correct place (it defaualts to /usr/local/bin).
From the research that i've done to date, I think that I need to modify the configuration script, during the build, and before i make a tgz out of it with checkinstall.
Does anyone know of a how-to on the subject of configuring a program from source code to build and install in the default slackware locations?
My guess is that I need to research the current location of Openssh, modify the ./configuration script from the raw Openssh source code to install in the same locations, and then build and install the program.
If it's supposed to go in /usr/bin instead of /usr/local/bin you can:
Code:
./configure --prefix=/usr
You can do some research and find out where everything is supposed to be after that. If you have some discrepancies, just 'removepkg' on it, and then extract the package into a new folder on your desktop via:
Code:
tar -xzf mynewpackage.tgz
Then you can manually cut and paste stuff so it's organized the way it should be. Double check your install script to make sure it has all the right locations in it for creating symlinks and then do a "makepkg".....
It's a hack, but not really. It's fairly easy to make a proper slack-pak once you know where everything goes...
Thanks, it looks like I am on the right path. What should I do if there are multiple files being installed and the prefix that I use is different for them? For instance, in Slack sshd is located, by default, at /usr/sbin/sshd and the config files are located in /etc/ssh. If I do a ./configure --prefix=/usr/sbin all of the files are installed into /usr/sbin and the config files are installed in /etc, not /etc/ssh.
How does ssh "know" where the config files are? If it was installed thinking that they were in /etc/* but I then move them to /etc/ssh/* then it breaks the whole thing- right?
Are there settings for these config files (or any other files for that matter) with in the configure script somewhere?
You ussually don't want to start moving stuff around like I mentioned earlier. Not when it comes to scripts anyway. You already picked up on that. Your right, the binaries won't know where to look then. You should rarely have to hand edit make scripts. Almost all programs come with a wide variety of compile options... Good luck tho...
I found out about ./configure --help on my own a little earlier today. It gave me a bunch of override options for install locations. I then figured I first needed to know where everything was being installed with the slackware package so I could attempt to mimic it with the patched tgz that I am building. To do this I did a explodepkg on openssh, then a "ls- alR | less" to see where everything was going. I started building the new package in the /tmp dir while playing around with the configure options to try to get it right. I would build and install with checkinstall to the /tmp dir and then compare it using a "ls -laR" with the exploded tgz. I think that I am really close to getting it right now. If you would please take a look, at the outputs- I have a couple of questions at the bottom of the post.
here's the exploded list of the openssh tgz that shipped with slack (i have it exploded under installed):
Here is what I have done so far- I have the path set to the tmp "4install" dir for easy install and removal but will of course modify the configure options before doing a real build:
4install/:
total 0
drwxr-xr-x 5 root root 120 Aug 23 20:09 .
drwxr-xr-x 7 plan9 users 360 Aug 23 20:24 ..
drwxr-xr-x 3 root root 72 Aug 23 20:09 etc
drwxr-xr-x 8 root root 192 Aug 23 20:09 usr
drwxr-xr-x 3 root root 72 Aug 23 20:09 var
4install/etc:
total 0
drwxr-xr-x 3 root root 72 Aug 23 20:09 .
drwxr-xr-x 5 root root 120 Aug 23 20:09 ..
drwxr-xr-x 2 root root 344 Aug 23 20:20 ssh
4install/etc/ssh:
total 144
drwxr-xr-x 2 root root 344 Aug 23 20:20 .
drwxr-xr-x 3 root root 72 Aug 23 20:09 ..
-rw-r--r-- 1 root root 111892 Aug 23 20:20 moduli
-rw-r--r-- 1 root root 1159 Aug 23 20:20 ssh_config
-rw------- 1 root root 668 Aug 23 20:20 ssh_host_dsa_key
-rw-r--r-- 1 root root 601 Aug 23 20:20 ssh_host_dsa_key.pub
-rw------- 1 root root 526 Aug 23 20:20 ssh_host_key
-rw-r--r-- 1 root root 330 Aug 23 20:20 ssh_host_key.pub
-rw------- 1 root root 883 Aug 23 20:20 ssh_host_rsa_key
-rw-r--r-- 1 root root 221 Aug 23 20:20 ssh_host_rsa_key.pub
-rw-r--r-- 1 root root 2774 Aug 23 20:20 sshd_config
4install/usr:
total 0
drwxr-xr-x 8 root root 192 Aug 23 20:09 .
drwxr-xr-x 5 root root 120 Aug 23 20:09 ..
drwxr-xr-x 2 root root 264 Aug 23 20:20 bin
drwxr-xr-x 2 root root 48 Aug 23 20:09 doc
drwxr-xr-x 2 root root 112 Aug 23 20:20 libexec
drwxr-xr-x 5 root root 120 Aug 23 20:20 man
drwxr-xr-x 2 root root 72 Aug 23 20:20 sbin
drwxr-xr-x 2 root root 72 Aug 23 20:20 share
4install/usr/bin:
total 648
drwxr-xr-x 2 root root 264 Aug 23 20:20 .
drwxr-xr-x 8 root root 192 Aug 23 20:09 ..
-rwxr-xr-x 1 root root 33024 Aug 23 20:20 scp
-rwxr-xr-x 1 root root 60072 Aug 23 20:20 sftp
lrwxrwxrwx 1 root root 5 Aug 23 20:20 slogin -> ./ssh
-rwxr-xr-x 1 root root 223360 Aug 23 20:20 ssh
-rwxr-xr-x 1 root root 70056 Aug 23 20:20 ssh-add
-rwxr-xr-x 1 root root 56408 Aug 23 20:20 ssh-agent
-rwxr-xr-x 1 root root 80872 Aug 23 20:20 ssh-keygen
-rwxr-xr-x 1 root root 123756 Aug 23 20:20 ssh-keyscan
4install/usr/doc:
total 0
drwxr-xr-x 2 root root 48 Aug 23 20:09 .
drwxr-xr-x 8 root root 192 Aug 23 20:09 ..
4install/usr/libexec:
total 164
drwxr-xr-x 2 root root 112 Aug 23 20:20 .
drwxr-xr-x 8 root root 192 Aug 23 20:09 ..
-rwxr-xr-x 1 root root 31068 Aug 23 20:20 sftp-server
-rws--x--x 1 root root 132424 Aug 23 20:20 ssh-keysign
4install/usr/man:
total 0
drwxr-xr-x 5 root root 120 Aug 23 20:20 .
drwxr-xr-x 8 root root 192 Aug 23 20:09 ..
drwxr-xr-x 2 root root 272 Aug 23 20:20 man1
drwxr-xr-x 2 root root 112 Aug 23 20:20 man5
drwxr-xr-x 2 root root 136 Aug 23 20:20 man8
4install/usr/man/man1:
total 92
drwxr-xr-x 2 root root 272 Aug 23 20:20 .
drwxr-xr-x 5 root root 120 Aug 23 20:20 ..
-rw-r--r-- 1 root root 4345 Aug 23 20:20 scp.1
-rw-r--r-- 1 root root 8984 Aug 23 20:20 sftp.1
lrwxrwxrwx 1 root root 7 Aug 23 20:20 slogin.1 -> ./ssh.1
-rw-r--r-- 1 root root 5615 Aug 23 20:20 ssh-add.1
-rw-r--r-- 1 root root 6780 Aug 23 20:20 ssh-agent.1
-rw-r--r-- 1 root root 13111 Aug 23 20:20 ssh-keygen.1
-rw-r--r-- 1 root root 3912 Aug 23 20:20 ssh-keyscan.1
-rw-r--r-- 1 root root 32814 Aug 23 20:20 ssh.1
4install/usr/man/man5:
total 48
drwxr-xr-x 2 root root 112 Aug 23 20:20 .
drwxr-xr-x 5 root root 120 Aug 23 20:20 ..
-rw-r--r-- 1 root root 22448 Aug 23 20:20 ssh_config.5
-rw-r--r-- 1 root root 23747 Aug 23 20:20 sshd_config.5
4install/usr/man/man8:
total 36
drwxr-xr-x 2 root root 136 Aug 23 20:20 .
drwxr-xr-x 5 root root 120 Aug 23 20:20 ..
-rw-r--r-- 1 root root 2453 Aug 23 20:20 sftp-server.8
-rw-r--r-- 1 root root 2694 Aug 23 20:20 ssh-keysign.8
-rw-r--r-- 1 root root 28079 Aug 23 20:20 sshd.8
4install/usr/sbin:
total 260
drwxr-xr-x 2 root root 72 Aug 23 20:20 .
drwxr-xr-x 8 root root 192 Aug 23 20:09 ..
-rwxr-xr-x 1 root root 266040 Aug 23 20:20 sshd
4install/usr/share:
total 4
drwxr-xr-x 2 root root 72 Aug 23 20:20 .
drwxr-xr-x 8 root root 192 Aug 23 20:09 ..
-rw-r--r-- 1 root root 600 Aug 23 20:20 Ssh.bin
4install/var:
total 0
drwxr-xr-x 3 root root 72 Aug 23 20:09 .
drwxr-xr-x 5 root root 120 Aug 23 20:09 ..
drwxr-xr-x 2 root root 48 Aug 23 20:09 empty
4install/var/empty:
total 0
drwxr-xr-x 2 root root 48 Aug 23 20:09 .
drwxr-xr-x 3 root root 72 Aug 23 20:09 ..
===============================
As you can see, it's really close to the shipped tgz right now! About the only thing that is missing is the "install" directory, and I don't think that I need that. I am concerned about the missing files in /etc/ssh- but was planning on copying them over like you recommended early. what do you think? I am also concerned about /etc/rc.d/rc.ssh. I haven't had a chance to read it yet, but I am hoping that it will be able to start and stop the new binaries so long as they are named the same thing (they are) and are in the same locations.
Thank you so much for your help. Once I get this going I'll submit it to the author of the patch so that he can put it up for all slackware users.
What a fantastic idea! Obviously, I had no idea that this info was available. From the source that you cited, it appears as though that is how he builds the tgz packages for slack. Would it be possible to take the source code for openssh, apply the patch and then build the same tgz there by saving others the hassle? how would you do this? it looks to me like all you would have to do is d/l everything in the openssh dir and then run openssh.SlackBuild- which would be nice because then it would install just like the original package! Please let me know what you think, and thanks!
Hey what does the last line of the config script do? Here it is:
$ARCH-slackware-linux
I would guess that it sets the architecture of the package build, but it is causing my build to error out. it's set to
ARCH=ARCH:-i486 in the openssh-SlackBuild files?
Yea, I'm sure he has an alias for slackware-linux that means i486.... Been awhile since I've used flags. march or whatever it is is what you want to set for an i486... I never thought of looking on the slackware site either. Those are typical commands that I use for LFS, thats why I mentioned it. Sounds like you'll want your startup script in rc.d obviously..... I'd copy that over if I were you. Your right, the "install" directory is bogus. That doesn't get installed when you use the 'installpkg' command.
Originally posted by plan9 Hey what does the last line of the config script do? Here it is:
$ARCH-slackware-linux
I would guess that it sets the architecture of the package build, but it is causing my build to error out. it's set to
ARCH=ARCH:-i486 in the openssh-SlackBuild files?
plan9
You may not need to bother with that script. Looking at your profile I see you're using Slack 9.1, so you'd be more interested in this script:
Many of these packages now have scripts that untar, patch, and compile the
source automatically. These are the 'SlackBuild' scripts.
BTW at the end of the script, it also creates the *.tgz slack package.
So, yes, you can 'd/l everything in the openssh dir and then run openssh.SlackBuild', although you'll have to figure out where to apply your patch. Maybe add a line to the script between where it untars and where it configures.
Thanks you all, this was very informative for me. I finally feel as though I am begining to get my head around slackware.
I need to update my profile because I am actually running slackware-current, with 2.6.7. I looked around a couple of times
but haven't found a way to do that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.