forked from llnl/libyogrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibyogrt.spec.in
More file actions
131 lines (119 loc) · 3.33 KB
/
Copy pathlibyogrt.spec.in
File metadata and controls
131 lines (119 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# libyogrt.spec
# Declare rpmbuild --with/--without parameters
%bcond_without slurm
Summary: @PACKAGE_NAME@
Name: @PACKAGE_TARNAME@
Version: @PACKAGE_VERSION@
Release: 1%{?dist}
License: Proprietary
Group: System Environment/Base
URL: @PACKAGE_URL@
Packager: Christopher J. Morrone <morrone2@llnl.gov>
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%if %{with slurm}
BuildRequires: slurm slurm-devel
Requires: slurm
%endif
# Disable automatic rpm requirement generation only on AIX
%ifos aix5.3 aix5.2 aix5.1 aix5.0 aix4.3
%define _use_internal_dependency_generator 0
%endif
%description
A simple wrapper library that provides a unified get-remaining-time
interface for multiple parallel job scheduling systems.
%prep
%setup -q
%build
%ifos aix5.3 aix5.2 aix5.1 aix5.0 aix4.3
CC=/usr/bin/gcc
export CC
# Build all of the libraries twice: 32bit versions, and then 64bit versions
TOP="`pwd`"
TMP="$TOP/aix"
rm -rf "$TMP"
for bits in 64 32; do
OBJECT_MODE=$bits
export OBJECT_MODE
%configure -C --program-prefix=%{?_program_prefix:%{_program_prefix}}
mkdir -p $TMP/orig/$bits
DESTDIR=$TMP/orig/$bits make install
make clean
done
# Now merge the 32bit and 64bit versions of the libraries together into
# one composite libyogrt.a library.
for subpackage in none slurm lcrm moab aixslurm; do
for bits in 32 64; do
if [ -f $TMP/orig/${bits}%{_libdir}/libyogrt/libyogrt-${subpackage}.a ]; then
mkdir -p $TMP/$subpackage/${bits}
cd $TMP/$subpackage/${bits}
ar -X${bits} x $TMP/orig/${bits}%{_libdir}/libyogrt/libyogrt-${subpackage}.a
fi
done
cd $TMP
if [ -d $TMP/$subpackage ]; then
ar -Xany cr libyogrt-${subpackage}.a $TMP/$subpackage/*/*
fi
cd $TOP
done
# now merge the 32- and 64-bit versions of the main library
for bits in 32 64; do
mkdir -p $TMP/${bits}
cd $TMP/${bits}
ar -X${bits} x $TMP/orig/${bits}%{_libdir}/libyogrt.a
done
cd $TMP
ar -Xany cr libyogrt.a $TMP/32/* $TMP/64/*
cd $TOP
rm -rf $TMP/orig
%else
%configure LDFLAGS=-Wl,--build-id
make
%endif
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT
%ifos aix5.3 aix5.2 aix5.1 aix5.0 aix4.3
CC=/usr/bin/gcc
export CC
%endif
DESTDIR="$RPM_BUILD_ROOT" make install
mv $RPM_BUILD_ROOT%{_sysconfdir}/yogrt.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/yogrt.conf
%ifos aix5.3 aix5.2 aix5.1 aix5.0 aix4.3
if [ -d aix ]; then
cp aix/libyogrt-* "$RPM_BUILD_ROOT"%{_libdir}/libyogrt
fi
cp aix/libyogrt.a "$RPM_BUILD_ROOT"%{_libdir}
# slurm plugins must be .so files, not .a, so now we unpack the spank plugin.
cd "$RPM_BUILD_ROOT"%{_libdir}/libyogrt
if [ -f libyogrt-spank-plugin.a ]; then
ar x ./libyogrt-spank-plugin.a
mv ./libyogrt-spank-plugin.so.1 ./libyogrt-spank-plugin.so
rm ./libyogrt-spank-plugin.a
fi
%endif
%files
%defattr(-,root,root,-)
%doc
%doc DISCLAIMER
%doc COPYING
%doc COPYING.LESSER
%doc INSTALL
%{_includedir}/yogrt.h
%ifos aix5.3 aix5.2 aix5.1 aix5.0 aix4.3
%{_libdir}/*.a
%attr(755, root, root) %dir %{_libdir}/libyogrt
%{_libdir}/libyogrt/*.a
%{_libdir}/libyogrt/libyogrt-spank-plugin.so
%{_libexecdir}/libyogrt_slurm_timed
%else
%{_libdir}/*.*
%{_libdir}/libyogrt/*
%endif
%{_mandir}/*/*
%config(noreplace) %{_sysconfdir}/yogrt.conf
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Mon Feb 12 2007 Christopher J. Morrone <morrone2@llnl.gov> -
- Initial build.