Subversion Repositories SvarDOS

Rev

Rev 185 | Rev 192 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 185 Rev 189
1
#!/bin/bash
1
#!/bin/bash
2
#
2
#
3
# SvarDOS build script
3
# SvarDOS build script
4
# http://svardos.osdn.io
4
# http://svardos.osdn.io
5
# Copyright (C) 2016-2021 Mateusz Viste
5
# Copyright (C) 2016-2021 Mateusz Viste
6
#
6
#
7
# This script generates the SvarDOS repository index and builds ISO CD images.
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
8
# It should be executed each time that a package has been modified, added or
9
# removed.
9
# removed.
10
#
10
#
11
 
11
 
12
### parameters block starts here ############################################
12
### parameters block starts here ############################################
13
 
13
 
14
PKGDIR=`realpath ./packages`
14
PKGDIR=`realpath ./packages`
15
REPOROOT=`realpath ./website/repo`
15
REPOROOT=`realpath ./website/repo`
16
BUILDIDX=`realpath ./buildidx/buildidx`
16
BUILDIDX=`realpath ./buildidx/buildidx`
17
PUBDIR=`realpath ./website/download`
17
PUBDIR=`realpath ./website/download`
18
CDROOT=`realpath ./cdroot`
18
CDROOT=`realpath ./cdroot`
19
CUSTFILES=`realpath ./files`
19
CUSTFILES=`realpath ./files`
20
 
20
 
21
GENISOIMAGE=''    # can be mkisofs, genisoimage or empty for autodetection
21
GENISOIMAGE=''    # can be mkisofs, genisoimage or empty for autodetection
22
 
22
 
23
### parameters block ends here ##############################################
23
### parameters block ends here ##############################################
24
 
24
 
25
# auto-detect whether to use mkisofs or genisoimage
25
# auto-detect whether to use mkisofs or genisoimage
26
 
26
 
27
if [ "x$GENISOIMAGE" == "x" ] ; then
27
if [ "x$GENISOIMAGE" == "x" ] ; then
28
mkisofs --help 2> /dev/null
28
mkisofs --help 2> /dev/null
29
if [ $? -eq 0 ] ; then
29
if [ $? -eq 0 ] ; then
30
  GENISOIMAGE='mkisofs'
30
  GENISOIMAGE='mkisofs'
31
fi
31
fi
32
fi
32
fi
33
 
33
 
34
if [ "x$GENISOIMAGE" == "x" ] ; then
34
if [ "x$GENISOIMAGE" == "x" ] ; then
35
genisoimage --help 2> /dev/null
35
genisoimage --help 2> /dev/null
36
if [ $? -eq 0 ] ; then
36
if [ $? -eq 0 ] ; then
37
  GENISOIMAGE='genisoimage'
37
  GENISOIMAGE='genisoimage'
38
fi
38
fi
39
fi
39
fi
40
 
40
 
41
if [ "x$GENISOIMAGE" == "x" ] ; then
41
if [ "x$GENISOIMAGE" == "x" ] ; then
42
  echo "ERROR: neither genisoimage nor mkisofs was found on this system"
42
  echo "ERROR: neither genisoimage nor mkisofs was found on this system"
43
  exit 1
43
  exit 1
44
fi
44
fi
45
 
45
 
46
 
46
 
47
# abort if anything fails
47
# abort if anything fails
48
set -e
48
set -e
49
 
49
 
50
 
50
 
51
# function that builds the packages repository
51
# function that builds the packages repository
52
function dorepo {
52
function dorepo {
53
  # copy all zip files to the web repo
53
  # copy all zip files to the web repo
54
  cp "$PKGDIR"/* $REPOROOT/
54
  cp "$PKGDIR"/* $REPOROOT/
55
  # now strip the sources from repo versions
55
  # now strip the sources from repo versions
56
  find "$REPOROOT/" -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
56
  find "$REPOROOT/" -iname '*.zip' -exec zip "{}" -d "SOURCE/*" ';'
57
  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/*" ';'
58
  find "$REPOROOT/" -iname '*.zip' -exec zip "{}" -d "Source/*" ';'
59
 
59
 
60
  # build repo idx
60
  # build repo idx
61
  $BUILDIDX "$REPOROOT/"
61
  $BUILDIDX "$REPOROOT/"
62
}
62
}
63
 
63
 
64
### actual code flow starts here ############################################
64
### actual code flow starts here ############################################
65
 
65
 
66
# check presence of the buildidx tool
66
# check presence of the buildidx tool
67
if [ ! -f "$BUILDIDX" ] ; then
67
if [ ! -f "$BUILDIDX" ] ; then
68
  echo "buildidx not found at $BUILDIDX"
68
  echo "buildidx not found at $BUILDIDX"
69
  exit 1
69
  exit 1
70
fi
70
fi
71
 
71
 
72
# remember where I am, so I can get back here once all is done
72
# remember where I am, so I can get back here once all is done
73
origdir=`pwd`
73
origdir=`pwd`
74
 
74
 
-
 
75
mkdir "$CDROOT"
-
 
76
 
75
# build the boot (install) floppy image first
77
# build the boot (install) floppy image first
76
cp $CUSTFILES/bootmini.img $CDROOT/boot.img
78
cp $CUSTFILES/bootmini.img $CDROOT/boot.img
77
export MTOOLS_NO_VFAT=1
79
export MTOOLS_NO_VFAT=1
78
mcopy -sQm -i "$CDROOT/boot.img" $CUSTFILES/floppy/* ::/
80
mcopy -sQm -i "$CDROOT/boot.img" $CUSTFILES/floppy/* ::/
79
if [ $? -ne 0 ] ; then exit 1 ; fi
81
if [ $? -ne 0 ] ; then exit 1 ; fi
80
 
82
 
-
 
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
 
81
# build the repo (also builds the listing.txt file)
138
# build the repo (also builds the listing.txt file)
82
dorepo
139
dorepo
83
 
140
 
84
# delete previous (if any) *.iso and *.md5 files
141
# delete previous (if any) *.iso and *.md5 files
85
echo "cleaning up old versions..."
142
echo "cleaning up old versions..."
86
rm -f "$PUBDIR/svardos.iso" "$PUBDIR/svardos.iso.md5"
143
rm -f "$PUBDIR/svardos.iso" "$PUBDIR/svardos.iso.md5"
87
 
144
 
88
CDISO="$PUBDIR/svardos.iso"
145
CDISO="$PUBDIR/svardos.iso"
89
 
146
 
90
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT"
147
$GENISOIMAGE -input-charset cp437 -b boot.img -iso-level 1 -f -V SVARDOS -o "$CDISO" "$CDROOT"
91
if [ $? -ne 0 ] ; then exit 1 ; fi
148
if [ $? -ne 0 ] ; then exit 1 ; fi
92
 
149
 
-
 
150
# cleanup CDROOT
-
 
151
rm -rf "$CDROOT"
-
 
152
 
93
# compute the MD5 of the ISO file, taking care to include only the filename in it
153
# compute the MD5 of the ISO file, taking care to include only the filename in it
94
echo "computing md5 sums..."
154
echo "computing md5 sums..."
95
cd `dirname "$CDISO"`
155
cd `dirname "$CDISO"`
96
md5sum `basename "$CDISO"` > "$CDISO.md5"
156
md5sum `basename "$CDISO"` > "$CDISO.md5"
97
if [ $? -ne 0 ] ; then exit 1 ; fi
157
if [ $? -ne 0 ] ; then exit 1 ; fi
98
 
158
 
99
cd "$origdir"
159
cd "$origdir"
100
 
160
 
101
#cd svnlschk
161
#cd svnlschk
102
#./webgen.sh
162
#./webgen.sh
103
#cd ..
163
#cd ..
104
 
164
 
105
echo "ALL DONE!"
165
echo "ALL DONE!"
106
 
166
 
107
exit 0
167
exit 0
108
 
168