summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy T. Bouse <undrgrid@users.sourceforge.net>2003-03-23 07:01:20 +0000
committerJeremy T. Bouse <undrgrid@users.sourceforge.net>2003-03-23 07:01:20 +0000
commit739ea144d276ca475730d0c928ed9fd82f3cba03 (patch)
tree58fad2d7ab1427e06150c53cdcb3e41a5d03f9f5
parentc9d73535b59fef3056c65c3be6e1e18e4509629a (diff)
downloadmonitoring-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
-rw-r--r--Makefile.am32
-rwxr-xr-xautogen.sh9
-rw-r--r--configure.in10
-rw-r--r--lib/Makefile.am2
-rw-r--r--pkg/solaris/pkginfo.in12
-rwxr-xr-xpkg/solaris/solpkg80
6 files changed, 114 insertions, 31 deletions
diff --git a/Makefile.am b/Makefile.am
index 33182593..8cc15144 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,7 @@
3SUBDIRS = lib plugins plugins-scripts 3SUBDIRS = lib plugins plugins-scripts
4 4
5EXTRA_DIST = CODING FAQ LEGAL REQUIREMENTS SUPPORT \ 5EXTRA_DIST = CODING FAQ LEGAL REQUIREMENTS SUPPORT \
6 Helper.pm contrib nagios-plugins.spec.in 6 Helper.pm contrib pkg nagios-plugins.spec.in
7 7
8ACLOCAL_AMFLAGS = -I lib 8ACLOCAL_AMFLAGS = -I lib
9 9
@@ -18,31 +18,17 @@ nagios-plugins.spec: nagios-plugins.spec.in
18 sed "s/%%{VER}/${VER}/;s/%%{REL}/${REL}/;" $? > $@ 18 sed "s/%%{VER}/${VER}/;s/%%{REL}/${REL}/;" $? > $@
19 19
20# Solaris pkgmk 20# Solaris pkgmk
21PACKDIR=build-pkg 21BUILDDIR=`pwd`/build-solaris
22PACKDIR=`pwd`/build-pkg
22VERSION=@PACKAGE_VERSION@ 23VERSION=@PACKAGE_VERSION@
23 24
24Prototype: 25solpkg:
26 if [ ! -d $(BUILDDIR) ] ; then mkdir $(BUILDDIR); fi
25 if [ ! -d $(PACKDIR) ] ; then mkdir $(PACKDIR); fi 27 if [ ! -d $(PACKDIR) ] ; then mkdir $(PACKDIR); fi
26 cd build-solaris
27 $(MAKE) all 28 $(MAKE) all
28 $(MAKE) DESTDIR=../$(PACKDIR) install 29 $(MAKE) DESTDIR=$(BUILDDIR) install
29 cd .. 30 $(INSTALL) pkg/solaris/pkginfo $(BUILDDIR)
30 echo i pkginfo> Prototype 31 $(cd $(BUILDDIR) && `pwd`/pkg/solaris/solpkg $(PACKDIR))
31 if [ -f checkinstall ] ; then echo i checkinstall>> Prototype; fi
32 if [ -f preinstall ] ; then echo i preinstall>> Prototype; fi
33 if [ -f postinstall ] ; then echo i postinstall>> Prototype; fi
34 pkgproto $(PACKDIR)=/ | sed -e "s|$(LOGNAME) $(GROUP)$$|root root|" | egrep -v "(s|d) none (/|/etc|/var|/usr|/usr/local) " >> Prototype
35
36pkgmap: ../Prototype
37 mkdir -p $(PACKDIR)/nagiosp
38 cd $(PACKDIR)/nagiosp
39 pkgmk -o -r / -f ../Prototype -d $(PACKDIR) nagiosp
40 cd ..
41
42nagios.SPARC.pkg.tar.gz: pkgmap
43 cd $(PACKDIR) && tar -cf - nagiosp | gzip -9 -c > ../nagiosp.SPARC.pkg.tar.gz
44
45pkgset: nagiosp.SPARC.pkg.tar.gz
46 32
47pkgclean: 33pkgclean:
48 rm -rf Prototype nagiosp.SPARC.pkg.tar.gz 34 rm -rf $(BUILDDIR) $(PACKDIR)
diff --git a/autogen.sh b/autogen.sh
index 0357d93a..b833a308 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -19,18 +19,13 @@ else
19fi 19fi
20 20
21# Refresh GNU autotools toolchain. 21# Refresh GNU autotools toolchain.
22for i in config.guess config.sub missing install-sh mkinstalldirs ; do 22for i in config.guess config.sub missing install-sh mkinstalldirs depcomp; do
23 test -r /usr/share/automake/${i} && { 23 test -r /usr/share/automake/${i} && {
24 rm -f ${i} 24 rm -f ${i}
25 cp /usr/share/automake/${i} .
26 } 25 }
27 chmod 755 ${i}
28done 26done
29 27
30aclocal -I lib 28tools/setup
31autoheader
32automake -c -a
33autoconf
34 29
35# For the Debian build 30# For the Debian build
36test -d debian && { 31test -d debian && {
diff --git a/configure.in b/configure.in
index 035ae36e..646519f8 100644
--- a/configure.in
+++ b/configure.in
@@ -99,6 +99,14 @@ ac_cv_uname_s=`uname -s`
99ac_cv_uname_r=`uname -r` 99ac_cv_uname_r=`uname -r`
100ac_cv_uname_v=`uname -v` 100ac_cv_uname_v=`uname -v`
101 101
102PKG_ARCH=`uname -p`
103REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
104REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'`
105
106AC_SUBST(PKG_ARCH)
107AC_SUBST(REV_DATESTAMP)
108AC_SUBST(REV_TIMESTAMP)
109
102dnl Checks for programs. 110dnl Checks for programs.
103AC_PATH_PROG(PYTHON,python) 111AC_PATH_PROG(PYTHON,python)
104AC_PATH_PROG(PERL,perl) 112AC_PATH_PROG(PERL,perl)
@@ -1469,7 +1477,7 @@ AC_SUBST(DEPLIBS)
1469 1477
1470AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"${VERSION}",[package version]) 1478AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"${VERSION}",[package version])
1471 1479
1472AC_OUTPUT(Makefile lib/Makefile plugins/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh command.cfg test.pl,PATH=.:..:$PATH command.cfg) 1480AC_OUTPUT(Makefile lib/Makefile plugins/Makefile plugins-scripts/Makefile plugins-scripts/subst plugins-scripts/utils.pm plugins-scripts/utils.sh command.cfg test.pl pkg/solaris/pkginfo)
1473 1481
1474ACX_FEATURE([with],[cgiurl]) 1482ACX_FEATURE([with],[cgiurl])
1475ACX_FEATURE([with],[nagios-user]) 1483ACX_FEATURE([with],[nagios-user])
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6353d01c..4c99944d 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -6,4 +6,6 @@ noinst_HEADERS = getopt.h fsusage.h mountlist.h
6 6
7libnagiosplug_a_SOURCES = getopt.c getopt1.c getloadavg.c snprintf.c fsusage.c mountlist.c 7libnagiosplug_a_SOURCES = getopt.c getopt1.c getloadavg.c snprintf.c fsusage.c mountlist.c
8 8
9EXTRA_DIST = afs.m4 fstypename.m4 fsusage.m4 ls-mntd-fs.m4
10
9INCLUDES = -I$(srcdir) 11INCLUDES = -I$(srcdir)
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 @@
1PKG="NPDTplugins"
2NAME="nagiosplugins"
3DESC="Nagios network monitoring plugins"
4ARCH="@PKG_ARCH@"
5VERSION="@PACKAGE_VERSION@,REV=@REV_DATESTAMP@"
6CATEGORY="application"
7VENDOR="Nagios Plugin Development Team"
8EMAIL="nagiosplug-devel@lists.sourceforge.net"
9PSTAMP="sfw@REV_TIMESTAMP@"
10BASEDIR="/usr/local"
11CLASSES="none"
12
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 @@
1#!/usr/bin/perl
2
3$pkgdevice = $ARGV[0] || die "Unable to determine device ($!)\n";
4
5$find = "/usr/bin/find";
6$pkgproto = "/usr/bin/pkgproto";
7$pkgmk = "/usr/bin/pkgmk";
8$pkgtrans = "/usr/bin/pkgtrans";
9$prototype = "prototype";
10$pkginfo = "pkginfo";
11
12# Sanity check
13
14$pwd = `pwd`;
15if ($pwd =~ '\/usr\/local') {
16 $pwd = $`;
17}
18die "Wrong location, please cd to <PKGBASE>/usr/local/ and run again.\n"
19 if ($pwd eq "");
20
21open (PREPROTO,"$find . -print |$pkgproto |") ||
22 die "Unable to read prototype information ($!)\n";
23open (PROTO,">$prototype") ||
24 die "Unable to write file prototype ($!)\n";
25print PROTO "i pkginfo=./$pkginfo\n";
26while (<PREPROTO>) {
27 # Read in the prototype information
28 chomp;
29 $thisline = $_;
30 if ($thisline =~ " prototype "
31 or $thisline =~ " pkginfo ") {
32 # Don't do anything as they aren't important
33 } elsif ($thisline =~ "^[fd] ") {
34 # Change the ownership of files and directories
35 ($dir, $none, $file, $mode, $user, $group) = split / /,$thisline;
36 print PROTO "$dir $none $file $mode bin bin\n";
37 } else {
38 # Symlinks and other stuff should be printed also
39 print PROTO "$thisline\n";
40 }
41}
42close PROTO;
43close PREPROTO;
44
45# Now we can start building the package
46
47$os = `uname -r`;
48$os =~ '\.';
49$os = "sol$'";
50chomp $os;
51
52open (PKGINFO,"<$pkginfo") ||
53 die "Unable to read package information ($!)\n";
54while (<PKGINFO>) {
55 # Read in the package information
56 chomp;
57 $thisline = $_;
58 ($var,$value) = split /=/,$thisline;
59 if ("$var" eq "NAME"
60 or "$var" eq "VERSION"
61 or "$var" eq "ARCH") {
62 $tmp = lc($var);
63 $value =~ s/\"//g;
64 if ("$tmp" eq "version"
65 and $value =~ ",REV") {
66 ($value,$var) = split /\,/,$value;
67 $$tmp = $value;
68 } else {
69 $$tmp = $value;
70 }
71 }
72}
73close PKGINFO;
74
75$packagename = "$name-$version-$os-$arch-local";
76
77print "Building package\n";
78system ("$pkgmk -o -r `pwd` -d $pkgdevice");
79system ("(cd $pkgdevice && $pkgtrans -s `pwd` ../$packagename)");
80print "Done. ($packagename)\n";