1 # Maintainers: keep this list of plugins up to date
2 # List plugins in %%{_libdir}/freecad/lib, less '.so' and 'Gui.so', here
3 %global plugins Assembly Complete Drawing Fem FreeCAD Image Import Inspection Mesh MeshPart Part Points QtUnit Raytracing ReverseEngineering Robot Sketcher Start Web PartDesignGui _PartDesign
5 # Some plugins go in the Mod folder instead of lib. Deal with those here:
6 %global mod_plugins Mod/PartDesign
8 # This revision is 0.13 final.
11 # Temporary workaround for cmake/boost bug:
12 # http://public.kitware.com/Bug/view.php?id=13446
13 %if 0%{?rhel} && 0%{?rhel} <= 6
14 %global cmake %cmake -DBoost_NO_BOOST_CMAKE=ON
17 # Some configuration options for other environments
18 # rpmbuild --with=occ: Compile using OpenCASCADE instead of OCE
19 %global occ %{?_with_occ:1} %{?!_with_occ: 0}
20 # rpmbuild --with=bundled_zipios: use bundled version of zipios++
21 %global bundled_zipios %{?_with_bundled_zipios:1} %{?!_with_bundled_zipios: 0}
22 # rpmbuild --with=bundled_pycxx: use bundled version of pycxx
23 %global bundled_pycxx %{?_with_bundled_pycxx:1} %{?!_with_bundled_pycxx: 0}
24 # rpmbuild --with=bundled_smesh: use bundled version of Salome's Mesh
25 %global bundled_smesh %{?_with_bundled_smesh:1} %{?!_with_bundled_smesh: 0}
28 Summary: A general purpose 3D CAD modeler
32 Group: Applications/Engineering
35 URL: http://sourceforge.net/apps/mediawiki/free-cad/
36 Source0: http://downloads.sourceforge.net/free-cad/%{name}-%{version}.%{rev}.tar.gz
37 # Source0-md5: 234747bdff47a62fd10cb902f3dd772b
38 Source101: %{name}.desktop
40 Source103: %{name}.appdata.xml
41 Source104: %{name}.sharedmimeinfo
43 Patch0: %{name}-3rdParty.patch
44 Patch1: %{name}-0.14-Xlib_h.patch
45 Patch2: %{name}-0.14-smesh.patch
46 # http://www.freecadweb.org/tracker/view.php?id=1757
47 Patch3: %{name}-0.14-DraftSnap.patch
48 #Patch4: %{name}-0.14-disable_auto_dxf_dl.patch
53 BuildRequires: desktop-file-utils
54 BuildRequires: dos2unix
55 BuildRequires: doxygen
56 BuildRequires: gcc-gfortran
57 BuildRequires: gettext
58 BuildRequires: graphviz
61 BuildRequires: tbb-devel
63 # Development Libraries
64 BuildRequires: freeimage-devel
65 BuildRequires: mesa-libGLU-devel
66 BuildRequires: xorg-lib-libXmu-devel
68 BuildRequires: OpenCASCADE-devel
70 BuildRequires: OCE-devel
73 # https://bugzilla.redhat.com/show_bug.cgi?id=665733
74 BuildRequires: Coin2-devel
75 #BuildRequires: Coin3-devel
76 BuildRequires: SoQt-devel
77 BuildRequires: boost-devel
78 BuildRequires: eigen3-devel
79 BuildRequires: python-devel
80 BuildRequires: qt-devel
81 BuildRequires: qt-webkit-devel
83 BuildRequires: libspnav-devel
84 #BuildRequires: ode-devel
85 #BuildRequires: opencv-devel
86 BuildRequires: python-pyside-devel
87 BuildRequires: shiboken-devel
88 BuildRequires: xerces-c
89 BuildRequires: xerces-c-devel
90 %if ! %{bundled_smesh}
91 BuildRequires: smesh-devel
93 BuildRequires: netgen-mesher-devel
94 %if ! %{bundled_zipios}
95 BuildRequires: zipios++-devel
97 %if ! %{bundled_pycxx}
98 BuildRequires: python-pycxx-devel
100 BuildRequires: libicu-devel
101 BuildRequires: python-matplotlib
105 BuildRequires: libappstream-glib
108 # Packages separated because they are noarch, but not optional so require them
110 Requires: %{name}-data = %{version}-%{release}
111 # Obsolete old doc package since it's required for functionality.
112 Obsoletes: freecad-doc < 0.13-5
114 # Needed for plugin support and is not a soname dependency.
115 %if ! 0%{?rhel} <= 6 && "%{_arch}" != "ppc64"
116 # python-pivy does not build on EPEL 6 ppc64.
117 Requires: python-pivy
119 Requires: hicolor-icon-theme
120 Requires: python-collada
121 Requires: python-matplotlib
122 Requires: python-pyside
124 # plugins and private shared libs in %%{_libdir}/freecad/lib are private;
125 # prevent private capabilities being advertised in Provides/Requires
126 %define plugin_regexp /^\\\(libFreeCAD.*%(for i in %{plugins}; do echo -n "\\\|$i\\\|$iGui"; done)\\\)\\\(\\\|Gui\\\)\\.so/d
128 %filter_provides_in %{_libdir}/%{name}/lib
129 %filter_from_requires %{plugin_regexp}
130 %filter_from_provides %{plugin_regexp}
131 %filter_provides_in %{_libdir}/%{name}/Mod
132 %filter_requires_in %{_libdir}/%{name}/Mod
138 FreeCAD is a general purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM
139 modeler, aimed directly at mechanical engineering and product design
140 but also fits a wider range of uses in engineering, such as
141 architecture or other engineering specialties. It is a feature-based
142 parametric modeler with a modular software architecture which makes it
143 easy to provide additional functionality without modifying the core
148 Summary: Data files for FreeCAD
149 Requires: %{name} = %{version}-%{release}
153 Data files for FreeCAD
157 %setup -q -n %{name}-%{version}.%{rev}
158 %patch0 -p1 -b .3rdparty
159 # Remove bundled pycxx if we're not using it
160 %if ! %{bundled_pycxx}
163 %patch1 -p1 -b .Xlib_h
164 %patch2 -p1 -b .smesh
165 %patch3 -p1 -b .draftsnap
166 # Patch comes from upstream/master, doesn't apply cleanly to 0.14.
167 #patch4 -p1 -b .no_dxf_dl
169 %if ! %{bundled_zipios}
174 dos2unix -k src/Mod/Test/unittestgui.py \
179 # Removed bundled libraries
184 rm -rf build && mkdir build && pushd build
186 # Deal with cmake projects that tend to link excessively.
187 LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS"
189 %cmake -DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
190 -DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \
191 -DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
192 -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
193 -DRESOURCEDIR=%{_datadir}/%{name} \
194 -DCOIN3D_INCLUDE_DIR=%{_includedir}/Coin2 \
195 -DCOIN3D_DOC_PATH=%{_datadir}/Coin2/Coin \
196 -DFREECAD_USE_EXTERNAL_PIVY=TRUE \
200 %if ! %{bundled_smesh}
201 -DFREECAD_USE_EXTERNAL_SMESH=TRUE \
202 -DSMESH_INCLUDE_DIR=%{_includedir}/smesh \
204 %if ! %{bundled_zipios}
205 -DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE \
207 %if ! %{bundled_pycxx}
208 -DPYCXX_INCLUDE_DIR=$(pkg-config --variable=includedir PyCXX) \
209 -DPYCXX_SOURCE_DIR=$(pkg-config --variable=srcdir PyCXX) \
213 %{__make} %{?_smp_mflags}
219 rm -rf $RPM_BUILD_ROOT
222 DESTDIR=$RPM_BUILD_ROOT
225 # Symlink binaries to %{_bindir}
226 install -d $RPM_BUILD_ROOT%{_bindir}
227 pushd $RPM_BUILD_ROOT%{_bindir}
228 ln -s ../%{_lib}/freecad/bin/FreeCAD .
229 ln -s ../%{_lib}/freecad/bin/FreeCADCmd .
232 # Fix problems with unittestgui.py
233 #chmod +x $RPM_BUILD_ROOT%{_libdir}/%{name}/Mod/Test/unittestgui.py
235 # Install desktop file
236 desktop-file-install \
237 --dir=$RPM_BUILD_ROOT%{_desktopdir} \
239 sed -i 's,@lib@,%{_lib},g' $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
241 # Install desktop icon
242 install -pD src/Gui/Icons/%{name}.svg \
243 $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
246 install -pD %{SOURCE102} \
247 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
249 # Symlink manpage to other binary names
250 pushd $RPM_BUILD_ROOT%{_mandir}/man1
251 ln -sf %{name}.1.gz FreeCAD.1.gz
252 ln -sf %{name}.1.gz FreeCADCmd.1.gz
255 # Remove obsolete Start_Page.html
256 rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}/Start_Page.html
258 # Install MimeType file
259 install -d $RPM_BUILD_ROOT%{_datadir}/mime/packages
260 install -pm 0644 %{SOURCE104} $RPM_BUILD_ROOT%{_datadir}/mime/packages/%{name}.xml
262 # Install appdata file
263 install -d $RPM_BUILD_ROOT%{_datadir}/appdata
264 install -pm 0644 %{SOURCE103} $RPM_BUILD_ROOT%{_datadir}/appdata/
266 # Bug maintainers to keep %%{plugins} macro up to date.
268 # Make sure there are no plugins that need to be added to plugins macro
269 new_plugins=`ls $RPM_BUILD_ROOT%{_libdir}/freecad/lib | sed -e '%{plugin_regexp}'`
270 if [ -n "$new_plugins" ]; then
271 echo -e "\n\n\n**** ERROR:\n" \
272 "\nPlugins not caught by regexp: " $new_plugins \
273 "\n\nPlugins in %{_libdir}/freecad/lib do not exist in" \
274 "\nspecfile %%{plugins} macro. Please add these to" \
275 "\n%%{plugins} macro at top of specfile and rebuild.\n****\n" 1>&2
278 # Make sure there are no entries in the plugins macro that don't match plugins
279 for p in %{plugins}; do
280 if [ -z "`ls $RPM_BUILD_ROOT%{_libdir}/freecad/lib/$p*.so`" ]; then
282 echo -e "\n\n\n**** ERROR:\n" \
283 "\nExtra entry in %%{plugins} macro with no matching plugin:" \
284 "'$p'.\n\nPlease remove from %%{plugins} macro at top of" \
285 "\nspecfile and rebuild.\n****\n" 1>&2
293 %{?fedora:appstream-util validate-relax --nonet \
294 %{buildroot}/%{_datadir}/appdata/*.appdata.xml}
298 /bin/%update_icon_cache_post hicolor &>/dev/null || :
299 %{_bindir}/%update_desktop_database
300 %{_bindir}/update-mime-database %{_datadir}/mime &> /dev/null || :
303 if [ $1 -eq 0 ] ; then
304 /bin/%update_icon_cache_post hicolor &>/dev/null
305 %{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
307 %{_bindir}/%update_desktop_database
308 %{_bindir}/update-mime-database %{_datadir}/mime &> /dev/null || :
311 %{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
314 rm -rf $RPM_BUILD_ROOT
317 %defattr(644,root,root,755)
318 %doc ChangeLog.txt copying.lib data/License.txt
319 %exclude %{_docdir}/freecad/freecad.*
320 %attr(755,root,root) %{_bindir}/*
321 %{_datadir}/appdata/*.appdata.xml
322 %{_desktopdir}/%{name}.desktop
323 %{_iconsdir}/hicolor/scalable/apps/%{name}.svg
324 %{_datadir}/mime/packages/%{name}.xml
325 %dir %{_libdir}/%{name}
326 %{_libdir}/%{name}/bin/
327 %{_libdir}/%{name}/lib/
328 %{_libdir}/%{name}/Mod/
332 %defattr(644,root,root,755)
334 %{_docdir}/%{name}/freecad.q*