diff --git a/build_rpm.in b/build_rpm.in index b203473b..7cc66e21 100755 --- a/build_rpm.in +++ b/build_rpm.in @@ -35,12 +35,13 @@ if ! test -z "$2"; then RESULTS=/tmp/nexus-mock-results mkdir -p $RESULTS mock_args="-r $2 --resultdir=$RESULTS" + rm -f $RESULTS/*.src.rpm # clean up so do not pick up wrong .src.rpm later mock ${mock_args} --init - env NEXUS_CONFIG_OPTIONS="$build_args" mock ${mock_args} --buildsrpm --spec nexus.spec --sources . --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" + mock ${mock_args} --buildsrpm --spec nexus.spec --sources . --define "nexus_config_options $build_args" --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" srpm=`ls $RESULTS/*.src.rpm` - env NEXUS_CONFIG_OPTIONS="$build_args" mock ${mock_args} --rebuild $srpm --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" + mock ${mock_args} --rebuild $srpm --define "nexus_config_options $build_args" --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" else # buildroot is actually where we install to cd $topdir/SPECS - env NEXUS_CONFIG_OPTIONS="$build_args" rpmbuild -ba --buildroot $nxtop/installroot --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" nexus.spec + rpmbuild -ba --buildroot $nxtop/installroot --define "nexus_config_options $build_args" --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" nexus.spec fi diff --git a/nexus_spec.in b/nexus_spec.in index 744e9cb2..951677b2 100644 --- a/nexus_spec.in +++ b/nexus_spec.in @@ -38,16 +38,34 @@ Packager: NeXus Developers %define is_rhel5 1 %endif +%if 0%{?rhel} == 6 +%define is_rhel6 1 +%endif +%if 0%{?el6} +%define is_rhel6 1 +%endif +%if "0%{?dist}" == "0.el6" +%define is_rhel6 1 +%endif + BuildRoot: %{_tmppath}/@PACKAGE_TARNAME@-@PACKAGE_VERSION@ BuildRequires: python numpy BuildRequires: hdf5-devel hdf-devel +BuildRequires: libxml2-devel +BuildRequires: java-1.6.0-openjdk-devel +BuildRequires: readline-devel # mxml is not in rhel or epel as yet +# ant on rhel5 is too old to build NXvalidate %if 0%{?fedora} BuildRequires: mxml-devel +BuildRequires: ant %endif %if 0%{?is_rhel5} BuildRequires: python-ctypes %endif +%if 0%{?is_rhel6} +BuildRequires: ant ant-nodeps +%endif %description NeXus is an international standard for exchanging data files @@ -107,9 +125,9 @@ data is stored using the HDF format from NCSA. This package provides # RPM_INSTALL_PREFIX - where to install software # do --prefix last in case also present in passed config options if ! test -z "$RPM_INSTALL_PREFIX"; then - ./configure $NEXUS_CONFIG_OPTIONS --prefix="$RPM_INSTALL_PREFIX" + ./configure %{?nexus_config_options} --prefix="$RPM_INSTALL_PREFIX" else - ./configure $NEXUS_CONFIG_OPTIONS --prefix=%{_prefix} --libdir=%{_libdir} + ./configure %{?nexus_config_options} --prefix=%{_prefix} --libdir=%{_libdir} fi make