1 |
#!/bin/sh |
2 |
|
3 |
distname='SME Server' |
4 |
disttag='smeserver' |
5 |
distvers=$(basename $(pwd)) |
6 |
distrel=${distvers:0:1} |
7 |
distarch=$(uname -i) |
8 |
|
9 |
if ! [ -d $distarch ] |
10 |
then |
11 |
echo "No $distarch directory?" |
12 |
exit 1 |
13 |
fi |
14 |
|
15 |
for img in product updates |
16 |
do |
17 |
if [ "$distrel" == "7" ] |
18 |
then |
19 |
/usr/bin/mkcramfs \ |
20 |
$(pwd)/$distarch/$img \ |
21 |
$(pwd)/$distarch/SME/base/$img.img |
22 |
else |
23 |
/sbin/mksquashfs \ |
24 |
$(pwd)/$distarch/$img \ |
25 |
$(pwd)/$distarch/images/$img.img \ |
26 |
-all-root -no-fragments -noappend |
27 |
sudo chmod 664 $(pwd)/$distarch/images/$img.img |
28 |
fi |
29 |
done |
30 |
|
31 |
if [ "$distrel" == "7" ] |
32 |
then |
33 |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
34 |
--productpath SME \ |
35 |
--withnumbers \ |
36 |
$(pwd)/$distarch/ |
37 |
|
38 |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/pkgorder \ |
39 |
--product SME \ |
40 |
$(pwd)/$distarch \ |
41 |
$distarch > pkgorder |
42 |
|
43 |
PYTHONPATH=/usr/lib/anaconda/ /usr/lib/anaconda-runtime/genhdlist \ |
44 |
--productpath SME \ |
45 |
--withnumbers \ |
46 |
--fileorder pkgorder \ |
47 |
$(pwd)/$distarch/ |
48 |
fi |
49 |
|
50 |
rm -f ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso ../iso/$distrel/$distarch/$disttag.iso |
51 |
|
52 |
if [ "$distrel" == "7" ] |
53 |
then |
54 |
createrepo $(pwd)/$distarch/ |
55 |
else |
56 |
createrepo -g repodata/comps.xml -u "media://$(head -1 $distarch/.discinfo)" $(pwd)/$distarch/ |
57 |
fi |
58 |
sync; rm -rf $(pwd)/$distarch/.olddata |
59 |
repoview $(pwd)/$distarch/ |
60 |
sync; rm -rf $(pwd)/$distarch/.repodata |
61 |
|
62 |
bootimg='isolinux/isolinux.bin' |
63 |
bootcat='isolinux/boot.cat' |
64 |
mkisopts='-v -U -J -r -T' |
65 |
today="$(date '+%d %b %Y')" |
66 |
mkisofs $mkisopts \ |
67 |
-V "$distname $distvers" \ |
68 |
-A "$distname created on $today" \ |
69 |
-b "$bootimg" \ |
70 |
-c "$bootcat" \ |
71 |
-no-emul-boot -boot-load-size 4 -boot-info-table \ |
72 |
-x lost+found \ |
73 |
-x CVS \ |
74 |
-o ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso \ |
75 |
$(pwd)/$distarch/ |
76 |
|
77 |
/usr/lib/anaconda-runtime/implantisomd5 ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
78 |
dd if=/dev/zero bs=2048 count=150 >> ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
79 |
md5sum ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso > ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso.md5sum |
80 |
sha1sum ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso > ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso.sha1sum |
81 |
zsyncmake -o ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso.zsync ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
82 |
mv ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso ../iso/$distrel/$distarch/$disttag.iso |
83 |
ln -sf $disttag.iso ../iso/$distrel/$distarch/$disttag-$distvers-$distarch.iso |
84 |
|
85 |
if [ -d SRPMS -a "$distarch" == "i386" ] |
86 |
then |
87 |
rm -f ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso ../iso/$distrel/source/$disttag-SRPMS.iso |
88 |
|
89 |
mkisofs $mkisopts \ |
90 |
-V "$distname $distvers SRPMS" \ |
91 |
-A "$distname SRPMS created on $today" \ |
92 |
-x lost+found \ |
93 |
-x CVS \ |
94 |
-o ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso \ |
95 |
--graft-points \ |
96 |
./SRPMS=SRPMS \ |
97 |
GPL=$distarch/GPL \ |
98 |
RPM-GPG-KEY-SMEServer=$distarch/RPM-GPG-KEY-SMEServer |
99 |
|
100 |
md5sum ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso > ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso.md5sum |
101 |
sha1sum ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso > ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso.sha1sum |
102 |
zsyncmake -o ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso.zsync ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso |
103 |
mv ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso ../iso/$distrel/source/$disttag-SRPMS.iso |
104 |
ln -sf $disttag-SRPMS.iso ../iso/$distrel/source/$disttag-$distvers-SRPMS.iso |
105 |
fi |
106 |
|
107 |
# That's it. |
108 |
|