blob: 5aaf343e2613aa5aba6f9e2047fc7cba14080926 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
##
## Created by Wolfram Schlich <wschlich@gentoo.org>
##
## TODO
## - install: shutdown running programs?
## - install: show EULA?!
## - install/config: copy keyfile?
##
inherit eutils
DESCRIPTION="AVIRA AntiVir virus scanner (SAVAPI)"
#MY_P="${PN/savapi/mailgate}-prof-${PV/_p/-}"
MY_P="${PN/savapi/mailgate}-prof-3.0.0-14"
MY_P2="${PN/savapi/mailgate}-prof"
SRC_URI="http://dl1.pro.antivir.de/package/mailgate/unix/en/${MY_P2}.tgz"
#SRC_URI="http://storage.bu.avira.com/pub/savapi/2008.10.07/savapi3-${PV/_p/.}-linux_glibc22.zip"
HOMEPAGE="http://www.avira.com/"
LICENSE="AVIRA-AntiVir"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""
DEPEND=""
RDEPEND=""
S="${WORKDIR}/${MY_P}"
#S="${WORKDIR}"
# prevent installation functions from stripping binaries
# otherwise the antivir selfcheck fails. also don't try
# to fetch the distribution tarball from a mirror.
RESTRICT="strip mirror"
#
# Settings overridable by user supplied environment variables
#
AVHOMEDIR="${AVHOMEDIR:-/usr/lib/AntiVir}"
AVCONFDIR="${AVCONFDIR:-/etc/avira}"
AVTMPDIR="${AVTMPDIR:-/var/tmp}"
#AVSAVAPISOCKET="${AVSAVAPISOCKET:-/var/run/antivir-savapi/scanner}"
#AVUSER="${AVUSER:-avgate}"
#AVUID="${AVUID:-220}"
#AVSH="${AVSH:--1}"
AVGROUP="${AVGROUP:-antivir}"
AVGID="${AVGID:-220}"
#
# Standard ebuild functions
#
pkg_setup() {
#
# Add USER + GROUP
#
enewgroup "${AVGROUP}" "${AVGID}"
# enewuser "${AVUSER}" "${AVUID}" "${AVSH}" -1 "${AVGROUP}" -c AntiVir
}
src_unpack() {
unpack ${A}
cd "${S}"
# ln -s . bin; ln -s . linux_glibc22
}
src_install () {
#
# Home directory
#
diropts -oroot -groot -m0755
dodir "${AVHOMEDIR}"
diropts -oroot -g"${AVGROUP}" -m0770
insinto "${AVHOMEDIR}"
insopts -oroot -g"${AVGROUP}" -m0644
#
# Executables, libraries and misc components
#
exeinto "${AVHOMEDIR}"
exeopts -oroot -g"${AVGROUP}" -m2755
doexe bin/linux_glibc22/savapi
doexe bin/linux_glibc22/avupdate.bin
doexe bin/linux_glibc22/avlinfo
exeopts -oroot -g"${AVGROUP}" -m0755
doexe script/savapi3_reload.sh
doexe script/savapi3_post.sh
doexe script/avupdate
doexe script/post_install.sh
doins bin/linux_glibc22/avupdate_msg.avr
doins bin/linux_glibc22/ae*.so
doins bin/linux_glibc22/ae*.dat
lv=$(cd bin/linux_glibc22; ls -1 libsavapi3.so.*); lv=${lv##*.so.}
doins bin/linux_glibc22/libsavapi3.so.${lv}
dosym libsavapi3.so.${lv} "${AVHOMEDIR}"/libsavapi3.so
diropts ""
dodir "${DESTTREE}/bin"
dosym "${AVHOMEDIR}/savapi" "${DESTTREE}/bin/savapi"
#
# Init script
#
# exeopts -oroot -groot -m0755
# exeinto /etc/init.d
# newexe "${FILESDIR}/${PV}/antivir-savapi.initd" antivir-savapi
#
# Config
#
insopts -oroot -g"${AVGROUP}" -m0640
# insinto "${AVCONFDIR}"
# doins "${FILESDIR}"/${PV}/antivir-savapi.conf
# dosed "s:%AVTMPDIR%:${AVTMPDIR}:g" "${AVCONFDIR}/antivir-savapi.conf"
# dosed "s:%AVSAVAPISOCKET%:${AVSAVAPISOCKET}:g" "${AVCONFDIR}/antivir-savapi.conf"
# dosed "s:%AVUSER%:${AVUSER}:g" "${AVCONFDIR}/antivir-savapi.conf"
# dosed "s:%AVGROUP%:${AVGROUP}:g" "${AVCONFDIR}/antivir-savapi.conf"
insinto "${AVCONFDIR}"
doins "${FILESDIR}"/${PV}/avupdate.conf
dosed "s:%AVHOMEDIR%:${AVHOMEDIR}:g" "${AVCONFDIR}/avupdate.conf"
dosed "s:%AVTMPDIR%:${AVTMPDIR}:g" "${AVCONFDIR}/avupdate.conf"
}
pkg_config () {
#
# Automatic updates
# Generate a random number between 1 and 59 for the crontab
#
rand="$$$(date +%s)"
min="$[ ($rand % 59) + 1 ]"
echo
einfo ""
einfo "Using the internet updater"
einfo "=========================="
einfo ""
einfo "Add the following line to your /etc/crontab or a new file"
einfo "in /etc/cron.d/ to make AntiVir check for updates"
einfo "${min} minutes after every full hour:"
einfo ""
einfo "\t${min} * * * * root exec ${AVHOMEDIR}/avupdate --product=scanner >/dev/null"
einfo ""
echo
}
|