3 %bcond_with occ # Compile using OpenCASCADE instead of OCE
4 %bcond_with bundled_zipios # use bundled version of zipios++
5 %bcond_with bundled_pycxx # use bundled version of pycxx
6 %bcond_with bundled_smesh # use bundled version of Salome's Mesh
8 # This revision is 0.15 final.
10 Summary: A general purpose 3D CAD modeler
15 Group: Applications/Engineering
16 Source0: http://downloads.sourceforge.net/project/free-cad/FreeCAD%20Source/%{name}_%{version}.%{rev}.tar.gz
17 # Source0-md5: 7afa95d3e8cd845bef83202e76db7f24
18 Source101: %{name}.desktop
20 Source103: %{name}.appdata.xml
21 Source104: %{name}.sharedmimeinfo
22 Patch0: %{name}-3rdParty.patch
23 Patch1: %{name}-0.14-Xlib_h.patch
24 Patch2: %{name}-0.14-smesh.patch
25 Patch3: %{name}-0.14-DraftSnap.patch
26 #Patch4: %{name}-0.14-disable_auto_dxf_dl.patch
27 URL: http://freecadweb.org/
30 BuildRequires: desktop-file-utils
31 BuildRequires: dos2unix
32 BuildRequires: doxygen
33 BuildRequires: gcc-fortran
34 BuildRequires: gettext
35 BuildRequires: graphviz
37 BuildRequires: tbb-devel
38 # Development Libraries
39 BuildRequires: FreeImage-devel
40 BuildRequires: Mesa-libGLU-devel
41 BuildRequires: xorg-lib-libXmu-devel
43 BuildRequires: OpenCASCADE-devel
45 BuildRequires: OCE-devel
47 BuildRequires: Coin-devel
48 BuildRequires: SoQt-devel
49 BuildRequires: boost-devel
51 BuildRequires: python-devel
52 BuildRequires: qt-devel
53 BuildRequires: qt-webkit-devel
54 BuildRequires: appstream-glib-devel
55 BuildRequires: libicu-devel
56 BuildRequires: libspnav-devel
57 BuildRequires: netgen-mesher-devel
58 #BuildRequires: ode-devel
59 #BuildRequires: opencv-devel
60 BuildRequires: python-matplotlib
61 %{!?with_bundled_pycxx:BuildRequires: python-pycxx-devel}
62 BuildRequires: python-pyside-devel
63 BuildRequires: shiboken
64 %{!?with_bundled_smesh:BuildRequires: smesh-devel}
65 BuildRequires: xerces-c
66 BuildRequires: xerces-c-devel
67 %{!?with_bundled_zipios:BuildRequires: zipios++-devel}
68 Requires: %{name}-data = %{version}-%{release}
69 Requires: glib2 >= 1:2.26.0
70 # Obsolete old doc package since it's required for functionality.
71 Obsoletes: freecad-doc < 0.13-5
72 # Needed for plugin support and is not a soname dependency.
73 Requires: hicolor-icon-theme
74 Requires: python-collada
75 Requires: python-matplotlib
77 Requires: python-pyside
78 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80 # Maintainers: keep this list of plugins up to date
81 # List plugins in %%{_libdir}/freecad/lib, less '.so' and 'Gui.so', here
82 %define plugins Assembly Complete Drawing Fem FreeCAD Image Import Inspection Mesh MeshPart Part Points QtUnit Raytracing ReverseEngineering Robot Sketcher Start Web PartDesignGui _PartDesign
84 # Some plugins go in the Mod folder instead of lib. Deal with those here:
85 %define mod_plugins Mod/PartDesign
87 # plugins and private shared libs in %%{_libdir}/freecad/lib are private;
88 # prevent private capabilities being advertised in Provides/Requires
89 %define plugin_regexp /^\\\(libFreeCAD.*%(for i in %{plugins}; do echo -n "\\\|$i\\\|$iGui"; done)\\\)\\\(\\\|Gui\\\)\\.so/d
91 %filter_provides_in %{_libdir}/%{name}/lib
92 %filter_from_requires %{plugin_regexp}
93 %filter_from_provides %{plugin_regexp}
94 %filter_provides_in %{_libdir}/%{name}/Mod
95 %filter_requires_in %{_libdir}/%{name}/Mod
100 FreeCAD is a general purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM
101 modeler, aimed directly at mechanical engineering and product design
102 but also fits a wider range of uses in engineering, such as
103 architecture or other engineering specialties. It is a feature-based
104 parametric modeler with a modular software architecture which makes it
105 easy to provide additional functionality without modifying the core
109 Summary: Data files for FreeCAD
110 Requires: %{name} = %{version}-%{release}
111 %if "%{_rpmversion}" >= "5"
116 Data files for FreeCAD.
119 %setup -q -n %{name}-%{version}.%{rev}
121 %if %{without bundled_pycxx}
127 # Patch comes from upstream/master, doesn't apply cleanly to 0.14.
130 %if %{without bundled_zipios}
135 dos2unix -k src/Mod/Test/unittestgui.py \
140 # Removed bundled libraries
147 # Deal with cmake projects that tend to link excessively.
148 export LDFLAGS="%{rpmcflags} -Wl,--as-needed -Wl,--no-undefined"
151 -DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
152 -DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \
153 -DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
154 -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
155 -DRESOURCEDIR=%{_datadir}/%{name} \
156 -DCOIN3D_INCLUDE_DIR=%{_includedir}/Coin2 \
157 -DCOIN3D_DOC_PATH=%{_datadir}/Coin2/Coin \
158 -DFREECAD_USE_EXTERNAL_PIVY=TRUE \
162 %if %{without bundled_smesh}
163 -DFREECAD_USE_EXTERNAL_SMESH=TRUE \
164 -DSMESH_INCLUDE_DIR=%{_includedir}/smesh \
166 %if %{without bundled_zipios}
167 -DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE \
169 %if %{without bundled_pycxx}
170 -DPYCXX_INCLUDE_DIR=$(pkg-config --variable=includedir PyCXX) \
171 -DPYCXX_SOURCE_DIR=$(pkg-config --variable=srcdir PyCXX) \
179 rm -rf $RPM_BUILD_ROOT
180 %{__make} -C build install \
181 DESTDIR=$RPM_BUILD_ROOT
183 # Symlink binaries to %{_bindir}
184 install -d $RPM_BUILD_ROOT%{_bindir}
185 ln -s ../%{_lib}/freecad/bin/FreeCAD $RPM_BUILD_ROOT%{_bindir}
186 ln -s ../%{_lib}/freecad/bin/FreeCADCmd $RPM_BUILD_ROOT%{_bindir}
188 # Fix problems with unittestgui.py
189 #chmod +x $RPM_BUILD_ROOT%{_libdir}/%{name}/Mod/Test/unittestgui.py
191 # Install desktop file
192 desktop-file-install --dir=$RPM_BUILD_ROOT%{_desktopdir} %{SOURCE101}
193 sed -i 's,@lib@,%{_lib},g' $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
195 # Install desktop icon
196 install -pD src/Gui/Icons/%{name}.svg $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
199 install -pD %{SOURCE102} $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
201 # Symlink manpage to other binary names
202 ln -s %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/FreeCAD.1
203 ln -s %{name}.1 $RPM_BUILD_ROOT%{_mandir}/man1/FreeCADCmd.1
205 # Remove obsolete Start_Page.html
206 rm $RPM_BUILD_ROOT%{_docdir}/%{name}/Start_Page.html
208 # Install MimeType file
209 install -d $RPM_BUILD_ROOT%{_datadir}/mime/packages
210 cp -p %{SOURCE104} $RPM_BUILD_ROOT%{_datadir}/mime/packages/%{name}.xml
212 # Install appdata file
213 install -d $RPM_BUILD_ROOT%{_datadir}/appdata
214 cp -p %{SOURCE103} $RPM_BUILD_ROOT%{_datadir}/appdata/
216 # Bug maintainers to keep %%{plugins} macro up to date.
218 # Make sure there are no plugins that need to be added to plugins macro
219 new_plugins=$(ls $RPM_BUILD_ROOT%{_libdir}/freecad/lib | sed -e '%{plugin_regexp}')
220 if [ -n "$new_plugins" ]; then
224 Plugins not caught by regexp: $new_plugins
226 Plugins in %{_libdir}/freecad/lib do not exist in
227 specfile %%{plugins} macro. Please add these to
228 %%{plugins} macro at top of specfile and rebuild.
235 # Make sure there are no entries in the plugins macro that don't match plugins
236 for p in %{plugins}; do
237 if [ -z "$(ls $RPM_BUILD_ROOT%{_libdir}/freecad/lib/$p*.so)" ]; then
242 Extra entry in %%{plugins} macro with no matching plugin:
245 Please remove from %%{plugins} macro at top of specfile and rebuild.
253 appstream-util validate-relax --nonet $RPM_BUILD_ROOT/%{_datadir}/appdata/*.appdata.xml
256 %update_icon_cache_post hicolor
257 %update_desktop_database
258 %update_mime_database
261 if [ $1 -eq 0 ] ; then
262 %update_icon_cache hicolor
264 %update_desktop_database
265 %update_mime_database
268 %update_icon_cache hicolor
271 rm -rf $RPM_BUILD_ROOT
274 %defattr(644,root,root,755)
275 %doc ChangeLog.txt copying.lib data/License.txt
276 %exclude %{_docdir}/freecad/freecad.*
277 %attr(755,root,root) %{_bindir}/*
279 %{_datadir}/appdata/*.appdata.xml
280 %{_desktopdir}/%{name}.desktop
281 %{_iconsdir}/hicolor/scalable/apps/%{name}.svg
282 %{_datadir}/mime/packages/%{name}.xml
283 %dir %{_libdir}/%{name}
284 %{_libdir}/%{name}/bin
285 %{_libdir}/%{name}/lib
286 %{_libdir}/%{name}/Mod
289 %defattr(644,root,root,755)
291 %{_docdir}/%{name}/freecad.q*