Ticket #64021: Portfile

File Portfile, 4.9 KB (added by ballapete (Peter "Pete" Dyballa), 3 years ago)

Portfile for clamav-legacy, already working

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2PortSystem 1.0
3PortGroup legacysupport 1.0
4PortGroup cmake 1.1
5
6name                    clamav-legacy
7set realname            clamav
8conflicts               clamav clamav-server
9version                 0.104.2
10revision                0
11categories              sysutils
12maintainers             {Peter "Pete" Dyballa}
13description             clamav anti-virus software adapted to old Macs
14license                 {GPL-2 OpenSSLException}
15
16long_description        Clam AntiVirus is a GPL anti-virus toolkit for UNIX. The \
17                        main purpose of this software is the integration with mail \
18                        servers (attachment scanning). This Port supports old Macs \
19                        with Mac OS X 10.410.6 (Tiger, Leopard, Snow Leopard)
20
21homepage                https://www.clamav.net
22master_sites            https://www.clamav.net/downloads
23distname                ${realname}-${version}
24
25checksums               rmd160  62915fde0cb4d659bb4c77ca2278560e7b141bda \
26                        sha256  3e45e46d9aaeb3a6956ed30376237ab7c4cd9573bc0f5d6fc15c588d30978d9d \
27                        size    11950409
28
29platforms               darwin
30supported_archs         i386 ppc ppc64 x86_64
31use_xcode               no
32
33compiler.cxx_standard       2014
34configure.cxxflags-append   -std=c++14
35
36# Disable tests to avoid extra dependencies
37configure.args-append   -DENABLE_TESTS=OFF
38
39## Parallel build causes build failures as of 0.104.0
40#use_parallel_build     yes
41
42depends_build           path:bin/cmake:cmake \
43                        port:pkgconfig \
44                        bin:git:git
45
46depends_lib             port:curl \
47                        port:ncurses \
48                        port:zlib \
49                        port:bzip2 \
50                        path:lib/libssl.dylib:openssl \
51                        port:pcre2 \
52                        port:libxml2 \
53                        port:libiconv \
54                        port:json-c \
55                        port:libtool
56
57## older systems support
58post-extract {
59    if { ${os.platform} eq "darwin" && ${os.major} < 11 } {
60
61        # use linux version of openssl cert util on systems < 10.7 that don't support the macOS version
62        # ./common/linux/cert_util_linux.c -> ./common/mac/cert_util_mac.m
63        # passes all tests. See: https://trac.macports.org/ticket/59168
64
65        ui_msg  "Replacing the port's Mac security with plain Linux security"
66        delete  ${worksrcpath}/common/mac/cert_util_mac.m
67        copy    ${worksrcpath}/common/linux/cert_util_linux.c \
68                ${worksrcpath}/common/mac/cert_util_mac.m
69    }
70}
71
72platform darwin 8 {     # Tiger, Mac OS X 10.4, uname -r
73        configure.args-append   -DOPTIMIZE=OFF
74        patchfiles              libclamav-others_common.c-O_SYMLINK@Tiger.patch
75}
76
77variant clamav_milter description {Build with libmilter support} {
78        depends_lib-append port:libmilter
79        configure.args-append   -DENABLE_MILTER=ON
80}
81
82pre-test {
83    if {![variant_isset tests]} {
84        ui_error "'tests' variant must be activated to enable test support"
85        error "Please enable the 'tests' variant, choose a suitable Python"
86        error "version, install the matching version of 'pytest' and try again"
87    }
88}
89
90variant tests description {Enable running 'port test'} {
91    ui_msg "Tests run using the installed version of this port."
92    depends_test-append          port:check
93
94    configure.args-delete       -DENABLE_TESTS=OFF
95    configure.pre_args-replace  -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
96                                -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF
97
98#    default_variants +python38
99
100    variant python37 conflicts python38 python39 python310 description {Create test data with Python 3.7 and run tests with Python 3.7} {
101        depends_test-append     port:python37 \
102                                port:py37-pytest
103    }
104    variant python38 conflicts python37 python39 python310 description {Create test data with Python 3.8 and run tests with Python 3.8} {
105        depends_test-append     port:python38 \
106                                port:py38-pytest
107    }
108    variant python39 conflicts python37 python38 python310 description {Create test data with Python 3.9 and run tests with Python 3.9} {
109        depends_test-append     port:python39 \
110                                port:py39-pytest
111    }
112    variant python310 conflicts python37 python38 python39 description {Create test data with Python 3.10 and run tests with Python 3.10} {
113        depends_test-append     port:python310 \
114                                port:py310-pytest
115    }
116
117    test.run yes
118    test.cmd ctest
119    test.target --rerun-failed --output-on-failure
120}
121
122livecheck.type          regex
123livecheck.url           http://www.clamav.net/downloads
124livecheck.regex         ${name}-(\\d+.\\d+.\\d+)${extract.suffix}