File rawtherapee.spec of Package rawtherapee

Name: rawtherapee
Version: 5.10
Release: 0
Url: https://rawtherapee.com
Summary: G-code generator for 3D printers (Bambu, Prusa, Voron, VzBot, RatRig, Creality, etc.)
Group: Hardware/Printing
BuildRequires: desktop-file-utils
BuildRequires: update-desktop-files
BuildRequires: hicolor-icon-theme
BuildRequires: -post-build-checks
BuildArch:      noarch
License:        LGPL-3.0-only
ExcludeArch:    %ix86 %arm s390 ppc
AutoReqProv: no
Source1: %{name}.png
Source2: RawTherapee_%{version}.AppImage
Source3: %{name}.desktop.txt
BuildRoot: %{_tmppath}/%{name}-%{version}-build

%description
RawTherapee is a free, cross-platform raw image processing program 

%build

%install
mkdir -p %{buildroot}/usr/share/pixmaps/
install -D -m 644 %{SOURCE1} %{buildroot}/usr/share/pixmaps/%{name}.png

mkdir -p %{buildroot}/opt/%{name}/
install -D -m 755 %{SOURCE2} %{buildroot}/opt/%{name}/RawTherapee_%{version}.AppImage
cp -f %{SOURCE3} %{buildroot}/opt/%{name}/%{name}.desktop

%post
# Create .desktop file
rm -f %{_datadir}/applications/%{name}.desktop
cat > %{_datadir}/applications/%{name}.desktop << EOM
[Desktop Entry]
Type=Application
Version=1.0
Name=RawTherapee
GenericName=Raw Photo Editor
GenericName[cs]=Editor raw obrázků
GenericName[fr]=Éditeur d'images raw
GenericName[pl]=Edytor zdjęć raw
Comment=An advanced raw photo development program
Comment[cs]=Program pro konverzi a zpracování digitálních raw fotografií
Comment[de]=Programm zur Konvertierung und Verarbeitung digitaler RAW-Fotos
Comment[fr]=Logiciel de conversion et de traitement de photos numériques de format raw (but de capteur)
Comment[pl]=Zaawansowany program do wywoływania zdjęć typu raw
Icon=rawtherapee
TryExec=rawtherapee
Exec=rawtherapee %f
Terminal=false
MimeType=image/jpeg;image/png;image/tiff;image/x-adobe-dng;image/x-canon-cr2;image/x-canon-cr3;image/x-canon-crf;image/x-canon-crw;image/x-fuji-raf;image/x-hasselblad-3fr;image/x-hasselblad-fff;image/x-jpg;image/x-kodak-dcr;image/x-kodak-k25;image/x-kodak-kdc;image/x-leaf-mos;image/x-leica-rwl;image/x-mamiya-mef;image/x-minolta-mrw;image/x-nikon-nef;image/x-nikon-nrw;image/x-olympus-orf;image/x-panasonic-raw;image/x-panasonic-rw2;image/x-pentax-pef;image/x-pentax-raw;image/x-phaseone-iiq;image/x-raw;image/x-rwz;image/x-samsung-srw;image/x-sigma-x3f;image/x-sony-arq;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;image/x-tif;inode/directory;
Categories=Graphics;Photography;2DGraphics;RasterGraphics;GTK;
Keywords=raw;photo;photography;develop;pp3;graphics;
StartupNotify=true
StartupWMClass=rawtherapee
EOM

# Create executable for app
rm -f /usr/bin/%{name}
cat > /usr/bin/%{name} << EOM
#!/bin/bash

LD_PRELOAD=/usr/lib64/libstdc++.so.6 /opt/%{name}/RawTherapee_%{version}.AppImage
EOM

chmod -R +x /usr/bin/%{name}

%desktop_database_post
%icon_theme_cache_post
%mime_database_post

update-desktop-database
gtk-update-icon-cache

%preun
if [ "$1" = 0 ]; then
  # Remove .desktop file
  rm -f %{_datadir}/applications/%{name}.desktop
  rm -f /usr/bin/%{name}

  %desktop_database_post
  %icon_theme_cache_post
  %mime_database_post

  update-desktop-database
  gtk-update-icon-cache
fi

%clean

%files
%defattr(755,root,root,755) 
/opt/%{name}/RawTherapee_%{version}.AppImage
%defattr(-,root,root)
/usr/share/pixmaps/%{name}.png
/opt/%{name}/%{name}.desktop

%changelog
openSUSE Build Service is sponsored by