• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create a pkg

 
Ramakanta Sahoo
Ranch Hand
Posts: 256
Fedora Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a sample.tar file and I want it in pkg so that if somebody does a pkgadd it will just untar the file.

Do anyone know how to do this.

How can I create a pkg file using the tar file which will only do a untar on execution of pkgadd command
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should have mentioned the OS you're using. Presumably it's Solaris.

Sun has a very good set of documentation on its packaging system in the online docs at sun.com, so the best thing to do is RTFM. A package can be created with an install script that does an untar.

However, in a way, a pkg file is itself a sort of "tar", so you're actually not going to gain a lot by doing that. It would be easier to untar the file before building the package and supply the untar'ed directories to the package builder. That way you'll save yourself the trouble of working up an installer script and the package manager can more cleanly remove the package if you ever need to.
 
Ramakanta Sahoo
Ranch Hand
Posts: 256
Fedora Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a prototype file and a pkginfo file and added i pkginfo=./pkginfo to the prototype file.
and when I'm trying to execute pkgmk -r 'pwd'

It shows error for like no object found though the file is there and not taking any path which has a whitespace in it or any file with whitespace in the name.
how to avoid this. I cant change the paths or file names.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Filenames with spaces in them are a nightmare, even in Windows or Macintosh machines, and they really have no business at all in a Unix environment.

However, they are supported, although dangerous. Just escape the spaces.

For example (and PLEASE don't actually make one of these!):

/usr/local/Program\ Files/My\ Program/file1

 
Ramakanta Sahoo
Ranch Hand
Posts: 256
Fedora Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tried your suggestion too same error.

May be I need to tar the file and make it a pkg. that should work but i dont know how to specify in the pkg that extract/untar the tar file when pkgadd is executing.

There is a way to put preinstall and postinstall commands so that during uninstall also it will remove all.

I'm not able to get it. If someone has already done so then please suggest.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic