Subversion Repositories SvarDOS

Rev

Rev 185 | Rev 192 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
134 mv_fox 1
#!/bin/bash
11 mv_fox 2
#
180 mateuszvis 3
# SvarDOS build script
4
# http://svardos.osdn.io
5
# Copyright (C) 2016-2021 Mateusz Viste
148 mv_fox 6
#
180 mateuszvis 7
# This script generates the SvarDOS repository index and builds ISO CD images.
8
# It should be executed each time that a package has been modified, added or
9
# removed.
11 mv_fox 10
#
2 mv_fox 11
 
11 mv_fox 12
### parameters block starts here ############################################
13
 
180 mateuszvis 14
PKGDIR=`realpath ./packages`
15
REPOROOT=`realpath ./website/repo`
185 mateuszvis 16
BUILDIDX=`realpath ./buildidx/buildidx`
180 mateuszvis 17
PUBDIR=`realpath ./website/download`
148 mv_fox 18
CDROOT=`realpath ./cdroot`
19
CUSTFILES=`realpath ./files`
2 mv_fox 20
 
171 mv_fox 21
GENISOIMAGE=''    # can be mkisofs, genisoimage or empty for autodetection
22
 
11 mv_fox 23
### parameters block ends here ##############################################
24
 
171 mv_fox 25
# auto-detect whether to use mkisofs or genisoimage
26
 
27
if [ "x$GENISOIMAGE" == "x" ] ; then
180 mateuszvis 28
mkisofs --help 2> /dev/null
171 mv_fox 29
if [ $? -eq 0 ] ; then
30
  GENISOIMAGE='mkisofs'
31
fi
32
fi
33
 
34
if [ "x$GENISOIMAGE" == "x" ] ; then
180 mateuszvis 35
genisoimage --help 2> /dev/null
171 mv_fox 36
if [ $? -eq 0 ] ; then
37
  GENISOIMAGE='genisoimage'
38
fi
39
fi
40
 
41
if [ "x$GENISOIMAGE" == "x" ] ; then
42
  echo "ERROR: neither genisoimage nor mkisofs was found on this system"
43
  exit 1
44
fi
45
 
46
 
180 mateuszvis 47
# abort if anything fails
48
set -e
134 mv_fox 49
 
50
 
180 mateuszvis 51
# function that builds the packages repository
52
function dorepo {
53
  # copy all zip files to the web repo
54
  cp "$PKGDIR"/* $REPOROOT/
55
  # now strip the sources from repo versions
56
  find "$REPOROOT/" -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
57
  find "$REPOROOT/" -iname '*.zip' -exec zip "{}" -d "source/*" ';'
58
  find "$REPOROOT/" -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
134 mv_fox 59
 
180 mateuszvis 60
  # build repo idx
61
  $BUILDIDX "$REPOROOT/"
134 mv_fox 62
}
63
 
64
### actual code flow starts here ############################################
65
 
148 mv_fox 66
# check presence of the buildidx tool
67
if [ ! -f "$BUILDIDX" ] ; then
68
  echo "buildidx not found at $BUILDIDX"
112 mv_fox 69
  exit 1
70
fi
71
 
148 mv_fox 72
# remember where I am, so I can get back here once all is done
11 mv_fox 73
origdir=`pwd`
74
 
189 mateuszvis 75
mkdir "$CDROOT"
76
 
180 mateuszvis 77
# build the boot (install) floppy image first
44 mv_fox 78
cp $CUSTFILES/bootmini.img $CDROOT/boot.img
52 mv_fox 79
export MTOOLS_NO_VFAT=1
148 mv_fox 80
mcopy -sQm -i "$CDROOT/boot.img" $CUSTFILES/floppy/* ::/
81
if [ $? -ne 0 ] ; then exit 1 ; fi
44 mv_fox 82
 
189 mateuszvis 83
# link CORE packages to CDROOT
84
mkdir -p "$CDROOT/CORE"
85
cp "$REPOROOT/udvd2.zip" "$CDROOT/CORE/"
86
cp "$REPOROOT/append.zip" "$CDROOT/CORE/"
87
cp "$REPOROOT/assign.zip" "$CDROOT/CORE/"
88
cp "$REPOROOT/attrib.zip" "$CDROOT/CORE/"
89
cp "$REPOROOT/chkdsk.zip" "$CDROOT/CORE/"
90
cp "$REPOROOT/choice.zip" "$CDROOT/CORE/"
91
cp "$REPOROOT/command.zip" "$CDROOT/CORE/"
92
cp "$REPOROOT/comp.zip" "$CDROOT/CORE/"
93
cp "$REPOROOT/cpidos.zip" "$CDROOT/CORE/"
94
cp "$REPOROOT/ctmouse.zip" "$CDROOT/CORE/"
95
cp "$REPOROOT/debug.zip" "$CDROOT/CORE/"
96
cp "$REPOROOT/defrag.zip" "$CDROOT/CORE/"
97
cp "$REPOROOT/deltree.zip" "$CDROOT/CORE/"
98
cp "$REPOROOT/devload.zip" "$CDROOT/CORE/"
99
cp "$REPOROOT/diskcomp.zip" "$CDROOT/CORE/"
100
cp "$REPOROOT/diskcopy.zip" "$CDROOT/CORE/"
101
cp "$REPOROOT/display.zip" "$CDROOT/CORE/"
102
cp "$REPOROOT/dosfsck.zip" "$CDROOT/CORE/"
103
cp "$REPOROOT/edit.zip" "$CDROOT/CORE/"
104
cp "$REPOROOT/edlin.zip" "$CDROOT/CORE/"
105
cp "$REPOROOT/exe2bin.zip" "$CDROOT/CORE/"
106
cp "$REPOROOT/fc.zip" "$CDROOT/CORE/"
107
cp "$REPOROOT/fdapm.zip" "$CDROOT/CORE/"
108
cp "$REPOROOT/fdisk.zip" "$CDROOT/CORE/"
109
cp "$REPOROOT/fdnpkg.zip" "$CDROOT/CORE/"
110
cp "$REPOROOT/find.zip" "$CDROOT/CORE/"
111
cp "$REPOROOT/format.zip" "$CDROOT/CORE/"
112
cp "$REPOROOT/help.zip" "$CDROOT/CORE/"
113
cp "$REPOROOT/himemx.zip" "$CDROOT/CORE/"
114
cp "$REPOROOT/kernel.zip" "$CDROOT/CORE/"
115
cp "$REPOROOT/keyb.zip" "$CDROOT/CORE/"
116
cp "$REPOROOT/keyb_lay.zip" "$CDROOT/CORE/"
117
cp "$REPOROOT/label.zip" "$CDROOT/CORE/"
118
cp "$REPOROOT/lbacache.zip" "$CDROOT/CORE/"
119
cp "$REPOROOT/mem.zip" "$CDROOT/CORE/"
120
cp "$REPOROOT/mirror.zip" "$CDROOT/CORE/"
121
cp "$REPOROOT/mode.zip" "$CDROOT/CORE/"
122
cp "$REPOROOT/more.zip" "$CDROOT/CORE/"
123
cp "$REPOROOT/move.zip" "$CDROOT/CORE/"
124
cp "$REPOROOT/nansi.zip" "$CDROOT/CORE/"
125
cp "$REPOROOT/nlsfunc.zip" "$CDROOT/CORE/"
126
cp "$REPOROOT/print.zip" "$CDROOT/CORE/"
127
cp "$REPOROOT/rdisk.zip" "$CDROOT/CORE/"
128
cp "$REPOROOT/recover.zip" "$CDROOT/CORE/"
129
cp "$REPOROOT/replace.zip" "$CDROOT/CORE/"
130
cp "$REPOROOT/share.zip" "$CDROOT/CORE/"
131
cp "$REPOROOT/shsucdx.zip" "$CDROOT/CORE/"
132
cp "$REPOROOT/sort.zip" "$CDROOT/CORE/"
133
cp "$REPOROOT/swsubst.zip" "$CDROOT/CORE/"
134
cp "$REPOROOT/tree.zip" "$CDROOT/CORE/"
135
cp "$REPOROOT/undelete.zip" "$CDROOT/CORE/"
136
cp "$REPOROOT/xcopy.zip" "$CDROOT/CORE/"
137
 
180 mateuszvis 138
# build the repo (also builds the listing.txt file)
139
dorepo
16 mv_fox 140
 
180 mateuszvis 141
# delete previous (if any) *.iso and *.md5 files
148 mv_fox 142
echo "cleaning up old versions..."
180 mateuszvis 143
rm -f "$PUBDIR/svardos.iso" "$PUBDIR/svardos.iso.md5"
25 mv_fox 144
 
180 mateuszvis 145
CDISO="$PUBDIR/svardos.iso"
162 mv_fox 146
 
180 mateuszvis 147
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT"
11 mv_fox 148
if [ $? -ne 0 ] ; then exit 1 ; fi
2 mv_fox 149
 
189 mateuszvis 150
# cleanup CDROOT
151
rm -rf "$CDROOT"
152
 
180 mateuszvis 153
# compute the MD5 of the ISO file, taking care to include only the filename in it
16 mv_fox 154
echo "computing md5 sums..."
148 mv_fox 155
cd `dirname "$CDISO"`
156
md5sum `basename "$CDISO"` > "$CDISO.md5"
157
if [ $? -ne 0 ] ; then exit 1 ; fi
11 mv_fox 158
 
159
cd "$origdir"
160
 
180 mateuszvis 161
#cd svnlschk
162
#./webgen.sh
163
#cd ..
165 mv_fox 164
 
180 mateuszvis 165
echo "ALL DONE!"
16 mv_fox 166
 
2 mv_fox 167
exit 0