[kisslicer] Initial import (#3985)

Miro Hrončok churchyard at rpmfusion.org
Sat Jul 9 21:50:41 CEST 2016


commit 3a51858ba51afdc5be44150c3271d5059b62ec0b
Author: Miro Hrončok <miro at hroncok.cz>
Date:   Sat Jul 9 21:50:07 2016 +0200

    Initial import (#3985)

 .gitignore     |   3 ++
 kisslicer.spec | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 sources        |   3 ++
 3 files changed, 151 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index e69de29..2d6f391 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/KISSlicer_Linux32_1_1_0.zip
+/KISSlicer_Linux64_1_1_0.zip
+/KISSlicer_Win32_1_1_0.zip
diff --git a/kisslicer.spec b/kisslicer.spec
new file mode 100644
index 0000000..ea33253
--- /dev/null
+++ b/kisslicer.spec
@@ -0,0 +1,145 @@
+Name:           kisslicer
+%global cname   KISSlicer
+%global maj     1
+%global min     1
+%global rev     0
+Version:        %{maj}.%{min}.%{rev}
+Release:        1%{?dist}
+Summary:        Keep It Simple Slicer
+URL:            http://www.kisslicer.com/
+
+# License information: http://www.kisslicer.com/download.html "MAY be shared freely"
+License:        Redistributable, no modification permitted
+
+# Download for both 64 and 32 bit
+Source0:        %{url}/files/%{maj}%{min}%{rev}/%{cname}_Linux64_%{maj}_%{min}_%{rev}.zip
+Source1:        %{url}/files/%{maj}%{min}%{rev}/%{cname}_Linux32_%{maj}_%{min}_%{rev}.zip
+# Get the Windows binary for icon extraction
+Source2:        %{url}/files/%{maj}%{min}%{rev}/%{cname}_Win32_%{maj}_%{min}_%{rev}.zip
+
+BuildRequires:  desktop-file-utils
+BuildRequires:  /usr/bin/wrestool
+BuildRequires:  /usr/bin/convert
+
+ExclusiveArch:  %{ix86} x86_64
+%global debug_package %{nil}
+
+# Provide a capitalized version as well
+Provides:       %{cname}%{?_isa} = %{version}-%{release}
+
+%description
+KISSlicer is a fast, easy-to-use, cross-platform program that takes 3D files
+(STL) and generates path information (G-code) for a 3D Printer.  This FREE
+version has all the features needed for the hobbyist who uses a single-head
+machine.
+
+%prep
+
+# Unpack 64bit binary
+%ifarch x86_64
+%setup -qTc -b0
+%endif
+
+# Unpack 32bit binary
+%ifarch %{ix86}
+%setup -qTc -b1
+%endif
+
+# Unpack Windows binary
+%setup -qTD -a2
+
+
+%build
+# Extract the icon from the Windows binary
+wrestool -x -t 14 %{cname}.exe > %{name}.ico
+rm %{cname}.exe
+# And convert it to PNGs
+for res in 256 128 96 64 48; do
+  mkdir -p hicolor/${res}x${res}/apps
+done
+cd hicolor
+convert ../%{name}.ico %{name}.png
+mv %{name}-0.png 256x256/apps/%{name}.png
+mv %{name}-1.png 128x128/apps/%{name}.png
+mv %{name}-2.png 96x96/apps/%{name}.png
+mv %{name}-3.png 64x64/apps/%{name}.png
+mv %{name}-4.png 48x48/apps/%{name}.png
+rm %{name}-*.png
+cd -
+rm %{name}.ico
+
+
+%install
+# Install the binary into libexec, because it expects user-writable config files right next to it
+mkdir -p %{buildroot}%{_libexecdir}
+install -pm 0755 %{cname} %{buildroot}%{_libexecdir}/%{cname}
+
+# Shell wrapper that links the binary to home
+mkdir -p %{buildroot}%{_bindir}
+
+cat > %{buildroot}%{_bindir}/%{name} << EOF
+#!/bin/bash
+mkdir -p ~/.%{cname} 2>/dev/null
+[ ! -f ~/.%{cname}/%{cname} ] &&
+  ln -sf %{_libexecdir}/%{cname} ~/.%{cname}/%{cname}
+
+exec ~/.%{cname}/%{cname} "\$@"
+EOF
+
+# Also provides capitalized executable
+ln -sf %{name} %{buildroot}%{_bindir}/%{cname}
+
+# Make sure it's executable
+chmod 0755 %{buildroot}%{_bindir}/*
+
+# Icons
+mkdir -p %{buildroot}%{_datadir}/icons
+cp -r hicolor %{buildroot}%{_datadir}/icons
+
+# desktopfile
+mkdir -p %{buildroot}%{_datadir}/applications
+
+cat > %{buildroot}%{_datadir}/applications/%{name}.desktop << EOF
+[Desktop Entry]
+Type=Application
+Version=1.0
+Name=%{cname}
+Comment=%{summary}
+Icon=%{name}
+TryExec=%{_bindir}/%{name}
+Exec=%{_bindir}/%{name} %U
+Terminal=false
+MimeType=application/sla;application/x-3ds;model/mesh;image/x-3ds;model/x3d+xml;model/x3d+binary;
+Categories=Graphics;3DGraphics;
+StartupNotify=true
+EOF
+
+%check
+desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
+
+%post
+/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+/usr/bin/update-desktop-database &>/dev/null || :
+
+%postun
+if [ $1 -eq 0 ] ; then
+    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+fi
+/usr/bin/update-desktop-database &>/dev/null || :
+
+%posttrans
+/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+update-desktop-database &>/dev/null || :
+
+%files
+%{_bindir}/%{name}
+%{_bindir}/%{cname}
+%{_libexecdir}/%{cname}
+%{_datadir}/applications/*
+%{_datadir}/icons/hicolor/*/apps/*
+
+
+%changelog
+* Mon Feb 22 2016 Miro Hrončok <mhroncok at redhat.com> - 1.1.0-1
+- Initial package
diff --git a/sources b/sources
index e69de29..7aa43dc 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,3 @@
+b2060cebd2caa5cd1d14ab3c015b80f1  KISSlicer_Linux32_1_1_0.zip
+14f84a3b450c46b1a4b68cd08e313724  KISSlicer_Linux64_1_1_0.zip
+1fe0cf4a51cf41460cfaf6724dce3ab5  KISSlicer_Win32_1_1_0.zip


More information about the rpmfusion-commits mailing list