]> git.pld-linux.org Git - packages/meshlab.git/blob - meshlab.spec
316dc3b5bf62d4497ac98d1e8af0576fca8807b5
[packages/meshlab.git] / meshlab.spec
1 Summary:        A system for processing and editing unstructured 3D triangular meshes
2 Name:           meshlab
3 Version:        1.3.2
4 Release:        0.1
5 License:        GPLv2+ and BSD and Public Domain
6 Group:          Applications/Multimedia
7 URL:            http://meshlab.sourceforge.net/
8
9 Source0:        http://downloads.sourceforge.net/meshlab/MeshLabSrc_AllInc_v132.tgz
10 # Source0-md5:  3cba61f6d34559f98129d9d0a3126f81
11 Source1:        %{name}-48x48.xpm
12
13 # Meshlab v131 tarball is missing the docs directory. Reported upstream,
14 # but for now we'll extract them from the v122 tarball.
15 Source2:        http://downloads.sourceforge.net/meshlab/MeshLabSrc_v122.tar.gz
16 # Source2-md5:  f06107dd01cbe0d6519dbb759ae84c11
17
18 # Fedora-specific patches to use shared libraries, and to put plugins and
19 # shaders in appropriate directories
20 Patch0:         %{name}-1.3.2-sharedlib.patch
21 Patch1:         %{name}-1.3.2-plugin-path.patch
22 Patch2:         %{name}-1.3.2-shader-path.patch
23
24 # Patch to fix FTBFS due to missing include of <cstddef>
25 # from Teemu Ikonen <tpikonen@gmail.com>
26 # Also added a missing include of <unistd.h>
27 Patch3:         %{name}-1.3.2-cstddef.patch
28
29 # Patch to fix reading of .ply files in comma separator locales
30 # from Teemu Ikonen <tpikonen@gmail.com>
31 Patch4:         %{name}-1.3.1-ply-numeric.patch
32
33 # Add #include <GL/glu.h> to various files
34 Patch5:         %{name}-1.3.1-glu.patch
35
36 # Disable io_ctm until openctm is packaged
37 Patch6:         %{name}-1.3.2-noctm.patch
38
39 # Change m.vert.math::Swap() to m.vert.swap()
40 # See Debian bug 667276
41 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667276
42 Patch9:         %{name}-1.3.2-vert-swap.patch
43
44 # Yet another incompatibility with GCC 4.7
45 Patch10:        %{name}-1.3.2-gcc47.patch
46
47 # Include paths shouldn't have consecutive double slashes.  Causes
48 # a problem for debugedit, used by rpmbuild to extract debuginfo.
49 Patch11:        %{name}-1.3.2-include-path-double-slash.patch
50
51 BuildRequires:  bzip2-devel
52 BuildRequires:  glew-devel
53 BuildRequires:  levmar-devel
54 BuildRequires:  lib3ds-devel
55 BuildRequires:  muparser-devel
56 BuildRequires:  qhull-devel
57 BuildRequires:  qt-devel
58 BuildRequires:  qtsoap-devel
59
60 BuildRequires:  ImageMagick
61 BuildRequires:  chrpath
62 BuildRequires:  desktop-file-utils
63
64 %description
65 MeshLab is an open source, portable, and extensible system for the
66 processing and editing of unstructured 3D triangular meshes. The
67 system is aimed to help the processing of the typical not-so-small
68 unstructured models arising in 3D scanning, providing a set of tools
69 for editing, cleaning, healing, inspecting, rendering and converting
70 these kinds of meshes.
71
72 %prep
73 %setup -q -c %{name}-%{version}
74
75 # get the missing docs directory from the old tarball
76 %setup -q -T -D -a 2
77 mv meshlab-snapshot-svn3524/meshlab/docs meshlab/docs
78 rm -rf meshlab-snapshot-svn3524
79
80 %patch0 -P 0 -p1 -b .sharedlib
81 %patch0 -P 1 -p1 -b .plugin-path
82 %patch0 -P 2 -p1 -b .shader-path
83 %patch0 -P 3 -p1 -b .cstddef
84 %patch0 -P 4 -p1 -b .ply-numeric
85 %patch0 -P 5 -p1 -b .glu
86 %patch0 -P 6 -p1 -b .noctm
87 %patch0 -P 9 -p1 -b .vert-swap
88 %patch0 -P 10 -p1 -b .gcc47
89 %patch0 -P 11 -p1 -b .include-path-double-slash
90
91 # Turn of execute permissions on source files to avoid rpmlint
92 # errors and warnings for the debuginfo package
93 find . \( -name *.h -o -name *.cpp -o -name *.inl \) -a -executable \
94         -exec chmod -x {} \;
95
96 # Remove bundled library sources, since we use the Fedora packaged
97 # libraries
98 rm -rf vcglib/wrap/system
99 rm -rf meshlab/src/external/{ann*,bzip2*,glew*,levmar*,lib3ds*,muparser*,ode*,qhull*,qtsoap*}
100
101 %build
102 # Build instructions from the wiki:
103 #   http://meshlab.sourceforge.net/wiki/index.php/Compiling_V122
104 # Note that the build instructions in README.linux are out of date.
105
106 cd meshlab/src/external
107 qmake-qt4 -recursive external.pro
108 # Note: -fPIC added to make jhead link properly; don't know why this wasn't
109 # also an issue with structuresynth
110 %{__make} \
111         CFLAGS="%{optflags} -fPIC"
112 cd ..
113 qmake-qt4 -recursive meshlab_full.pro
114 %{__make} \
115         CFLAGS="%{optflags}" \
116         DEFINES="-D__DISABLE_AUTO_STATS__ -DPLUGIN_DIR=\\\"%{_libdir}/%{name}\\\""
117
118 # process icon
119 convert %{SOURCE1} meshlab.png
120
121 # create desktop file
122 cat <<EOF >meshlab.desktop
123 [Desktop Entry]
124 Name=meshlab
125 GenericName=MeshLab 3D triangular mesh processing and editing
126 Exec=meshlab
127 Icon=meshlab
128 Terminal=false
129 Type=Application
130 Categories=Graphics;
131 EOF
132
133 # convert doc files from ISO-8859-1 to UTF-8 encoding:
134 cd ../docs
135 for f in contrib_Gangemi_Vannini.txt contrib_Buzzelli_Mazzanti.txt
136 do
137   iconv -fiso88591 -tutf8 $f >$f.new
138   touch -r $f $f.new
139   mv $f.new $f
140 done
141
142 %install
143 rm -rf $RPM_BUILD_ROOT
144 # The QMAKE_RPATHDIR stuff puts in the path to the compile-time location
145 # of libcommon, which won't work at runtime, so we change the rpath here.
146 # The use of rpath will cause an rpmlint error, but the Fedora Packaging
147 # Guidelines specifically allow use of an rpath for internal libraries:
148 # http://fedoraproject.org/wiki/Packaging:Guidelines#Rpath_for_Internal_Libraries
149 # Ideally upstream would rename the library to libmeshlab, libmeshlabcommon,
150 # or the like, so that we could put it in the system library directory
151 # and avoid rpath entirely.
152 chrpath -r %{_libdir}/meshlab meshlab/src/distrib/{meshlab,meshlabserver}
153
154 install -d $RPM_BUILD_ROOT%{_bindir}
155 install -p meshlab/src/distrib/meshlab \
156                   meshlab/src/distrib/meshlabserver \
157                   $RPM_BUILD_ROOT%{_bindir}
158
159 install -d $RPM_BUILD_ROOT%{_mandir}/man1
160 install -p meshlab/docs/meshlab.1 \
161                   meshlab/docs/meshlabserver.1 \
162                   $RPM_BUILD_ROOT%{_mandir}/man1
163
164 install -d $RPM_BUILD_ROOT%{_libdir}/meshlab
165 install -p meshlab/src/distrib/libcommon.so.1.0.0 \
166                   $RPM_BUILD_ROOT%{_libdir}/meshlab
167 ln -s libcommon.so.1.0.0 $RPM_BUILD_ROOT%{_libdir}/meshlab/libcommon.so.1.0
168 ln -s libcommon.so.1.0.0 $RPM_BUILD_ROOT%{_libdir}/meshlab/libcommon.so.1
169 ln -s libcommon.so.1.0.0 $RPM_BUILD_ROOT%{_libdir}/meshlab/libcommon.so
170
171 install -d $RPM_BUILD_ROOT%{_libdir}/meshlab/plugins
172 install -p meshlab/src/distrib/plugins/*.so \
173                   $RPM_BUILD_ROOT%{_libdir}/meshlab/plugins
174
175 install -d $RPM_BUILD_ROOT%{_datadir}/meshlab/shaders
176 install -p meshlab/src/distrib/shaders/*.{frag,gdp,vert} \
177                   $RPM_BUILD_ROOT%{_datadir}/meshlab/shaders
178
179 install -d $RPM_BUILD_ROOT%{_datadir}/meshlab/shaders/shadersrm
180 install -p meshlab/src/distrib/shaders/shadersrm/*.rfx \
181                   $RPM_BUILD_ROOT%{_datadir}/meshlab/shaders/shadersrm
182
183 install -d $RPM_BUILD_ROOT%{_datadir}/meshlab/textures
184
185 install -d $RPM_BUILD_ROOT%{_pixmapsdir}
186 install -p meshlab/src/meshlab.png \
187                   $RPM_BUILD_ROOT%{_pixmapsdir}
188
189 install -d $RPM_BUILD_ROOT%{_desktopdir}
190 install -p meshlab/src/meshlab.desktop \
191                   $RPM_BUILD_ROOT%{_desktopdir}
192
193 desktop-file-validate $RPM_BUILD_ROOT%{_desktopdir}/meshlab.desktop
194
195 %post -p /sbin/ldconfig
196 %postun -p /sbin/ldconfig
197
198 %files
199 %defattr(644,root,root,755)
200 %doc meshlab/docs/contrib_Buzzelli_Mazzanti.txt
201 %doc meshlab/docs/contrib_Gangemi_Vannini.txt
202 %doc meshlab/docs/contrib_Latronico_Venturi.txt
203 %doc meshlab/docs/contrib_Mochi_Portelli_Vacca.txt
204 %doc meshlab/docs/gpl.txt
205 %doc meshlab/docs/history.txt
206 %doc meshlab/docs/privacy.txt
207 %doc meshlab/docs/README.linux
208 %doc meshlab/docs/readme.txt
209 %doc meshlab/docs/ToDo.txt
210 %doc meshlab/src/distrib/shaders/3Dlabs-license.txt
211 %doc meshlab/src/distrib/shaders/LightworkDesign-license.txt
212 %doc meshlab/src/meshlabplugins/filter_poisson/license.txt
213
214 %attr(755,root,root) %{_bindir}/meshlab
215 %attr(755,root,root) %{_bindir}/meshlabserver
216 %{_libdir}/meshlab
217 %{_datadir}/meshlab
218 %{_mandir}/man1/*.1.*
219 %{_desktopdir}/meshlab.desktop
220 %{_pixmapsdir}/meshlab.png
221
222 %changelog
223
224 %clean
225 rm -rf $RPM_BUILD_ROOT
This page took 0.074934 seconds and 2 git commands to generate.