diff options
author | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-03-23 07:01:20 +0000 |
---|---|---|
committer | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-03-23 07:01:20 +0000 |
commit | 739ea144d276ca475730d0c928ed9fd82f3cba03 (patch) | |
tree | 58fad2d7ab1427e06150c53cdcb3e41a5d03f9f5 /pkg | |
parent | c9d73535b59fef3056c65c3be6e1e18e4509629a (diff) | |
download | monitoring-plugins-739ea144d276ca475730d0c928ed9fd82f3cba03.tar.gz |
Solaris package build system
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@449 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/solaris/pkginfo.in | 12 | ||||
-rwxr-xr-x | pkg/solaris/solpkg | 80 |
2 files changed, 92 insertions, 0 deletions
diff --git a/pkg/solaris/pkginfo.in b/pkg/solaris/pkginfo.in new file mode 100644 index 00000000..be4b97fa --- /dev/null +++ b/pkg/solaris/pkginfo.in @@ -0,0 +1,12 @@ +PKG="NPDTplugins" +NAME="nagiosplugins" +DESC="Nagios network monitoring plugins" +ARCH="@PKG_ARCH@" +VERSION="@PACKAGE_VERSION@,REV=@REV_DATESTAMP@" +CATEGORY="application" +VENDOR="Nagios Plugin Development Team" +EMAIL="nagiosplug-devel@lists.sourceforge.net" +PSTAMP="sfw@REV_TIMESTAMP@" +BASEDIR="/usr/local" +CLASSES="none" + diff --git a/pkg/solaris/solpkg b/pkg/solaris/solpkg new file mode 100755 index 00000000..0b82bce0 --- /dev/null +++ b/pkg/solaris/solpkg @@ -0,0 +1,80 @@ +#!/usr/bin/perl + +$pkgdevice = $ARGV[0] || die "Unable to determine device ($!)\n"; + +$find = "/usr/bin/find"; +$pkgproto = "/usr/bin/pkgproto"; +$pkgmk = "/usr/bin/pkgmk"; +$pkgtrans = "/usr/bin/pkgtrans"; +$prototype = "prototype"; +$pkginfo = "pkginfo"; + +# Sanity check + +$pwd = `pwd`; +if ($pwd =~ '\/usr\/local') { + $pwd = $`; +} +die "Wrong location, please cd to <PKGBASE>/usr/local/ and run again.\n" + if ($pwd eq ""); + +open (PREPROTO,"$find . -print |$pkgproto |") || + die "Unable to read prototype information ($!)\n"; +open (PROTO,">$prototype") || + die "Unable to write file prototype ($!)\n"; +print PROTO "i pkginfo=./$pkginfo\n"; +while (<PREPROTO>) { + # Read in the prototype information + chomp; + $thisline = $_; + if ($thisline =~ " prototype " + or $thisline =~ " pkginfo ") { + # Don't do anything as they aren't important + } elsif ($thisline =~ "^[fd] ") { + # Change the ownership of files and directories + ($dir, $none, $file, $mode, $user, $group) = split / /,$thisline; + print PROTO "$dir $none $file $mode bin bin\n"; + } else { + # Symlinks and other stuff should be printed also + print PROTO "$thisline\n"; + } +} +close PROTO; +close PREPROTO; + +# Now we can start building the package + +$os = `uname -r`; +$os =~ '\.'; +$os = "sol$'"; +chomp $os; + +open (PKGINFO,"<$pkginfo") || + die "Unable to read package information ($!)\n"; +while (<PKGINFO>) { + # Read in the package information + chomp; + $thisline = $_; + ($var,$value) = split /=/,$thisline; + if ("$var" eq "NAME" + or "$var" eq "VERSION" + or "$var" eq "ARCH") { + $tmp = lc($var); + $value =~ s/\"//g; + if ("$tmp" eq "version" + and $value =~ ",REV") { + ($value,$var) = split /\,/,$value; + $$tmp = $value; + } else { + $$tmp = $value; + } + } +} +close PKGINFO; + +$packagename = "$name-$version-$os-$arch-local"; + +print "Building package\n"; +system ("$pkgmk -o -r `pwd` -d $pkgdevice"); +system ("(cd $pkgdevice && $pkgtrans -s `pwd` ../$packagename)"); +print "Done. ($packagename)\n"; |