LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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
 
LinkBack Search this Thread
Old 02-25-2003, 03:16 PM   #1
ratbert90
Member
 
Registered: Jan 2003
Posts: 67

Rep: Reputation: 16
Talking make your own slackware packages!


Hey, I just learned how to make your own slackware (.tgz) packages!

It pretty simple really.

1) get the program and unzip it. Ill use gaim as my example.
tar -zvxf gaim.tar.gz

2) do a ./configure && make in the console.

3) now you do a make install DESTDIR=/tmp/package
(this sets the install directory to /tmp/package.

4) change directories to /tmp/package
cd /tmp/package

5) type makepkg -l y -c n ../gaim.tgz

after that is done, go back 1 directory and gaim.tgz should be there!

6) installpkg gaim.tgz

yeah! now not only is this program installed, but its in pkgmanager also. so deleting programs is much easier.

also, if you keep the slackware package, it takes seconds to install it instead of minutes.

have fun!
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-25-2003, 06:11 PM   #2
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Rep: Reputation: 32
so after you do all that is it safe to delete the source files/tarball?
 
Old 02-25-2003, 06:39 PM   #3
Allen614
Member
 
Registered: Dec 2002
Location: Plains
Distribution: Slackware 13
Posts: 465

Rep: Reputation: 30
Is there a significant size difference between the tarball and the package?
 
Old 02-25-2003, 11:36 PM   #4
ratbert90
Member
 
Registered: Jan 2003
Posts: 67

Original Poster
Rep: Reputation: 16
actually, there is. take wine for example, in tar ball, its 7 megs ZIPED.. in tgz, its 11 killobytes!!!! and it works!
 
1 members found this post helpful.
Old 02-26-2003, 12:30 AM   #5
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 46
Just so you know, Slackware packages ARE tarballs. There is
no meaningful difference between the packages that someone
calls a "slackware package" and one that is called a "tarball"
except that the slackware package contains some additional
information of what to do with the files that are packaged up. This
information is in a file called "install/doinst.sh" that is created
when makepkg forms the slackpack. That's pretty much it.
man makepkg
man pkgtool

Quote:
From the makepkg(8) man page
PACKAGE FORMAT
makepkg uses GNU tar plus GNU gzip to create its packages.
A simple way to extract the contents of a package (without
executing the installation scripts, of course) is to use a
command like this:

tar xzvvf package.tgz
Also, There is no known mathematical way to compress something from 7MB to 11KB, unless every bit is essentially the
same. So, even if the slackpacks were not the same thing as
tarballs, either you're missing a hell of a lot of files in your
"Slackware package", or you mistook the 11MB for 11KB.

Last edited by moses; 02-26-2003 at 12:33 AM.
 
Old 02-26-2003, 03:36 AM   #6
xYko
Member
 
Registered: Feb 2003
Location: Helsingborg, Sweden
Distribution: Slackware
Posts: 52

Rep: Reputation: 16
The only problem with that is that the package that you create is system specific. It has been (dynamically) compiled on your system, hence it's using the libraries that you have. That is, if you want to use it on a different computer, you will have to have the same libraries you had at the compile time.

If you're thinking of distributing packages I suggest you either compile statically (which is when you compile the support inside the executable instead of linking to libraries), or have a very generic setup on your system using older libraries which are more likely for people to have.

If you're just building packages for your own use, then this is avery cool as it will allow you to install/uninstall programs when you feel like it. Easier than using rpm if I might add (don't tell the RH fans I said this ).

Quote:
Also, There is no known mathematical way to compress something from 7MB to 11KB, unless every bit is essentially the
same. So, even if the slackpacks were not the same thing as
tarballs, either you're missing a hell of a lot of files in your
"Slackware package", or you mistook the 11MB for 11KB.
The only thing you're missing is the fact that source tarballs contains files that contain text, much of which is NOT used in the actual binary executable file (make scripts, documents, portability stuff and such), while the package that he created only contains the finished compilation.
 
1 members found this post helpful.
Old 02-26-2003, 04:37 AM   #7
Bluesuperman
Member
 
Registered: Nov 2002
Distribution: Slackware
Posts: 155

Rep: Reputation: 30
Hey - I think it is cool, what do the -l and -c do ?
 
Old 02-26-2003, 05:50 AM   #8
kater
Member
 
Registered: Feb 2003
Location: Switzerland, Berne
Distribution: Slackware 9.0
Posts: 186

Rep: Reputation: 30
For this job, i use the little program 'checkinstall'. Works fine here!
http://asic-linux.com.mx/~izto/checkinstall/
 
Old 02-27-2003, 01:11 AM   #9
wr3ck3d
Member
 
Registered: Dec 2002
Location: IL
Distribution: NetBSD, Slackware, Gentoo, Debian, FreeBSD
Posts: 444

Rep: Reputation: 31
yea, 7mb into 11kb, lol....had to be mistaken...on a dial up that a difference of a 3 second download to a 25 minute download.
 
Old 02-27-2003, 09:53 AM   #10
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 46
Quote:
Originally posted by xYko
The only thing you're missing is the fact that source tarballs contains files that contain text, much of which is NOT used in the actual binary executable file (make scripts, documents, portability stuff and such), while the package that he created only contains the finished compilation.
The Wine binary (for example, since that's the one he used)
by itself only compresses to 47 kB. If you include everything else
required by wine to actually run (libraries, man pages, etc.), you
will hit MB rather quickly.

A mistake was made either in the reading of the number, or the
creation of the tarball. A slackpack is always going to be a
bit larger than a tarball containing the same binary files (libs,
executables, etc.) because it also has to contain the scripts that
tell the package manager what to do with those files. It may not
be as large as a source tarball, but there is a limit to how much you
can trim off before you have nothing useful.
 
Old 02-27-2003, 02:59 PM   #11
otbibb
Member
 
Registered: Oct 2002
Distribution: Slackware 8.1
Posts: 33

Rep: Reputation: 15
There is a big difference between a Slackware package and a source tarball, namely that the Slackware package contains binaries that have been zipped up into a tar.gz format, and the source tarballs contain source code that has been zipped up into tar.gz format.

It is quite common for the compiled binaries to be much smaller than the original source code, since the code contains all kind of stuff that isn't folded into the binary. As a matter of fact, just today I downloaded both the binary and the source packages for OpenOffice.org 1.0.2. The binary is about 71 megs, and the source package is about 172 megs.

The only similarity between a Slackware package and a source "tarball" is the compression scheme.

BB
 
Old 02-27-2003, 11:16 PM   #12
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 46
A slackware package can contain whatever you want it to
contain. All you need to do is build your install/* and
var/log/setup scripts to do what you need. If you want to
distribute source as a slackpack, then do so and write your
doinst.sh, setup.*, etc. to do what you need them to do
(configure, compile, install, make clean, etc.). Theoretically, you
could even create a slackpack that just contains scripts to
connect to some server somewhere, download the files it needs,
compile them (if necessary), install them, and then clean up after
itself.
A Slackware package is NOT limited to precompiled binaries.

The point I was making in my previous post was that the claim
that the wine package went from 7MB to 11KB was bogus, either
because ratbert90 misread the filesize or didn't put everything
in the tarball. The compressed wine binary itself is larger than
ratbert90's purported size of the entire wine slackpack. I don't
claim that ratbert90 was not telling the truth, just that there was a
mistake made.
The post before that about compressing down from 7MB to 11KB
being impossible still stands. If you can show me an algorithm
that will allow almost 1000X compression of BINARY (hah, even
non-repetitive text) data, then you could be a very rich person.
If the new size of the tarball is really 11KB, then data is missing.
 
Old 02-28-2003, 08:22 AM   #13
otbibb
Member
 
Registered: Oct 2002
Distribution: Slackware 8.1
Posts: 33

Rep: Reputation: 15
No, I'm not defending the miraculously shrinking Wine binary... that is certainly extreme. Also, you are correct that you can use makepkg to do anything you want. pkgtool is not strictly limited to Slackware, just as you could also use apt-get to keep your Slackware distro up to date, if the configuration stars were all aligned.

However, I think of a "slackware package" as something found either in Pat's binary tree, on linuxpackages.net, or what you can make yourself after compiling.

Have you ever seen a Slackware package that was like a Gentoo script (download/compile/install)? Such a package would indeed by a bit larger than just the source code zipped up, as you originally said.

The original poster made an excellent point that making a package out of freshly compiled software is a great way to keep tabs on your system. Someone else asked if you would save disk space relative to keeping the source around, and my point was that you do (overly optimistic claims notwithstanding).

Cheers,
BB

edit: Oh, I forgot to mention the main point of my reply. My statement about the difference between source tar.gz and slack tar.gz was not really intended as a counter-point to moses. Rather, I've seen many newbies confused about what to do with this "tarball thingy." The answer is, well.. it depends. You need to be aware of when to do tar -zxvf and when to do installkpkg.

Last edited by otbibb; 02-28-2003 at 08:24 AM.
 
Old 02-28-2003, 09:20 AM   #14
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 46
I guess my point (which was never stated as such) is that you
really need to be careful of what you are putting into your own
personal package before you start deleting things. Clearly a
mistake was made with the wine "repackaging", and if care isn't
taken, when the wine install is removed (for some reason), and
an attempt to reinstall it using the above package is made, it
won't work. Thus, the claim of a slackware package being
1000x smaller than the source tarball is dangerous -- it may
encourage people unfamiliar with compression and slackware
packages to try to achieve such space saving without really
knowing what they are doing.
 
Old 02-28-2003, 05:27 PM   #15
saturn_vk
Member
 
Registered: Feb 2003
Location: Sofia
Distribution: slackware
Posts: 104

Rep: Reputation: 15
Quote:
Originally posted by moses

The point I was making in my previous post was that the claim
that the wine package went from 7MB to 11KB was bogus, either
because ratbert90 misread the filesize or didn't put everything
in the tarball. The compressed wine binary itself is larger than
ratbert90's purported size of the entire wine slackpack. I don't
claim that ratbert90 was not telling the truth, just that there was a
mistake made.
The post before that about compressing down from 7MB to 11KB
being impossible still stands. If you can show me an algorithm
that will allow almost 1000X compression of BINARY (hah, even
non-repetitive text) data, then you could be a very rich person.
If the new size of the tarball is really 11KB, then data is missing.
well, look into something called heaven7 on google (it's for windows though)

it's a 64k file, that when run uses about 34 megs of ram (i dont know if it comes from the file though, but it definetely doesnt come from the net)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make my own packages Wynand1 VectorLinux 2 03-10-2004 05:42 PM
slackware 9 what packages do i have to install to make my gcc work zeroversion Linux - Software 1 11-26-2003 11:19 AM
Newer Slackware Packages on older slackware version pengStudent Slackware 2 11-12-2003 12:47 PM
how to make RPM packages off a tarball? chupacabra Linux - General 2 10-15-2002 11:06 AM
Can I automate the tar, ./configure, make, and make install of about 50 packages? JoeLinux Linux - General 2 04-13-2002 03:35 AM


All times are GMT -5. The time now is 03:06 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration