diff --git a/util/antivirus/clamav/actions.py b/util/antivirus/clamav/actions.py
index 3f6175cb3a..ceb98f8bee 100644
--- a/util/antivirus/clamav/actions.py
+++ b/util/antivirus/clamav/actions.py
@@ -4,36 +4,31 @@
# Licensed under the GNU General Public License, version 3.
# See the file https://www.gnu.org/licenses/gpl-3.0.txt
-from pisi.actionsapi import shelltools, mesontools, cmaketools, pisitools, get
+from pisi.actionsapi import mesontools, cmaketools, pisitools
j = ''.join([
' -DCMAKE_BUILD_TYPE=None',
' -DENABLE_EXAMPLES=ON',
- ' -DENABLE_MILTER=OFF',
- ' -DENABLE_SYSTEMD=OFF',
+ ' -DENABLE_{MILTER,SYSTEMD}=OFF',
' -DAPP_CONFIG_DIRECTORY=/etc/clamav',
' -DDATABASE_DIRECTORY=/var/lib/clamav',
- ' -B_build -G Ninja -L '
+ ' -Bbuild -G Ninja -L '
])
def setup():
- shelltools.export("CFLAGS", "%s -I/usr/include/iconv " % get.CFLAGS())
cmaketools.configure(j)
def build():
- mesontools.build("-C _build")
+ mesontools.build()
def check():
- # failed utf16 to utf8 converting
- #pass
- mesontools.build("-C _build test")
+ mesontools.build("test")
+ # pass
def install():
- mesontools.install("-C _build install")
+ mesontools.install()
- #pisitools.dodir("/run/clamav")
pisitools.dodir("/var/lib/clamav")
- #pisitools.dodir("/var/log/clamav")
- for t in shelltools.ls("%s/etc/clamav" % get.installDIR()):
+ for t in ["clamd.conf.sample", "freshclam.conf.sample"]:
pisitools.rename("/etc/clamav/%s" % t, t.replace(".sample", ""))
diff --git a/util/antivirus/clamav/comar/clamd.py b/util/antivirus/clamav/comar/clamd.py
index 0eeda147da..9452fc404a 100644
--- a/util/antivirus/clamav/comar/clamd.py
+++ b/util/antivirus/clamav/comar/clamd.py
@@ -1,24 +1,31 @@
# -*- coding: utf-8 -*-
-#!/usr/bin/env python
+#!/usr/bin/python
import os
from comar.service import *
-serviceType = "server"
+serviceType = "local"
+serviceDefault = "off"
+serviceConf = "clamd"
serviceDesc = _({"en": "Clam Anti-Virus Daemon",
"tr": "Clam Antivirüs Servisi"})
+PIDFILE = "/var/run/clamd.pid"
+
@synchronized
def start():
startService(command="/usr/sbin/clamd",
- pidfile="/run/clamd.pid",
- donotify=False)
- time.sleep(4)
+ args="--config-file=/etc/clamav/clamd.conf %s" % config.get("CLIOPTS"),
+ pidfile=PIDFILE,
+ detach=True,
+ donotify=True)
@synchronized
def stop():
stopService(command="/usr/sbin/clamd",
+ pidfile=PIDFILE,
donotify=True)
+ if os.path.isfile(PIDFILE): os.unlink(PIDFILE)
def status():
- return isServiceRunning("/run/clamd.pid")
+ return isServiceRunning(PIDFILE)
diff --git a/util/antivirus/clamav/comar/freshclam.py b/util/antivirus/clamav/comar/freshclam.py
index 1ee37fd95a..55b9232df5 100644
--- a/util/antivirus/clamav/comar/freshclam.py
+++ b/util/antivirus/clamav/comar/freshclam.py
@@ -1,23 +1,30 @@
# -*- coding: utf-8 -*-
-#!/usr/bin/env python
+#!/usr/bin/python
import os
from comar.service import *
-serviceType = "server"
+serviceType = "local"
+serviceDefault = "off"
+serviceConf = "freshclam"
serviceDesc = _({"en": "ClamAV database updater service"})
+PIDFILE = "/var/run/freshclam.pid"
+
@synchronized
def start():
startService(command="/usr/bin/freshclam",
- args="-d -p /run/freshclam.pid",
- pidfile="/run/freshclam.pid",
+ args="--config-file=/etc/clamav/freshclam.conf %s" % config.get("CLIOPTS"),
+ pidfile=PIDFILE,
+ detach=True,
donotify=True)
@synchronized
def stop():
stopService(command="/usr/bin/freshclam",
+ pidfile=PIDFILE,
donotify=True)
+ if os.path.isfile(PIDFILE): os.unlink(PIDFILE)
def status():
- return isServiceRunning("/run/freshclam.pid")
+ return isServiceRunning(PIDFILE)
diff --git a/util/antivirus/clamav/comar/package.py b/util/antivirus/clamav/comar/package.py
index 58c83ea5d0..95a82f852a 100644
--- a/util/antivirus/clamav/comar/package.py
+++ b/util/antivirus/clamav/comar/package.py
@@ -1,8 +1,17 @@
-#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
- os.system("/bin/chown clamav:clamav /var/lib/clamav -R")
- #os.system("/bin/chown clamav:clamav /run/clamav -R")
- #os.system("/bin/chown clamav:clamav /var/log/clamav -R")
+ try:
+ os.system("/usr/sbin/useradd -r -k /dev/null -m -b /var/lib -U clamav")
+ except:
+ pass
+
+def postRemove():
+ try:
+ os.system("/usr/sbin/userdel -r clamav")
+ os.system("/usr/sbin/groupdel clamav")
+ except:
+ pass
diff --git a/util/antivirus/clamav/files/clamd.conf b/util/antivirus/clamav/files/clamd.conf
new file mode 100644
index 0000000000..4b6659241d
--- /dev/null
+++ b/util/antivirus/clamav/files/clamd.conf
@@ -0,0 +1,2 @@
+# see clamd --help
+CLIOPTS=""
diff --git a/util/antivirus/clamav/files/config.patch b/util/antivirus/clamav/files/config.patch
new file mode 100644
index 0000000000..89988551f9
--- /dev/null
+++ b/util/antivirus/clamav/files/config.patch
@@ -0,0 +1,70 @@
+diff --git a/etc/clamd.conf.sample b/etc/clamd.conf.sample
+index 120cf32..b4bc4c1 100644
+--- a/etc/clamd.conf.sample
++++ b/etc/clamd.conf.sample
+@@ -5,7 +5,7 @@
+
+
+ # Comment or remove the line below.
+-Example
++#Example
+
+ # Uncomment this option to enable logging.
+ # LogFile must be writable for the user running daemon.
+@@ -74,7 +74,7 @@ Example
+ # It is recommended that the directory where this file is stored is
+ # also owned by root to keep other users from tampering with it.
+ # Default: disabled
+-#PidFile /run/clamav/clamd.pid
++PidFile /var/run/clamd.pid
+
+ # Optional path to the global temporary directory.
+ # Default: system specific (usually /tmp or /var/tmp).
+@@ -115,7 +115,7 @@ Example
+
+ # TCP port address.
+ # Default: no
+-#TCPSocket 3310
++TCPSocket 3310
+
+ # TCP address.
+ # By default we bind to INADDR_ANY, probably not wise.
+@@ -123,7 +123,7 @@ Example
+ # from the outside world. This option can be specified multiple
+ # times if you want to listen on multiple IPs. IPv6 is now supported.
+ # Default: no
+-#TCPAddr localhost
++TCPAddr localhost
+
+ # Maximum length the queue of pending connections may grow to.
+ # Default: 200
+diff --git a/etc/freshclam.conf.sample b/etc/freshclam.conf.sample
+index d91fe81..f07a5e4 100644
+--- a/etc/freshclam.conf.sample
++++ b/etc/freshclam.conf.sample
+@@ -5,14 +5,14 @@
+
+
+ # Comment or remove the line below.
+-Example
++#Example
+
+ # Path to the database directory.
+ # WARNING: It must match clamd.conf's directive!
+ # WARNING: It must already exist, be an absolute path, be writeable by
+ # freshclam, and be readable by clamd/clamscan.
+ # Default: hardcoded (depends on installation options)
+-#DatabaseDirectory /var/lib/clamav
++DatabaseDirectory /var/lib/clamav
+
+ # Path to the log file (make sure it has proper permissions)
+ # Default: disabled
+@@ -54,7 +54,7 @@ Example
+ # It is recommended that the directory where this file is stored is
+ # also owned by root to keep other users from tampering with it.
+ # Default: disabled
+-#PidFile /run/clamav/freshclam.pid
++PidFile /var/run/freshclam.pid
+
+ # By default when started freshclam drops privileges and switches to the
+ # "clamav" user. This directive allows you to change the database owner.
diff --git a/util/antivirus/clamav/files/daemon_confs.patch b/util/antivirus/clamav/files/daemon_confs.patch
deleted file mode 100644
index 01f8b6cf7e..0000000000
--- a/util/antivirus/clamav/files/daemon_confs.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-diff -Nuar a/etc/clamav-milter.conf.sample b/etc/clamav-milter.conf.sample
---- a/etc/clamav-milter.conf.sample 2023-10-24 20:10:14.000000000 +0300
-+++ b/etc/clamav-milter.conf.sample 2023-11-04 11:15:20.706075909 +0300
-@@ -3,7 +3,7 @@
- ##
-
- # Comment or remove the line below.
--Example
-+# Example
-
-
- ##
-diff -Nuar a/etc/clamd.conf.sample b/etc/clamd.conf.sample
---- a/etc/clamd.conf.sample 2023-10-24 20:10:14.000000000 +0300
-+++ b/etc/clamd.conf.sample 2023-11-04 11:20:07.859485998 +0300
-@@ -5,13 +5,14 @@
-
-
- # Comment or remove the line below.
--Example
-+# Example
-
- # Uncomment this option to enable logging.
- # LogFile must be writable for the user running daemon.
- # A full path is required.
- # Default: disabled
- #LogFile /tmp/clamd.log
-+LogFile /var/log/clamd.log
-
- # By default the log file is locked for writing - the lock protects against
- # running clamd multiple times (if want to run another clamd, please
-@@ -19,7 +20,7 @@
- # the daemon with --config-file option).
- # This option disables log file locking.
- # Default: no
--#LogFileUnlock yes
-+LogFileUnlock yes
-
- # Maximum size of the log file.
- # Value of 0 disables the limit.
-@@ -75,6 +76,7 @@
- # also owned by root to keep other users from tampering with it.
- # Default: disabled
- #PidFile /run/clamav/clamd.pid
-+PidFile /run/clamd.pid
-
- # Optional path to the global temporary directory.
- # Default: system specific (usually /tmp or /var/tmp).
-@@ -82,7 +84,7 @@
-
- # Path to the database directory.
- # Default: hardcoded (depends on installation options)
--#DatabaseDirectory /var/lib/clamav
-+DatabaseDirectory /var/lib/clamav
-
- # Only load the official signatures published by the ClamAV project.
- # Default: no
-@@ -100,6 +102,7 @@
- # Default: disabled (must be specified by a user)
- #LocalSocket /run/clamav/clamd.sock
- #LocalSocket /tmp/clamd.sock
-+LocalSocket /run/clamd.socket
-
- # Sets the group ownership on the unix socket.
- # Default: disabled (the primary group of the user running clamd)
-@@ -115,7 +118,7 @@
-
- # TCP port address.
- # Default: no
--#TCPSocket 3310
-+TCPSocket 3310
-
- # TCP address.
- # By default we bind to INADDR_ANY, probably not wise.
-diff -Nuar a/etc/freshclam.conf.sample b/etc/freshclam.conf.sample
---- a/etc/freshclam.conf.sample 2023-10-24 20:10:14.000000000 +0300
-+++ b/etc/freshclam.conf.sample 2023-11-04 11:22:10.603951481 +0300
-@@ -5,16 +5,16 @@
-
-
- # Comment or remove the line below.
--Example
-+# Example
-
- # Path to the database directory.
- # WARNING: It must match clamd.conf's directive!
- # Default: hardcoded (depends on installation options)
--#DatabaseDirectory /var/lib/clamav
-+DatabaseDirectory /var/lib/clamav
-
- # Path to the log file (make sure it has proper permissions)
- # Default: disabled
--#UpdateLogFile /var/log/freshclam.log
-+UpdateLogFile /var/log/freshclam.log
-
- # Maximum size of the log file.
- # Value of 0 disables the limit.
-@@ -53,6 +53,7 @@
- # also owned by root to keep other users from tampering with it.
- # Default: disabled
- #PidFile /run/clamav/freshclam.pid
-+PidFile /run/freshclam.pid
-
- # By default when started freshclam drops privileges and switches to the
- # "clamav" user. This directive allows you to change the database owner.
diff --git a/util/antivirus/clamav/files/freshclam.conf b/util/antivirus/clamav/files/freshclam.conf
new file mode 100644
index 0000000000..257f5adc7f
--- /dev/null
+++ b/util/antivirus/clamav/files/freshclam.conf
@@ -0,0 +1,2 @@
+# see freshclam --help
+CLIOPTS=""
diff --git a/util/antivirus/clamav/pspec.xml b/util/antivirus/clamav/pspec.xml
index cfe45585fc..d4cd1ea117 100644
--- a/util/antivirus/clamav/pspec.xml
+++ b/util/antivirus/clamav/pspec.xml
@@ -5,32 +5,33 @@
clamav
https://www.clamav.net/
- PisiLinux Community
- admins@pisilinux.org
+ Kamil Atlı
+ suvari@pisilinux.org
- GPL-2
+ GPLv2
app:console
- Clam Antivirus software.
+ util.antivirus
+ A GPL virus scanner.
Clam AntiVirus is a GPL anti-virus toolkit for UNIX.
- https://www.clamav.net/downloads/production/clamav-1.2.1.tar.gz
+ https://github.com/Cisco-Talos/clamav/releases/download/clamav-1.4.2/clamav-1.4.2.tar.gz
rust
cmake
ninja
-
curl-devel
zlib-devel
check-devel
json-c-devel
+ rust-bindgen
openssl-devel
ncurses-devel
python3-devel
libxml2-devel
libpcre2-devel
- libiconv-devel
- daemon_confs.patch
+
+ config.patch
@@ -46,45 +47,23 @@
ncurses
openssl
libpcre2
- libiconv
-
- /etc/clamav
+ /etc
/usr/bin
/usr/sbin
/usr/lib
- /run/clamav
- /var/lib/clamav
- /var/log/clamav
- /usr/share/doc
- /usr/share/man
+ /usr/share
+ /var
-
+ clamd.conf
+ freshclam.conf
System.Package
- System.Service
-
-
-
-
- freshclam
-
- clamav
-
-
- /etc/clamav/freshclam.conf
- /usr/bin/freshclam
- /usr/lib/libfreshclam.so
- /usr/lib/libfreshclam.so.2
- /usr/lib/libfreshclam.so.2.0.2
- /usr/share/man/man1/freshclam.1
- /usr/share/man/man5/freshclam.conf.5
-
-
- System.Service
+ System.Service
+ System.Service
@@ -94,12 +73,20 @@
clamav
+ /usr/bin/clamav-config
/usr/include
/usr/lib/pkgconfig
+
+ 2025-04-19
+ 1.4.2
+ Rebuild.
+ Kamil Atlı
+ suvari@pisilinux.org
+
2023-12-19
1.2.1