summaryrefslogtreecommitdiff
path: root/make/makeallchives
blob: 6c841e7a6d8d53e1cd24a5b6e7f31eb994619f7b (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
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
#!/bin/sh
#
# $Id: makeallchives 117677 2008-01-18 17:07:17Z vakatov $
#
#
# Creates all archives from a directory above 'ncbi'
#
# based on mkarchive written by
# J. Epstein, 9/29/95
#   modified to work in a distributed environment 3/13/98 (Friday the 13th)
#    -Karl Sirotkin
#
PATH=/bin:/usr/bin:$PATH
export PATH

if [ ! -d ncbi ] ; then
	echo must be executed above \'ncbi\' 
	exit 1
fi
if [ ! -d ncbi/build ] ; then
	echo must be executed above \'ncbi\' after make
	exit 1
fi

datafiles="humrep.fsa lineages.txt sequin.hlp asn2ff.prt bstdt.val \
   featdef.val gc.val makerpt.prt objprt.prt pubkey.enc seqcode.val \
   sgmlbb.ent taxlist.txt BLOSUM62 KSat.flt KSchoth.flt KSgc.flt \
   KShopp.flt KSkyte.flt KSpur.flt KSpyr.flt \
   BLOSUM45 BLOSUM80 PAM30 PAM70 KSpcc.mat \
   ecnum_ambiguous.txt ecnum_specific.txt UniVec.nhr UniVec.nin UniVec.nsq \
   UniVec_Core.nhr UniVec_Core.nin UniVec_Core.nsq"

configfiles="nlmstmanrc sequinrc ncbidtrc"

TOPDIR=`pwd`
configdir=$TOPDIR/ncbi/config/unix
datadir=$TOPDIR/ncbi/data
errmsgdir=$TOPDIR/ncbi/errmsg
sequindoc=$TOPDIR/ncbi/doc/sequin.htm
sequinimages=$TOPDIR/ncbi/doc/images/

#delete the old archive subdir
test -d archive && rm -rf archive

#make sure we have timestamp file
test -f ncbi/VERSION || date > ncbi/VERSION

for i in sequin entrez fa2htgs asn2xml
do
	f=""
	mkdir -p archive/$i/data
	for file in $datafiles
	do
		ln $datadir/$file archive/$i/data/
	done
	ln ncbi/VERSION archive/$i/VERSION

#	cat > archive/$i/Cn3D.ReadMe <<EOF
#Cn3D is now distributed separately from $i
#To download Cn3D please look at the Cn3D home page or ftp site:
#
#http://www.ncbi.nlm.nih.gov/Structure/cn3d.html
#ftp://ftp.ncbi.nih.gov/cn3d/
#EOF

	case "$i" in
	entrez)
		cat > archive/$i/README.1st <<EOF
If you have not done so already, please refer to the
file at ftp://ftp.ncbi.nih.gov/entrez/README
EOF
		f="entrez entrez2 ../doc/firewall.html"		
		(cd ncbi/build; test -f Nentrez && ln -f Nentrez entrez)
		;;
	sequin)
		f="sequin"
		(cd ncbi/build; test -f Psequin && ln -f Psequin sequin)
		mkdir -p archive/sequin/errmsg archive/sequin/images
		test -d $errmsgdir && ln $errmsgdir/* archive/sequin/errmsg/
		test -d $sequinimages && ln $sequinimages/* archive/sequin/images/
		test -r $sequindoc && ln $sequindoc archive/sequin/
		#for file in $configfiles
		#do
		#	test -r $configdir/$file && ln $configdir/$file archive/sequin/config/
		#done
		;;
	asn2xml)
		f="asn2xml ../doc/README.asn2xml ../doc/ncbixml.txt"
		#no need in data subdir
		rm -rf archive/asn2xml/data
		;;
	fa2htgs)
		f="fa2htgs"
		;;
	*)
		;;
	esac
	for file in $f
	do
		if [ -f ./ncbi/build/$file ] ; then
			ln ./ncbi/build/$file ./archive/$i/
		else
			echo "$i: file $file was not built, skipping the archive"
			rm -fr ./archive/$i
		fi
	done
done

#cd back to archive
cd $TOPDIR/archive

case `uname -s` in
SunOS)
	case `uname -r` in
	4.1*)
		platform=sun
		;;
	*)
		if [ `uname -p` = i386 ] ; then
			platform=solarisintel
		else
			platform=solaris
			if [ "$SOLARIS_MODE" = "64" ] ; then
				platform=solaris64
			fi
		fi
		;;
	esac
	;;
IRIX*)
	case `uname -r` in
	4.*)
		platform=sgi4
		;;
	5.*)
		platform=sgi5
		;;
	6.5)
		#platform=sgi-mips4
		platform=sgi
		;;
	6.[0-4])
		platform=sgi
		;;
	*)
		platform=sgi
		;;
	esac
	;;
Linux)
	case `uname -m` in
	ppc)
		platform=ppclinux
		;;
	parisc)
		platform=hppalinux
		;;
	alpha)
		platform=linux-alpha
		;;
	x86_64)
		platform=linux-x86_64
		;;
	i?86)
		platform=linux-x86
		if [ "$LINUX_MODE" = "icc" ] ; then
			platform=linux-x86_icc
		fi
		;;
	ia64)
		platform=linux-ia64
		;;
	*)
		platform=linux
		;;
	esac
	;;
OSF1)
	platform=alphaOSF1
	;;
HP-UX)
	if [ `uname -m` = ia64 ] ; then
		platform=hpux_ia64
	else
		platform=hpux
	fi
	;;
QNX)
	platform=qnx
	;;
FreeBSD)
	platform=freebsd
	;;
Darwin)
	platform=darwin
	;;
NetBSD)
	platform=netbsd
	;;
AIX)
	platform=ibm_auto
	;;
*)
	platform="`uname -s`.`uname -m`"
	platform=`echo $platform|tr '[A-Z]' '[a-z]'|tr ' ' '_'`
	;;
esac

echo PLATFORM is $platform
pwd

for A in sequin entrez fa2htgs
do
	cd $A || continue
	#if [ $platform = "linux" ] ; then
	#	touch README.1st
	#fi

	if [ $platform = "solaris" ] ; then
		touch README.1st
		cat >>README.1st <<EOF
As of 5/29/1996, the Solaris executables distributed by NCBI no longer include
a statically-linked Motif library.  This is due to the manner in which
Sun distributes Motif libraries.  Users of Solaris version 2.4 and higher
will find the runtime shared Motif library on their system.  Users of Solaris
version 2.3 and earlier may need to either upgrade their systems or purchase
the Motif library separately.

It may be necessary to set your LD_LIBRARY_PATH environment variable to
point to the directory where this file, libXm.so.3 (the final digit may
vary), appears on your system.  E.g.
   setenv LD_LIBRARY_PATH /usr/dt/lib
EOF
	fi

	if [ $platform = "sun" ] ; then
		touch README.1st
		cat >>README.1st <<EOF
 ******************************************************************
 *          ! ! !   W A R N I N G   ! ! !                         *
 *                                                                *
 *  The NCBI Toolkit on                                           *
 *     Windows 16 bit                                             *
 *         and                                                    *
 *     SunOS 4.X platforms                                        *
 *                                                                *
 *     WILL NO LONGER BE SUPPORTED   after May 1, 1999            *
 *                                                                *
 ******************************************************************

EOF
	fi
	if [ $platform = "sgi5" ] ; then
		touch README.sgi5
		cat >>README.1st <<EOF
 *******************************************************************
 *          ! ! !   W A R N I N G   ! ! !                          *
 *                                                                 *
 *  The NCBI Toolkit binaries for IRIX5.X                          *
 *     WILL NO LONGER BE SUPPORTED AND BUILT after January 1, 2002 *
 *                                                                 *
 *******************************************************************

EOF
	fi
	#cd back to archive
	cd ..
done

for A in sequin entrez fa2htgs asn2xml
do
	cd $A || continue
	tar cf ../$A.$platform.tar .
	rm -f ../$A.$platform.tar.Z
	#compress < ../$A.$platform.tar > ../$A.$platform.tar.Z
	gzip < ../$A.$platform.tar > ../$A.$platform.tar.gz 2>/dev/null
	if [ $? != 0 ] ; then
		/usr/ncbi/bin/gzip < ../$A.$platform.tar > ../$A.$platform.tar.gz 2>/dev/null
	fi
	rm -f ../$A.$platform.tar
	# cd back to archive
	cd ..
	#and remove it
	rm -fr $A
done

echo Building blast archive...

BLASTDIR=blast-`cat ../ncbi/demo/.BLAST_VERSION`

mkdir $BLASTDIR
mkdir $BLASTDIR/bin
mkdir $BLASTDIR/data
mkdir $BLASTDIR/doc

for file in blastall blastpgp seedtop formatdb formatrpsdb fastacmd copymat makemat impala megablast blastclust rpsblast bl2seq 
do
cp ../ncbi/build/$file $BLASTDIR/bin
done

for file in $datafiles
do
cp ../ncbi/data/$file $BLASTDIR/data
done

for file in bl2seq.html blast.html blastall.html blastclust.html blastdb.html blastftp.html blastpgp.html fastacmd.html filter.html formatdb.html formatrpsdb.html history.html impala.html index.html megablast.html netblast.html rpsblast.html scoring.pdf web_blast.pl
do
cp ../ncbi/doc/blast/$file $BLASTDIR/doc
done

cp ../ncbi/VERSION $BLASTDIR

tar -cpf blast.$platform.tar $BLASTDIR
gzip blast.$platform.tar
rm -rf $BLASTDIR

# end build blast archive

echo Building netblast archive...

mkdir net$BLASTDIR
mkdir net$BLASTDIR/data
mkdir net$BLASTDIR/bin
mkdir net$BLASTDIR/doc

for file in $datafiles
do
cp ../ncbi/data/$file              net$BLASTDIR/data
done

cp ../ncbi/doc/firewall.html       net$BLASTDIR/doc
cp ../ncbi/doc/blast/netblast.html net$BLASTDIR/doc
cp ../ncbi/bin/blastcl3            net$BLASTDIR/bin
cp ../ncbi/VERSION                 net$BLASTDIR

tar -cpf netblast.$platform.tar    net$BLASTDIR
gzip netblast.$platform.tar
rm -rf net$BLASTDIR

echo Building wwwblast archive...

mkdir blast

cp -r ../ncbi/network/wwwblast/* blast 

find blast -type d -name CVS | xargs rm -rf
find blast -type d -name Src | xargs rm -rf

for file in psiblast.REAL psiblast_cs.REAL blast.REAL blast_cs.REAL wblast2.REAL wblast2_cs.REAL bl2bag.cgi nph-viewgif.cgi
do
cp ../ncbi/build/$file blast
done

mkdir -p blast/TmpGifs
chmod 777 blast/TmpGifs
chmod 666 blast/*.log

tar -cpf wwwblast.$platform.tar blast
gzip wwwblast.$platform.tar

rm -rf blast

exit 0