VectorLinux
September 01, 2014, 06:10:13 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1] 2
  Print  
Author Topic: First (no-)go at packaging (solved).  (Read 7678 times)
nightflier
Administrator
Vectorian
*****
Posts: 4022



« on: September 03, 2007, 02: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, 04:10:55 am by nightflier » Logged
M0E-lnx
Administrator
Vectorian
*****
Posts: 3179



« Reply #1 on: September 03, 2007, 03: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
Logged

nightflier
Administrator
Vectorian
*****
Posts: 4022



« Reply #2 on: September 03, 2007, 04: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: 3179



« Reply #3 on: September 03, 2007, 06: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?
Logged

nightflier
Administrator
Vectorian
*****
Posts: 4022



« Reply #4 on: September 03, 2007, 06: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



« Reply #5 on: September 04, 2007, 12:03:23 am »

Try using a DESTDIR install instead of checkinstall:

Code:
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 Smiley
Logged

nightflier
Administrator
Vectorian
*****
Posts: 4022



« Reply #6 on: September 04, 2007, 06:55:18 am »

Code:
make DESTDIR='/tmp/package-gnump3d' install
That 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



« Reply #7 on: September 04, 2007, 07:23:34 am »

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

Glad your making packages,
Uelsk8s
Logged
exeterdad
Packager
Vectorian
****
Posts: 2046



« Reply #8 on: September 04, 2007, 11:54:36 am »

Quote
Did I violate any packaging rules in the process?

Sometimes you have to do what you have to do.  Smiley 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: 4022



« Reply #9 on: September 04, 2007, 12: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.  Smiley
Logged
Triarius Fidelis
Vecteloper
Vectorian
****
Posts: 2399


Domine, exaudi vocem meam


WWW
« Reply #10 on: September 04, 2007, 12: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: 4022



« Reply #11 on: September 04, 2007, 01: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



« Reply #12 on: September 04, 2007, 03: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: 4022



« Reply #13 on: September 04, 2007, 05:17:59 pm »

There is no configure. Here is "Makefile":
http://pastebin.com/m60bb399e
« Last Edit: September 04, 2007, 05:21:02 pm by nightflier » Logged
M0E-lnx
Administrator
Vectorian
*****
Posts: 3179



« Reply #14 on: September 04, 2007, 06: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
Logged

Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!