Compare commits
23 Commits
Author | SHA1 | Date | |
---|---|---|---|
809db0b902 | |||
5c9e7c0ba2 | |||
f4a881a08a | |||
cc92473b32 | |||
d178958e45 | |||
463f2ad21d | |||
b0901315aa | |||
22fdf135d8 | |||
|
3f3081af25 | ||
|
3ef7191ecf | ||
|
817805f598 | ||
|
cfcfbd4360 | ||
|
69c0d2a4e1 | ||
|
690024f64a | ||
|
d8621d034e | ||
|
946c4b64ba | ||
|
4fee3e0db2 | ||
|
23c4b7a54c | ||
|
7c10d28065 | ||
|
4ecab4cd20 | ||
|
ca818e199a | ||
|
0a5f669442 | ||
|
b56ed1c270 |
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.yar linguist-vendored
|
87
README.md
87
README.md
@ -1,4 +1,5 @@
|
||||
# go-clamav
|
||||
[](https://pkg.go.dev/github.com/ca110us/go-clamav?tab=doc)
|
||||
|
||||
go-clamav is go wrapper for [libclamav](https://docs.clamav.net/manual/Development/libclamav.html)
|
||||
|
||||
@ -14,8 +15,6 @@ apt-get update && apt-get install -y \
|
||||
libncurses5-dev libpcre2-dev libssl-dev libxml2-dev zlib1g-dev
|
||||
|
||||
python3 -m pip install --user cmake / apt-get install cmake
|
||||
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
```
|
||||
|
||||
Download the source from the clamav [downloads page](https://www.clamav.net/downloads)
|
||||
@ -35,9 +34,89 @@ sudo cmake --build . --target install
|
||||
For other Linux distributions, see [clamav documentation](https://docs.clamav.net/manual/Installing/Installing-from-source-Unix.html)
|
||||
|
||||
## Quick Start
|
||||
Refer to the `example` directory
|
||||
### Dynamic linking
|
||||
```bash
|
||||
$ cd example && cat main.go
|
||||
```
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
clamav "git.cyber.gent/friedkiwi/go-clamav"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// new clamav instance
|
||||
c := new(clamav.Clamav)
|
||||
err := c.Init(clamav.SCAN_OPTIONS{
|
||||
General: 0,
|
||||
Parse: clamav.CL_SCAN_PARSE_ARCHIVE | clamav.CL_SCAN_PARSE_ELF,
|
||||
Heuristic: 0,
|
||||
Mail: 0,
|
||||
Dev: 0,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// free clamav memory
|
||||
defer c.Free()
|
||||
|
||||
// load db
|
||||
signo, err := c.LoadDB("./db", uint(clamav.CL_DB_DIRECTORY))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Println("db load succeed:", signo)
|
||||
|
||||
// compile engine
|
||||
err = c.CompileEngine()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
c.EngineSetNum(clamav.CL_ENGINE_MAX_SCANSIZE, 1024*1024*40)
|
||||
c.EngineSetNum(clamav.CL_ENGINE_MAX_SCANTIME, 9000)
|
||||
// fmt.Println(c.EngineGetNum(clamav.CL_ENGINE_MAX_SCANSIZE))
|
||||
|
||||
// scan
|
||||
scanned, virusName, ret := c.ScanFile("./test_file/nmap")
|
||||
fmt.Println(scanned, virusName, ret)
|
||||
}
|
||||
```
|
||||
|
||||
```bash
|
||||
$ CGO_LDFLAGS="-L/usr/local/lib -lclamav" go run main.go
|
||||
|
||||
db load succeed: 9263
|
||||
209 YARA.Unix_Packer_UpxDetail.UNOFFICIAL Virus(es) detected
|
||||
```
|
||||
|
||||
If the `libclamav.so` file is not found, try it:
|
||||
|
||||
```bash
|
||||
$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib CGO_LDFLAGS="-L/usr/local/lib -lclamav" go run main.go
|
||||
|
||||
db load succeed: 9263
|
||||
209 YARA.Unix_Packer_UpxDetail.UNOFFICIAL Virus(es) detected
|
||||
```
|
||||
|
||||
### Static build
|
||||
```bash
|
||||
$ sudo bash ./prepare.sh
|
||||
$ SRCDIR=$(pwd)
|
||||
$ export CGO_CFLAGS="-g -Wall -I${SRCDIR}/clamav-mussels-cookbook/mussels/install/include"
|
||||
$ export CGO_LDFLAGS="-L${SRCDIR}/clamav-mussels-cookbook/mussels/install/lib -lclamav_static -lbz2_static -lclammspack_static -lclamunrar_iface_static -lclamunrar_static -lcrypto -ljson-c -lpcre2-8 -lpcre2-posix -lssl -lxml2 -lz -lm -ldl -lstdc++"
|
||||
$ CGO_ENABLED=1 go build --ldflags '--extldflags "-static -fpic"' main.go
|
||||
```
|
||||
|
||||
|
||||
## Reference
|
||||
[mirtchovski/clamav](https://github.com/mirtchovski/clamav)
|
||||
[ca110us/go-clamav](https://github.com/ca110us/go-clamav)
|
||||
|
||||
*This project was written because `mirtchovski/clamav` no longer supports the new version `clamav`*
|
||||
This is an adaptation of `mirtchovski/clamav` because it fails to compile on newer versions of go on macOS.
|
||||
|
43
README_CN.md
43
README_CN.md
@ -1,43 +0,0 @@
|
||||
# go-clamav
|
||||
|
||||
go-clamav 是 go 语言对 [libclamav](https://docs.clamav.net/manual/Development/libclamav.html) 的封装
|
||||
|
||||
## 环境
|
||||
### Ubuntu
|
||||
|
||||
```bash
|
||||
apt-get update && apt-get install -y \
|
||||
`# install tools` \
|
||||
gcc make pkg-config python3 python3-pip python3-pytest valgrind \
|
||||
`# install clamav dependencies` \
|
||||
check libbz2-dev libcurl4-openssl-dev libjson-c-dev libmilter-dev \
|
||||
libncurses5-dev libpcre2-dev libssl-dev libxml2-dev zlib1g-dev
|
||||
|
||||
python3 -m pip install --user cmake / apt-get install cmake
|
||||
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||
```
|
||||
|
||||
Download the source from the clamav [downloads page](https://www.clamav.net/downloads)
|
||||
|
||||
```bash
|
||||
tar xzf clamav-[ver].tar.gz
|
||||
cd clamav-[ver]
|
||||
|
||||
mkdir build && cd build
|
||||
|
||||
cmake ..
|
||||
cmake --build .
|
||||
ctest
|
||||
sudo cmake --build . --target install
|
||||
```
|
||||
|
||||
其他 Linux 发行版参照 [clamav documentation](https://docs.clamav.net/manual/Installing/Installing-from-source-Unix.html)
|
||||
|
||||
## 快速开始
|
||||
参考 `example` 目录
|
||||
|
||||
## 参考
|
||||
[mirtchovski/clamav](https://github.com/mirtchovski/clamav)
|
||||
|
||||
*因为 `mirtchovski/clamav` 不再支持新版本 `clamav`,所以写了该项目*
|
21
clamav.go
21
clamav.go
@ -5,9 +5,6 @@
|
||||
package goclamav
|
||||
|
||||
/*
|
||||
#cgo CFLAGS: -g -Wall
|
||||
#cgo LDFLAGS: -lclamav
|
||||
|
||||
#include <clamav.h>
|
||||
#include <stdlib.h>
|
||||
*/
|
||||
@ -149,7 +146,7 @@ func (c *Clamav) CompileEngine() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetNum sets a number in the specified field of the engine configuration.
|
||||
// EngineSetNum sets a number in the specified field of the engine configuration.
|
||||
// Certain fields accept only 32-bit numbers, silently truncating the higher bits
|
||||
// of the engine config. See dat.go for more information.
|
||||
func (c *Clamav) EngineSetNum(field EngineField, num uint64) error {
|
||||
@ -162,7 +159,7 @@ func (c *Clamav) EngineSetNum(field EngineField, num uint64) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetNum acquires a number from the specified field of the engine configuration. Tests show that
|
||||
// EngineGetNum acquires a number from the specified field of the engine configuration. Tests show that
|
||||
// the ClamAV library will not overflow 32-bit fields, so a GetNum on a 32-bit field can safely be
|
||||
// cast to uint32.
|
||||
func (c *Clamav) EngineGetNum(field EngineField) (uint64, error) {
|
||||
@ -179,11 +176,15 @@ func (c *Clamav) EngineGetNum(field EngineField) (uint64, error) {
|
||||
|
||||
// Free the memory allocated to clamav instance, Free should be called
|
||||
// when the engine is no longer in use.
|
||||
func (c *Clamav) Free() int {
|
||||
return int(C.cl_engine_free((*C.struct_cl_engine)(c.engine)))
|
||||
func (c *Clamav) Free() error {
|
||||
ret := ErrorCode(C.cl_engine_free((*C.struct_cl_engine)(c.engine)))
|
||||
if ret == CL_SUCCESS {
|
||||
return nil
|
||||
}
|
||||
return Strerr(ret)
|
||||
}
|
||||
|
||||
// ScanMapCb scans custom data
|
||||
// ScanMapCB scans custom data
|
||||
func (c *Clamav) ScanMapCB(fmap *Fmap, fileName string, context interface{}) (uint, string, error) {
|
||||
var scanned C.ulong
|
||||
var virusName *C.char
|
||||
@ -201,7 +202,7 @@ func (c *Clamav) ScanMapCB(fmap *Fmap, fileName string, context interface{}) (ui
|
||||
defer CloseMemory(fmap)
|
||||
// clean
|
||||
if ret == CL_SUCCESS {
|
||||
return 0, "", nil
|
||||
return uint(scanned), "", nil
|
||||
}
|
||||
// virus
|
||||
if ret == CL_VIRUS {
|
||||
@ -235,7 +236,7 @@ func (c *Clamav) ScanFile(path string) (uint, string, error) {
|
||||
return 0, "", Strerr(ret)
|
||||
}
|
||||
|
||||
// ScanFileCb scans a single file for viruses using the ClamAV databases and using callbacks from
|
||||
// ScanFileCB scans a single file for viruses using the ClamAV databases and using callbacks from
|
||||
// ClamAV to read/resolve file data. The callbacks can be used to scan files in memory, to scan multiple
|
||||
// files inside archives, etc. The function returns the number of bytes
|
||||
// read from the file (if found), the virus name and an error code.
|
||||
|
88
define.go
88
define.go
@ -1,14 +1,14 @@
|
||||
package goclamav
|
||||
|
||||
/*
|
||||
#cgo CFLAGS: -g -Wall
|
||||
#cgo LDFLAGS: -lclamav
|
||||
|
||||
#include <clamav.h>
|
||||
#include <stdlib.h>
|
||||
*/
|
||||
import "C"
|
||||
import "errors"
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// ErrorCode models ClamAV errors
|
||||
type ErrorCode C.cl_error_t
|
||||
@ -22,6 +22,54 @@ type SCAN_OPTIONS struct {
|
||||
Dev uint
|
||||
}
|
||||
|
||||
const (
|
||||
/* general */
|
||||
CL_SCAN_GENERAL_ALLMATCHES = 0x1 /* scan in all-match mode */
|
||||
CL_SCAN_GENERAL_COLLECT_METADATA = 0x2 /* collect metadata (--gen-json) */
|
||||
CL_SCAN_GENERAL_HEURISTICS = 0x4 /* option to enable heuristic alerts */
|
||||
CL_SCAN_GENERAL_HEURISTIC_PRECEDENCE = 0x8 /* allow heuristic match to take precedence. */
|
||||
CL_SCAN_GENERAL_UNPRIVILEGED = 0x10 /* scanner will not have read access to files. */
|
||||
|
||||
/* parsing capabilities options */
|
||||
CL_SCAN_PARSE_ARCHIVE = 0x1
|
||||
CL_SCAN_PARSE_ELF = 0x2
|
||||
CL_SCAN_PARSE_PDF = 0x4
|
||||
CL_SCAN_PARSE_SWF = 0x8
|
||||
CL_SCAN_PARSE_HWP3 = 0x10
|
||||
CL_SCAN_PARSE_XMLDOCS = 0x20
|
||||
CL_SCAN_PARSE_MAIL = 0x40
|
||||
CL_SCAN_PARSE_OLE2 = 0x80
|
||||
CL_SCAN_PARSE_HTML = 0x100
|
||||
CL_SCAN_PARSE_PE = 0x200
|
||||
|
||||
/* heuristic alerting options */
|
||||
CL_SCAN_HEURISTIC_BROKEN = 0x2 /* alert on broken PE and broken ELF files */
|
||||
CL_SCAN_HEURISTIC_EXCEEDS_MAX = 0x4 /* alert when files exceed scan limits (filesize, max scansize, or max recursion depth) */
|
||||
CL_SCAN_HEURISTIC_PHISHING_SSL_MISMATCH = 0x8 /* alert on SSL mismatches */
|
||||
CL_SCAN_HEURISTIC_PHISHING_CLOAK = 0x10 /* alert on cloaked URLs in emails */
|
||||
CL_SCAN_HEURISTIC_MACROS = 0x20 /* alert on OLE2 files containing macros */
|
||||
CL_SCAN_HEURISTIC_ENCRYPTED_ARCHIVE = 0x40 /* alert if archive is encrypted (rar, zip, etc) */
|
||||
CL_SCAN_HEURISTIC_ENCRYPTED_DOC = 0x80 /* alert if a document is encrypted (pdf, docx, etc) */
|
||||
CL_SCAN_HEURISTIC_PARTITION_INTXN = 0x100 /* alert if partition table size doesn't make sense */
|
||||
CL_SCAN_HEURISTIC_STRUCTURED = 0x200 /* data loss prevention options, i.e. alert when detecting personal information */
|
||||
CL_SCAN_HEURISTIC_STRUCTURED_SSN_NORMAL = 0x400 /* alert when detecting social security numbers */
|
||||
CL_SCAN_HEURISTIC_STRUCTURED_SSN_STRIPPED = 0x800 /* alert when detecting stripped social security numbers */
|
||||
CL_SCAN_HEURISTIC_STRUCTURED_CC = 0x1000 /* alert when detecting credit card numbers */
|
||||
CL_SCAN_HEURISTIC_BROKEN_MEDIA = 0x2000 /* alert if a file does not match the identified file format, works with JPEG, TIFF, GIF, PNG */
|
||||
|
||||
/* mail scanning options */
|
||||
CL_SCAN_MAIL_PARTIAL_MESSAGE = 0x1
|
||||
|
||||
/* dev options */
|
||||
CL_SCAN_DEV_COLLECT_SHA = 0x1 /* Enables hash output in sha-collect builds - for internal use only */
|
||||
CL_SCAN_DEV_COLLECT_PERFORMANCE_INFO = 0x2 /* collect performance timings */
|
||||
|
||||
/* cl_countsigs options */
|
||||
CL_COUNTSIGS_OFFICIAL = 0x1
|
||||
CL_COUNTSIGS_UNOFFICIAL = 0x2
|
||||
CL_COUNTSIGS_ALL = (CL_COUNTSIGS_OFFICIAL | CL_COUNTSIGS_UNOFFICIAL)
|
||||
)
|
||||
|
||||
// Fmap models in-memory files
|
||||
type Fmap C.cl_fmap_t
|
||||
|
||||
@ -80,22 +128,26 @@ const CL_INIT_DEFAULT C.uint = C.CL_INIT_DEFAULT
|
||||
|
||||
// Wraps the corresponding error message
|
||||
func Strerr(code ErrorCode) error {
|
||||
err := errors.New(C.GoString(C.cl_strerror(C.int(code))))
|
||||
return err
|
||||
switch code {
|
||||
case CL_VIRUS:
|
||||
return errors.New("Virus detected")
|
||||
case CL_EUNPACK:
|
||||
return errors.New("Unpacking failed")
|
||||
case CL_EVERIFY:
|
||||
return errors.New("Verification failed")
|
||||
case CL_ECVD:
|
||||
return errors.New("CVD database error")
|
||||
case CL_EOPEN:
|
||||
case CL_EACCES:
|
||||
case CL_EREAD:
|
||||
case CL_ESTAT:
|
||||
return errors.New("I/O error while scanning file.")
|
||||
default:
|
||||
return errors.New(fmt.Sprintf("Error %d", C.int(code)))
|
||||
}
|
||||
return errors.New("Unknown error")
|
||||
}
|
||||
|
||||
/* parsing capabilities options */
|
||||
const CL_SCAN_PARSE_ARCHIVE = C.CL_SCAN_PARSE_ARCHIVE
|
||||
const CL_SCAN_PARSE_ELF = C.CL_SCAN_PARSE_ELF
|
||||
const CL_SCAN_PARSE_PDF = C.CL_SCAN_PARSE_PDF
|
||||
const CL_SCAN_PARSE_SWF = C.CL_SCAN_PARSE_SWF
|
||||
const CL_SCAN_PARSE_HWP3 = C.CL_SCAN_PARSE_HWP3
|
||||
const CL_SCAN_PARSE_XMLDOCS = C.CL_SCAN_PARSE_XMLDOCS
|
||||
const CL_SCAN_PARSE_MAIL = C.CL_SCAN_PARSE_MAIL
|
||||
const CL_SCAN_PARSE_OLE2 = C.CL_SCAN_PARSE_OLE2
|
||||
const CL_SCAN_PARSE_HTML = C.CL_SCAN_PARSE_HTML
|
||||
const CL_SCAN_PARSE_PE = C.CL_SCAN_PARSE_PE
|
||||
|
||||
/* db options */
|
||||
// clang-format off
|
||||
type DBOptions uint
|
||||
|
2
env.osx
Normal file
2
env.osx
Normal file
@ -0,0 +1,2 @@
|
||||
export CGO_LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib -L/usr/local/lib -lclamav"
|
||||
export CGO_CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"
|
@ -38,14 +38,10 @@ func main() {
|
||||
}
|
||||
|
||||
c.EngineSetNum(clamav.CL_ENGINE_MAX_SCANSIZE, 1024*1024*40)
|
||||
c.EngineSetNum(clamav.CL_ENGINE_PCRE_MAX_FILESIZE, 1024*1024*20)
|
||||
c.EngineSetNum(clamav.CL_ENGINE_MAX_SCANTIME, 9000)
|
||||
c.EngineSetNum(clamav.CL_ENGINE_PCRE_MATCH_LIMIT, 1000)
|
||||
c.EngineSetNum(clamav.CL_ENGINE_PCRE_RECMATCH_LIMIT, 500)
|
||||
|
||||
// fmt.Println(c.EngineGetNum(clamav.CL_ENGINE_PCRE_RECMATCH_LIMIT))
|
||||
// fmt.Println(c.EngineGetNum(clamav.CL_ENGINE_MAX_SCANSIZE))
|
||||
|
||||
// scan
|
||||
scanned, msg, err := c.ScanFile("./test_file/nmap")
|
||||
fmt.Println(scanned, msg, err)
|
||||
scanned, virusName, ret := c.ScanFile("./test_file/nmap")
|
||||
fmt.Println(scanned, virusName, ret)
|
||||
}
|
||||
|
91
example/prepare.sh
Normal file
91
example/prepare.sh
Normal file
@ -0,0 +1,91 @@
|
||||
#!/bin/bash
|
||||
|
||||
# make static lib for clamav deps
|
||||
apt-get update
|
||||
apt-get install -y python3-pip
|
||||
apt-get install -y build-essential clang llvm
|
||||
apt-get install -y libstdc++6 libstdc++-6-dev
|
||||
apt-get install -y flex bison python3-dev pkg-config ninja-build
|
||||
python3 -m pip install mussels
|
||||
|
||||
wget https://cmake.org/files/v3.21/cmake-3.21.5-linux-x86_64.tar.gz
|
||||
tar -zxvf cmake-3.21.5-linux-x86_64.tar.gz -C /usr/local/
|
||||
ln -s /usr/local/cmake-3.21.5-linux-x86_64/bin/cmake /usr/bin/cmake
|
||||
rm -rf cmake-3.21.5-linux-x86_64.tar.gz
|
||||
|
||||
git clone --depth 1 https://github.com/ca110us/clamav-mussels-cookbook.git
|
||||
cd clamav-mussels-cookbook
|
||||
rm -rf mussels/* &> /dev/null
|
||||
mkdir mussels &> /dev/null
|
||||
msl build libclamav_deps -t host-static -w mussels/work -i mussels/install
|
||||
cd -
|
||||
|
||||
# make get clamav source code
|
||||
git clone https://github.com/Cisco-Talos/clamav.git
|
||||
cd clamav
|
||||
git checkout clamav-0.104.0
|
||||
cd -
|
||||
|
||||
|
||||
# libclamav
|
||||
cd clamav
|
||||
|
||||
rm -rf ./build/* &> /dev/null
|
||||
mkdir build &> /dev/null
|
||||
cd -
|
||||
export CLAMAV_DEPENDENCIES="$(pwd)/clamav-mussels-cookbook/mussels/install/"
|
||||
|
||||
cd clamav/build
|
||||
|
||||
cmake .. -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE="Release" \
|
||||
-DJSONC_INCLUDE_DIR="$CLAMAV_DEPENDENCIES/include/json-c" \
|
||||
-DJSONC_LIBRARY="$CLAMAV_DEPENDENCIES/lib/libjson-c.a" \
|
||||
-DBZIP2_INCLUDE_DIR="$CLAMAV_DEPENDENCIES/include" \
|
||||
-DBZIP2_LIBRARY_RELEASE="$CLAMAV_DEPENDENCIES/lib/libbz2_static.a" \
|
||||
-DOPENSSL_ROOT_DIR="$CLAMAV_DEPENDENCIES" \
|
||||
-DOPENSSL_INCLUDE_DIR="$CLAMAV_DEPENDENCIES/include" \
|
||||
-DOPENSSL_CRYPTO_LIBRARY="$CLAMAV_DEPENDENCIES/lib/libcrypto.a" \
|
||||
-DOPENSSL_SSL_LIBRARY="$CLAMAV_DEPENDENCIES/lib/libssl.a" \
|
||||
-DLIBXML2_INCLUDE_DIR="$CLAMAV_DEPENDENCIES/include/libxml2" \
|
||||
-DLIBXML2_LIBRARY="$CLAMAV_DEPENDENCIES/lib/libxml2.a" \
|
||||
-DPCRE2_INCLUDE_DIR="$CLAMAV_DEPENDENCIES/include" \
|
||||
-DPCRE2_LIBRARY="$CLAMAV_DEPENDENCIES/lib/libpcre2-8.a" \
|
||||
-DZLIB_INCLUDE_DIR="$CLAMAV_DEPENDENCIES/include" \
|
||||
-DZLIB_LIBRARY="$CLAMAV_DEPENDENCIES/lib/libz.a" \
|
||||
-DENABLE_JSON_SHARED=OFF \
|
||||
-DENABLE_STATIC_LIB=ON \
|
||||
-DENABLE_SYSTEMD=OFF \
|
||||
-DENABLE_TESTS=OFF \
|
||||
-DENABLE_LIBCLAMAV_ONLY=ON \
|
||||
-DENABLE_UNRAR=ON \
|
||||
-DENABLE_SHARED_LIB=OFF \
|
||||
-DDATABASE_DIRECTORY=/var/lib/clamav \
|
||||
-DCMAKE_INSTALL_PREFIX=install
|
||||
|
||||
cmake --build .
|
||||
|
||||
cd -
|
||||
|
||||
rm -rf ./lib/*
|
||||
mkdir lib &> /dev/null
|
||||
cp clamav/build/libclamav/libclamav_static.a ./lib
|
||||
cp clamav/build/libclammspack/libclammspack_static.a ./lib
|
||||
cp clamav/build/libclamunrar/libclamunrar_static.a ./lib
|
||||
cp clamav/build/libclamunrar_iface/libclamunrar_iface_static.a ./lib
|
||||
|
||||
cp "$CLAMAV_DEPENDENCIES/lib/libbz2_static.a" ./lib
|
||||
cp "$CLAMAV_DEPENDENCIES/lib/libjson-c.a" ./lib
|
||||
cp "$CLAMAV_DEPENDENCIES/lib/libcrypto.a" ./lib
|
||||
cp "$CLAMAV_DEPENDENCIES/lib/libssl.a" ./lib
|
||||
cp "$CLAMAV_DEPENDENCIES/lib/libxml2.a" ./lib
|
||||
cp "$CLAMAV_DEPENDENCIES/lib/libpcre2-8.a" ./lib
|
||||
cp "$CLAMAV_DEPENDENCIES/lib/libz.a" ./lib
|
||||
|
||||
rm -rf ./include/*
|
||||
mkdir include &> /dev/null
|
||||
cp clamav/build/*.h ./include
|
||||
cp clamav/libclamav/clamav.h ./include
|
||||
|
||||
cp ./include/* clamav-mussels-cookbook/mussels/install/include/
|
||||
cp ./lib/* clamav-mussels-cookbook/mussels/install/lib/
|
2
go.mod
2
go.mod
@ -1,3 +1,3 @@
|
||||
module github.com/ca110us/go-clamav
|
||||
module git.cyber.gent/friedkiwi/go-clamav
|
||||
|
||||
go 1.18
|
||||
|
Loading…
x
Reference in New Issue
Block a user