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 Complete DraftUtils Drawing Fem FreeCAD Image Import Inspection Mesh MeshPart Part PartDesign Path Points QtUnit Raytracing ReverseEngineering Robot Sketcher Spreadsheet Start Web PartDesignGui _PartDesign Spreadsheet SpreadsheetGui area |
4 |
|
5 |
# Some plugins go in the Mod folder instead of lib. Deal with those here: |
6 |
%global mod_plugins Mod/PartDesign |
7 |
|
8 |
%define srcname FreeCAD |
9 |
|
10 |
Name: freecad |
11 |
Version: 0.18 |
12 |
Release: %mkrel 1 |
13 |
Summary: A general purpose 3D CAD modeler |
14 |
Group: Graphics/3D |
15 |
|
16 |
License: GPLv2+ |
17 |
URL: http://www.freecadweb.org/ |
18 |
Source0: https://github.com/%{srcname}/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz |
19 |
Source102: freecad.1 |
20 |
|
21 |
Patch1: freecad-0.17-zipios.patch |
22 |
Patch2: freecad-0.17-Version_h.patch |
23 |
|
24 |
# Utilities |
25 |
BuildRequires: cmake |
26 |
BuildRequires: doxygen |
27 |
BuildRequires: swig |
28 |
BuildRequires: graphviz |
29 |
BuildRequires: gettext |
30 |
BuildRequires: dos2unix |
31 |
BuildRequires: desktop-file-utils |
32 |
BuildRequires: autoconf |
33 |
BuildRequires: automake |
34 |
BuildRequires: gcc |
35 |
BuildRequires: gcc-c++ |
36 |
BuildRequires: gcc-gfortran |
37 |
|
38 |
# Development Libraries |
39 |
BuildRequires: glibc-devel |
40 |
BuildRequires: boost-devel |
41 |
BuildRequires: freeimage-devel |
42 |
BuildRequires: med-devel |
43 |
# need same hdf5 version as med is build against |
44 |
BuildRequires: hdf5_10-devel |
45 |
BuildRequires: opencascade-devel |
46 |
BuildRequires: qt4-devel |
47 |
BuildRequires: smesh-devel |
48 |
BuildRequires: spnav-devel |
49 |
BuildRequires: vtk-devel |
50 |
BuildRequires: zipios++-devel |
51 |
BuildRequires: cmake(double-conversion) |
52 |
BuildRequires: pkgconfig(Coin) |
53 |
BuildRequires: pkgconfig(eigen3) |
54 |
BuildRequires: pkgconfig(freetype2) |
55 |
BuildRequires: pkgconfig(glew) |
56 |
BuildRequires: pkgconfig(jsoncpp) |
57 |
BuildRequires: pkgconfig(netcdf) |
58 |
BuildRequires: pkgconfig(shiboken) |
59 |
BuildRequires: pkgconfig(QtWebKit) |
60 |
BuildRequires: pkgconfig(SoQt) |
61 |
BuildRequires: pkgconfig(python2) |
62 |
BuildRequires: pkgconfig(pyside) |
63 |
BuildRequires: pkgconfig(freeglut) |
64 |
BuildRequires: pkgconfig(xerces-c) |
65 |
BuildRequires: pkgconfig(xmu) |
66 |
BuildRequires: pyside-tools |
67 |
BuildRequires: python2-qt4-webkit |
68 |
BuildRequires: python2dist(cxx) |
69 |
BuildRequires: python2dist(matplotlib) |
70 |
|
71 |
# Packages separated because they are noarch, but not optional so require them |
72 |
# here. |
73 |
Requires: %{name}-data = %{version}-%{release} |
74 |
|
75 |
Requires: pythonegg(2)(pivy) |
76 |
Requires: python2dist(matplotlib) |
77 |
Requires: pythonegg(2)(pycollada) |
78 |
Requires: pyside |
79 |
Requires: openscad |
80 |
|
81 |
%description |
82 |
FreeCAD is a general purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler, aimed |
83 |
directly at mechanical engineering and product design but also fits a wider |
84 |
range of uses in engineering, such as architecture or other engineering |
85 |
specialties. It is a feature-based parametric modeler with a modular software |
86 |
architecture which makes it easy to provide additional functionality without |
87 |
modifying the core system. |
88 |
|
89 |
|
90 |
%package data |
91 |
Summary: Data files for FreeCAD |
92 |
Group: Graphics/3D |
93 |
BuildArch: noarch |
94 |
Requires: %{name} >= %{version}-%{release} |
95 |
Requires: qt4-assistant |
96 |
|
97 |
%description data |
98 |
Data files for FreeCAD. |
99 |
|
100 |
|
101 |
%prep |
102 |
%autosetup -p1 -n %{srcname}-%{version} |
103 |
|
104 |
# Removed bundled libraries |
105 |
#rm -rf src/3rdParty |
106 |
rm -rf src/CXX |
107 |
rm -rf src/zipios++ |
108 |
|
109 |
|
110 |
%build |
111 |
|
112 |
# Deal with cmake projects that tend to link excessively. |
113 |
LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS |
114 |
|
115 |
%cmake -DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \ |
116 |
-DCMAKE_INSTALL_LIBDIR=%{_libdir}/%{name}/lib \ |
117 |
-DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \ |
118 |
-DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \ |
119 |
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \ |
120 |
-DRESOURCEDIR=%{_datadir}/%{name} \ |
121 |
-DOpenGL_GL_PREFERENCE=GLVND \ |
122 |
-DCOIN3D_INCLUDE_DIR=%{_includedir}/Coin3 \ |
123 |
-DCOIN3D_DOC_PATH=%{_datadir}/Coin3/Coin \ |
124 |
-DFREECAD_USE_EXTERNAL_PIVY=TRUE \ |
125 |
-DFREECAD_USE_EXTERNAL_SMESH=FALSE \ |
126 |
-DSMESH_INCLUDE_DIR=%{_includedir}/smesh \ |
127 |
-DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE \ |
128 |
-DPYCXX_INCLUDE_DIR=$(pkg-config --variable=includedir PyCXX) \ |
129 |
-DPYCXX_SOURCE_DIR=$(pkg-config --variable=srcdir PyCXX) \ |
130 |
-DMEDFILE_INCLUDE_DIRS=%{_includedir}/med \ |
131 |
../ |
132 |
|
133 |
%make_build |
134 |
|
135 |
|
136 |
%install |
137 |
%make_install -C build |
138 |
|
139 |
# Launchers in /usr/bin |
140 |
mkdir -p %{buildroot}%{_bindir} |
141 |
cat > %{buildroot}%{_bindir}/FreeCAD << EOF |
142 |
#!/bin/bash |
143 |
LD_LIBRARY_PATH=%{_libdir}/freecad/lib %{_libdir}/freecad/bin/FreeCAD "\$@" |
144 |
EOF |
145 |
|
146 |
cat > %{buildroot}%{_bindir}/FreeCADCmd << EOF |
147 |
#!/bin/bash |
148 |
LD_LIBRARY_PATH=%{_libdir}/freecad/lib %{_libdir}/freecad/bin/FreeCADCmd "\$@" |
149 |
EOF |
150 |
|
151 |
chmod a+rx %{buildroot}%{_bindir}/FreeCAD |
152 |
chmod a+rx %{buildroot}%{_bindir}/FreeCADCmd |
153 |
|
154 |
# Move mis-installed files to the right location |
155 |
# Need to figure out if FreeCAD can install correctly at some point. |
156 |
mkdir -p %{buildroot}%{_datadir} |
157 |
mv %{buildroot}%{_libdir}/%{name}/share/* \ |
158 |
%{buildroot}%{_datadir} |
159 |
|
160 |
# Install man page |
161 |
install -pD -m 0644 %{SOURCE102} \ |
162 |
%{buildroot}%{_mandir}/man1/%{name}.1 |
163 |
|
164 |
# Symlink manpage to other binary names |
165 |
pushd %{buildroot}%{_mandir}/man1 |
166 |
ln -sf %{name}.1.gz FreeCAD.1.xz |
167 |
ln -sf %{name}.1.gz FreeCADCmd.1.xz |
168 |
popd |
169 |
|
170 |
# Remove obsolete Start_Page.html |
171 |
rm -f %{buildroot}%{_docdir}/%{name}/Start_Page.html |
172 |
|
173 |
# Belongs in %%license not %%doc |
174 |
rm -f %{buildroot}%{_docdir}/freecad/ThirdPartyLibraries.html |
175 |
|
176 |
%files |
177 |
%license data/License.txt src/Doc/ThirdPartyLibraries.html |
178 |
%doc ChangeLog.txt README.md |
179 |
%exclude %{_docdir}/freecad/freecad.* |
180 |
%{_bindir}/* |
181 |
%{_metainfodir}/org.freecadweb.%{srcname}.appdata.xml |
182 |
%{_datadir}/applications/org.freecadweb.%{srcname}.desktop |
183 |
%{_datadir}/icons/hicolor/scalable/apps/org.freecadweb.%{srcname}.svg |
184 |
%{_datadir}/mime/packages/org.freecadweb.%{srcname}.xml |
185 |
%dir %{_libdir}/%{name} |
186 |
%{_libdir}/%{name}/bin/ |
187 |
%{_libdir}/%{name}/lib/ |
188 |
%{_libdir}/%{name}/Ext/ |
189 |
%{_libdir}/%{name}/Mod/ |
190 |
%{_mandir}/man1/*.1.* |
191 |
|
192 |
%files data |
193 |
%{_datadir}/%{name}/ |
194 |
%{_docdir}/%{name}/freecad.q* |