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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
|
#!/bin/sh
yesno () {
answ=X;
while [ $answ = X ]; do
echo -n "$1"
read answ
if [ X$answ = X ]; then answ="YES"; fi
case $answ in
y|yes|Y|YES) answ=YES;;
n|no|N|NO) answ=NO;;
*) echo invalid answer
answ=X
;;
esac
done
}
F=$WRKDIR/.config
configure () {
rm -f $F
cat <<END
Which servers do you wish to build, you can save a lot of disk space
by only compiling the server you will be using. It will also save you
considerable compile time.
END
servers="SVGA VGA16 VGA16Dual Mono MonoDual S3 I8514 Mach8 Mach32 Mach64 P9000 AGX W32"
for i in $servers; do
yesno "Do you want to build the $i server? [YES] "
echo "#undef XF86${i}Server" >>$F
echo "#define XF86${i}Server $answ" >>$F
done
echo
echo -n "default server to install. [none] "
read answ
if [ X$answ = X ]; then answ=none; fi
if [ $answ != none ]; then
echo "#define ServerToInstall XF86_$answ" >>$F
fi
cat >> $F <<END
#define XF86SvgaDrivers et4000 et3000 pvga1 gvga ati tvga8900 cirrus \
ncr77c22 compaq oak mx al2101 ali cl64xx \
video7 chips generic
#define XF86Vga16Drivers et4000 ncr77c22 ati tvga8900 oak cl64xx generic
#define XF86Vga2Drivers et4000 et3000 pvga1 gvga ati tvga8900 cirrus \
ncr77c22 compaq oak cl64xx generic
#define XF86MonoDrivers hgc1280 sigma apollo hercules
#define XF86W32Drivers et4000w32
END
cat <<END
Do you want to install the default system config files, this will overwrite
and files that you may be currently using. This would only be required
on a first time build.
END
yesno "Install xdm config? [YES] "
echo "#undef InstallXdmConfig" >> $F
echo "#define InstallXdmConfig $answ" >> $F
yesno "Install xinit config? [YES] "
echo "#undef InstallXinitConfig" >> $F
echo "#define InstallXinitConfig $answ" >> $F
yesno "Do you want to include support for the FontServer? [YES] "
echo "#undef BuildFontServer" >>$F
echo "#define BuildFontServer $answ" >>$F
echo "#undef InstallFSConfig" >>$F
echo "#define InstallFSConfig $answ" >>$F
cat <<'END'
Do you want to Build Fonts (Usually you only want to build and install
fonts once, if this is a first time install you will want to build the
fonts)
END
yesno "Build fonts? [YES] "
if [ $answ = NO ]; then
echo "#define BuildFonts NO" >> $F
fi
yesno "Build PEX? [YES] "
if [ $answ = NO ]; then
echo "#define BuildPexExt NO" >> $F
fi
yesno "Build XIE? [YES] "
if [ $answ = NO ]; then
echo "#define BuildXIE NO" >> $F
fi
echo
cat <<'END'
MIT supplies an authentication mechanism that relies upon DES, this is
called XDM-AUTHORIZATION-1.
Source code for this authentication mechanism may not be exported from
the United States, however, there are compatible replacements for this
mechanism available elsewhere. Also, while this scheme is not used for
general purpose encryption, some countries restrict the use of strong
cryptography.
If you have aquired a copy of "Wraphelp.c" and it currently resides in
the same location as the XFree86 upgrade patches or in the ports "files"
subdirectory, it will be copied into the right place in the X11 source
distribution and support for this feature will be enabled if you answer
YES to the following question.
If you do not have a copy of this file, even if you answer YES to this
question, support will not be enabled. If you wish to change this later,
the option controling this is contined the file xc/config/cf/xf86site.def.
END
yesno "Do you want to enable XDM-AUTHORIZATION-1 support? [YES] "
if [ $answ = YES ]; then
WH=$WRKDIR/xc/lib/Xdmcp/Wraphelp.c
cpwh=NO
if [ -f $WH ] ; then
echo "==> $WH found in source distribution."
elif [ -f $X11FIXES/Wraphelp.c ] ; then
echo "==> Wraphelp.c found in fix directory, copying to source tree."
cpwh=$X11FIXES/Wraphelp.c
elif [ -f $FILESDIR/Wraphelp.c ] ; then
echo "==> Wraphelp.c found in files directory, copying to source tree."
cpwh=$FILESDIR/Wraphelp.c
else
echo "==> Wraphelp.c not found, DES support NOT enabled."
answ=NO
fi
fi
echo "#undef HadXdmAuth" >> $F
echo "#define HasXdmAuth $answ" >> $F
cat <<'END'
Additional support for Kerberos V4 is available should you chose to
install it. If you choose to install the Kerberos V4 patches, you
will also be asked if you want to enable Kerberos V4 support.
END
yesno "Do you want to add the Kerberos V4 support patches? [YES] "
k4patch=$answ
if [ $k4patch = YES ] ; then
echo
yesno "Do you want to enable Kerberos V4 support? [YES] "
echo "#undef HasKrb4" >>$F
echo "#define HasKrb4 $answ" >>$F
fi
echo
echo "End of configuration questions. No more user input required"
echo
}
if [ -f $WRKDIR/.cdrom ]; then
X11FIXES=`cat $WRKDIR/.cdrom`
echo -n 'Where is the "xc" directory on the cdrom? [/cdrom] '
read X11R6; if [ X$X11R6 = X ]; then X11R6=/cdrom; fi
if [ ! -d $X11R6/xc/config/cf ]; then
echo "Can't find X11R6 in $X11R6"
exit 1
fi
yesno "Is your cdrom distibution already patched? [y] ";
if [ $answ = YES ]; then
echo -n "What is the patchlevel of the distribution? [3] ";
read pl; if [ X$pl = X ]; then pl=3; fi
pl=`expr $pl + 1`
if [ $pl -lt 10 ]; then pl=0$pl; fi
else
pl=01
fi
ok=0
err=0
for i in 01 02 03 04 05 06 07 08 09 10 11 12; do
if [ $i = $pl ]; then ok=1; fi
if [ $ok = 1 ]; then
if [ ! -f $X11FIXES/fix-$i ]; then
echo "can't find $X11FIXES/fix-$i !!!"
err=1
fi
if [ $i = 10 ]; then
if [ ! -f $X11FIXES/fix10fonts.Z ]; then
echo "can't find $X11FIXES/fix10fonts.Z !!!"
err=1
fi
fi
if [ $i = 11 ]; then
if [ ! -f $X11FIXES/XFree86-3.1.1.tar.gz ]; then
echo "can't find $X11FIXES/XFree86-3.1.1.tar.gz !!!"
err=1
fi
fi
fi
done
if [ ! -f $X11FIXES/XFree86-3.1.2.diff.gz ]; then
echo "can't find $X11FIXES/XFree86-3.1.2.diff.gz !!!"
err=1
fi
if [ ! -f $X11FIXES/cfont312.tgz ]; then
echo "can't find $X11FIXES/cfont312.tgz !!!"
err=1
fi
if [ ! -f $X11FIXES/3.1.2-3.1.2-S.diff.gz ]; then
echo "can't find $X11FIXES/3.1.2-3.1.2-S.diff.gz !!!"
err=1
fi
if [ $err = 1 ]; then exit 1; fi
configure
echo "==> building the tree"
(cd $WRKDIR; sh $FILESDIR/maketree $X11R6)
else
X11FIXES=`cat $WRKDIR/.ftp`
pl=12
configure
fi
if [ X$cpwh != XNO ]; then
cp $cpwh $WH
fi
echo -n "==> applying XC patches"
ok=0
for i in 01 02 03 04 05 06 07 08 09 10 11 12; do
if [ $i = $pl ]; then ok=1; fi
if [ $ok = 1 ]; then
echo -n .;
patch -d $WRKSRC --forward --quiet -E -p1 < $X11FIXES/fix-$i
if [ $i = 10 ]; then
zcat $X11FIXES/fix10fonts.Z | patch -d $WRKSRC --forward --quiet -E -p1
fi
if [ $i = 11 ]; then
rm -rf $WRKDIR/xc/programs/Xserver/hw/xfree86
(cd $WRKDIR; gunzip -c $X11FIXES/XFree86-3.1.1.tar.gz | tar xpf -)
fi
if [ $i = 12 ]; then
rm -f $WRKDIR/xc/lib/Xt/Shell.h
rm -f $WRKDIR/xc/lib/StringDefs.h
rm -f $WRKDIR/xc/lib/StringDefs.c
fi
fi
done
echo
echo "==> applying XFree86 patches"
zcat $X11FIXES/XFree86-3.1.2.diff.gz | patch -d $WRKSRC --forward --quiet -E -p1
tar xzf $X11FIXES/cfont312.tgz -C $WRKDIR
zcat $X11FIXES/3.1.2-3.1.2-S.diff.gz | patch -d $WRKSRC --forward --quiet -E -p1
if [ $k4patch = YES ] ; then
echo
echo "==> applying Kerberos-V4 support patch"
cat $FILESDIR/kerberos4.diffs | \
patch -d $WRKSRC --forward --quiet -E -p1
fi
cat $F >> $WRKSRC/config/cf/xf86site.def
cd $WRKSRC/config/cf/ || exit 1;
version=`uname -r`
set `echo $version|sed -e 's/\./ /g' -e 's/-/ /g'`
mv FreeBSD.cf FreeBSD.cf.old
sed -e "s/2.0.5/$version/" \
-e "s/OSMajorVersion *2/OSMajorVersion $1/" \
-e "s/OSMinorVersion *0/OSMinorVersion $2/" \
-e "s/OSTeenyVersion *5/OSTeenyVersion $3/" \
-e "s/UseGnuMalloc.*YES/UseGnuMalloc NO/" \
<FreeBSD.cf.old >FreeBSD.cf
exit 0
|