Enable native code compilation when ocamlopt is available.
[whenjobs.git] / whenjobs.spec.in
1 %define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
2 %define debug_package %{nil}
3
4 # Prevent unwanted bytecode stripping by RPM.
5 %define __strip /bin/true
6
7 Name:            @PACKAGE_NAME@
8 Version:         @PACKAGE_VERSION@
9 Release:         @RPM_RELEASE@%{?dist}
10 Summary:         Replacement for cron with dependencies
11
12 Group:           Development/Libraries
13 License:         GPLv2+
14 URL:             http://people.redhat.com/~rjones/whenjobs
15 Source0:         http://people.redhat.com/~rjones/whenjobs/files/%{name}-%{version}.tar.gz
16
17 BuildRequires:   ocaml >= 3.12.0
18 BuildRequires:   ocaml-ocamldoc
19 BuildRequires:   ocaml-findlib-devel
20 BuildRequires:   ocaml-calendar-devel >= 2
21 BuildRequires:   ocaml-ocamlnet-devel >= 3
22 BuildRequires:   ocaml-camlp4-devel
23 BuildRequires:   mailx
24
25 # For building manual pages.
26 BuildRequires:   /usr/bin/perldoc
27
28 # Not clear what requires this, but it is needed.
29 BuildRequires:   pcre-devel
30 BuildRequires:   ocaml-pcre-devel
31
32 # Requires camlp4 and ocamlfind at runtime.
33 Requires:        /usr/bin/ocamlc
34 Requires:        ocaml-camlp4-devel
35 Requires:        ocaml-findlib-devel
36
37 # Requires mailx for sending email.
38 Requires:        mailx
39
40
41 %description
42 Whenjobs is a powerful but simple cron replacement.
43
44 Two key advantages over cron are a simpler syntax for writing rules
45 and a powerful dependency system that lets one job depend on variables
46 set when other jobs run (allowing, for example, one job to run only
47 when another job has finished successfully).
48
49
50 %prep
51 %setup -q
52
53
54 %build
55 %configure
56 make %{?_smp_mflags}
57
58
59 %check
60 make check
61
62
63 %install
64 rm -rf $RPM_BUILD_ROOT
65
66 make DESTDIR=$RPM_BUILD_ROOT install
67
68 # Add a prelink blacklist.
69 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/prelink.conf.d
70 cat <<EOF >$RPM_BUILD_ROOT/%{_sysconfdir}/prelink.conf.d/%{name}.conf
71 -b %{_bindir}/whenjobs
72 -b %{_sbindir}/whenjobsd
73 EOF
74
75
76 %files
77 %doc COPYING README
78 %{_sysconfdir}/prelink.conf.d/%{name}.conf
79 %{_bindir}/whenjobs
80 %{_sbindir}/whenjobsd
81 %dir %{_libdir}/whenjobs
82 %{_libdir}/whenjobs/*.cmi
83 %{_libdir}/whenjobs/pa_when.cmo
84 %{_libdir}/whenjobs/whenlib.cma
85 %{_mandir}/man1/*.1*
86 %{_mandir}/man8/*.8*
87
88
89 %changelog
90 * Sun Mar 18 2012 Richard W.M. Jones <rjones@redhat.com> - @PACKAGE_VERSION@-@RPM_RELEASE@
91 - Initial release.