Blog: LDView - Packaged for Linux: ldview.spec

File ldview.spec, 6.2 KB (added by retracile, 10 years ago)
Line 
1Name: ldview
2Version: 4.2b1.20140530
3Release: ec1
4Source0: ldview.tar.bz2
5Patch1: ldview-1-no-force-zoomtofit.patch
6Patch2: ldview-2-typo.patch
7Patch3: ldview-3-64-bit-fix.patch
8Summary: Lego CAD viewer
9Group: Engineering/CAD
10License: GPL
11Vendor: Travis Cobbs <ldview@gmail.com>
12Packager: Peter Bartfai <pbartfai@stardust.hu>
13URL: http://ldview.sourceforge.net
14Buildroot: /tmp/%{name}-%{version}-root
15#Requires: ldraw_parts ldraw_parts-creativecommons
16BuildRequires: qt-devel, boost-devel, tinyxml-devel, gcc-c++, libpng-devel, gl2ps-devel, libjpeg-turbo-devel, mesa-libOSMesa-devel
17#, lib3ds-devel >= 2.0.0-rc1 ???
18#, cvs
19
20%description
21LDView is a real-time 3D viewer for displaying LDraw models using hardware-accellerated 3D graphics.
22
23%prep
24%setup -n ldview
25%patch1 -p1
26%patch2 -p1
27%patch3 -p1
28
29%build
30cd QT
31PATH=/usr/lib64/qt4/bin:$PATH # uic: File generated with too old version of Qt Designer
32#PATH=$PATH:/usr/lib/qt-3.3/bin
33#export QTDIR=/usr/lib/qt-3.3
34qmake
35
36make
37strip LDView
38cd ../OSMesa
39make
40
41%install
42cd QT
43INSTALL_ROOT=$RPM_BUILD_ROOT make install
44
45#mkdir -p $RPM_BUILD_ROOT/usr/share/ldview
46#mkdir -p $RPM_BUILD_ROOT/usr/bin
47#install -d $RPM_BUILD_ROOT/usr/share/ldview
48#install -m 755 LDView $RPM_BUILD_ROOT/usr/bin/LDView
49#install -m 644 ../Textures/SansSerif.fnt \
50#$RPM_BUILD_ROOT/usr/share/ldview/SansSerif.fnt
51#install -m 644 ../Help.html $RPM_BUILD_ROOT/usr/share/ldview/Help.html
52#install -m 644 ../Readme.txt $RPM_BUILD_ROOT/usr/share/ldview/Readme.txt
53#install -m 644 ../ChangeHistory.html $RPM_BUILD_ROOT/usr/share/ldview/ChangeHistory.html
54#install -m 644 ../license.txt $RPM_BUILD_ROOT/usr/share/ldview/license.txt
55#install -m 644 ../m6459.ldr $RPM_BUILD_ROOT/usr/share/ldview/m6459.ldr
56#install -m 644 ../8464.mpd $RPM_BUILD_ROOT/usr/share/ldview/8464.mpd
57#install -m 644 ../LDViewMessages.ini \
58#                               $RPM_BUILD_ROOT/usr/share/ldview/LDViewMessages.ini
59#cat ../LDExporter/LDExportMessages.ini >> \
60#                               $RPM_BUILD_ROOT/usr/share/ldview/LDViewMessages.ini
61#install -m 644 ../Translations/German/LDViewMessages.ini \
62#                               $RPM_BUILD_ROOT/usr/share/ldview/LDViewMessages_de.ini
63#install -m 644 ../Translations/Italian/LDViewMessages.ini \
64#                               $RPM_BUILD_ROOT/usr/share/ldview/LDViewMessages_it.ini
65#install -m 644 ../Translations/Czech/LDViewMessages.ini \
66#                           $RPM_BUILD_ROOT/usr/share/ldview/LDViewMessages_cz.ini
67#install -m 644 ../Translations/Hungarian/LDViewMessages.ini \
68#                               $RPM_BUILD_ROOT/usr/share/ldview/LDViewMessages_hu.ini
69#install -m 644 todo.txt $RPM_BUILD_ROOT/usr/share/ldview/todo.txt
70#install -m 644 ldview_en.qm $RPM_BUILD_ROOT/usr/share/ldview/ldview_en.qm
71#install -m 644 ldview_de.qm $RPM_BUILD_ROOT/usr/share/ldview/ldview_de.qm
72#install -m 644 ldview_it.qm $RPM_BUILD_ROOT/usr/share/ldview/ldview_it.qm
73#install -m 644 ldview_cz.qm $RPM_BUILD_ROOT/usr/share/ldview/ldview_cz.qm
74install -m 644 ../LDExporter/LGEO.xml \
75                           $RPM_BUILD_ROOT/usr/share/ldview/LGEO.xml
76mkdir -p $RPM_BUILD_ROOT/usr/share/mime-info/
77mkdir -p $RPM_BUILD_ROOT/usr/share/mime/packages/
78mkdir -p $RPM_BUILD_ROOT/usr/share/application-registry/
79mkdir -p $RPM_BUILD_ROOT/usr/share/applications/
80mkdir -p $RPM_BUILD_ROOT/usr/bin
81mkdir -p $RPM_BUILD_ROOT/usr/share/pixmaps/gnome-ldraw.png
82mkdir -p $RPM_BUILD_ROOT/usr/share/icons/gnome/32x32/mimetypes
83mkdir -p $RPM_BUILD_ROOT/etc/gconf/schemas
84install -m 644 desktop/ldraw.mime $RPM_BUILD_ROOT/usr/share/mime-info/ldraw.mime
85install -m 644 desktop/ldraw.xml  $RPM_BUILD_ROOT/usr/share/mime/packages/ldraw.xml
86install -m 644 desktop/ldraw.keys $RPM_BUILD_ROOT/usr/share/mime-info/ldraw.keys
87install -m 644 desktop/ldview.applications $RPM_BUILD_ROOT/usr/share/application-registry/ldview.applications
88install -m 644 xfce/ldraw.desktop $RPM_BUILD_ROOT/usr/share/applications/ldraw.desktop
89install -m 755 desktop/ldraw-thumbnailer $RPM_BUILD_ROOT/usr/bin/ldraw-thumbnailer
90install -m 644 images/LDViewIcon.png $RPM_BUILD_ROOT/usr/share/pixmaps/gnome-ldraw.png
91install -m 644 images/LDViewIcon.png $RPM_BUILD_ROOT/usr/share/icons/gnome/32x32/mimetypes/gnome-mime-application-x-ldraw.png
92install -m 644 images/LDViewIcon.png $RPM_BUILD_ROOT/usr/share/icons/gnome/32x32/mimetypes/gnome-mime-application-x-multipart-ldraw.png
93install -m 644 desktop/ldraw.schemas $RPM_BUILD_ROOT/etc/gconf/schemas/ldraw.schemas
94
95cd ..
96install -m 755 OSMesa/ldview $RPM_BUILD_ROOT/usr/bin/ldview
97
98
99%files
100/usr/bin/LDView
101/usr/share/ldview/SansSerif.fnt
102/usr/share/ldview/Help.html
103/usr/share/ldview/license.txt
104/usr/share/ldview/ChangeHistory.html
105/usr/share/ldview/m6459.ldr
106/usr/share/ldview/8464.mpd
107/usr/share/ldview/Readme.txt
108/usr/share/ldview/LDViewMessages.ini
109/usr/share/ldview/LDViewMessages_de.ini
110/usr/share/ldview/LDViewMessages_it.ini
111/usr/share/ldview/LDViewMessages_cz.ini
112/usr/share/ldview/LDViewMessages_hu.ini
113/usr/share/ldview/todo.txt
114#/usr/share/ldview/ldview_en.qm
115#/usr/share/ldview/ldview_de.qm
116#/usr/share/ldview/ldview_it.qm
117#/usr/share/ldview/ldview_cz.qm
118/usr/share/ldview/LGEO.xml
119
120%clean
121rm -rf $RPM_BUILD_ROOT
122
123%package osmesa
124Summary: OSMesa port of LDView for servers without X11
125Group: Applications/Multimedia
126Requires: ldview
127%description osmesa
128OSMesa port of LDView for servers without X11
129
130%files osmesa
131/usr/bin/ldview
132
133%package gnome
134Summary: Gnome integration for LDView
135Group: Applications/Multimedia
136Requires: ldview
137PreReq: GConf2, shared-mime-info, desktop-file-utils
138%description gnome
139Gnome integration for LDView
140
141%files gnome
142/usr/share/mime-info/ldraw.mime
143/usr/share/mime/packages/ldraw.xml
144/usr/share/mime-info/ldraw.keys
145/usr/share/application-registry/ldview.applications
146/usr/share/applications/ldraw.desktop
147/usr/bin/ldraw-thumbnailer
148/usr/share/pixmaps/gnome-ldraw.png
149/usr/share/icons/gnome/32x32/mimetypes/gnome-mime-application-x-ldraw.png
150/usr/share/icons/gnome/32x32/mimetypes/gnome-mime-application-x-multipart-ldraw.png
151/etc/gconf/schemas/ldraw.schemas
152
153%post gnome
154update-mime-database  /usr/share/mime >/dev/null
155update-desktop-database
156cd /etc/gconf/schemas
157GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
158gconftool-2 --makefile-install-rule ldraw.schemas >/dev/null
159pidof nautilus | xargs --no-run-if-empty kill -s HUP
160
161%postun gnome
162update-mime-database  /usr/share/mime >/dev/null
163update-desktop-database
164
165%preun gnome
166cd /etc/gconf/schemas
167GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
168gconftool-2 --makefile-uninstall-rule ldraw.schemas >/dev/null