-
Notifications
You must be signed in to change notification settings - Fork 4
/
libspe2.spec
255 lines (212 loc) · 5.14 KB
/
libspe2.spec
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
%define release %{_version}
%define build_all 1
Name: libspe2
Version: 2.3.0
Release: %{release}
License: LGPL
Group: System Environment/Base
URL: http://www.bsc.es/projects/deepcomputing/linuxoncell
Source: http://www.bsc.es/projects/deepcomputing/linuxoncell/development/release2.0/libspe/%{name}-%{version}.%{release}.tar.gz
Buildroot: %{_tmppath}/libspe
Exclusivearch: ppc ppc64 noarch
Summary: SPE Runtime Management Library
# to build the wrapper, call rpmbuild with --define="with_wrapper 1"
%define WITH_WRAPPER %{?with_wrapper:%with_wrapper}%{!?with_wrapper:0}
%if %{build_all}
%define build_common 1
%else
%ifarch ppc
%define build_common 1
%else
%define build_common 0
%endif
%endif
%ifarch noarch
%define sysroot %{nil}
%define set_optflags %{nil}
%else
%define sysroot %{nil}
%define set_optflags OPTFLAGS="%{optflags}"
%endif
%define sysroot %{nil}
%define set_optflags OPTFLAGS="%{optflags}"
%ifarch ppc
%define _libdir /usr/lib
%endif
%ifarch ppc64
%define _libdir /usr/lib64
%endif
%define _adabindingdir /usr/adainclude
%define _includedir2 /usr/spu/include
%define _spe_ld_dir /usr/lib/spe
%define _initdir /etc/init.d
%define _unpackaged_files_terminate_build 0
%if %{WITH_WRAPPER}
%package -n libspe
Summary: SPE Runtime Management Wrapper Library
Group: Development/Libraries
Requires: %{name} = %{version}
%endif
%package devel
Summary: SPE Runtime Management Library
Group: Development/Libraries
Requires: %{name} = %{version}
%if %{WITH_WRAPPER}
%package -n libspe-devel
Summary: SPE Runtime Management Library
Group: Development/Libraries
Requires: %{name} = %{version}
%endif
%if %{build_common}
%package -n elfspe2
Summary: Helper for standalong SPE applications
Group: Applications/System
Requires: %{name} = %{version}
%endif
%if %{build_common}
%package adabinding
Summary : Ada package files porting libspe headers
Group: Development/Libraries
Requires: %{name} = %{version}
%endif
%description
SPE Runtime Management Library for the
Cell Broadband Engine Architecture.
%if %{WITH_WRAPPER}
%description -n libspe
Header and object files for SPE Runtime
Management Wrapoer Library.
%endif
%description devel
Header and object files for SPE Runtime
Management Library.
%if %{WITH_WRAPPER}
%description -n libspe-devel
Header and object files for SPE Runtime
Management Library.
%endif
%if %{build_common}
%description adabinding
Ada package files porting libspe headers
Management Library.
%endif
%if %{build_common}
%description -n elfspe2
This tool acts as a standalone loader for spe binaries.
%endif
%prep
%setup
%build
%define _make_flags ARCH=%{_target_cpu} SYSROOT=%{sysroot} %{set_optflags} prefix=%{_prefix} libdir=%{_libdir} spe_ld_dir=%{_spe_ld_dir}
make %{_make_flags}
%if %{build_common}
make elfspe-all %{_make_flags}
%endif
%install
rm -rf $RPM_BUILD_ROOT%{sysroot}
make install DESTDIR=$RPM_BUILD_ROOT %{_make_flags}
%if %{build_common}
make elfspe-install DESTDIR=$RPM_BUILD_ROOT %{_make_flags}
%endif
mkdir -p $RPM_BUILD_ROOT%{sysroot}%{_initdir}
cat > $RPM_BUILD_ROOT%{sysroot}%{_initdir}/elfspe <<"EOF"
#!/bin/bash
#
# /etc/rc.d/init.d/elfspe
#
# registers elfspe handler
#
# chkconfig: 345 1 1
# description: executes elfspe-register
# Source function library.
. /etc/init.d/functions
start() {
echo -n "Starting elfspe: "
sh /usr/bin/elfspe-register
return 0
}
stop() {
echo -n "Shutting down elfspe: "
sh /usr/bin/elfspe-unregister
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
;;
restart)
stop
start
;;
reload)
;;
condrestart)
[ -f /var/lock/subsys/elspe ] && restart || :
;;
*)
echo "Usage: elfspe {start|stop|status|reload|restart"
exit 1
;;
esac
exit $?
EOF
chmod +x $RPM_BUILD_ROOT%{sysroot}%{_initdir}/elfspe
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%if %{build_common}
%preun -n elfspe2
[ -f %{_initdir}/elfspe ] && /sbin/chkconfig --del elfspe
[ -f %{_bindir}/elfspe-unregister ] && %{_bindir}/elfspe-unregister
%post -n elfspe2
[ -f %{_initdir}/elfspe ] && /sbin/chkconfig --add elfspe
[ -f %{_bindir}/elfspe-register ] && %{_bindir}/elfspe-register
%endif
%files
%defattr(-,root,root)
%{sysroot}%{_libdir}/*2.so.*
%if %{WITH_WRAPPER}
%files -n libspe
%defattr(-,root,root)
%{sysroot}%{_libdir}/libspe.so.*
%endif
%files devel
%defattr(-,root,root)
%{sysroot}%{_libdir}/*2.so
%{sysroot}%{_libdir}/*2.a
%{sysroot}%{_includedir}/*2*.h
%{sysroot}%{_includedir}/cbea_map.h
%{sysroot}%{_includedir2}/*.h
%{sysroot}%{_libdir}/pkgconfig/libspe2.pc
%if %{WITH_WRAPPER}
%files -n libspe-devel
%defattr(-,root,root)
%{sysroot}%{_libdir}/libspe.so
%{sysroot}%{_libdir}/libspe.a
%{sysroot}%{_includedir}/libspe.h
%endif
%if %{build_common}
%files -n elfspe2
%defattr(-,root,root)
%{sysroot}%{_bindir}/elfspe-register
%{sysroot}%{_bindir}/elfspe-unregister
%{sysroot}%{_bindir}/elfspe
%{sysroot}/etc/init.d/elfspe
%endif
%if %{build_common}
%files adabinding
%defattr(-,root,root)
%{sysroot}%{_adabindingdir}/libspe2.ads
%{sysroot}%{_adabindingdir}/libspe2_types.ads
%{sysroot}%{_adabindingdir}/cbea_map.ads
%{sysroot}%{_adabindingdir}/README-libspe2
%endif
%changelog
* Thu Nov 24 2005 - Arnd Bergmann <[email protected]> 1.0.1-3
- initial spec file for fc5