VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Pages: [1] 2

Author Topic: First (no-)go at packaging (solved).  (Read 8706 times)

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4085
First (no-)go at packaging (solved).
« on: September 03, 2007, 03:15:23 pm »

To test out the procedure for creating packages, I decided to start out easy, with gnump3d.

The program is very simple, installing is just a matter of extracting and typing "make install". This works fine.

However, when I try to install from the package made with checkinstall, some directories in /var do not get created. The script fails (quietly) to make /var/log/gnump3d and /var/cache/gnump3d. The other files are created okay.

Am I overlooking something obvious?
« Last Edit: September 06, 2007, 05:10:55 am by nightflier »
Logged

M0E-lnx

  • Administrator
  • Vectorian
  • *****
  • Posts: 3217
Re: First (no-)go at packaging.
« Reply #1 on: September 03, 2007, 04:05:19 pm »

you may need to check ./configure --help and make sure you are setting the correct values. For example most of our appliactions are installed to /usr but most make files try to install to /usr/local so you would need to run you configure script like this ./configure --prefix=usr to override the default value. The same goes for the /var value

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4085
Re: First (no-)go at packaging.
« Reply #2 on: September 03, 2007, 05:34:05 pm »

This one does not even use .configure. Seems like the installer just copies ASCII files (perl scripts and modules) to various locations on the drive. Like I said, just running "make install" in the extracted directory results in a functioning application.

I presume the file "makefile" is what controls the actions. It contains "prefix =/usr". I made a change in it to create an rc.file, and that got picked up by checkinstall.

When I look inside the resulting .tlz file, I see /etc, /install and /usr, and the files that get copied in the process, but no /var.
Logged

M0E-lnx

  • Administrator
  • Vectorian
  • *****
  • Posts: 3217
Re: First (no-)go at packaging.
« Reply #3 on: September 03, 2007, 07:13:08 pm »

you should examine the resulting directories to see if /var is somewhere in the wrong location. You can also do a make --help on some applications to see what arguments it takes.  And what exactly are you expecting to end up in /var?

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4085
Re: First (no-)go at packaging.
« Reply #4 on: September 03, 2007, 07:42:25 pm »

some directories in /var do not get created. The script fails (quietly) to make /var/log/gnump3d and /var/cache/gnump3d.

It is supposed to create empty directories for the program to use. I found that if I throw some dummy files in there, they do get created. Looks like checkinstall ignores empty directories?
Logged

easuter

  • Global Moderator
  • Vectorian
  • *****
  • Posts: 2160
Re: First (no-)go at packaging.
« Reply #5 on: September 04, 2007, 01:03:23 am »

Try using a DESTDIR install instead of checkinstall:

Code: [Select]
make DESTDIR='/tmp/package-gnump3d' install
After that, all the files should be installed to /tmp/package-gnump3d, and you can then just package them up with the makepkg command.
If that doesn't work, then the Makefile might not support a DESTDIR install...at which point a patch might be necessary for it to work.

Let us know how it works out :)
Logged

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4085
Re: First (no-)go at packaging.
« Reply #6 on: September 04, 2007, 07:55:18 am »

Code: [Select]
make DESTDIR='/tmp/package-gnump3d' installThat directory did not get created.

However, I made some progress using the following steps:
1: Create an initial package by following the steps outlined in the packaging howto.
2: Extract the contents of the package to a new directory.
3: Edit doinst.sh with commands to create the directories.
4: Create a new package from these files with makepkg.

Now the package installs everything and as far as I can see, the program behaves the same way as if I use "make install".

Did I violate any packaging rules in the process?
Logged

uelsk8s

  • Administrator
  • Vectorian
  • *****
  • Posts: 2504
Re: First (no-)go at packaging.
« Reply #7 on: September 04, 2007, 08:23:34 am »

Nope.
You learned what lots of us find out, Most things dont package correctly without some tweaking by hand.  :)

Glad your making packages,
Uelsk8s
Logged

exeterdad

  • Packager
  • Vectorian
  • ****
  • Posts: 2046
Re: First (no-)go at packaging.
« Reply #8 on: September 04, 2007, 12:54:36 pm »

Quote
Did I violate any packaging rules in the process?

Sometimes you have to do what you have to do.  :) If it works, that is the main thing. 

So the makefile had no reference of DESTDIR?

I often will search the makefile for DESTDIR or destdir before packaging because some aren't written that way.  Some will have some sort of alternate prefix at the beginning of the string that you can use instead.

Did you create the destination directory first?  The temp directory must be created before you can install to it.
Quote
mkdir -p /tmp/package-gnump3d

then

Quote
make DESTDIR='/tmp/package-gnump3d' install
Logged

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4085
Re: First (no-)go at packaging.
« Reply #9 on: September 04, 2007, 01:17:09 pm »

Quote
So the makefile had no reference of DESTDIR?
I can not find it in there.

Quote
Did you create the destination directory first?
Same result with or without the directory in place.

This was very educational. I will continue to play with packaging for programs that I use and am familiar with.

Thanks for the help, guys.  :)
Logged

Triarius Fidelis

  • Vecteloper
  • Vectorian
  • ****
  • Posts: 2399
  • Domine, exaudi vocem meam
    • my website
Re: First (no-)go at packaging.
« Reply #10 on: September 04, 2007, 01:19:35 pm »

I'll warrant it's in /usr/var

After you run make install as root, quickly run 'find /usr -not -type d -cmin -5 > pkglist' and see what comes up. That method only functions properly provided you run it promptly after installation, and if you haven't installed or changed anything else in /usr in the last five minutes.
Logged
"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4085
Re: First (no-)go at packaging.
« Reply #11 on: September 04, 2007, 02:20:33 pm »

Quote
I'll warrant it's in /usr/var

If that was the case, I would see it inside the tlz package, right? It does not show up there. Nor in /usr/var on the hdd.

I tried a slightly different approach in step 3 mentioned above. Instead of modifying doinst.sh, I just created the missing directories and set the permissions. New package built and installed fine. Guess there are many ways of doing this.
Logged

easuter

  • Global Moderator
  • Vectorian
  • *****
  • Posts: 2160
Re: First (no-)go at packaging.
« Reply #12 on: September 04, 2007, 04:36:42 pm »

After the configure has finishes, can you post the Makefile in pastebin and link that here please?
It is possible to "fix" the DESTDIR issue manually, and then creating a patch for it.
Logged

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4085
Re: First (no-)go at packaging.
« Reply #13 on: September 04, 2007, 06:17:59 pm »

There is no configure. Here is "Makefile":
http://pastebin.com/m60bb399e
« Last Edit: September 04, 2007, 06:21:02 pm by nightflier »
Logged

M0E-lnx

  • Administrator
  • Vectorian
  • *****
  • Posts: 3217
Re: First (no-)go at packaging.
« Reply #14 on: September 04, 2007, 07:06:19 pm »

I can't see that file here but i bet it has something like localstatedir or logdir=$prefix/var.     dang! That's hard to do on a cell phone
Pages: [1] 2