Package Inventor: Specfile

  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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
#
# Copyright (c) 2004, 2005, 2006, 2007, 2008 Ralf Corsepius, Ulm, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#

%def_with demos
%def_with examples
%def_with motif

Name: Inventor
Version: 2.1.5
Release: alt5

Summary: SGI Open Inventor (TM)

License: LGPLv2+
Group: Development/C++
Url: https://github.com/aumuell/open-inventor

Packager: Michael Shigorin <mike@altlinux.org>

Source: ftp://oss.sgi.com/projects/inventor/download/inventor-2.1.5-10.src.tar.gz
Patch: Inventor-2.1.5-30.diff.bz2
Patch1: Inventor-2.1.5-30-31.diff
# GCC44 compatibility hacks
Patch2: Inventor-2.1.5-31-32.diff
# Misc C++ modernization stuff
Patch3: Inventor-2.1.5-32-33.diff
Patch4: Inventor-2.1.5-alt-DSO.diff
# abs issue
Patch5: Inventor-2.1.5-abs-c++17.patch
# aarch64
Patch6: Inventor-2.1.5-64bit.patch
# freetype 2.9
Patch7: Inventor-2.1.5-debian-freetype.patch

%define hackcxxflags -O2 -fno-strict-aliasing

# Automatically added by buildreq on Mon Mar 23 2009
BuildRequires: gcc-c++ libGLw-devel libXext-devel libXi-devel libXt-devel libfreetype-devel libjpeg-devel

BuildRequires: gcc-c++
BuildRequires: libGLU-devel
BuildRequires: libGLw-devel
BuildRequires: libXi-devel
BuildRequires: libX11-devel
BuildRequires: libXt-devel

%if_with motif
BuildRequires: libopenmotif-devel
%endif
BuildRequires: libfreetype-devel
BuildRequires: libjpeg-devel
BuildRequires: bison
BuildRequires: tcsh

BuildRequires: fonts-ttf-liberation rpm-macros-make

%add_optflags -funsigned-char

%description
SGI Open Inventor(TM) is an object-oriented 3D toolkit offering a
comprehensive solution to interactive graphics programming
problems. It presents a programming model based on a 3D scene database
that dramatically simplifies graphics programming. It includes a rich
set of objects such as cubes, polygons, text, materials, cameras,
lights, trackballs, handle boxes, 3D viewers, and editors that speed
up your programming time and extend your 3D programming capabilities.

%package -n lib%name
Summary: SGI Open Inventor (TM) shared libraries
Group: System/Libraries

%description -n lib%name
SGI Open Inventor (TM) shared libraries

%package -n lib%name-devel
Summary: SGI Open Inventor (TM) development files
Group: Development/C++
Requires: %name = %version-%release
Requires: pkgconfig
Requires: libGLU-devel
Requires: libfreetype-devel libjpeg-devel

%description -n lib%name-devel
SGI Open Inventor (TM) development files

%if_with motif
%package -n libInventorXt
Summary: SGI Open Inventor (TM) Motif bindings
Group: System/Libraries
Requires: %name = %version-%release
Requires: %_bindir/xmessage

%description -n libInventorXt
SGI Open Inventor (TM) development files

%package -n libInventorXt-devel
Summary: SGI Open Inventor (TM) Motif bindings
Group: Development/C++
Requires: %name = %version-%release
Requires: libInventorXt = %version-%release
Requires: libInventor-devel = %version-%release
Requires: pkg-config
Requires: libopenmotif-devel

%description -n libInventorXt-devel
SGI Open Inventor (TM) development files

%endif

%if_with demos
%package demos
Summary: SGI Open Inventor (TM) Demos
Group: Development/Documentation
Requires: %name-data

%description demos
SGI Open Inventor (TM) demos
%endif

%package data
Summary: SGI Open Inventor (TM) data
Group: Development/C++
BuildArch: noarch

%description data
SGI Open Inventor data files

%if_with examples
%package examples
Summary: SGI Open Inventor (TM) source code examples
Group: Development/Documentation
# Should we once ship binary examples, this requirement can be dropped
Requires: libInventorXt-devel
BuildArch: noarch

%description examples
SGI Open Inventor (TM) Source Examples from the Inventor books
"The Inventor Mentor" and "The Inventor Toolmaker"
%endif

%prep
%setup -n inventor
find -name CVS | xargs rm -rf
%patch0 -p0
%patch1 -p0
%patch2 -p1
%patch3 -p1
%patch4 -p2
%patch5 -p1
%patch6 -p1
%patch7 -p1

sed -i \
-e 's,^IVPREFIX =.*$,IVPREFIX = %prefix,' \
-e 's,^_BINDIR =.*$,_BINDIR = %_bindir,' \
-e 's,^_LIBDIR =.*$,_LIBDIR = %_libdir,' \
-e 's,^_HDRTOP =.*$,_HDRTOP = %_includedir/Inventor,' \
-e 's,^_MAN1DIR =.*$,_MAN1DIR = %_man1dir,' \
-e 's,^_MAN3DIR =.*$,_MAN3DIR = %_man3dir,' \
-e 's,^_FONTPATH =.*$,_FONTPATH = %_datadir/Inventor/fonts,' \
-e 's,^_HELPDIR =.*$,_HELPDIR = %_datadir/Inventor/help,' \
-e 's,^_DATADIR =.*$,_DATADIR = %_datadir/Inventor/data/models,' \
-e 's,^_MATERIALSDIR =.*$,_MATERIALSDIR = %_datadir/Inventor/data/materials,' \
-e 's,^_TEXTURESDIR =.*$,_TEXTURESDIR = %_datadir/Inventor/data/textures,' \
-e 's,^_DEMOBINDIR =.*$,_DEMOBINDIR = %_libdir/Inventor,' \
-e 's,^_DEMODATADIR =.*$,_DEMODATADIR = %_datadir/Inventor/data/demos,' \
-e 's,^OPTIMIZER = -O -DNDEBUG,OPTIMIZER = -DNDEBUG,' \
-e 's,(X11DIR)/lib,(X11DIR)/%_lib,g' \
make/ivcommondefs

for i in apps/demos/*/*.RUNME; do \
  # \/: otherwise rpmcs might break second pattern on x86_64
  # resulting in self-unmets in Inventor-demos
  sed -i \
    -e 's,/usr\/share/inventor/,%_datadir/Inventor/,g' \
    -e 's,/usr\/lib/inventor/,%_libdir/Inventor/,g' \
    $i
done

for i in *.pc.in; do
  sed \
    -e 's,@prefix@,%prefix,g' \
    -e 's,@exec_prefix@,%_exec_prefix,g' \
    -e 's,@includedir@,%_includedir,g' \
    -e 's,@libdir@,%_libdir,g' \
    -e 's,X11R6/lib,X11R6/%_lib,g' \
    < $i > $(basename $i .in)
done

rm -f data/models/scenes/chesschairs.iv

%build
# Inventor's build system wants us to install and build everything at once.

export LD_LIBRARY_PATH=%buildroot%_libdir
export VCOPTS="%optflags -D_REENTRANT"
export VCXXOPTS=$(echo "%optflags -D_REENTRANT -D__STDC_FORMAT_MACROS" | sed -e 's,-O2,%hackcxxflags,')
%make_ext all \
  FREETYPE=1 IVROOT=%buildroot \
  LSUBDIRS="libimage tools libFL"
%make_install install \
  FREETYPE=1 IVROOT=%buildroot
  LSUBDIRS="lib libSoXt"
%make_ext all \
  FREETYPE=1 IVROOT=%buildroot BUILDMAN=1 \
  LSUBDIRS="doc apps data"

# convert Mentor and Toolmaker examples into a standalone package
rm -rf devel-docs
cp -a apps/examples devel-docs
cp -a make devel-docs
pushd devel-docs > /dev/null
find -name 'GNUmakefile*' | while read a; do \
  b=`echo $a | sed 's,GNUmakefile.*$,,;s,^\./,,;s,[^/]*/,../,g;s,\/$,,;s,^$,.,'`
  sed -i -e "s,^IVDEPTH = .*$,IVDEPTH = $b," $a
done
find -name '*.c++' | while read a; do \
  sed -i -e "s,%_datadir/src/Inventor/examples/data,%_datadir/Inventor/examples/data,g" $a
done
subst '/^IVLIBHDRDIRS.*/,/libSoXt\/include/c\
IVLIBHDRS = `pkg-config --cflags libInventorXt`' \
make/ivcommondefs
make clean
popd > /dev/null

%install
export LD_LIBRARY_PATH=%buildroot%_libdir
export VCOPTS="%optflags -D_REENTRANT"
export VCXXOPTS="%optflags -D_REENTRANT"
%make_install install \
  FREETYPE=1 IVROOT=%buildroot BUILDMAN=1

install -d -m755 %buildroot%_pkgconfigdir
install -m644 libInventor.pc %buildroot%_pkgconfigdir
install -m644 libInventorXt.pc %buildroot%_pkgconfigdir

install -d -m755 %buildroot%_libdir/Inventor
mv devel-docs %buildroot%_datadir/Inventor/examples

install -d -m755 %buildroot%_datadir/Inventor/data/materials
install -d -m755 %buildroot%_datadir/Inventor/data/textures
install -d -m755 %buildroot%_datadir/Inventor/fonts

rm -rf %buildroot/usr/X11R6/lib64/X11/app-defaults/

# Map Inventor's standard fonts
# Utopia, Helvetica and Courier to liberation-TTF fonts
# Times-Roman is being used by some examples
pushd %buildroot%_datadir/Inventor/fonts > /dev/null
ln -s Utopia-Regular Times-Roman
ln -s %_datadir/fonts/ttf/liberation/LiberationSerif-Regular.ttf Utopia-Regular
ln -s %_datadir/fonts/ttf/liberation/LiberationSerif-Bold.ttf Utopia-Bold
ln -s %_datadir/fonts/ttf/liberation/LiberationSerif-Italic.ttf Utopia-Italic
ln -s %_datadir/fonts/ttf/liberation/LiberationSerif-BoldItalic.ttf Utopia-BoldItalic
ln -s %_datadir/fonts/ttf/liberation/LiberationSans-Regular.ttf Helvetica
ln -s %_datadir/fonts/ttf/liberation/LiberationSans-Bold.ttf Helvetica-Bold
ln -s %_datadir/fonts/ttf/liberation/LiberationSans-Italic.ttf Helvetica-Oblique
ln -s %_datadir/fonts/ttf/liberation/LiberationSans-BoldItalic.ttf Helvetica-BoldOblique
ln -s %_datadir/fonts/ttf/liberation/LiberationMono-Regular.ttf Courier
ln -s %_datadir/fonts/ttf/liberation/LiberationMono-Bold.ttf Courier-Bold
ln -s %_datadir/fonts/ttf/liberation/LiberationMono-Italic.ttf Courier-Oblique
ln -s %_datadir/fonts/ttf/liberation/LiberationMono-BoldItalic.ttf Courier-BoldOblique
popd > /dev/null

%files
%doc COPYING BUGS FAQ README
%_bindir/iv2toiv1
%_bindir/ivcat
%_bindir/ivdowngrade
%_bindir/ivfix
%_bindir/ivinfo
%_bindir/ivnorm
%_bindir/ivAddVP
%dir %_datadir/Inventor
%_datadir/Inventor/fonts
%_man1dir/inventor.*
%_man1dir/iv2toiv1.*
%_man1dir/ivcat.*
%_man1dir/ivdowngrade.*
%_man1dir/ivfix.*
%_man1dir/ivinfo.*

%files -n lib%name
%_libdir/libInventor.so.*

%files -n lib%name-devel
%dir %_includedir/Inventor
%_includedir/Inventor/[^X]*
%_libdir/libInventor.so
%_pkgconfigdir/libInventor.pc
%_man3dir/Sb*
%_man3dir/So[^X]*

%if_with motif
%files -n libInventorXt
%_bindir/SceneViewer
%_bindir/ivview
%_bindir/ivperf
%_man1dir/SceneViewer.*
%_man1dir/ivview.*
%_libdir/libInventorXt.so.*
%dir %_datadir/Inventor
# Used by libInventorXt
%_datadir/Inventor/help
# Used by SceneViewer
%dir %_datadir/Inventor/data
%dir %_datadir/Inventor/data/materials
%dir %_datadir/Inventor/data/textures

%files -n libInventorXt-devel
%dir %_includedir/Inventor
%_includedir/Inventor/Xt
%_libdir/libInventorXt.so
%_pkgconfigdir/libInventorXt*.pc
%_man3dir/SoXt*
%endif

%files data
%dir %_datadir/Inventor
%dir %_datadir/Inventor/data
%_datadir/Inventor/data/models
%_datadir/Inventor/data/materials
%_datadir/Inventor/data/textures

%if_with demos
%files demos
# requires data, so dirs already owned
%_datadir/Inventor/data/demos
%_libdir/Inventor/[^e]*
%endif

%if_with examples
%files examples
%dir %_datadir/Inventor
%_datadir/Inventor/examples
%endif

%changelog
* Thu Jul 05 2018 Michael Shigorin <mike@altlinux.org> 2.1.5-alt5
- rebuilt against current freetype (using debian patch)

* Wed Jun 20 2018 Vitaly Lipatov <lav@altlinux.ru> 2.1.5-alt4
- cleanup spec
- fix build with std::abs (C++17)
- fix build on aarch64

* Thu Jun 07 2012 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 2.1.5-alt3.4
- Fixed build

* Wed Mar 09 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 2.1.5-alt3.3
- Fixed build

* Thu Nov 25 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 2.1.5-alt3.2
- Rebuilt for soname set-versions

* Tue Jun 15 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 2.1.5-alt3.1
- Built from CVS
- Changed using glwMDrawingAreaWidgetClass -> SoglwMDrawingAreaWidgetClass

* Sat Mar 28 2009 Michael Shigorin <mike@altlinux.org> 2.1.5-alt3
- fixed subtle spec breakage resulting in wrong path fixup
  on x86_64; cheated rpmcs with escaping a slash in a path

* Tue Mar 24 2009 Michael Shigorin <mike@altlinux.org> 2.1.5-alt2
- *libification*
- introduced noarch subpackages

* Sun Mar 22 2009 Michael Shigorin <mike@altlinux.org> 2.1.5-alt1
- built for ALT Linux
  + based on Fedora spec
  + heavy spec cleanup
- libification
- examples moved from %%_libdir to %%_datadir
- buildreq 

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.5-35
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Feb 19 2009 Ralf Corsépius <corsepiu@fedoraproject.org> - 2.1.5-34
- Add Inventor-2.1.5-31-32.diff.
- Add Inventor-2.1.5-32-33.diff.

* Tue Jun 03 2008 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-33
- Add -fnostrict-aliasing to VCXXOPTS to work around GCC-4.3 breakage.

* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.1.5-32
- Autorebuild for GCC 4.3

* Thu Jan 10 2008 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-31
- Spec file cleanup.
- Introduce --with openmotif.
- Add Inventor-2.1.5-30-31.diff.

* Mon Nov 19 2007 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-30.1
- Add hard-coded deps on font files (BZ 388761).
- Switch to using liberation-fonts instead of dejavu-fonts.

* Fri Aug 17 2007 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-30
- Apply major hacks (*-30.diff) to address BZ: 245192.

* Fri Aug 17 2007 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-29
- Update license tag.

* Thu Jun 21 2007 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-28
- ExcludeArch: ppc64 (BZ: 245192).

* Thu Jun 21 2007 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-27
- Add *-27.patch.
- Remove _ia64 grep (Incorporated into *-27.diff).
- Add powerpc64 hack.

* Wed Mar 14 2007 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-26
- Use dejavu-fonts as fonts.
- Attempt to fix BZ 232017.

* Tue Feb 13 2007 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-25
- Specfile fixes.

* Tue Oct 03 2006 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-24
- Specfile cosmetics.
- Use %%{_datadir}/Inventor instead of %%{_datadir}/%name
- Fix dep on xmessage for FC4.
- Add %%{_datadir}/Inventor/data/materials.
- Add %%{_datadir}/Inventor/fonts.

* Mon Oct 02 2006 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-23
- Add make-var _PDFVIEWER.
- Backport to FC4.
- Fix path to chessboard.iv in chesschairs.iv.

* Thu Sep 25 2006 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-22
- Misc minor fixes.
- Add dep to xmessage.
- Use unified patch.
- Rebuild against lesscrap.

* Tue Sep 05 2006 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-21
- Mass rebuild.

* Sun Feb 19 2006 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-20
- Rebuild.

* Fri Dec 30 2005 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-19
- Don't BR: libXau-devel (#176313 reported to be fixed).

* Wed Dec 28 2005 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-18
- Remove patch10 (#173879, #175251 are reported to be fixed).

* Thu Dec 22 2005 Ralf Corsépius <rc040203@freenet.de> - 2.1.5-17
- Remove BR: libX11-devel (#173712 reported to be fixed).
- Remove BR: libGL-devel (#175253 reported to be fixed).

* Wed Dec 14 2005 Ralf Corsepius <rc040203@freenet.de> - 2.1.5-16
- Remove BR: libXext-devel (Impl. R'd by openmotif-devel).
- Remove BR: xorg-x11-proto-devel (PR #175256).

* Thu Dec 8 2005 Ralf Corsepius <rc040203@freenet.de> - 2.1.5-15
- Further modular X fixes.
- Reflect modular X pkgconfigs.

* Thu Dec 8 2005 Ralf Corsepius <rc040203@freenet.de> - 2.1.5-14
- Attempt to build against modular X.
- Add Inventor-redhat-bugs patch.

* Tue Aug 03 2005 Ralf Corsepius <ralf[AT]links2linux.de> - 2.1.5-13
- Let PPC use standard RPM_OPT_FLAGS.

* Tue Aug 02 2005 Ralf Corsepius <ralf[AT]links2linux.de> - 2.1.5-12
- Add SoTempPath fix.

* Sun May 22 2005 Ralf Corsepius <ralf[AT]links2linux.de> - 2.1.5-9
- Increment release in an attempt to please build system.

* Sun May 22 2005 Ralf Corsepius <ralf[AT]links2linux.de> - 2.1.5-8
- Use BR: xorg-x11-* instead of *.so.1 to work around rpm's brain-dead
  SONAME handling.
- Add %%dist.
- Use sed -i to avoid temporary files.

* Fri Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
- rebuilt

* Wed Feb 16 2005 Thorsten Leemhuis <fedora[AT]leemhuis[DOT]info> - 2.1.5-7
- Add specfile-patch from Andy Loening to fix build on x86_64 (rhb#147267)

* Mon Feb 14 2005 David Woodhouse <dwmw2 infradead org> - 2.1.5-6
- Work around gcc bug by backing down to -O1 on ppc

* Mon Sep 6 2004 Ralf Corsepius <ralf[AT]links2linux.de> - 2.1.5-0.fdr.5
- Add ivAddVP ivnorm ivperf to Inventor rsp. InventorXt.
- Remove BuildRequires: tcsh.

* Wed Aug 8 2004 Ralf Corsepius <ralf[AT]links2linux.de> - 2.1.5-0.fdr.4
- Split out InventorXt, InventorXt-devel, Inventor-examples
- make/ivcommondefs: Remove -O from $OPTIMIZER.
- Various changes to libInventor.pc and libInventorXt.pc.

* Wed Jul 7 2004 Ralf Corsepius <ralf[AT]links2linux.de> - 2.1.5-0.fdr.3
- Remove Mesa-Requires.
- Add pkgconfig support.
- Add various Requires: to *devel.
- Add Provides: InventorXt and InventorXt-devel.

* Thu Jul 1 2004 Ralf Corsepius <ralf[AT]links2linux.de> - 2.1.5-0.fdr.2
- Adopt portions of Michael Schwendt's patch.
- Fix hard-coded paths in apps/demos/*.RUNMEs.
- Use %%{_prefix}/lib instead of %%{_libdir} to install the demos into.
- Add make/ to devel docs.
- Hack devel docs to be buildable.

* Wed Jun 30 2004 Ralf Corsepius <ralf[AT]links2linux.de> - 2.1.5-0.fdr.1
- Initial Fedora Extras RPM.
- Adopt Debian/Testing patches (Thanks to Steve M. Robbins for keeping
  Inventor alive).