From 6d7d4ce7f386a8b55d50390176f563490f41c1f8 Mon Sep 17 00:00:00 2001
From: Michele Calgaro <michele.calgaro@yahoo.it>
Date: Sun, 11 Jan 2026 12:27:55 +0900
Subject: Install script examples files in the application data folder

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
---
 admin/acinclude.m4.in                      | 4 +++-
 doc/Makefile.am                            | 2 +-
 doc/scriptexamples/Makefile.am             | 3 ++-
 doc/scriptexamples/antiidle/Makefile.am    | 3 ++-
 doc/scriptexamples/minesweeper/Makefile.am | 3 ++-
 doc/scriptexamples/mp3share/Makefile.am    | 3 ++-
 doc/scriptexamples/playing/Makefile.am     | 3 ++-
 doc/scriptexamples/runmenu/Makefile.am     | 3 ++-
 doc/scriptexamples/simplehttp/Makefile.am  | 3 ++-
 doc/scriptexamples/tutorial/Makefile.am    | 3 ++-
 src/scripts/config/kvirc-config.in         | 1 +
 11 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/admin/acinclude.m4.in b/admin/acinclude.m4.in
index 7584d20..7ebc1eb 100644
--- a/admin/acinclude.m4.in
+++ b/admin/acinclude.m4.in
@@ -2262,10 +2262,12 @@ AC_DEFUN([AC_SS_FINAL_CONFIG],
 	fi
 	AC_SUBST(mandir)
 
-
 	licensedir="\${globalkvircdir}/license"
 	AC_SUBST(licensedir)
 
+	docdir="\${globalkvircdir}/doc"
+	AC_SUBST(docdir)
+
 	if test -n "$SS_KDE_SERVICESDIR"; then
 		kdeservicesdir="$SS_KDE_SERVICESDIR"
 	else
diff --git a/doc/Makefile.am b/doc/Makefile.am
index b64b1b2..338e920 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -4,7 +4,7 @@
 
 SUBDIRS = man scriptexamples
 
-EXTRA_DIST = COPYING *.txt
+EXTRA_DIST = *.txt
 
 tmpdir = $(licensedir)
 tmp_DATA = COPYING
diff --git a/doc/scriptexamples/Makefile.am b/doc/scriptexamples/Makefile.am
index a63d443..9a6c1c0 100644
--- a/doc/scriptexamples/Makefile.am
+++ b/doc/scriptexamples/Makefile.am
@@ -4,4 +4,5 @@
 
 SUBDIRS = antiidle minesweeper mp3share playing runmenu simplehttp tutorial
 
-EXTRA_DIST = *.kvs
+tmpdir = $(docdir)/scriptexamples
+tmp_DATA = *.kvs
diff --git a/doc/scriptexamples/antiidle/Makefile.am b/doc/scriptexamples/antiidle/Makefile.am
index 840a6b4..129ff57 100644
--- a/doc/scriptexamples/antiidle/Makefile.am
+++ b/doc/scriptexamples/antiidle/Makefile.am
@@ -2,4 +2,5 @@
 # KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it>
 ###############################################################################
 
-EXTRA_DIST = antiidle.kvs
+tmpdir = $(docdir)/scriptexamples/antiidle
+tmp_DATA = antiidle.kvs
diff --git a/doc/scriptexamples/minesweeper/Makefile.am b/doc/scriptexamples/minesweeper/Makefile.am
index 914e382..f5e2526 100644
--- a/doc/scriptexamples/minesweeper/Makefile.am
+++ b/doc/scriptexamples/minesweeper/Makefile.am
@@ -2,4 +2,5 @@
 # KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it>
 ###############################################################################
 
-EXTRA_DIST = *.kvs
+tmpdir = $(docdir)/scriptexamples/minesweeper
+tmp_DATA = minesweeper.kvs
diff --git a/doc/scriptexamples/mp3share/Makefile.am b/doc/scriptexamples/mp3share/Makefile.am
index a48a998..4ad4e53 100644
--- a/doc/scriptexamples/mp3share/Makefile.am
+++ b/doc/scriptexamples/mp3share/Makefile.am
@@ -2,4 +2,5 @@
 # KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it>
 ###############################################################################
 
-EXTRA_DIST = mp3share.kvs mp3share_icon.png
+tmpdir = $(docdir)/scriptexamples/mp3share
+tmp_DATA = mp3share.kvs mp3share_icon.png
diff --git a/doc/scriptexamples/playing/Makefile.am b/doc/scriptexamples/playing/Makefile.am
index d673dfb..f55625a 100644
--- a/doc/scriptexamples/playing/Makefile.am
+++ b/doc/scriptexamples/playing/Makefile.am
@@ -2,4 +2,5 @@
 # KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it>
 ###############################################################################
 
-EXTRA_DIST = playing.kvs playing_icon.png
+tmpdir = $(docdir)/scriptexamples/playing
+tmp_DATA = playing.kvs playing_icon.png
diff --git a/doc/scriptexamples/runmenu/Makefile.am b/doc/scriptexamples/runmenu/Makefile.am
index d91889e..58e4bca 100644
--- a/doc/scriptexamples/runmenu/Makefile.am
+++ b/doc/scriptexamples/runmenu/Makefile.am
@@ -2,4 +2,5 @@
 # KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it>
 ###############################################################################
 
-EXTRA_DIST = runmenu.kvs
+tmpdir = $(docdir)/scriptexamples/runmenu
+tmp_DATA = runmenu.kvs
diff --git a/doc/scriptexamples/simplehttp/Makefile.am b/doc/scriptexamples/simplehttp/Makefile.am
index 540ab61..0c4dce0 100644
--- a/doc/scriptexamples/simplehttp/Makefile.am
+++ b/doc/scriptexamples/simplehttp/Makefile.am
@@ -2,4 +2,5 @@
 # KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it>
 ###############################################################################
 
-EXTRA_DIST = simplehttp.kvs
+tmpdir = $(docdir)/scriptexamples/simplehttp
+tmp_DATA = simplehttp.kvs
diff --git a/doc/scriptexamples/tutorial/Makefile.am b/doc/scriptexamples/tutorial/Makefile.am
index 914e382..e78d570 100644
--- a/doc/scriptexamples/tutorial/Makefile.am
+++ b/doc/scriptexamples/tutorial/Makefile.am
@@ -2,4 +2,5 @@
 # KVirc IRC client Makefile - 16.12.98 Szymon Stefanek <stefanek@tin.it>
 ###############################################################################
 
-EXTRA_DIST = *.kvs
+tmpdir = $(docdir)/scriptexamples/tutorial
+tmp_DATA = *.kvs
diff --git a/src/scripts/config/kvirc-config.in b/src/scripts/config/kvirc-config.in
index 2427a56..630b7e6 100644
--- a/src/scripts/config/kvirc-config.in
+++ b/src/scripts/config/kvirc-config.in
@@ -46,6 +46,7 @@ oldincludedir="/usr/include"
 headersdir="@headersdir@"
 configdir="@configdir@"
 configmodulesdir="@configmodulesdir@"
+docdir="@docdir@"
 defscriptdir="@defscriptdir@"
 globalkvircdir="@globalkvircdir@"
 helpdir="@helpdir@"
-- 
cgit v1.2.3

