| 1 | # @configure_input@ |
|---|
| 2 | # $Id$ |
|---|
| 3 | # Template for NeXus RPM SPEC file |
|---|
| 4 | # Copyright (C) 2004 Freddie Akeroyd <freddie.akeroyd@stfc.ac.uk> |
|---|
| 5 | # |
|---|
| 6 | Summary: Libraries and utilities for using NeXus format data files |
|---|
| 7 | Name: @PACKAGE_TARNAME@ |
|---|
| 8 | Version: @NEXUS_VERSION@ |
|---|
| 9 | # Release is the number of times this version of the software was |
|---|
| 10 | # built into an RPM file; it should be incremented each RPM build and |
|---|
| 11 | # then reset to 1 when a new version of the software is released |
|---|
| 12 | Release: @PACKAGE_RELEASE@.@NEXUS_RELEASE@%{?dist} |
|---|
| 13 | License: LGPL |
|---|
| 14 | # Group: there is more than one choice for this - maybe we need to split |
|---|
| 15 | # nexus into separate packages (libraries + apps) |
|---|
| 16 | Group: Development/Libraries |
|---|
| 17 | #Group: Development/Tools |
|---|
| 18 | Source: http://download.nexusformat.org/kits/@PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.gz |
|---|
| 19 | URL: http://www.nexusformat.org/ |
|---|
| 20 | Distribution: @DISTRIBUTION@ |
|---|
| 21 | #Icon: nexus.xpm |
|---|
| 22 | Vendor: NeXus International Advisory Committee (NIAC) |
|---|
| 23 | Packager: NeXus Developers <nexus-developers@nexusformat.org> |
|---|
| 24 | # Prefix allows our package to be relocatable i.e. installable in |
|---|
| 25 | # other than just the /usr/local directory |
|---|
| 26 | #Prefix: /usr |
|---|
| 27 | # BuildRoot is the root for software installation |
|---|
| 28 | # this value will not usually be used, but something must |
|---|
| 29 | # be specified here to allow rpm --buildroot to be used later |
|---|
| 30 | # (it will get used for a rpmbuild --recompile of the the src.rpm) |
|---|
| 31 | %if 0%{?rhel} == 5 |
|---|
| 32 | %define is_rhel5 1 |
|---|
| 33 | %endif |
|---|
| 34 | %if 0%{?el5} |
|---|
| 35 | %define is_rhel5 1 |
|---|
| 36 | %endif |
|---|
| 37 | %if "0%{?dist}" == "0.el5" |
|---|
| 38 | %define is_rhel5 1 |
|---|
| 39 | %endif |
|---|
| 40 | |
|---|
| 41 | %if 0%{?rhel} == 6 |
|---|
| 42 | %define is_rhel6 1 |
|---|
| 43 | %endif |
|---|
| 44 | %if 0%{?el6} |
|---|
| 45 | %define is_rhel6 1 |
|---|
| 46 | %endif |
|---|
| 47 | %if "0%{?dist}" == "0.el6" |
|---|
| 48 | %define is_rhel6 1 |
|---|
| 49 | %endif |
|---|
| 50 | |
|---|
| 51 | BuildRoot: %{_tmppath}/@PACKAGE_TARNAME@-@PACKAGE_VERSION@ |
|---|
| 52 | BuildRequires: python numpy |
|---|
| 53 | BuildRequires: hdf5-devel hdf-devel |
|---|
| 54 | BuildRequires: libxml2-devel |
|---|
| 55 | BuildRequires: java-1.6.0-openjdk-devel |
|---|
| 56 | BuildRequires: readline-devel |
|---|
| 57 | # mxml is not in rhel or epel as yet |
|---|
| 58 | # ant on rhel5 is too old to build NXvalidate |
|---|
| 59 | %if 0%{?fedora} |
|---|
| 60 | BuildRequires: mxml-devel |
|---|
| 61 | BuildRequires: ant |
|---|
| 62 | %endif |
|---|
| 63 | %if 0%{?is_rhel5} |
|---|
| 64 | BuildRequires: python-ctypes |
|---|
| 65 | %endif |
|---|
| 66 | %if 0%{?is_rhel6} |
|---|
| 67 | BuildRequires: ant ant-nodeps |
|---|
| 68 | %endif |
|---|
| 69 | |
|---|
| 70 | %description |
|---|
| 71 | NeXus is an international standard for exchanging data files |
|---|
| 72 | among Neutron, Muon and X-ray science facilities. The underlying |
|---|
| 73 | data is stored using the HDF format from NCSA. This package provides |
|---|
| 74 | access routines, documentation, examples and a basic NeXus file browser. |
|---|
| 75 | |
|---|
| 76 | %package devel |
|---|
| 77 | Summary: Libraries and utilities for using NeXus format data files |
|---|
| 78 | Group: Development/Libraries |
|---|
| 79 | |
|---|
| 80 | %description devel |
|---|
| 81 | NeXus is an international standard for exchanging data files |
|---|
| 82 | among Neutron, Muon and X-ray science facilities. The underlying |
|---|
| 83 | data is stored using the HDF format from NCSA. This package provides |
|---|
| 84 | |
|---|
| 85 | %package tools |
|---|
| 86 | Summary: Libraries and utilities for using NeXus format data files |
|---|
| 87 | Group: Development/Libraries |
|---|
| 88 | |
|---|
| 89 | %description tools |
|---|
| 90 | NeXus is an international standard for exchanging data files |
|---|
| 91 | among Neutron, Muon and X-ray science facilities. The underlying |
|---|
| 92 | data is stored using the HDF format from NCSA. This package provides |
|---|
| 93 | |
|---|
| 94 | %package doc |
|---|
| 95 | Summary: Libraries and utilities for using NeXus format data files |
|---|
| 96 | Group: Development/Libraries |
|---|
| 97 | |
|---|
| 98 | %description doc |
|---|
| 99 | NeXus is an international standard for exchanging data files |
|---|
| 100 | among Neutron, Muon and X-ray science facilities. The underlying |
|---|
| 101 | data is stored using the HDF format from NCSA. This package provides |
|---|
| 102 | |
|---|
| 103 | @HAVE_PYTHON_TRUE@%package python |
|---|
| 104 | @HAVE_PYTHON_TRUE@Summary: Libraries and utilities for using NeXus format data files |
|---|
| 105 | @HAVE_PYTHON_TRUE@Group: Development/Libraries |
|---|
| 106 | @HAVE_PYTHON_TRUE@ |
|---|
| 107 | @HAVE_PYTHON_TRUE@%description python |
|---|
| 108 | @HAVE_PYTHON_TRUE@NeXus is an international standard for exchanging data files |
|---|
| 109 | @HAVE_PYTHON_TRUE@among Neutron, Muon and X-ray science facilities. The underlying |
|---|
| 110 | @HAVE_PYTHON_TRUE@data is stored using the HDF format from NCSA. This package provides |
|---|
| 111 | |
|---|
| 112 | @HAVE_JAVAC_TRUE@%package java |
|---|
| 113 | @HAVE_JAVAC_TRUE@Summary: Libraries and utilities for using NeXus format data files |
|---|
| 114 | @HAVE_JAVAC_TRUE@Group: Development/Libraries |
|---|
| 115 | @HAVE_JAVAC_TRUE@ |
|---|
| 116 | @HAVE_JAVAC_TRUE@%description java |
|---|
| 117 | @HAVE_JAVAC_TRUE@NeXus is an international standard for exchanging data files |
|---|
| 118 | @HAVE_JAVAC_TRUE@among Neutron, Muon and X-ray science facilities. The underlying |
|---|
| 119 | @HAVE_JAVAC_TRUE@data is stored using the HDF format from NCSA. This package provides |
|---|
| 120 | |
|---|
| 121 | %prep |
|---|
| 122 | %setup -q -n @PACKAGE_TARNAME@-@PACKAGE_VERSION@ |
|---|
| 123 | |
|---|
| 124 | %build |
|---|
| 125 | # RPM_INSTALL_PREFIX - where to install software |
|---|
| 126 | # do --prefix last in case also present in passed config options |
|---|
| 127 | if ! test -z "$RPM_INSTALL_PREFIX"; then |
|---|
| 128 | ./configure %{?nexus_config_options} --prefix="$RPM_INSTALL_PREFIX" |
|---|
| 129 | else |
|---|
| 130 | ./configure %{?nexus_config_options} --prefix=%{_prefix} --libdir=%{_libdir} |
|---|
| 131 | fi |
|---|
| 132 | make |
|---|
| 133 | |
|---|
| 134 | %install |
|---|
| 135 | # RPM_BUILD_ROOT is where to install software to |
|---|
| 136 | if test "$RPM_BUILD_ROOT" != "/"; then rm -fr "$RPM_BUILD_ROOT"; fi |
|---|
| 137 | make DESTDIR="$RPM_BUILD_ROOT" install |
|---|
| 138 | find "$RPM_BUILD_ROOT" -name '*.la' -exec rm -f {} \; |
|---|
| 139 | |
|---|
| 140 | %files |
|---|
| 141 | %defattr(-,root,root) |
|---|
| 142 | %doc README NEWS ChangeLog AUTHORS COPYING INSTALL |
|---|
| 143 | # %docdir /usr/local/doc |
|---|
| 144 | %{_libdir}/libNeXus*.so* |
|---|
| 145 | %{_libdir}/libnxconvert*.so* |
|---|
| 146 | #%ifarch x86_64 |
|---|
| 147 | #/usr/lib/*.so* |
|---|
| 148 | #%endif |
|---|
| 149 | |
|---|
| 150 | %files devel |
|---|
| 151 | %defattr(-,root,root) |
|---|
| 152 | %{_libdir}/libNeXus*.a |
|---|
| 153 | %{_libdir}/libnxconvert*.a |
|---|
| 154 | %{_libdir}/pkgconfig |
|---|
| 155 | %{_includedir}/* |
|---|
| 156 | |
|---|
| 157 | %files tools |
|---|
| 158 | %defattr(-,root,root) |
|---|
| 159 | %{_bindir}/* |
|---|
| 160 | %{_datadir}/man |
|---|
| 161 | |
|---|
| 162 | %files doc |
|---|
| 163 | %defattr(-,root,root) |
|---|
| 164 | %{_datadir}/nexus |
|---|
| 165 | |
|---|
| 166 | @HAVE_PYTHON_TRUE@%files python |
|---|
| 167 | @HAVE_PYTHON_TRUE@%defattr(-,root,root) |
|---|
| 168 | @HAVE_PYTHON_TRUE@/usr/lib/python*/site-packages/nxs |
|---|
| 169 | |
|---|
| 170 | @HAVE_JAVAC_TRUE@%files java |
|---|
| 171 | @HAVE_JAVAC_TRUE@%defattr(-,root,root) |
|---|
| 172 | @HAVE_JAVAC_TRUE@%{_datadir}/java |
|---|
| 173 | @HAVE_JAVAC_TRUE@%{_libdir}/libjnexus.so* |
|---|
| 174 | @HAVE_JAVAC_TRUE@%{_libdir}/libjnexus.a |
|---|
| 175 | |
|---|
| 176 | %clean |
|---|
| 177 | if test "$RPM_BUILD_ROOT" != "/"; then rm -fr "$RPM_BUILD_ROOT"; fi |
|---|
| 178 | |
|---|
| 179 | %post |
|---|
| 180 | if test `whoami` = root; then ldconfig; fi |
|---|
| 181 | |
|---|
| 182 | %post tools |
|---|
| 183 | if [ "$RPM_INSTALL_PREFIX" != "" ]; then |
|---|
| 184 | INSTALL_PREFIX=$RPM_INSTALL_PREFIX |
|---|
| 185 | else |
|---|
| 186 | INSTALL_PREFIX=%{_prefix} |
|---|
| 187 | fi |
|---|
| 188 | |
|---|
| 189 | ( cd $INSTALL_PREFIX/bin; for i in nxbuild; do \ |
|---|
| 190 | sed -i -e "s|^prefix=.*|prefix=$INSTALL_PREFIX|" $i; done ) |
|---|
| 191 | |
|---|
| 192 | %postun |
|---|
| 193 | if test `whoami` = root; then ldconfig; fi |
|---|
| 194 | # |
|---|
| 195 | # %changelog date format as per `date +"%a %d %b %Y"` |
|---|
| 196 | # first line should be date user email |
|---|
| 197 | %changelog |
|---|
| 198 | * Sat Oct 22 2011 Freddie Akeroyd <freddie.akeroyd@stfc.ac.uk> - 4.3.0 |
|---|
| 199 | - Split into subpackages |
|---|
| 200 | * Thu May 24 2007 Freddie Akeroyd <F.A.Akeroyd@rl.ac.uk> - 4.0.0 |
|---|
| 201 | - Tag and build 4.0.0 |
|---|
| 202 | * Wed May 16 2007 Freddie Akeroyd <F.A.Akeroyd@rl.ac.uk> - 4.0rc3 |
|---|
| 203 | - Tag and build 4.0rc3 |
|---|
| 204 | * Fri Mar 30 2007 Freddie Akeroyd <F.A.Akeroyd@rl.ac.uk> - 4.0rc2 |
|---|
| 205 | - Tag and build 4.0rc2 |
|---|
| 206 | * Thu Mar 15 2007 Freddie Akeroyd <F.A.Akeroyd@rl.ac.uk> - 4.0rc1 |
|---|
| 207 | - Tag and build 4.0rc1 |
|---|
| 208 | * Wed Jul 27 2005 Freddie Akeroyd <F.A.Akeroyd@rl.ac.uk> |
|---|
| 209 | - Change Copyright: to License: and add PACKAGE_RELEASE |
|---|
| 210 | * Mon Jun 6 2005 Freddie Akeroyd <F.A.Akeroyd@rl.ac.uk> |
|---|
| 211 | - Add extra documentation and example files to distribution |
|---|
| 212 | * Wed May 12 2004 Jens Krueger <jens.krueger@frm2.tum.de> |
|---|
| 213 | - Change the License entry to LGPL |
|---|
| 214 | - remove /usr/local/nexus /usr/local/doc from the file list |
|---|
| 215 | * Wed Mar 24 2004 Freddie Akeroyd <F.A.Akeroyd@rl.ac.uk> |
|---|
| 216 | - Fix up prefix in nxbuild after an install so the RPM is now relocatable |
|---|
| 217 | * Sun Feb 22 2004 Freddie Akeroyd <F.A.Akeroyd@rl.ac.uk> |
|---|
| 218 | - Initial RPM kit version |
|---|