freecad/freecad.spec
2016-09-19 18:19:23 +04:00

124 lines
3.8 KiB
RPMSpec

%define oname FreeCAD
Summary: FreeCAD is a general purpose 3D CAD modeler
Name: freecad
Version: 0.16
Release: 2
License: GPLv2+ and LGPLv2+
Group: Graphics
Url: http://www.freecadweb.org/
Source0: https://github.com/FreeCAD/FreeCAD/archive/%{oname}-%{version}.tar.gz
Source1: %{name}.desktop
Source2: %{name}.1
Source3: %{name}.rpmlintrc
BuildRequires: cmake
BuildRequires: eigen3 >= 3.0.1
BuildRequires: gcc-gfortran
BuildRequires: python-matplotlib
BuildRequires: pyside-tools
BuildRequires: boost-devel >= 1.33.1
BuildRequires: libspnav-devel
BuildRequires: opencascade-devel >= 5.2
BuildRequires: qt4-devel
BuildRequires: pkgconfig(glu)
BuildRequires: pkgconfig(SoQt) >= 1.2.0
BuildRequires: pkgconfig(Coin) >= 2.4.0
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(gstreamer-0.10)
BuildRequires: pkgconfig(ode)
BuildRequires: pkgconfig(opencv)
BuildRequires: pkgconfig(python) >= 2.5
BuildRequires: pkgconfig(shiboken)
BuildRequires: pkgconfig(pyside)
BuildRequires: pkgconfig(xerces-c) >= 2.6
Requires: pyside
%description
FreeCAD will be a general purpose parametric 3D CAD modeler. The development
is completely Open Source. It is a feature based parametric modeler with a
modular software architecture which makes it easy to provide additional
functionality without modifying the core system. As with many modern 3D CAD
modelers it has many 2D component in order to extract design detail from
the 3D model to create 2D production drawings, but direct 2D drawing (e.g.
AutoCAD LT) is not the focus, neither are animation and organic shapes (e.g.
Maya, 3D StudioMAX, Blender and Cinema 4D).
%files
%doc ChangeLog.txt copying.lib data/License.txt build/doc/*
%{_bindir}/*
%{_libdir}/%{name}/bin/
%{_libdir}/%{name}/Mod/
%{_libdir}/%{name}/*.so
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/%{name}/
%{_mandir}/man1/*.1*
#----------------------------------------------------------------------------
%package devel
Summary: Devel package for %{name}
Requires: %{name} = %{version}
Group: Development/C++
%description devel
Development files for FreeCAD.
%files devel
%doc ChangeLog.txt copying.lib
%{_libdir}/%{name}/include/
#----------------------------------------------------------------------------
%prep
%setup -qn %{oname}-%{version}
#%%apply_patches
# Fix bogus file perms
find ./src -name "*.py*" |xargs chmod 755
find ./src -name "*.h*" |xargs chmod 644
find ./src -name "*.cpp*" |xargs chmod 644
%build
#define Werror_cflags %%nil
%cmake_qt4 -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
-DCMAKE_INSTALL_INCLUDEDIR=%{_libdir}/%{name}/include \
-DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \
-DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
-DCMAKE_INSTALL_LIBDIR=%{_libdir}/%{name} \
-DRESOURCEDIR=%{_libdir}/freecad
%make
%install
%makeinstall_std -C build
# Symlink binaries to /usr/bin
mkdir -p %{buildroot}%{_bindir}
pushd %{buildroot}%{_bindir}
ln -s ../%{_lib}/freecad/bin/FreeCAD .
ln -s ../%{_lib}/freecad/bin/FreeCADCmd .
popd
# Fix bogus perms
chmod +x %{buildroot}%{_libdir}/%{name}/Mod/PartDesign/Scripts/*.py
# Install and fix .desktop file
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
sed -i 's,@lib@,%{_lib},g' %{buildroot}%{_datadir}/applications/%{name}.desktop
# Install desktop icon
install -pD -m 0644 src/Gui/Icons/%{name}.svg \
%{buildroot}%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
# Install man page
install -pD -m 0644 %{SOURCE2} %{buildroot}%{_mandir}/man1/%{name}.1
# Symlink manpage to other binary names
pushd %{buildroot}%{_mandir}/man1
ln -sf %{name}.1.gz FreeCAD.1.gz.
ln -sf %{name}.1.gz FreeCADCmd.1.gz
popd
# FIXME: Apparently there are no more include files to install.
# For now keep the devel package and manually create the needed (empty) dir
mkdir -p %{buildroot}%{_libdir}/%{name}/include