I just tried to build monit-5.0-beta1 using its included monit.spec under
CentOS 4. It fails due to RPM version names not allowing hyphens:

  $ mach build monit.spec
  Building .src.rpm from monit.spec
  ERROR: Failed parsing spec file 'monit.spec' (return value 1).
  Output follows:
  error: line 3: Illegal char '-' in version: Version: 5.0-beta1

The attached patch fixes this by building 5.0_beta1 instead of 5.0-beta1. Of
course this won't be needed once the software is released :-)

But it also fixes the following errors:

  configure: error: monit requires flex, not lex
...
  checking for SSL include directory... Not found

  Couldn't find your SSL header files.
  Use --with-ssl-incl-dir option to fix this problem or disable
  the SSL support with --without-ssl
...
  + make
  yacc -dt p.y
  make: yacc: Command not found
  make: *** [y.tab.c] Error 127
  error: Bad exit status from /var/tmp/rpm-tmp.1667 (%build)

by adding explicit build dependencies on flex, bison and openssl-devel.
Building in a clean chroot environment is very good at finding these :-)

Regards,

Brian.

P.S. Aside: UPGRADE.txt doesn't mention the config file syntax changes from
4.10.1 to 5.0, although CHANGES.txt does.

UPGRADE.txt is also missing from the final RPM package. Perhaps this is
intentional, if it is obsolete. Or was it forgotten from %doc ?
--- monit-5.0-beta1/monit.spec  2008-04-14 23:53:06.000000000 +0100
+++ monit.spec  2008-04-28 11:17:21.000000000 +0100
@@ -1,12 +1,16 @@
 Name: monit
 Summary: Process monitor and restart utility
-Version: 5.0-beta1
+Version: 5.0_beta1
+%define RealVersion 5.0-beta1
 Release: 1
-Source: http://www.tildeslash.com/monit/dist/%{name}-%{version}.tar.gz
+Source: http://www.tildeslash.com/monit/dist/%{name}-%{RealVersion}.tar.gz
 Group: Utilities/Console
 URL: http://www.tildeslash.com/monit/
 BuildRoot: %{_tmppath}/%{name}-buildroot
 License: GPL
+BuildRequires: flex
+BuildRequires: bison
+BuildRequires: openssl-devel
 
 %description
 Monit is a utility for managing and monitoring processes,
@@ -15,7 +19,7 @@
 actions in error situations.
 
 %prep
-%setup
+%setup -q -n %{name}-%{RealVersion}
 
 %build
 %{configure}
_______________________________________________
monit-dev mailing list
monit-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monit-dev

Reply via email to