File: build-uvscan

package info (click to toggle)
uvscan 3-3
  • links: PTS
  • area: contrib
  • in suites: slink
  • size: 56 kB
  • ctags: 1
  • sloc: sh: 235; makefile: 31
file content (171 lines) | stat: -rwxr-xr-x 5,016 bytes parent folder | download
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#!/bin/sh
cat << EOF
This script will create full McAfee Virusscan program and datfile .debs
in the current directory. You will need dpkg-dev installed, as well as
root access (fakeroot will work also). Also keep in mind that Network
Associates Inc. has not licensed you to distribute these packages.
EOF
if [ "`id -u`" != "0" ]; then
	echo This script needs root access to run. Exiting...
	exit 1
fi

if [ -e uvscan-build-dir ]; then
	read -p "A previous temporary build directory exists. Proceed? [y/n] :" proceed
	if [ "$proceed" = "y" ]; then
		rm -rf uvscan-build-dir
	else
		exit 1
	fi
fi

mkdir uvscan-build-dir
if [ "$?" != "0" ]; then
	echo Could not create directory uvscan-build-dir. Exiting...
	exit 1
fi

cd uvscan-build-dir

mkdir debian
cd debian
#
# Generate the necessary control files
#
cat << EOF > control
Source: uvscan3
Section: admin
Priority: optional
Maintainer: Robert Woodcock <rcw@oz.net>
Standards-Version: 2.4.0.0

Package: uvscan3
Architecture: i386
Depends: ${shlibs:Depends} uvscan3-dats
Replaces: uvscan
Conflicts: uvscan
Provides: uvscan-full
Description: McAfee Virusscan for Linux
 This is an automatic build of Virusscan.

Package: uvscan3-dats
Architecture: any
Depends: uvscan3
Provides: uvscan-full
Conflicts: uvscan
Replaces: uvscan
Description: McAfee Virusscan datfiles
 This is an automatic build of the McAfee Virusscan datfiles.
EOF

# Get the version
if [ -e /usr/doc/uvscan/Packing.lst ]; then
	ENGINE=`cat /usr/doc/uvscan/Packing.lst | head -1 | cut -f2 -dv \
	| tr -d '()' | sed 's- -d-g' | cut -f1 -dd`
elif [ -e /usr/doc/uvscan3/Packing.lst ]; then
	ENGINE=`cat /usr/doc/uvscan3/Packing.lst | head -1 | cut -f2 -dv \
	| tr -d '()' | sed 's- -d-g' | cut -f1 -dd`
else
	echo Unable to locate Packing.lst. Exiting.
	exit 1
fi
DATS="`cat /usr/lib/neta/scan.dat | head -1 | cut -f2-4 -d.`"

# Get the date
RFC822DATE=`822-date`

mkdir -p tmp-uvscan3/usr/lib/neta
mkdir -p tmp-uvscan3-dats/usr/lib/neta
mkdir -p tmp-uvscan3/usr/doc/uvscan3
mkdir -p tmp-uvscan3-dats/usr/doc/uvscan3-dats
mkdir -p tmp-uvscan3/usr/bin
mkdir -p tmp-uvscan3/usr/man/man1
mkdir -p tmp-uvscan3/DEBIAN
mkdir -p tmp-uvscan3-dats/DEBIAN

cat << EOF | sed s/VERSION/$ENGINE/g | sed "s/DATE/$RFC822DATE/g" > changelog
uvscan3 (VERSION-1) local; urgency=low

  * Autobuilt release

 -- Robert Woodcock <rcw@oz.net>  DATE
EOF

cp /usr/lib/neta/*.dat tmp-uvscan3-dats/usr/lib/neta
cp /usr/lib/neta/uvscan tmp-uvscan3/usr/lib/neta
cp /usr/bin/uvscan tmp-uvscan3/usr/bin
cp /usr/man/man1/uvscan.1.gz tmp-uvscan3/usr/man/man1
cp /usr/man/man1/build-uvscan.1.gz tmp-uvscan3/usr/man/man1
# The world's first self-replicating debian package!!!
cp /usr/bin/build-uvscan tmp-uvscan3/usr/bin
if [ -e /usr/doc/uvscan/Readme.1st ]; then
	cp /usr/doc/uvscan/{Readme.1st,Packing.lst,Reseller.txt,Whatsnew.txt} tmp-uvscan3/usr/doc/uvscan3
elif [ -e /usr/doc/uvscan3/Readme.1st ]; then
	cp /usr/doc/uvscan3/{Readme.1st,Packing.lst,Reseller.txt,Whatsnew.txt} tmp-uvscan3/usr/doc/uvscan3
else
	echo Unable to locate Readme.1st. Exiting.
	cd ../..
	rm -rf uvscan-build-dir
	exit 1
fi

cat << EOF > tmp-uvscan3/usr/doc/uvscan3/README.Debian
McAfee Virusscan for Debian
---------------------------

Note: This package is not distributable. It was automatically built
from the uvscan installer package.

To remove this package, you also have to remove the uvscan3-dats
package. You can do that with a command like:

dpkg --purge uvscan3 uvscan3-dats
EOF

cat << EOF > tmp-uvscan3/usr/doc/uvscan3/copyright
This package was created from an automatic build script by the
local administrators.

Network Associates Inc.'s license for McAfee Virusscan can be found in
/usr/doc/uvscan3/Readme.1st.
EOF

cat << EOF > tmp-uvscan3-dats/usr/doc/uvscan3-dats/README.Debian
McAfee Virusscan DATs for Debian
--------------------------------
This package is just the datfiles for McAfee Virusscan. It's designed to
work with the uvscan3 package.

You'll find documentation and copyright information in that package.

To remove this package, you also have to remove the uvscan3
package. You can do that with a command like:

dpkg --purge uvscan3 uvscan3-dats
EOF

cat << EOF > tmp-uvscan3-dats/usr/doc/uvscan3-dats/copyright
This package was created from an automatic build script by the
local administrators.

Network Associates Inc.'s license for McAfee Virusscan can be found in
/usr/doc/uvscan3/Readme.1st.
EOF

cp changelog tmp-uvscan3-dats/usr/doc/uvscan3-dats/changelog
cp changelog tmp-uvscan3/usr/doc/uvscan3/changelog.Debian

gzip -9 tmp-uvscan3-dats/usr/doc/uvscan3-dats/changelog
gzip -9 tmp-uvscan3/usr/doc/uvscan3/changelog.Debian

cd ..
echo Done generating files. Generating control information...
dpkg-shlibdeps debian/tmp-uvscan3/usr/lib/neta/uvscan
dpkg-gencontrol -Pdebian/tmp-uvscan3 -puvscan3
dpkg-gencontrol -v$DATS -Pdebian/tmp-uvscan3-dats -puvscan3-dats
dpkg-deb --build debian/tmp-uvscan3 ..
dpkg-deb --build debian/tmp-uvscan3-dats ..
echo Removing build directory...
cd ..
rm -rf uvscan-build-dir
echo Done.