OpenSolaris Solaris Forum  
     

Left Nav Register FAQ Members List Default Password Members List Linux Commands Search Today's Posts Mark Forums Read Right Nav

Left Container Right Container
 

Go Back   OpenSolaris Solaris Forum » Solaris General

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-10-2010, 06:21 AM
Junior Member
 
Join Date: Jun 2010
Posts: 2
Default How to create solaris package for a java application

Hi I have created a java application and created its executable jar (java archieve) file. Now I want to create solaris packager for that java application to which I can install in any solaris OS.



Thanks
Sunil Kumar Sahoo
Reply With Quote
Sponsored Links

  #2 (permalink)  
Old 06-10-2010, 06:26 AM
Unregistered
Guest
 
Posts: n/a
Default

have you looked into
Put the following in a Makefile, and replace "BOLTpget", with the name of YOUR package, and any other appropriate substitutions

PKG=BOLTpget
#possible ARCH values are i386, sparc, all
ARCH=all
PKGFILE=$(PKG)-$(ARCH).pkg

pkg:
pkgmk -o -d /tmp -a $(ARCH)
touch $(PKGFILE)
pkgtrans -s /tmp $(PKGFILE) $(PKG)
rm -r /tmp/$(PKG)
@echo check current directory for .pkg files


Remember, those big spaces at the start of lines represent a TAB!

Then, create two files in the current directory: pkginfo, and prototype.
Here are some examples for you. First is 'pkginfo'

CLASSES=none
BASEDIR=/usr/local
TZ=PST
PATH=/sbin:/usr/sbin:/usr/bin:/usr/sadm/install/bin
PKG=BOLTpget
NAME=pkg-get
VERSION=1.0
CATEGORY=system
DESC=A convinient way to automate package install from sunfreeware.com
VENDOR=Philip Brown, Bolthole Software
EMAIL=phil@bolthole.com
PKGSAV=/var/sadm/pkg/BOLTpget/save

Next is the 'prototype' file.

i pkginfo
!default 0755 root bin
d none bin ? ? ?
f none bin/pkg-get=pkg-get
d none share ? ? ?
d none share/man ? ? ?
d none share/man/man1m ? ? ?
f none share/man/man1m/pkg-get.1m=pkg-get.1m

d means "directory"
i means "information"
f means "file"

The idea for the "file" entry being that you put where you want the file to go on the left of the '=' sign, and where it is currently, on the right side. Also, there is an implied $BASEDIR in front of the destination dir.

So, if you had a file in the current directory called help.proto, and you wanted it installed in /usr/local/lib/myprog.proto, you could have as an entry,

f none $BASEDIR/lib/myprog.proto=helpproto

although as I mentioned, the $BASEDIR/ is implied, and takes whatever value is set for BASEDIR in pkginfo. Which is why it is always nice to set something reasonable for BASEDIR in pkginfo, instead of BASEDIR=/

-- Go! --
So now, if you have all your binaries, etc listed in the prototype file, all you have to do is type

make pkg

and very soon you will have a shiney new .pkg file in your curent directory!
Suitable for "pkgadd -d name.pkg" to add it. Or use pkgchk -d name.pkg with various options, to examine your new package.

Package dependencies
If you want your package to depend on another package, you need to create a 'depend' file (man depend) and add

i depend

to the prototype file.

How to make a Solaris package (pkg format)
Reply With Quote
  #3 (permalink)  
Old 06-10-2010, 07:25 AM
Junior Member
 
Join Date: Jun 2010
Posts: 2
Default How to create solaris package for a java application

Thanks for your post,
The url that you have mentioned does not give complete information regarding how to create packages from scratch level. I am new to solaris.


Thanks
Sunil Kumar Sahoo
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LiveCD with automatic execution of a graphical application at boot time Unregistered Solaris OpenSolaris Servers 0 05-23-2010 04:56 PM
How to add the new repositories in package manager bang1902 Solaris General 1 05-13-2010 06:02 PM


All times are GMT. The time now is 01:22 PM.


Powered by vBulletin. Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.