Slackware This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
|
05-30-2006, 07:13 AM
|
#1
|
Senior Member
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519
Rep:
|
Making slackware packages - What Magic To Use?
Hi all,
Well since I lost my power supply the other day, I had to reload the pc as I needed so many new parts, and decided to do a reinstall of Slack 10.2 as I believed I may have had a broken compiler and thus couldn't do "makepkg" for anything.
My pc: fresh install slack 10.2 full; and I chose menu and checked everything so that it would be installed. Using stock 2.4 kernel and vesa frame buffer. I dont even have a mouse wheel! This is how 'virgin' the install of the pc is. No updates, and no internet, no wire pluged in.
Now I made an 'image' of the slackware partition so I can allways go back.
Now here is a perfect example of the 'h - e - double toothepicks" that I run into with slackware:
For example, I tried to put the latest Amarok on here, version 1.0.4a
Pre-requisites: libmusicbrainz & libtunepimp
There are others, but they are either already in Slackware 10.2 or I simply don't need them. I don't even need k3b plugin. Remember I dont have k3b on here.
1. download libmusicbrainz to my user/home directory for the user account I run as. do 'configure' and I get errors. the errors don't really matter for me to post. I talk about this later.
2. make...get errors.
3. decide not to install it delete the folder.
Now I su to root...and run configure, make and 'makepkg' I chose to reset the symlinks and change the folder permissions as slack's makepkg recommends. I then 'installpkg' I had no errors on config and make.
Now I go to libtunepimp...and configure doesnt' even see the libmusicbrainz!
So I remove the libmusicbrainz from pkgtool...delete my folder for libmusicbrainz and run as root all over again, confi, make and make install this time...no makepkg. goes in fine.
Then I run libtunepimp configure, make, make install and fine.
So my question is:
1. Why is it that the example programs above, like many, many other app's require root to configure, make and make install.
I see everyone say "put the download in your home, config and make as normal then make install as root"
This simply does not work for me. From what I see these config and make's need to see or access files that only the root can get to. And if so, how the heck do you know that they need to? Because many times these app's will go in, you think they are installed but they are not.
Another program I have this issue on: berkely, openldap, hp printing, guarddog.
Now I'm using slack packs from Alien Bob to whom I am so gratefull. But I'd really like to be a 'big boy' and make my own, for learning purposes, and that on some things I can stay a little more current where it matters.
Am I going wrong at the removing symlinks like 'makepkg' recommends, or am I going wrong when 'makepkg' wants me to reset the folder rules?
I thought I had a broken compiler, it must be that I have a broken brain or something
Thanks in advance.
Fogie.
Last edited by Old_Fogie; 06-09-2006 at 12:37 PM.
|
|
|
05-30-2006, 08:09 AM
|
#2
|
Member
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498
Rep:
|
99.9 % of times you really don't need to build sources as root.
Direct installation of software with make install is not recommended because you lose all features of package management, like installation records and possibility of clean uninstalls. For packaging purposes it's much better to install not in root(/) but indirectly into dedicated subdirectory and there after some tweaking like permissions setting and binaries stripping build a new package. Redirection possibilities could be figured out from Makefiles. When created by automake it's DESTDIR variable most of times.
For illustration it's best to see some SlackBuild scripts like following from Slackware-current: libmusicbrainz.SlackBuild
|
|
|
05-30-2006, 09:55 AM
|
#3
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
Quote:
Originally Posted by Old_Fogie
1. download libmusicbrainz to my user/home directory for the user account I run as. do 'configure' and I get errors. the errors don't really matter for me to post. I talk about this later.
2. make...get errors.
3. decide not to install it delete the folder.
|
I happen to have a libmusicbrainz package "hidden" in my zinf package directory, so I grabbed the tarball and unpacked it as myself (non-root) and ran configure and make..... no errors whatsoever.
Could it be that you already ran these commands as root (or unpacked the sources being root) before you tried the configure and make commands as your own account?
Quote:
Am I going wrong at the removing symlinks like 'makepkg' recommends, or am I going wrong when 'makepkg' wants me to reset the folder rules?
|
The default in Pat's and my own packages is to run makepkg "--linkadd y --chown n" i.e. to remove symlinks from the package and add them to the doinst.sh script, and to leave the file ownership alone.
Me, I do not see a problem in being root when building software. Then again, I build my packages in a protected environment (using a QEMU virtual machine) so that no accidental harm comes to my real computers. I do see the point of others that do not want to be root when compiling programs - you never know what might happen, if the makefiles are broken you could accidentally be running "rm-rf"...
Eric
|
|
|
05-30-2006, 11:29 AM
|
#4
|
Senior Member
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519
Original Poster
Rep:
|
Quote:
Originally Posted by Alien Bob
Could it be that you already ran these commands as root (or unpacked the sources being root) before you tried the configure and make commands as your own account? Eric
|
While I have done that in the past and then realized that was bad after our discussion on NFS and folder permissions, I don't think I did it this time. I'm trying to break that habbit. I'll try it again.
Quote:
Originally Posted by Alien Bob
The default in Pat's and my own packages is to run makepkg "--linkadd y --chown n" i.e. to remove symlinks from the package and add them to the doinst.sh script, and to leave the file ownership alone. Eric
|
Let me see if I have this right then:
-download the file as normal user and save it to my home.
-go to my home, right click on it and choose extract here with 'ark'
-now go into that folder and simply hit F4 key in konqueror, open's up my terminal, I'm still normal user.
-type 'configure'
-type 'make'
-now 'su -'
-enter root pass
-as root I now cd to /home/fogie/libmusicbrainzXX/
-then type makepkg libmusicbrainz.tgz --linkadd y --chown n
-then installpkg libmusicbrainz.tgz
Now I should be good to go right?
|
|
|
05-30-2006, 11:42 AM
|
#5
|
Senior Member
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705
Rep:
|
You have some good advice here and I don't have anything to add to it except that when I had similar questions I got a lot of help in this thread:
http://www.linuxquestions.org/questi...=1#post2118552
|
|
|
05-30-2006, 11:42 AM
|
#6
|
Senior Member
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914
Rep:
|
Quote:
Originally Posted by Old_Fogie
run configure, make and 'makepkg'
Now I go to libtunepimp...and configure doesnt' even see the libmusicbrainz!
|
There's your problem. 'makepkg' isn't 'checkinstall'...
Code:
./configure --prefix=/usr
make
mkdir /tmp/package-libmusicbrainz
make install DESTDIR=/tmp/package-libmusicbrainz
cd /tmp/package-libmusicbrainz
mkdir install
cat << EOF > install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------|
libmusicbrainz: libmusicbrainz (music database)
libmusicbrainz:
libmusicbrainz: MusicBrainz is a community music metadatabase that attempts to
libmusicbrainz: create a comprehensive music information site. You can use the
libmusicbrainz: MusicBrainz data either by browsing the web site, or you can
libmusicbrainz: access the data from a client program - for example,
libmusicbrainz: soundjuicer can use MusicBrainz to identify CDs and provide
libmusicbrainz: information about the CD, about the artist or other related
libmusicbrainz: information.
libmusicbrainz:
libmusicbrainz:
EOF
makepkg -l y -c n /tmp/libmusicbrainz-2.1.2-i486-1.tgz
installpkg /tmp/libmusicbrainz-2.1.2-i486-1.tgz
mv /tmp/libmusicbrainz-2.1.2-i486-1.tgz /somewhere/for/safe/keeping
manpages aren't being compressed and binaries and libs aren't being stripped but that's the general proceedure for building packages.
If I understood right, you were making a package out of your entire source directory... ;-)
Last edited by jong357; 05-30-2006 at 11:46 AM.
|
|
|
05-31-2006, 08:39 AM
|
#7
|
Senior Member
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519
Original Poster
Rep:
|
Quote:
Originally Posted by jong357
There's your problem. 'makepkg' isn't 'checkinstall'...
|
OK I went to slacky.it and grabbed the checkinstall there that Randux linked me to (thanks Randux) and installed it.
-----------------------
Quote:
Originally Posted by jong357
Code:
./configure --prefix=/usr
make
mkdir /tmp/package-libmusicbrainz
make install DESTDIR=/tmp/package-libmusicbrainz
cd /tmp/package-libmusicbrainz
mkdir install
|
You were a "normal user" for the make.....correct? I did this as normal user and it seemed to go fine for me.
But I typed [QUOTE ]cat << EOF > install/slack-desc[/quote] and I get nothing. So I guess that meant for me to switch up to root, then cd to the /tmp/pakcage-libmusicbrainz diretory and then call the
Quote:
cat << EOF > install/slack-desc
|
But when I do that as root, I just get:
Quote:
root@pooter:~# cat << EOF > install/slack-desc
>
|
I don't get any of this here tho, (should I be typing something else?):
Quote:
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------|
|
------------------------
Quote:
manpages aren't being compressed and binaries and libs aren't being stripped but that's the general proceedure for building packages.
|
Compressing the manpages I guess is ok for me, most of my pc's have plenty of hard drive size. What would an advantage be of "compressing binaries and libs"
Quote:
Originally Posted by jong357
If I understood right, you were making a package out of your entire source directory... ;-)
|
I was simply working out of my user account's home directory:
that is : I read somewhere you're supposed to have a 'sandbox' for normal users to play with and compile things if need be, so I just call mine "scratchpad" instead of "sandbox".
Thanks for helping me, I really appreciate it.
|
|
|
05-31-2006, 09:51 AM
|
#8
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
That bit of
Quote:
cat << EOF > install/slack-desc
|
was not meant to run just like that. This command is the start of a so-called "here-document" (look it up like here: http://www.faqs.org/docs/abs/HTML/here-docs.html) which means that all of the text that follows that command line - up to the line starting with the word EOF is part of the command.
The result would be that this text would be written to the file "install/slack-desc".
As to zipping man pages and stripping binaries/libraries, this is of course not needed if you build packages that just you are going to use on your own giant hard disk. But if you intend to distribute your package to other people, you don't know how diskspace starved these computers are going to be. It is simply being nice to those folks if you try to keep your packages as small as possible.
Cheers, Eric
|
|
|
05-31-2006, 10:38 AM
|
#9
|
Senior Member
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519
Original Poster
Rep:
|
thanks for explaining that Eric. I went to linuxpackages, and saw that they have a tool to make one of these "slack-desc" files, so I made one there and just made a text file and pasted the info and called the file 'slack-desc.txt' and put it in the /tmp/install of the package.
I think I have libtunepimp in right, and libmusic brains.
I ran the .configure on the amarok, but I get an error/warning that KDE is in /opt/kde and that I'm supposed to update KDE with some setting and then restart KDE. Something with KDEDIRRS=/usr;/opt/KDE or something like that I just lost the terminal window darn.
Would this amarok program be an example of when I need to go into their 'configure' script and manually change their script? Or pass an argument when I do the configure? If so what argument would I pass to tell it that KDE is installed on my system in /opt/KDE?
|
|
|
05-31-2006, 10:42 AM
|
#10
|
Senior Member
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519
Original Poster
Rep:
|
oh I think I have to change prefix=/usr to prefix=/opt/KDE ?
|
|
|
05-31-2006, 11:00 AM
|
#11
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
If you really want to do it as generic as possible when you prepare a KDE package, set the prefix like this:
Code:
./configure --prefix=$(kde-config --prefix)
instead of "./configure --prefix=/opt/kde".
By the way, the slack-desc file in your package's "install" directory should be called "slack-desc" not "slack-desc.txt"!
Eric
|
|
|
05-31-2006, 11:54 AM
|
#12
|
Senior Member
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519
Original Poster
Rep:
|
OK
thanks
Last edited by Old_Fogie; 06-25-2006 at 05:42 AM.
|
|
|
05-31-2006, 12:17 PM
|
#13
|
Senior Member
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914
Rep:
|
Quote:
Originally Posted by Old_Fogie
OK I went to slacky.it and grabbed the checkinstall there that Randux linked me to (thanks Randux) and installed it.
|
You can use checkinstall if you want. All you have to do there is:
./configure --prefix=/blah
make
checkinstall
I highly suggest you eventually move to makepkg at some point. Checkinstall used to be severley bugged when it wrote it's doinst.sh but from what I hear, it doesn't do it anymore. I'm not entirely sure it compresses the man/info pages, strips libs and binaries and if there are any commands that need to be run on the doinst.sh, it won't pick those up either (which results in an incomplete/broken package install). IMO, checkinstall is a pretty weak way to go. There is no substitute for 'makepkg' and personal attention to details.
Quote:
Originally Posted by Old_Fogie
You were a "normal user" for the make.....correct? I did this as normal user and it seemed to go fine for me.
|
I always build/run as root. Not the smartest of ideas at times due to carelessness on my part, but I do it none the less. You have the right of it with doing the configure/make as a user and the 'su'ing to root for the 'make install DESTDIR=/tmp/packagename'
As for the 'cat' part, Eric already explained that. All the way down to 'EOF' was meant to be one command. That's kinda why I put spaces above and below it; to seperate it. So you would have copy/pasted all of this:
Code:
cat << EOF > install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------|
libmusicbrainz: libmusicbrainz (music database)
libmusicbrainz:
libmusicbrainz: MusicBrainz is a community music metadatabase that attempts to
libmusicbrainz: create a comprehensive music information site. You can use the
libmusicbrainz: MusicBrainz data either by browsing the web site, or you can
libmusicbrainz: access the data from a client program - for example,
libmusicbrainz: soundjuicer can use MusicBrainz to identify CDs and provide
libmusicbrainz: information about the CD, about the artist or other related
libmusicbrainz: information.
libmusicbrainz:
libmusicbrainz:
EOF
Quote:
Originally Posted by Old_Fogie
What would an advantage be of "compressing binaries and libs"
|
You compress manpages and strip binaries and libs of their debugging symbols. Your average user doesn't want to debug a program, just run it. It reduces the size of the binaries/libs and is considered 'proper' form for slak-paks... Same thing goes with using a prefix of /usr/local... Don't do it. Not if your going to distribute your package anyway... If manpages get installed to /usr/share/man then move them to /usr/man... If doc's get installed to /usr/share/doc move them to /usr/doc... If you get a /usr/info/dir file and it doesn't come from the texinfo package, then delete it... There are quite a few things to watch out for if you are the anal type and want your packages to be 'proper'. IMO, it's a good idea to just start doing it, else you form bad habits...
Quote:
Originally Posted by Old_Fogie
I read somewhere you're supposed to have a 'sandbox' for normal users to play with and compile things if need be, so I just call mine "scratchpad" instead of "sandbox".
|
Again, good idea. I can't tell you how many times I've screwed stuff up by running as root 24/7.... I'm not worried about attacks from the web, just inadvertent attacks from my own stupidity. I have ZERO apps listening on ports, run a strong iptable firewall script and am behind a router to boot.
I've recursively erased my windows partition a few times because it was mounted. I've wiped /var/log/packages clean once over a typo and numerous other stupid things... But hey... It's a great way to learn... Doesn't happen so often now except when I'm tired.
Anywho, don't forsake 'makepkg' just yet. Study build scripts in the Slackware FTP site and you'll start to understand rather quickly how things work.
Last edited by jong357; 05-31-2006 at 12:21 PM.
|
|
|
05-31-2006, 01:51 PM
|
#14
|
Senior Member
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519
Original Poster
Rep:
|
Hi Jong
I must have mis-understood you when you said:
Quote:
"There's your problem. 'makepkg' isn't 'checkinstall'.."
|
As I thought you meant I should get it. I did download it and put it in, but I've been using the process you showed there; so effectively I guess I'm not using it then.
All of my packages have no description, I'm going to have to read Eric's link he gave me there more I guess as creating that text file doesn't seem to work. Baby steps, baby steps
I see over at the how-to at linuxpackages the writer reccommends this for about 90% of the time he says:
Quote:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
|
Maybe I should do that allways to play it safe, unless I know that it's a KDE required program and then use what Eric gave there.
I noticed as I just tried to do the touchpad driver, even tho the package goes in, I have to copy over to my /usr/lib/modules.... these two files for the touchpad. Maybe when I get more advanced I'll learn how to input that into my script.
Last edited by Old_Fogie; 06-09-2006 at 12:41 PM.
|
|
|
05-31-2006, 03:07 PM
|
#15
|
Senior Member
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191
Rep:
|
Hey Fogie, you mentioned using the slack-desc builder from linuxpackages.net. I just wanted to say this was a great resource for me when learning to create slack-packages the "right way"; this link in particular.
Quote:
Tho, all of my packages have no description, I'm going to have to read Eric's link he gave me there more I guess as creating that text file doesn't seem to work. Baby steps, baby steps
|
I had this problem too when I first started doing it. It can be a bit touchy at times so here are some tips that got it working right for me.
a) enter in the program name exactly as the base name of your package will appear (case sensitive)
b) same goes for the version #
c) the name of your package must be in this exact format or you will get no description form the slack-desc:
<name from a>-<version from b>-<architecture>-<build number>.tgz
example: seamonkey-1.0.1-i686-1.tgz
I usually just put "noarch" for architecture but you can put in your processor type if you want: ie i686 for me.
have fun making packages!
...drkstr
PS:
I love the slackware package maker. After I learned how to do it, I got a little caried away and tired to turn everything I had the source to, into a package. I even made a package that restores my system and installs all my newly created packages after a clean install of Slack (doinst.sh rocks the house). What fun!
Last edited by drkstr; 05-31-2006 at 03:10 PM.
|
|
|
All times are GMT -5. The time now is 09:30 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|