forked from metamath/metamath-website-seed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·1936 lines (1795 loc) · 74.9 KB
/
install.sh
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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/sh
# install.sh for the Metamath site (metamath.org) - version of 7-Nov-2020
#
# To check for problems after the run (see below for more information):
#
# egrep -i \
# "warning|error|no such|cannot|permission|denied|invalid|too long|can't|bug" \
# install.log | egrep -v \
# "No errors|Font Warn|label token|ignored|Warning: File|Warning: Label" \
# | egrep -v "_bug|mmj2bug"
#
#
# History:
#
# 6-Jun-2021 nm Print elapsed time at major points
# 16-Mar-2021 nm Add /labels to some markup commands
# 7-Nov-2020 nm Add mmfrege.raw.html conversion
# 30-Jun-2020 nm remove -ansi (and -std=c99) from gcc command
# 26-Apr-2020 nm Add bigtriangleup gif image
# 1-Feb-2020 nm Removed regeneration of metamath-program.zip because of mismatched
# sha256 complaint; must be generated by hand from now on.
# 13-Dec-2019 nm Add man page metamath.1 to metamath-program.zip
# 13-Jul-2019 nm Use mmnf.raw.html instead of mmnf.html
# 7-Jun-2019 nm Change subset to subsetneq
# 6-Jun-2019 nm Fix missing symbol in nfegif
# 6-Feb-2019 nm Temporarily turn off metamath.pdf generation until
# DAW's scripts for new version can be incorporated; look for "6-Feb-2019"
# 28-Jan-2019 mm Use mmil.raw.html instead of mmil.html
# 19-Dec-2018 nm Added /labels for mmset.html markup
# 16-Dec-2018 nm Switched from mmset.html to mmset.raw.html, etc.
# In the future, look for 3 occurrences of "16-Dec-2018" below for
# adding a new mm*raw.html file to mpegif or changing 'markup' options.
# 13-Dec-2018 nm Added missing symbols for iset.mm
# 12-Dec-2018 nm Added configure.ac Makefile.am to metamath-program.zip
# 15-Aug-2018 nm Added mmrecent_IL.html for ilegif
# 1-Jun-2018 nm Increased "write recent" to 100 instead of 10 in mmrecent.html
# 28-May-2018 nm Added missing gifs to nfegif and ilegif
# 26-Sep-2017 nm Changed default links from Unicode to GIF
# Author: Norman Megill
# ** PUBLIC DOMAIN **
# This file (specifically, the version of this file with the above date)
# is placed in the public domain per the Creative Commons Public Domain
# Dedication. http://creativecommons.org/licenses/publicdomain/
# See http://www.faqs.org/docs/abs/HTML/index.html for the syntax of
# the bash language used in this file
#
# This Linux bash shell script regenerates the automatically-generated parts
# of the Metamath site. It should be run from the metamathsite directory (where
# this script resides) by typing "./install.sh".
#
#
# If you do not have LaTeX installed, some .pdf files will not be created.
# In that case, at the end of the run you will be given an informational warning,
# which will tell you which .pdf files to retrieve from the metamath.org site in
# order to make your installation complete.
#
#
# Suggestion: You might want to run with logging in order to detect any
# problems that may have occurred. To do this, instead of "./install.sh" type:
#
# sh -x ./install.sh >install.log 2>&1
#
# You can monitor the progress in another window with "tail -f install.log".
#
# After the run, check the log file for problems:
#
# egrep -i \
# "warning|error|no such|cannot|permission|denied|invalid|too long|can't|bug" \
# install.log | egrep -v \
# "No errors|Font Warn|label token|ignored|Warning: File|Warning: Label" \
# | egrep -v "_bug|mmj2bug"
#
# If all went OK there should be no output.
#
# If you are using Cygwin on Windows XP, see the "Note for Cygwin on Windows XP"
# below for recovery from a Microsoft bug you might encounter.
#
#
# This script can be broken up to run on several cores. See the notes
# at https://groups.google.com/d/msg/metamath/w3f1cVH3R_g/DSRTSf67BQAJ
#
#
# The script is intended to be robust in that it can be re-run if
# it is aborted in the middle.
#
# Please report any problems via github issue at
# https://github.com/metamath/metamath-website-seed
# or via the contact methods at https://us.metamath.org/email.html
#
##############################################################################
# (The following notes are intended for N. Megill only)
# QA checklist for official web site release
# 1. nohup ./install.sh & check nohup.out for errors - Linux and Cygwin
# 2. tar -xzf downloads/metamathsite.tar.gz, diff -rq with original
# 2. nohup wget --mirror (url)/index.html & check nohup.out for "ERROR 404"
# 3. diff -r between wget'ed and original
# 4. check latex/metamath.log, latex/finiteaxiom.log for warnings
# 5. http://validator.w3.org/
# index.html
# mmsolitaire/mms.html
# mmsolitaire/mmsviewer.html
# mpeuni/mmbiblio.html
# mpeuni/mmcomplex.html
# mpeuni/mmdeduction.html
# mpeuni/mmhil.html
# mpeuni/mmmusic.html
# mpeuni/mmrecent.html
# mpeuni/mmset.html
# mpeuni/mmzfcnd.html
# qleuni/mmql.html
# symbols/symbols.html
# 6. tar -cf - * | gzip -9 > ../metamathmirror.tar.gz generates release file
# (End of N.Megill-only stuff)
##############################################################################
# The Metamath site-building script starts here
# 14-Nov-2015 changed from 200 to 1000 most recent proofs
# 6-Jun-2021
echo "install.sh time start: `date`"
# Check that necessary software is present
# Note: md5sum is called md5 on Mac. (However, the need for md5sum
# was removed on 8-Jun-2009, so this is no longer a problem.)
DEPS="bash gcc tar gzip zip bzip2 find ls mv cp rm sed touch chmod"
for item in $DEPS
do
if [ -z "`which $item`" ]; then
echo "?Fatal error: $item (needed for build) is not installed on your system."
exit 1
fi
done
# Cygwin support
CYGWIN=false
case "`uname`" in
# Match the conventional Cygwin naming scheme returned from uname
CYGWIN*) CYGWIN=true ;;
esac
######## Recover if a previous run was aborted in the middle #######
#
# ############ Note for Cygwin on Windows XP ##########
#
# Sometimes Windows XP will "lock" a file or directory randomly for no
# apparent reason, such that if an attempt to delete/rename the file or
# is made from the Windows Explorer, the error message "Cannot rename/delete
# xxx - access is denied. Make sure the disk is not full or write-protected."
# appears, even if all applications are closed. Rebooting sometimes works.
# Other times, the following manual procedure (found on a newsgroup and
# verified to work) is needed to delete the file:
#
# "Open a Command Prompt window and leave it open. Close all open programs.
# Click Start, Run and enter TASKMGR.EXE Go to the Processes tab and End
# Process on Explorer.exe. Leave Task Manager open. Go back to the Command
# Prompt window and change to the directory the AVI (or other undeletable
# file) is located in. At the command prompt type DEL <filename> where
# <filename> is the file you wish to delete. Go back to Task Manager, click
# File, New Task and enter EXPLORER.EXE to restart the GUI shell. Close Task
# Manager."
#
# In this script we attempt to detect all such cases of this problem, so
# that hopefully this script will never terminate with a false "success"
# message. Unfortunately this Windows bug makes this script much more
# complex than it would otherwise have to be.
#
if [ -d tmpmetamathsite ] ; then
# If the subdirectory tmpmetamathsite exists, the site master
# backup was not finished, so just delete it. Nothing else was
# touched yet.
echo "Recovering from an earlier aborted run..."
rm -rf tmpmetamathsite
if [ -d tmpmetamathsite ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'tmpmetamathsite'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
# If there was an aborted failure to delete the metamathsite directory
# at the end of this script in an earlier run, we should try to delete it
# now because it may be corrupted and shouldn't be reused.
rm -rf metamathsite
if [ -d metamathsite ] ; then
# If the rm -rf failed, some files in 'metamathsite' may be gone but not
# others. However, everything else completed OK. We must prevent
# metamathsite from being used for recovery, so we create a dummy
# tmpmetamathsite file for use by install.sh recovery the next time around.
#DEBUG
#echo debugmkdirtmpmetamathsite1
mkdir tmpmetamathsite
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'metamathsite'."
echo "Is someone else using that subdirectory?"
echo "On Windows, please reboot before running install.sh again."
exit 1
fi
elif [ -d metamathsite ] ; then
# If the subdirectory metamathsite exists, we finished the
# site master backup but everything else is in an unknown state
# and may be corrupted. Recover from the site master backup.
echo "Recovering from an earlier aborted run..."
if [ -d metamathsite/metamathsite ] ; then
# Bad bad user ... but even so he/she can still recover...
echo "A run was aborted inside the metamathsite subdirectory of an earlier"
echo "aborted run. You must first cd to the metamathsite subdirectory then"
echo "run ./install.sh from there to recover, then come back here and"
echo "run ./install.sh again to complete the recovery."
exit 1
fi
# This will delete files but leave directories intact
# Of course, we don't want to delete the install.sh we're running from
# nor any files we're logging to
rm -f `ls | egrep -v "install.sh|install.log|nohup.out"`
# Now delete all directories except the metamathsite recovery directory.
# The "-name "?*" filters the empty "." directory.
for i in `find . -type d -name "?*" | egrep -v "metamathsite"`
do
rm -rf $i
if [ -d $i ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory '$i'."
echo "Is someone else using that subdirectory?"
echo "On Windows, please reboot before running install.sh again."
exit 1
fi
done
cd metamathsite
# Finally, move all files up a level where they are expected, then delete the
# metamathsite recovery directory
mv `ls | grep -v install.sh` ..
cd ..
rm -rf metamathsite
if [ -d metamathsite ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'metamathsite'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
fi
######## End of recover if a previous run was aborted in the middle #######
echo "Creating subdirectories..."
# Remove "backup" version of set.mm if any
[ -f metamathsite/set.mm~1 ] && rm -f metamathsite/set.mm~1
# Remove "working" version of set.mm if any
[ -f metamathsite/set.mm ] && rm -f metamathsite/set.mm
##### Recreate the minimal site master for recovery and archiving #####
# The minimal site recovery files are placed in a temporary subdirectory
# called metamathsite, which persists until the end in case this script
# is aborted. Before deleting the metamathsite subdirectory, it is
# archived into metamathsite.tar.gz which will allow the site to be
# rebuilt on another machine.
# Remove old tmp directory (if it exists) and create new one
rm -rf tmpmetamathsite
if [ -d tmpmetamathsite ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'tmpmetamathsite'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
#DEBUG
#echo debugmkdirtmpmetamathsite2
mkdir tmpmetamathsite
# Copy home directory files; create needed subdirectories
for i in *
do
[ -f $i ] && cp -p $i tmpmetamathsite/
done
# We skip the tmpmetamathsite we're working on, of course; also, mpeuni
# and qleuni are fully automatically generated so we skip them too
#for i in `find . -type d -name "?*" | egrep -v "tmpmetamathsite|mpeuni|qleuni"`
# 16-Apr-2015 nm add nfeuni
# 12-Jul-2015 nm add holuni
# 21-Jul-2015 nm add ileuni
# for i in `find . -type d -name "?*" | egrep -v \
# 12-Jul-2015 match at least 2 characters so "." result will be skipped
for i in `find . -type d -name "??*" | egrep -v \
"tmpmetamathsite|mpeuni|qleuni|nfeuni|holuni|ileuni"`
do
mkdir tmpmetamathsite/$i
#????
#???? 7/12/15 What is going on here? Why is 'find' prefixing './'? From log:
#????
#???? + find . -type d -name ?*
#???? + egrep -v tmpmetamathsite|mpeuni|qleuni|nfeuni
#???? + mkdir tmpmetamathsite/.
#???? mkdir: cannot create directory `tmpmetamathsite/.': File exists
#???? + mkdir tmpmetamathsite/./mpegif
#???? + mkdir tmpmetamathsite/./metamath
#????
#???? I don't think this happened many years ago. Did they change 'find'?
done
# Remove any log files from previous (or this) run
[ -f tmpmetamathsite/install.log ] && rm -f tmpmetamathsite/install.log
[ -f tmpmetamathsite/nohup.out ] && rm -f tmpmetamathsite/nohup.out
# Copy subdirectories but omit the two "Explorer"s for now
#for i in `find . -type d -name "?*" | egrep -v \
# "tmpmetamathsite|mpegif|mpeuni|qlegif|qleuni"`
# 16-Apr-2015 nm add nfe
# 12-Jul-2015 nm add hol
# 21-Jul-2015 nm add ile
for i in `find . -type d -name "?*" | egrep -v \
"tmpmetamathsite|mpegif|mpeuni|qlegif|qleuni|nfegif|nfeuni|holgif|holuni|ilegif|ileuni"`
do
cp -p $i/* tmpmetamathsite/$i/
done
# Copy only manually-created files from the "Explorer"s
# Metamath Proof Explorer
cd mpegif
# Copy all the non-html files
find . -type f ! -name "*.html" -exec cp -p {} ../tmpmetamathsite/mpegif/ \;
# Delete any non-custom symbols that exist in the symbols directory
for i in *.gif
do
[ -f ../symbols/$i ] && rm -f ../tmpmetamathsite/mpegif/$i
done
# Delete files that will be copied from home directory
[ -f mm.gif ] && rm -f ../tmpmetamathsite/mpegif/mm.gif
[ -f favicon.ico ] && rm -f ../tmpmetamathsite/mpegif/favicon.ico
[ -f _nmemail.gif ] && rm -f ../tmpmetamathsite/mpegif/_nmemail.gif
# Our convention is that all manually-created html files begin with "mm"
cp -p mm*.html ../tmpmetamathsite/mpegif/
# But some of them are automatically generated, so we don't include them
# Omit the automatically-generated mm*.html files
[ -f mmtheorems.html ] && rm -f ../tmpmetamathsite/mpegif/mmtheorems*.html
[ -f mmdefinitions.html ] && rm -f ../tmpmetamathsite/mpegif/mmdefinitions.html
[ -f mmascii.html ] && rm -f ../tmpmetamathsite/mpegif/mmascii.html
# 16-Dec-2018: These are now generated from mm*.raw.html:
[ -f mmset.html ] && rm -f ../tmpmetamathsite/mpegif/mmset.html
[ -f mmcomplex.html ] && rm -f ../tmpmetamathsite/mpegif/mmcomplex.html
[ -f mmdeduction.html ] && rm -f ../tmpmetamathsite/mpegif/mmdeduction.html
[ -f mmnatded.html ] && rm -f ../tmpmetamathsite/mpegif/mmnatded.html
[ -f mmzfcnd.html ] && rm -f ../tmpmetamathsite/mpegif/mmzfcnd.html
cd ..
# Quantum Logic Explorer
cd qlegif
# Copy all the non-html files
find . -type f ! -name "*.html" -exec cp -p {} ../tmpmetamathsite/qlegif/ \;
# Delete any non-custom symbols that exist in the symbols directory
for i in *.gif
do
[ -f ../symbols/$i ] && rm -f ../tmpmetamathsite/qlegif/$i
done
# Delete any non-custom symbols that exist in the mpegif directory
for i in *.gif
do
[ -f ../mpegif/$i ] && rm -f ../tmpmetamathsite/qlegif/$i
done
# Delete font file if it already exists in mpegif directory
[ -f ../mpegif/xits-math.woff ] && \
rm -f ../tmpmetamathsite/qlegif/xits-math.woff
# Delete files that will be copied from home directory
[ -f favicon.ico ] && rm -f ../tmpmetamathsite/qlegif/favicon.ico
[ -f _nmemail.gif ] && rm -f ../tmpmetamathsite/qlegif/_nmemail.gif
# Our convention is that all manually-created html files begin with "mm"
cp -p mm*.html ../tmpmetamathsite/qlegif/
# Omit the automatically-generated mm*.html files
[ -f mmtheorems.html ] && rm -f ../tmpmetamathsite/qlegif/mmtheorems*.html
[ -f mmdefinitions.html ] && rm -f ../tmpmetamathsite/qlegif/mmdefinitions.html
[ -f mmascii.html ] && rm -f ../tmpmetamathsite/qlegif/mmascii.html
cd ..
# 16-Apr-2015 nm Add nfe
# New Foundations Explorer
cd nfegif
# Copy all the non-html files
find . -type f ! -name "*.html" -exec cp -p {} ../tmpmetamathsite/nfegif/ \;
# Delete any non-custom symbols that exist in the symbols directory
for i in *.gif
do
[ -f ../symbols/$i ] && rm -f ../tmpmetamathsite/nfegif/$i
done
# Delete any non-custom symbols that exist in the mpegif directory
for i in *.gif
do
[ -f ../mpegif/$i ] && rm -f ../tmpmetamathsite/nfegif/$i
done
# Delete font file if it already exists in mpegif directory
[ -f ../mpegif/xits-math.woff ] && \
rm -f ../tmpmetamathsite/nfegif/xits-math.woff
# Delete files that will be copied from home directory
[ -f favicon.ico ] && rm -f ../tmpmetamathsite/nfegif/favicon.ico
[ -f _nmemail.gif ] && rm -f ../tmpmetamathsite/nfegif/_nmemail.gif
# Our convention is that all manually-created html files begin with "mm"
cp -p mm*.html ../tmpmetamathsite/nfegif/
# Omit the automatically-generated mm*.html files
[ -f mmtheorems.html ] && rm -f ../tmpmetamathsite/nfegif/mmtheorems*.html
[ -f mmdefinitions.html ] && rm -f ../tmpmetamathsite/nfegif/mmdefinitions.html
[ -f mmascii.html ] && rm -f ../tmpmetamathsite/nfegif/mmascii.html
cd ..
# 12-Jul-2015 nm Add hol
# Higher-Order Logic Explorer
cd holgif
# Copy all the non-html files
find . -type f ! -name "*.html" -exec cp -p {} ../tmpmetamathsite/holgif/ \;
# Delete any non-custom symbols that exist in the symbols directory
for i in *.gif
do
[ -f ../symbols/$i ] && rm -f ../tmpmetamathsite/holgif/$i
done
# Delete any non-custom symbols that exist in the mpegif directory
for i in *.gif
do
[ -f ../mpegif/$i ] && rm -f ../tmpmetamathsite/holgif/$i
done
# Delete font file if it already exists in mpegif directory
[ -f ../mpegif/xits-math.woff ] && \
rm -f ../tmpmetamathsite/holgif/xits-math.woff
# Delete files that will be copied from home directory
[ -f favicon.ico ] && rm -f ../tmpmetamathsite/holgif/favicon.ico
[ -f _nmemail.gif ] && rm -f ../tmpmetamathsite/holgif/_nmemail.gif
# Our convention is that all manually-created html files begin with "mm"
cp -p mm*.html ../tmpmetamathsite/holgif/
# Omit the automatically-generated mm*.html files
[ -f mmtheorems.html ] && rm -f ../tmpmetamathsite/holgif/mmtheorems*.html
[ -f mmdefinitions.html ] && rm -f ../tmpmetamathsite/holgif/mmdefinitions.html
[ -f mmascii.html ] && rm -f ../tmpmetamathsite/holgif/mmascii.html
cd ..
# 21-Jul-2015 nm Add ile
# Intuitionistic Logic Explorer
cd ilegif
# Copy all the non-html files
find . -type f ! -name "*.html" -exec cp -p {} ../tmpmetamathsite/ilegif/ \;
# Delete any non-custom symbols that exist in the symbols directory
for i in *.gif
do
[ -f ../symbols/$i ] && rm -f ../tmpmetamathsite/ilegif/$i
done
# Delete any non-custom symbols that exist in the mpegif directory
for i in *.gif
do
[ -f ../mpegif/$i ] && rm -f ../tmpmetamathsite/ilegif/$i
done
# Delete font file if it already exists in mpegif directory
[ -f ../mpegif/xits-math.woff ] && \
rm -f ../tmpmetamathsite/ilegif/xits-math.woff
# Delete files that will be copied from home directory
[ -f favicon.ico ] && rm -f ../tmpmetamathsite/ilegif/favicon.ico
[ -f _nmemail.gif ] && rm -f ../tmpmetamathsite/ilegif/_nmemail.gif
# Our convention is that all manually-created html files begin with "mm"
cp -p mm*.html ../tmpmetamathsite/ilegif/
# Omit the automatically-generated mm*.html files
[ -f mmtheorems.html ] && rm -f ../tmpmetamathsite/ilegif/mmtheorems*.html
[ -f mmdefinitions.html ] && rm -f ../tmpmetamathsite/ilegif/mmdefinitions.html
[ -f mmascii.html ] && rm -f ../tmpmetamathsite/ilegif/mmascii.html
cd ..
# Metamath Solitaire
cd mmsolitaire
# Delete any non-custom symbols that exist in the symbols directory
for i in *.gif
do
[ -f ../symbols/$i ] && rm -f ../tmpmetamathsite/mmsolitaire/$i
done
# Delete any symbols that exist in the mpegif directory
for i in *.gif
do
[ -f ../mpegif/$i ] && rm -f ../tmpmetamathsite/mmsolitaire/$i
done
# Delete files that will be copied from home directory
[ -f mm.gif ] && rm -f ../tmpmetamathsite/mmsolitaire/mm.gif
[ -f favicon.ico ] && rm -f ../tmpmetamathsite/mmsolitaire/favicon.ico
[ -f _nmemail.gif ] && rm -f ../tmpmetamathsite/mmsolitaire/_nmemail.gif
cd ..
# GIF Images for Math Symbols
cd symbols
# Delete files that will be copied from home directory
[ -f mm.gif ] && rm -f ../tmpmetamathsite/symbols/mm.gif
[ -f favicon.ico ] && rm -f ../tmpmetamathsite/symbols/favicon.ico
[ -f _nmemail.gif ] && rm -f ../tmpmetamathsite/symbols/_nmemail.gif
#[ -f valid-html401.png ] && rm -f ../tmpmetamathsite/symbols/valid-html401.png
cd ..
# LaTeX directory
cd latex
# Remove auxilliary files created by LaTeX (all files but *.tex)
find . -type f ! -name "*.tex" -exec rm -f ../tmpmetamathsite/latex/{} \;
cd ..
# 6-Jun-2021
echo "install.sh time create downloads: `date`"
# Download directory
# Remove the automatically-generated compressed downloads; by convention these
# are ones whose prefix is a directory name
#for i in mpegif mpeuni qlegif qleuni mmsolitaire symbols metamathsite metamath
# 16-Apr-2015 nm Added nfe
# 12-Jul-2015 nm Added hol
# 21-Jul-2015 nm Added ile
for i in mpegif mpeuni qlegif qleuni nfegif nfeuni holgif holuni ilegif ileuni \
mmsolitaire symbols metamathsite metamath
do
[ -f downloads/${i}.tar.bz2 ] && rm -f tmpmetamathsite/downloads/${i}.tar.bz2
[ -f downloads/${i}.tar.gz ] && rm -f tmpmetamathsite/downloads/${i}.tar.gz
[ -f downloads/${i}.zip ] && rm -f tmpmetamathsite/downloads/${i}.zip
done
# Remove the automatically-created .pdf files
#
# Note: megillaward2005he and megillaward2005eu are not included
# because they contain false pdflatex errors that make checking the log
# for errors confusing. Therefore, their pdfs are permanently stored in
# the downloads directory instead of being recompiled each time.
#
# 6-Feb-2018 leave metamath.pdf alone for now
#for i in metamath finiteaxiom megillaward2003 megillaward2004
for i in finiteaxiom megillaward2003 megillaward2004
do
[ -f downloads/${i}.pdf ] && rm -f tmpmetamathsite/downloads/${i}.pdf
done
# Remove all but one compressed quantum-logic - leave the .bz2
[ -f downloads/quantum-logic.tar.gz ] && rm -f tmpmetamathsite/downloads/quantum-logic.tar.gz
[ -f downloads/quantum-logic.zip ] && rm -f tmpmetamathsite/downloads/quantum-logic.zip
# Remove any previous (platform-dependent) metamath compilation left
# over from an aborted run
[ -f metamath/metamath ] && rm -f tmpmetamathsite/metamath/metamath
# 4-Feb-2005 Remove README files - they will be recreated from rdme-xxx.txt
# 15-Sep-2016 This is dangerous - it deleted completeusersproof__README.TXT,
# so it had to be renamed something else TODO: explicitly enumerate
# the actual files to be deleted
rm -f */*README*
rm -f *README*
# Keep the top-level LICENSE file
rm -f */LICENSE.TXT
# We're now done creating the minimal site master backup; rename it
# First delete any old metamathsite (shouldn't exist but just in case)
rm -rf metamathsite
if [ -d metamathsite ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'metamathsite'."
echo "Is someone else using that subdirectory?"
echo "On Windows, please reboot before running install.sh again."
exit 1
fi
mv tmpmetamathsite metamathsite
if [ -d tmpmetamathsite ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not rename the subdirectory 'tmpmetamathsite'."
echo "Is someone else using that subdirectory?"
echo "On Windows, please reboot before running install.sh again."
exit 1
fi
########### End of creating minimal site master ###############
########### Compile Metamath #############
cd metamath
# Make sure the Windows version is executable under Cygwin
[ -f metamath.exe ] && chmod +x metamath.exe
echo "Compiling Metamath..."
if $CYGWIN ; then
# Save the original Windows metamath.exe in case we're running on Cygwin,
# because in Cygwin, gcc appends .exe to the compiled file name
[ -f metamath.exe ] && mv metamath.exe metamath.exe-save
fi
gcc m*.c -o metamath -O3 -funroll-loops -finline-functions \
-fomit-frame-pointer -Wall -pedantic -fno-strict-overflow
cd ..
######## Generate Metamath Proof Explorer ############
# Copy manually-created files. The mpegif directory is assumed to contain
# the lastest "master" versions of them. The mpeuni directory is discarded.
mkdir mpegif-new
# 9/3/14 nm This is so Mario can add files
chmod a+w mpegif-new
cp -p metamathsite/mpegif/* mpegif-new/
[ -f favicon.ico ] && cp -p favicon.ico mpegif-new/
[ -f _nmemail.gif ] && cp -p _nmemail.gif mpegif-new/
[ -f mm.gif ] && cp -p mm.gif mpegif-new/
# Copy the non-custom symbols from the symbols subdirectory, plus mm.gif
# 30-Nov-2013 Changed iota to riota
# Note: parallel.gif is for Paul Chapman's mathbox
# Note: top.gif is for Anthony Hart's mathbox
# Note: cpi oplus wbox wdiamond are for FL's mathbox
# Note: bbi simeq sub1 subb subh subp subr subt supn are for Jeff Madsen's mathbox
# Note: subw subin models subg phi prod are for Mario Carneiro's mathbox 28-Feb-2014
# Note: subo added for 3o,4o 25-Aug-2013 (3o,4o may become single gif someday)
# Note: bbe for Scott Fenton's mathbox: Unicode is way too big
# Note: zeta for Mario Carneiro's mathbox. Warning: conflict w/ _zeta as var
# Note: int sub2 rmd for Mario Carneiro's mathbox 3/23/14
# Note: bbp....veebar for Mario Carneiro's gif conversion 4/2/14
# Note: cgamma bba subf cx for Mario 7/27/14
# Note: Is r.gif necessary? (Check ^r htmldef resolution.) 11/29/15
# Note: bigtriangleup added 4/26/20
# Note: ltimes for Peter Mazsa's mathbox 2/17/22
for i in \
0 1 2 3 4 5 6 7 8 9 amp approx ast backquote backtick bang \
barwedge bbc bbn bbq \
bbr bbz bigcap bigcup bigto caln calp calq calr cap cdot \
circ clambda colon \
comma csigma cup diagup eq equiv exists forall gamma im in riota \
langle lbrace lbrack ldots leftrightarrow le lfloor lnot \
longrightarrow lp lt mapsto minus ne notin \
omega onetoone onetooneonto onto perp pi plus \
preccurlyeq prec rangle \
rbrace rbrack re restriction rightsquigarrow rmcc rmce rmci rmcv rme rmi \
rp scrh scrp setminus \
shortminus smallsmile solidus subseteq subsetneq supast surd times to \
uparrow varnothing vee vert wedge varaleph lessdot mm \
parallel \
top \
cpi oplus wbox wdiamond \
bbi simeq sub1 subb sube subh subp subr subt supn \
subw subin models subg phi prod \
subo \
bbe \
zeta \
int sub2 rmd \
bbp blacktriangleright llangle octothorpe otimes period rmcp \
rrangle sub0 sub3 sub4 suba subc subcp subcr subm subminus \
subrmw subs subv sup3 t veebar \
cgamma bba subf cx cc rmcd cl sup1 co sigma theta mu subcl \
comega subk subn subu gt ge pm infty r quote finv tau \
bigtriangleup \
ltimes
do
[ -f symbols/${i}.gif ] && cp -p symbols/${i}.gif mpegif-new/
done
# All manually-created files are the same for both gif and symbol-font versions
mkdir mpeuni-new
# 9/3/14 nm This is so Mario can add files
chmod a+w mpeuni-new
cp -p mpegif-new/* mpeuni-new/
# 6-Jun-2021
echo "install.sh time start mpegif: `date`"
cd mpegif-new
# 16-Dec-2018 nm Added markup mm*.raw.html - note that this must be
# done first so that mmset.html, mmhil.html will exist to check
# bibliography references during 'show statement' etc.
# show statement... = regenerate proof pages
# write bibliography... = refresh bibiographic cross-reference
# write recent_additions... = refresh recent additions
../metamath/metamath "read '../metamath/set.mm'" \
"markup mmset.raw.html mmset.html /html /symbols /css /labels" \
"markup mmcomplex.raw.html mmcomplex.html /html /symbols /css /labels" \
"markup mmdeduction.raw.html mmdeduction.html /html /symbols /css /labels" \
"markup mmnatded.raw.html mmnatded.html /html /symbols /css /labels" \
"markup mmzfcnd.raw.html mmzfcnd.html /html /symbols /css /labels" \
"markup mmfrege.raw.html mmfrege.html /html /symbols /css /labels" \
"show statement */html/time" \
"write theorem_list /html /theorems_per_page 100 /show_lemmas" \
"write bibliography mmbiblio.html" \
"write recent_additions mmrecent.html /html /limit 100" \
"write recent_additions mmrecent.html /html /limit 1000" \
"exit"
rm -f mmtheorems.html~1
rm -f mmbiblio.html~1
rm -f mmrecent.html~2
mv mmrecent.html mmrecent1000.html
mv mmrecent.html~1 mmrecent.html
cd ..
# There should not be an old one, but just in case
rm -rf mpegif-old
if [ -d mpegif-old ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'mpegif-old'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
mv mpegif mpegif-old
if [ -d mpegif ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not rename the subdirectory 'mpegif'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
mv mpegif-new mpegif
if [ -d mpegif-new ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not rename the subdirectory 'mpegif-new'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
rm -rf mpegif-old
if [ -d mpegif-old ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'mpegif-old'."
echo "Is someone else using that subdirectory?"
echo "On Windows, please reboot before running install.sh again."
exit 1
fi
# 6-Jun-2021
echo "install.sh time start mpeuni: `date`"
cd mpeuni-new
# 16-Dec-2018 nm Added markup mm*.raw.html
# show statement... = regenerate proof pages (alt_html = Unicode version)
# write bibliography... = refresh bibiographic cross-reference
# write recent_additions... = refresh recent additions
../metamath/metamath "read '../metamath/set.mm'" \
"markup mmset.raw.html mmset.html /alt_html /symbols /css /labels" \
"markup mmcomplex.raw.html mmcomplex.html /alt_html /symbols /css /labels" \
"markup mmdeduction.raw.html mmdeduction.html /alt_html /symbols /css /labels" \
"markup mmnatded.raw.html mmnatded.html /alt_html /symbols /css /labels" \
"markup mmzfcnd.raw.html mmzfcnd.html /alt_html /symbols /css /labels" \
"markup mmfrege.raw.html mmfrege.html /alt_html /symbols /css /labels" \
"show statement */alt_html/time" \
"write theorem_list /alt_html /theorems_per_page 100 /show_lemmas" \
"write bibliography mmbiblio.html" \
"write recent_additions mmrecent.html /alt_html / limit 100" \
"write recent_additions mmrecent.html /alt_html / limit 1000" \
"exit"
rm -f mmtheorems.html~1
rm -f mmbiblio.html~1
rm -f mmrecent.html~2
mv mmrecent.html mmrecent1000.html
mv mmrecent.html~1 mmrecent.html
cd ..
if ! [ -d mpeuni ] ; then
# We're doing an initial build, not a rebuild
mkdir mpeuni
fi
# There should not be an old one, but just in case
rm -rf mpeuni-old
if [ -d mpeuni-old ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'mpeuni-old'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
mv mpeuni mpeuni-old
if [ -d mpeuni ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not rename the subdirectory 'mpeuni'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
mv mpeuni-new mpeuni
if [ -d mpeuni-new ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not rename the subdirectory 'mpeuni-new'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
rm -rf mpeuni-old
if [ -d mpeuni-old ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'mpeuni-old'."
echo "Is someone else using that subdirectory?"
echo "On Windows, please reboot before running install.sh again."
exit 1
fi
######## Generate Quantum Logic Explorer ############
# Copy manually-created files. The qlegif directory is assumed to contain
# the lastest "master" versions of them. The qleuni directory is discarded.
mkdir qlegif-new
cp -p metamathsite/qlegif/* qlegif-new/
[ -f favicon.ico ] && cp -p favicon.ico qlegif-new/
[ -f _nmemail.gif ] && cp -p _nmemail.gif qlegif-new/
# Copy the non-custom symbols needed from the symbols subdirectory
for i in \
0 1 amp bigto cap cc comma cup eq equiv le lnot lp rp to \
vee supperp langle rangle perp
do
[ -f symbols/${i}.gif ] && cp -p symbols/${i}.gif qlegif-new/
done
# Copy the custom symbols needed from the mpegif subdirectory
for i in _scrch _veeh _vdash _wff bn65_20 spacer _bi
do
[ -f mpegif/${i}.gif ] && cp -p mpegif/${i}.gif qlegif-new/
done
# Copy font file from mpegif directory
[ -f mpegif/xits-math.woff ] && \
cp -p mpegif/xits-math.woff qlegif-new/
# All manually-created files are the same for both gif and symbol-font versions
mkdir qleuni-new
cp -p qlegif-new/* qleuni-new/
# 6-Jun-2021
echo "install.sh time start qlegif and others: `date`"
# Regenerate proof pages
cd qlegif-new
../metamath/metamath "read '../metamath/ql.mm'" \
"show statement */html" \
"write theorem_list /theorems_per_page 100 /show_lemmas" \
"exit"
rm -f mmtheorems.html~1
cd ..
# There should not be an old one, but just in case
rm -rf qlegif-old
if [ -d qlegif-old ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'qlegif-old'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
mv qlegif qlegif-old
if [ -d qlegif ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not rename the subdirectory 'qlegif'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
mv qlegif-new qlegif
if [ -d qlegif-new ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not rename the subdirectory 'qlegif-new'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
rm -rf qlegif-old
if [ -d qlegif-old ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'qlegif-old'."
echo "Is someone else using that subdirectory?"
echo "On Windows, please reboot before running install.sh again."
exit 1
fi
cd qleuni-new
../metamath/metamath "read '../metamath/ql.mm'" \
"show statement */alt_html" \
"write theorem_list /theorems_per_page 100 /show_lemmas" \
"exit"
rm -f mmtheorems.html~1
cd ..
if ! [ -d qleuni ] ; then
# We're doing an initial build, not a rebuild
mkdir qleuni
fi
# There should not be an old one, but just in case
rm -rf qleuni-old
if [ -d qleuni-old ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'qleuni-old'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
mv qleuni qleuni-old
if [ -d qleuni ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not rename the subdirectory 'qleuni'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
mv qleuni-new qleuni
if [ -d qleuni-new ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not rename the subdirectory 'qleuni-new'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
rm -rf qleuni-old
if [ -d qleuni-old ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'qleuni-old'."
echo "Is someone else using that subdirectory?"
echo "On Windows, please reboot before running install.sh again."
exit 1
fi
# 16-Apr-2015 nm Added nfe
######## Generate New Foundations Explorer ############
# Copy manually-created files. The nfegif directory is assumed to contain
# the lastest "master" versions of them. The nfeuni directory is discarded.
mkdir nfegif-new
cp -p metamathsite/nfegif/* nfegif-new/
[ -f favicon.ico ] && cp -p favicon.ico nfegif-new/
[ -f _nmemail.gif ] && cp -p _nmemail.gif nfegif-new/
# Copy the non-custom symbols needed from the symbols subdirectory
for i in \
bigto amp \
backquote backquote lp oplus varnothing otimes rp comma longrightarrow \
lnot barwedge onetoone onetooneonto to onto solidus diagup wedge colon \
leftrightarrow langle llangle lt le le lt eq ne rangle rrangle forall \
subsetneq subseteq exists perp top bigcup times times lbrack setminus vee \
rbrack rmce rmci rmci rmcv backtick in notin cap riota circ circ cup \
lbrace vert mapsto bigcap restriction rbrace scrp scrp approx finv \
veebar
do
[ -f symbols/${i}.gif ] && cp -p symbols/${i}.gif nfegif-new/
done
# Copy the custom symbols needed from the mpegif subdirectory
# 18-Aug-2016 nm Added _.plus.gif ... _.vee.gif needed by nf.mm
# 6-Jun-2019 nm _set -> _setvar
for i in \
_plc _plus _wedge _le _vee _1st _2nd _ca _cb _cc _cd _ce _e1 _em1 _cf \
_fix _fn _fun _cg _ch _ci _isom _cj _ck _cl _cm _cn _co _cp _cq _cr _rel \
_cs _ct _cu _cupbar _cv _cw _cx _cy _cz _ulbrack _urbrack _hatm _hatpm \
_cnv _cnv _a _b _c _chi _class _d _dom _e _eta _f _g _h _i _if _j _k \
_kappa _l _lambda _m _mu _n _o _p _varphi _psi _q _r _ran _rho _s _setvar \
_sigma _t _tau _theta _u _v _w _wff _x _y _z _zeta _vdash _capbar \
_.plus _.wedge _.le _.vee \
_.oplus _.otimes _.ast _.plushat _.plusb _.comma _.minus _.solidus _.0 \
_.bf0 _.1 _.lt _.times _.uparrow _.perp _.cdot _.bullet _.parallel _.sim \
_finvbar _dlbrack _drbrack
do
[ -f mpegif/${i}.gif ] && cp -p mpegif/${i}.gif nfegif-new/
done
# Copy font file from mpegif directory
[ -f mpegif/xits-math.woff ] && \
cp -p mpegif/xits-math.woff nfegif-new/
# 18-Oct-2015 nm The customized mmbiblio.html template now has a
# globally-unique name to prevent confusion during editing
[ -f nfegif-new/mmbiblio_NF.html ] && \
cp -p nfegif-new/mmbiblio_NF.html nfegif-new/mmbiblio.html
# All manually-created files are the same for both gif and symbol-font versions
mkdir nfeuni-new
cp -p nfegif-new/* nfeuni-new/
# Regenerate proof pages
cd nfegif-new
../metamath/metamath "read '../metamath/nf.mm'" \
"markup mmnf.raw.html mmnf.html /html /symbols /css /labels" \
"show statement */html" \
"write theorem_list /theorems_per_page 100 /show_lemmas" \
"write bibliography mmbiblio.html" \
"exit"
rm -f mmtheorems.html~1
cd ..
# There should not be an old one, but just in case
rm -rf nfegif-old
if [ -d nfegif-old ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'nfegif-old'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
mv nfegif nfegif-old
if [ -d nfegif ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not rename the subdirectory 'nfegif'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
mv nfegif-new nfegif
if [ -d nfegif-new ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not rename the subdirectory 'nfegif-new'."
echo "Is someone else using that subdirectory?"
echo "If this is Windows, please reboot before running install.sh again."
exit 1
fi
rm -rf nfegif-old
if [ -d nfegif-old ] ; then
# See comment about Windows XP above.
echo "?Fatal error: Could not delete the subdirectory 'nfegif-old'."
echo "Is someone else using that subdirectory?"
echo "On Windows, please reboot before running install.sh again."
exit 1
fi