Skip to content

Commit

Permalink
First go at building RPM files - you need to set up your build root
Browse files Browse the repository at this point in the history
(see README.rpm) and then run  build_rpm  after a   make distcheck


git-svn-id: https://svn.nexusformat.org/code/trunk@246 ff5d1e40-2be0-497f-93bd-dc18237bd3c7
  • Loading branch information
FreddieAkeroyd authored and faa committed Feb 22, 2004
1 parent 263db87 commit 5eb333e
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 1 deletion.
25 changes: 25 additions & 0 deletions README.rpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Unless you plan to build the rpm files as root you will need to do the
following:

(1) Create a ~/.rpmmacros file with a line similar to the following

%_topdir /home/faa/mybuilds

(note: that is a tab separating the two parts)

(2) create the corresponding RPM build directories

cd /home/faa/mybuilds
mkdir BUILD RPMS SOURCES SPECS SRPMS
cd RPMS
mkdir i386 i486 i586 i686

(i.e. this should look like the default build area /usr/src/redhat)

(3) Now you should be able to run the build_rpm script - this
will generate src and binary rpms from the current
nexus*.tar.gz created from the last "make distcheck" or "make dist"

Freddie Akeroyd <F.A.Akeroyd@rl.ac.uk>

$Id$
24 changes: 24 additions & 0 deletions build_rpm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh
#
# $Id$
#
# Script to build RPMs from current nexus*.tar.gz file
# Copyright (C) 2004 Freddie Akeroyd
#
# get topdir - must find a better way ...
topdir=`rpm --showrc|grep topdir| awk '{print $3}' | tail -1`
#
if test ! -w "$topdir"; then
echo "ERROR: RPM build directory not writable - check README.rpm"
exit
fi
#
nxtop=`pwd`
rm -fr $nxtop/installroot
mkdir $nxtop/installroot
#
ln -sf $nxtop/nexus-2.0.0.tar.gz $topdir/SOURCES
cp $nxtop/nexus.spec $topdir/SPECS
cd $topdir/SPECS
# buildroot is actually where we install to
rpmbuild -ba --buildroot $nxtop/installroot nexus.spec
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ AM_CONDITIONAL([HAVE_F90], [test ! -z "$F90"])
AM_CONDITIONAL([HAVE_HDF4], [test ! -z "$H4ROOT"])
AM_CONDITIONAL([HAVE_HDF5], [test ! -z "$H5ROOT"])

AC_CONFIG_FILES([Makefile
AC_CONFIG_FILES([Makefile
nexus.spec
include/Makefile
src/Makefile
applications/Makefile
Expand Down
65 changes: 65 additions & 0 deletions nexus_spec.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# @configure_input@
# $Id$
# Template for NeXus RPM SPEC file
# Copyright (C) 2004 Freddie Akeroyd
#
Summary: Libraries and utilities for using NeXus format data files
Name: @PACKAGE_TARNAME@
Version: @PACKAGE_VERSION@
# Release is the number of times this version of the software was
# built into an RPM file; it should be incremented each RPM build and
# then reset to 1 when a new version of the software is released
Release: 1
Copyright: GLPL
# Group: there is more than one choice for this - maybe we need to split
# nexus into separate packages (libraries + apps)
Group: Development/Libraries
#Group: Development/Tools
Source: ftp://ftp.neutron.anl.gov/nexus/@PACKAGE_TARNAME@-@PACKAGE_VERSION@.tar.gz
URL: http://www.neutron.anl.gov/NeXus/
#Distribution:
#Icon: nexus.xpm
Vendor: NeXus International Advisory Committee (NIAC)
Packager: NeXus Developers <nexus-developers@anl.gov>
# Prefix allows our package to be relocatable i.e. installable in
# other than just the /usr/local directory
Prefix: /usr/local
# BuildRoot is the root for software installation
# this value will not usually be used, but something must
# be specified here to allow rpm --buildroot to be used later
# (it will get used for a rpmbuild --recompile of the the src.rpm)
BuildRoot: /tmp/@PACKAGE_TARNAME@-@PACKAGE_VERSION@
%description
NeXus is an international standard for exchanging data files
amongst Neutron, Muon and X-ray science facilities. The underlying
data is stored using the HDF format from NCSA. This package provides
access routines, documentation, examples and a basic NeXus file browser.
%prep
%setup
%build
# RPM_BUILD_ROOT - where to install software
if ! test -z "$RPM_BUILD_ROOT"; then
./configure --prefix=$RPM_BUILD_ROOT/usr/local
else
./configure
fi
make
%install
make install
%files
%doc README NEWS ChangeLog AUTHORS COPYING INSTALL
%docdir /usr/local/nexus/doc
/usr/local/lib
/usr/local/bin
/usr/local/include
/usr/local/nexus
%clean
#this rm line can be dangerous - build_root might be / !
# leave commented out for moment, but we need to implement
# some cleaning mechanism if we use alternative build roots
#rm -fr $RPM_BUILD_ROOT
%post
if test `whoami` = root; then ldconfig; fi
# also need to sort out nxbuild if we are not installed to /usr/local
%postun
if test `whoami` = root; then ldconfig; fi

0 comments on commit 5eb333e

Please sign in to comment.