Blob Blame History Raw
Name:           OpenMesh
Version:        4.1
Release:        1%{?dist}
Summary:        A generic and efficient polygon mesh data structure
Group:          Applications/Engineering
License:        LGPLv3+ with exceptions
URL:            http://www.openmesh.org/
Source0:        http://www.openmesh.org/media/Releases/%{version}/OpenMesh-%{version}.tar.bz2
Source1:        README.Fedora
# Fedora specifics
Patch0:         OpenMesh-4.1-fedora.patch

BuildRequires:  cmake
BuildRequires:  libICE-devel
BuildRequires:  libX11-devel
BuildRequires:  libXext-devel
BuildRequires:  mesa-libGL-devel
BuildRequires:  mesa-libGLU-devel
BuildRequires:  freeglut-devel
BuildRequires:  qt4-devel
BuildRequires:  doxygen
BuildRequires:  desktop-file-utils

%description
OpenMesh is a generic and efficient data structure for representing
and manipulating polygonal meshes.

%package devel
Summary:        Development headers and libraries for OpenMesh
Group:          Applications/Engineering
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description devel
This package contains development headers and libraries necessary to
compile programs against OpenMesh.

%package doc
Summary:        Doxygen documentation for OpenMesh
Group:          Applications/Engineering
BuildArch:      noarch

%description doc
This package contains the Doxygen documentation for OpenMesh.

%package tools
Summary:        OpenMesh tools
Group:          Applications/Engineering
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description tools
This package contains the applications that ship with OpenMesh.

%prep
%setup -q
%patch0 -p1 -b .fedora
cp -p %{SOURCE1} .

# Generate desktop files
for xb in DecimaterGui ProgViewer QtViewer SubdividerGui Synthesizer; do
    cat > om_${xb}.desktop <<EOF
[Desktop Entry]
Name=$xb
Exec=%{_libdir}/%{name}/$xb
Terminal=false
Type=Application
StartupNotify=true
Categories=Utility;Science
EOF
done

%build
mkdir objdir
cd objdir
%{cmake} -DCMAKE_BUILD_TYPE=RELEASE ..
make %{?_smp_mflags}
make doc %{?_smp_mflags}

%install
make -C objdir/src/OpenMesh/Apps install DESTDIR=%{buildroot}
make -C objdir/src/OpenMesh/Core install DESTDIR=%{buildroot}
make -C objdir/src/OpenMesh/Tools install DESTDIR=%{buildroot}

# Get rid of static libraries
rm %{buildroot}%{_libdir}/*.a

# Tools have names that are too generic. Install them in a different place
mkdir -p %{buildroot}%{_libdir}/%{name}
mv %{buildroot}%{_bindir}/* %{buildroot}%{_libdir}/%{name}/
# and generate om_ prefixed symlinks
pushd %{buildroot}%{_libdir}/%{name}/
for b in *; do
    ln -s %{_libdir}/%{name}/$b %{buildroot}%{_bindir}/om_$b
done
popd

# Install desktop files
for xb in DecimaterGui ProgViewer QtViewer SubdividerGui Synthesizer; do
    desktop-file-install --dir=%{buildroot}%{_datadir}/applications om_${xb}.desktop
done

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%doc LICENSE README README.Fedora
%{_libdir}/libOpenMesh*.so.*

%files tools
%{_datadir}/applications/om_*.desktop
%{_libdir}/OpenMesh/
%{_bindir}/om_*

%files devel
%{_includedir}/OpenMesh/
%{_libdir}/libOpenMesh*.so

%files doc
%doc LICENSE
%doc objdir/Build/share/OpenMesh/Doc/html/*

%changelog
* Mon Sep 21 2015 Susi Lehtola <jussilehtola@fedoraproject.org> - 4.1-1
- Update to 4.1.

* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 3.2-4
- Rebuilt for GCC 5 C++11 ABI change

* Tue Feb 24 2015 Dominik Mierzejewski <rpm@greysector.net> - 3.2-3
- Rebuild with gcc-5.0 (blocks IQmol rebuild)

* Sun Aug 24 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 3.2-2
- Review fixes.

* Wed Aug 20 2014 Susi Lehtola <jussilehtola@fedoraproject.org> - 3.2-1
- Initial package.