From af42752da0e7e6942e6f4f15c6d7f7b721caa3d3 Mon Sep 17 00:00:00 2001
From: Vitaly Lipatov <lav@etersoft.ru>
Date: Wed, 13 Mar 2024 13:37:40 +0300
Subject: [PATCH] epm play: add ridoclnx

---
 play.d/ridoclnx.sh   | 26 ++++++++++++++++++++++++++
 repack.d/ridoclnx.sh | 19 +++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100755 play.d/ridoclnx.sh
 create mode 100755 repack.d/ridoclnx.sh

diff --git a/play.d/ridoclnx.sh b/play.d/ridoclnx.sh
new file mode 100755
index 00000000..0b494a5b
--- /dev/null
+++ b/play.d/ridoclnx.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+PKGNAME=ridoclnx
+SUPPORTEDARCHES="x86_64"
+VERSION="$2"
+DESCRIPTION="RiDocLNX - scanner software for Linux"
+URL="https://ridoclnx.com/"
+
+. $(dirname $0)/common.sh
+
+pkgtype=$(epm print info -p)
+case $pkgtype in
+    rpm)
+        mask="ridoclnx-1.0-4.4.x86_64.rpm"
+        ;;
+    deb)
+        mask="ridoclnx_1.0.4.4.deb"
+        ;;
+esac
+
+PKGURL="https://ridoclnx.com/download/$mask"
+
+# for add /usr/bin/ridoclnx
+repack='--repack'
+
+epm install $repack "$PKGURL"
diff --git a/repack.d/ridoclnx.sh b/repack.d/ridoclnx.sh
new file mode 100755
index 00000000..7932f6ac
--- /dev/null
+++ b/repack.d/ridoclnx.sh
@@ -0,0 +1,19 @@
+#!/bin/sh -x
+# It will run with two args: buildroot spec
+BUILDROOT="$1"
+SPEC="$2"
+
+PRODUCT=ridoclnx
+
+. $(dirname $0)/common.sh
+
+move_to_opt
+
+add_bin_exec_command
+subst "2icd $PRODUCTDIR" usr/bin/$PRODUCT
+
+fix_desktop_file /usr/share/ridoclnx/ridoclnx.ico
+fix_desktop_file /usr/share/ridoclnx/ridoclnx
+fix_desktop_file /usr/share/ridoclnx/ $PRODUCTDIR
+
+add_libs_requires
-- 
2.24.1