{"id":68,"date":"2008-05-21T16:17:12","date_gmt":"2008-05-21T21:17:12","guid":{"rendered":"http:\/\/blogs.cae.tntech.edu\/mwr\/2008\/05\/21\/making-solaris-packages-from-commercial-software\/"},"modified":"2024-10-27T14:26:19","modified_gmt":"2024-10-27T14:26:19","slug":"making-solaris-packages-from-commercial-software","status":"publish","type":"post","link":"https:\/\/sites.tntech.edu\/renfro\/2008\/05\/21\/making-solaris-packages-from-commercial-software\/","title":{"rendered":"Making Solaris Packages from Commercial Software"},"content":{"rendered":"<p>Creating a managed infrastructure can go pretty slowly when you&#8217;re beset with a combination of bare competence and a work schedule that&#8217;s overrun with non-infrastructural tasks. So yes, it&#8217;s been just under a year since I wrote up <a href=\"http:\/\/blogs.cae.tntech.edu\/mwr\/2007\/05\/28\/making-debian-packages-from-commercial-software\/\">how to make Debian packages from commercial software<\/a>. On to getting similar capabilities out of the Solaris systems.<\/p>\n<p><strong>The packages<\/strong><\/p>\n<p>I already use Blastwave and pkg-get to install third-party free software applications, so I figured it would be easiest to use the same tools on my packaging. So for a first example, I installed Maple 11.00 manually into \/opt\/maple\/11 on a Solaris 10 system. Then I made a temporary working folder and build folder, made an opt folder there, and moved the maple folder from the regular opt to my build folder&#8217;s opt. I also made a usr\/local\/bin in my build folder, and made relative symlinks from the main Maple executables to their assumed homes in usr\/local\/bin. The abridged results from the temporary working folder looked like this:<\/p>\n<pre>\n# pwd\n\/root\/work\/maple11-11.00\n# ls -l\ntotal 6\ndrwxr-xr-x   4 root     root         512 May 22 09:27 build\n-rw-r--r--   1 root     root          41 May 21 17:59 copyright\n-rw-r--r--   1 root     root           0 May 22 09:36 depend\n-rw-r--r--   1 root     root         143 May 22 09:35 pkginfo\n# cat copyright\nCopyright MapleSoft, All Rights Reserved\n# cat pkginfo\nPKG=MAPLmaple11\nNAME=maple11\nVERSION=11.00\nARCH=sun4u\nDESC=Interactive computer algebra system\nBASEDIR=\/\nCATEGORY=application\nVENDOR=MapleSoft\nEMAIL=renfro@tntech.edu\n# ls -al build\/opt\/maple\/11\ntotal 504\ndrwxrwxr-x  17 root     other        512 May 22 08:43 .\ndrwxrwxr-x   3 root     other        512 May 22 08:42 ..\ndrwxr-xr-x   2 root     other        512 May 22 08:42 afm\ndrwxr-xr-x   2 root     other        512 May 22 08:42 bin\ndrwxr-xr-x   3 root     other       2048 May 22 08:42 bin.SUN_SPARC_SOLARIS\ndrwxr-xr-x   9 root     other        512 May 22 08:42 data\ndrwxr-xr-x   2 root     other        512 May 22 08:42 etc\ndrwxr-xr-x   2 root     other       3072 May 22 08:42 examples\ndrwxr-xr-x   3 root     other        512 May 22 08:42 extern\n-rw-r--r--   1 root     other     153861 May 21 14:12 Install.html\ndrwxr-xr-x   2 root     other       1536 May 22 08:42 java\ndrwxrwxr-x   7 root     other        512 May 22 08:42 jre.SUN_SPARC_SOLARIS\ndrwxr-xr-x   4 root     other       1536 May 22 08:43 lib\ndrwxr-xr-x   2 root     other        512 May 22 08:43 license\ndrwxr-xr-x   3 root     other        512 May 22 08:43 man\n-rw-rw-r--   1 root     other      60064 May 21 14:15 Maple_11_InstallLog.log\n-rw-r--r--   1 root     other      10285 May 21 14:12 readme.txt\ndrwxr-xr-x   6 root     other        512 May 22 08:43 samples\ndrwxr-xr-x   2 root     other        512 May 22 08:43 test\ndrwxr-xr-x   2 root     other        512 May 22 08:42 X11_defaults\n# ls -al build\/usr\/local\/bin\ntotal 10\ndrwxr-xr-x   2 root     root         512 May 22 08:56 .\ndrwxr-xr-x   3 root     root         512 May 22 08:47 ..\nlrwxrwxrwx   1 root     root          31 May 22 08:55 maple11 -&gt; ..\/..\/..\/opt\/maple\/11\/bin\/maple\nlrwxrwxrwx   1 root     root          30 May 22 08:56 mint11 -&gt; ..\/..\/..\/opt\/maple\/11\/bin\/mint\nlrwxrwxrwx   1 root     root          32 May 22 08:55 xmaple11 -&gt; ..\/..\/..\/opt\/maple\/11\/bin\/xmaple\n<\/pre>\n<p>Now, given that folder structure, I could adapt <a href=\"http:\/\/www.blastwave.org\/standards\/pkgcreation.php\">Blastwave&#8217;s package creation instructions<\/a> to create some workable Solaris packages:<\/p>\n<pre>\n# (echo \"i pkginfo\"; echo \"i copyright\" ; echo \"i depend\" ; cd build ; find . | pkgproto ) &gt; prototype\n# pkgmk -b \/ -a `uname -p`\n# filename=maple11-11.00-SunOS`uname -r`-`uname -p`.pkg\n# pkgtrans -s \/var\/spool\/pkg \/root\/$filename MAPLmaple11\n# cd \/root\n# gzip $filename\n<\/pre>\n<p>Once mkpkg is all done with its work, I have a valid maple11-11.00-SunOS5.10-sparc.pkg.gz Solaris package in my \/root folder. After testing it with regular pkgadd, I&#8217;m ready to put it into a private pkg-get repository.<\/p>\n<p><strong>The pkg-get repository<\/strong><\/p>\n<p>Compared to <a href=\"http:\/\/blogs.cae.tntech.edu\/mwr\/2007\/05\/28\/my-own-private-debian-repository\/\">a Debian repository<\/a>, a pkg-get repository is pretty simple. From the top-level folder in the repository on the ftp server:<\/p>\n<pre>\n# find sparc -print\nsparc\nsparc\/5.10\nsparc\/5.10\/maple11-11.00-SunOS5.10-sparc.pkg.gz\nsparc\/5.10\/descriptions\nsparc\/5.10\/catalog\n<\/pre>\n<p>A pkg-get repository&#8217;s top-level folders are named by processor type, i.e., the results of <code>uname -p<\/code>. Each processor type folder contains folders for each OS release level (from <code>uname -r<\/code>). Each release level folder contains packages for that CPU and OS, plus a descriptions and a catalog file.<\/p>\n<p>The catalog file is created with Phil Brown&#8217;s <a href=\"http:\/\/www.bolthole.com\/solaris\/makecontents\">makecontents<\/a> script. It could potentially handle creating the descriptions, file, too, but I guess he never needed them. But the pkg-get script I got from blastwave.org definitely wants a descriptions file, so I&#8217;ll need to create that, too.<\/p>\n<p>The way I&#8217;m creating the descriptions file is with the following script (on a Debian ftp server, so there may be some GNU-isms or bash-isms in the following code):<\/p>\n<pre>\n#!\/bin\/sh\nPKG_GET_DIR=\/wherever\/has\/the\/sparc\/and\/i386\/folders\ncd ${PKG_GET_DIR}\nfor name in sparc i386; do\n    if [ -d $name ]; then\n        cd $name\n        for version in 5*; do\n            if [ -d $version ]; then\n                cd $version\n                for package in *.gz; do\n                    name=`grep $package catalog | awk '{print $1}'`\n                    echo -ne \"$name - \"\n                    zcat $package | head | strings | grep DESC= | cut -d= -f2-\n                done &gt; descriptions\n                cd ..\n            fi\n        done\n        cd ..\n    fi\ndone\n<\/pre>\n<p>which leaves me with a catalog file containing (so far, since I&#8217;ve only made one package):<\/p>\n<pre>\nmaple11 11.00 MAPLmaple11 maple11-11.00-SunOS5.10-sparc.pkg.gz\n<\/pre>\n<p>and a descriptions file containing:<\/p>\n<pre>\nmaple11 - Interactive computer algebra system\n<\/pre>\n<p>And now I can install them on a second host that&#8217;s never seen Maple installed before with:<\/p>\n<pre>\npkg-get -s ftp:\/\/host\/path\/to\/repository\/ -U ; pkg-get -s ftp:\/\/host\/path\/to\/repository\/ install maple11\n<\/pre>\n<p>and afterwards get:<\/p>\n<pre>\n# which maple11\n\/usr\/local\/bin\/maple11\n# maple11\n    |\\\\^\/|     Maple 11 (SUN SPARC SOLARIS)\n._|\\\\|   |\/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2007\n \\\\  MAPLE  \/  All rights reserved. Maple is a trademark of\n &lt;____ ____&gt;  Waterloo Maple Inc.\n      |       Type ? for help.\n&gt; quit\nbytes used=412112, alloc=393144, time=0.07\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Creating a managed infrastructure can go pretty slowly when you&#8217;re beset with a combination of bare competence and a work schedule that&#8217;s overrun with non-infrastructural tasks. So yes, it&#8217;s been just under a year since I wrote up how to make Debian packages from commercial software. On to getting similar capabilities out of the Solaris &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/sites.tntech.edu\/renfro\/2008\/05\/21\/making-solaris-packages-from-commercial-software\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Making Solaris Packages from Commercial Software&#8221;<\/span><\/a><\/p>\n","protected":false},"author":87,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,18],"tags":[],"class_list":["post-68","post","type-post","status-publish","format-standard","hentry","category-infrastructures","category-solaris","entry"],"_links":{"self":[{"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/posts\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/users\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":1,"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":469,"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/posts\/68\/revisions\/469"}],"wp:attachment":[{"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.tntech.edu\/renfro\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}