Creation of software-packages under Solaris
1. Download the source code of the Software.
http://ftp.samba.org/pub/samba/stable/
2. Compile/Configure it.
/opt/samba-3.5.18/source3/configure
3. Once Configure we need to run Make.
make or gmake
4. Run Install after that. make install (If it is a GNU Software, please use gmake and gmake install)
make install OR
gmake install
5. Install the Man Pages.
make installman OR
gmake installman
6. There is a library issue reported in this compilation, hence copy the library to /usr/lib/
cp -pr /opt/samba-3.5.18/source3/bin/libwbclient.so.0 /usr/lib/ OR
cp -pr /usr/local/samba/lib/libwbclient.so.0 /usr/lib/
7. After that we need to start the procedure of packaging.
We have installed the Software at /usr/local/samba. Now we can use find to retrieve a list of all files there.
Of course we don't want t empty lines. We can use awk for the job.
find /usr/local/samba | awk 'length > 0'
8. Now we have all the list of files. We have to put that in a file and save it.
vi /var/tmp/sw.list
9. Now we need to create a prototype.
cat /var/tmp/sw.list | pkgproto > /var/tmp/sw.proto
10. Check the file permissions and ownership's, maybe they are not the way you'd like them to be. If your satisfied with the permissions
you need to add at least two additional files -- pkginfo containing a description of your package and checkinstall containing a script to
perform checks before installation. 11. checkinstall file should look like this. These files (checkinstall, pkginfo) need to be in same directory as your sw.proto file.
Please do mention bit,release and platfrom value as per your need.
root@hostname # more checkinstall
#!/bin/sh
#
expected_bits="64"
expected_release="5.9"
expected_platform="sparc"
#
release=`uname -r`
platform=`uname -p`
bits=`isainfo -b`
#
if [ ${platform} != ${expected_platform} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_platform} architecture\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
if [ ${release} != ${expected_release} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_release} machine\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
if [ ${bits} != ${expected_bits} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_bits} bit machine\n"
echo "\tYour machine is running a ${bits} bit O.S. currently\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
exit 0
12. pkginfo file should look like this. The file is self explanatory. Please do fill the required details.
root@hostname # more pkginfo
PKG=GNUSamba
NAME=GNU Samba 3.5.18 SPARC 64bit Solaris 9
VERSION=3.5.18
ARCH=sparc
CLASSES=none
CATEGORY=utility
VENDOR=GNU
PSTAMP=11 MARCH 2013
EMAIL=manas.tri@gmail.com
ISTATES=S s 1 2 3
RSTATES=S s 1 2 3
BASEDIR=/
13. After you made those file , please put it in the first 2 lines of sw.proto.root@hostname # more sw.proto
i pkginfo
i checkinstall
d none /usr/local/samba 0755 root other
d none /usr/local/samba/bin 0755 root other
f none /usr/local/samba/bin/wbinfo 0755 root other
f none /usr/local/samba/bin/smbclient 0755 root other
f none /usr/local/samba/bin/net 0755 root other
14. Now run pkgmake to create the package.
pkgmk -o -r / -d /var/tmp/ -f sw.proto
15. Prefer to have the package in `datastream' format, it's easier to distribute. We can do the transformation with the pkgtrans-utility:
pkgtrans -s `pwd` /var/tmp/samba-3.5.18-Solaris-9-SPARC GNUSamba
16. After this you'll have a file named samba-3.5.18-Solaris-9-SPARC in /var/tmp/, containing your package in datastream format.
Just gzip it and upload it somewhere. The uncompressed datastream package can be installed with `pkgadd -d filename`
http://ftp.samba.org/pub/samba/stable/
2. Compile/Configure it.
/opt/samba-3.5.18/source3/configure
3. Once Configure we need to run Make.
make or gmake
4. Run Install after that. make install (If it is a GNU Software, please use gmake and gmake install)
make install OR
gmake install
5. Install the Man Pages.
make installman OR
gmake installman
6. There is a library issue reported in this compilation, hence copy the library to /usr/lib/
cp -pr /opt/samba-3.5.18/source3/bin/libwbclient.so.0 /usr/lib/ OR
cp -pr /usr/local/samba/lib/libwbclient.so.0 /usr/lib/
7. After that we need to start the procedure of packaging.
We have installed the Software at /usr/local/samba. Now we can use find to retrieve a list of all files there.
Of course we don't want t empty lines. We can use awk for the job.
find /usr/local/samba | awk 'length > 0'
8. Now we have all the list of files. We have to put that in a file and save it.
vi /var/tmp/sw.list
9. Now we need to create a prototype.
cat /var/tmp/sw.list | pkgproto > /var/tmp/sw.proto
10. Check the file permissions and ownership's, maybe they are not the way you'd like them to be. If your satisfied with the permissions
you need to add at least two additional files -- pkginfo containing a description of your package and checkinstall containing a script to
perform checks before installation. 11. checkinstall file should look like this. These files (checkinstall, pkginfo) need to be in same directory as your sw.proto file.
Please do mention bit,release and platfrom value as per your need.
root@hostname # more checkinstall
#!/bin/sh
#
expected_bits="64"
expected_release="5.9"
expected_platform="sparc"
#
release=`uname -r`
platform=`uname -p`
bits=`isainfo -b`
#
if [ ${platform} != ${expected_platform} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_platform} architecture\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
if [ ${release} != ${expected_release} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_release} machine\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
if [ ${bits} != ${expected_bits} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_bits} bit machine\n"
echo "\tYour machine is running a ${bits} bit O.S. currently\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
exit 0
12. pkginfo file should look like this. The file is self explanatory. Please do fill the required details.
root@hostname # more pkginfo
PKG=GNUSamba
NAME=GNU Samba 3.5.18 SPARC 64bit Solaris 9
VERSION=3.5.18
ARCH=sparc
CLASSES=none
CATEGORY=utility
VENDOR=GNU
PSTAMP=11 MARCH 2013
EMAIL=manas.tri@gmail.com
ISTATES=S s 1 2 3
RSTATES=S s 1 2 3
BASEDIR=/
13. After you made those file , please put it in the first 2 lines of sw.proto.root@hostname # more sw.proto
i pkginfo
i checkinstall
d none /usr/local/samba 0755 root other
d none /usr/local/samba/bin 0755 root other
f none /usr/local/samba/bin/wbinfo 0755 root other
f none /usr/local/samba/bin/smbclient 0755 root other
f none /usr/local/samba/bin/net 0755 root other
14. Now run pkgmake to create the package.
pkgmk -o -r / -d /var/tmp/ -f sw.proto
15. Prefer to have the package in `datastream' format, it's easier to distribute. We can do the transformation with the pkgtrans-utility:
pkgtrans -s `pwd` /var/tmp/samba-3.5.18-Solaris-9-SPARC GNUSamba
16. After this you'll have a file named samba-3.5.18-Solaris-9-SPARC in /var/tmp/, containing your package in datastream format.
Just gzip it and upload it somewhere. The uncompressed datastream package can be installed with `pkgadd -d filename`
No comments