-
Notifications
You must be signed in to change notification settings - Fork 0
/
vnmik.package.make
executable file
·131 lines (122 loc) · 2.81 KB
/
vnmik.package.make
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
#!bash
export SRC_DIR=/cygdrive/c/data/vnmik
export ROOT_DIR=$PREFIX
# make vnmik package
# package name
# list of files and other options to z program
#
makepkg_core()
{
stat_msg "creating package: $*"
local pkg="`echo $1 | sed -e 's/\./_/g'`"
shift
local dest="$ROOT_DIR/vnmik.makepkg/$pkg$PKG_SUFFIX"
mkdir -p `dirname $dest`
local pattern="$*"
local script=vnmik.log/z.$pkg
if [ -f $SRC_DIR/$script ]; then
cp -fv $SRC_DIR/$script $ROOT_DIR/$script
stat_log "copy $script from $SRC_DIR to $ROOT_DIR; return status: $?"
fi
if [ ! -f $ROOT_DIR/$script ];
then
stat_log "cannot find script file: $script"
script=
fi
if [ "x$script$pattern" == "x" ];
then
stat_warn "both script and pattern is emtpy"
return 1
else
[ -f $dest ] && (stat_log "removing old package $dest"; rm -fv $dest)
cd $ROOT_DIR
z cfvj $dest $script $pattern | tee -a $LOGFILE
stat_msg "new package: $dest"
fi
}
makepkg()
{
local texmaker_files="qtcore4.dll qtgui4.dll mingwm10.dll texmaker.exe texmaker.ini"
local sumatra_pdf_files="spdf.exe"
while [ "x$1" != "x" ];
do
case $1 in
# editors
"txc")makepkg_core txc "tex.editor/txc*";;
"texmaker")
local pattern=""
for f in $texmaker_files; do
pattern="tex.bin/$f $pattern"
done
makepkg_core texmaker $pattern
;;
# test routines
"test")
# update the source files ;)
mkdir -p $ROOT_DIR/tex.doc/test/
rm -fv $ROOT_DIR/tex.doc/test/*
cp -fv \
$SRC_DIR/tex.doc/test/* \
$ROOT_DIR/tex.doc/test/
makepkg_core vnmik_test \
"tex.doc/test/*.tex"
;;
# tex variant and config . direcotires were completely ignored!!!!
# for next release, we should have option to use $USERPROFILE as var and config directory
"var")makepkg_core tex_var "";;
"config")makepkg_core tex_config "";;
# binary files
"bin")
echo '' > $LOGDIR/tmp
for f in $texmaker_files; do
echo "*tex.bin/$f*" >> $LOGDIR/tmp
done
makepkg_core tex.bin \
"tex.bin/*" \
--exclude-from=$LOGDIR/tmp
;;
# texmf tree
"user")makepkg_core tex.user "tex.user/*";;
"base")makepkg_core tex.base "tex.base/*";;
# nothing for anything else....?
*)stat_msg "nothing to do";;
esac
shift
done
}
makepkg_all()
{
makepkg \
base user \
var config \
bin \
texmaker \
test
}
# this is so bad. we must enter package directory to check sum :D
# a hack script should be written for this purpose
make_md5checksum()
{
stat_log "creating md5sum files for packages..."
cd $PKGDIR
for f in *$PKG_SUFFIX; do
md5sum $f > $f.md5sum
done
cd -
}
make_distro()
{
cd $SRC_DIR
local dest="$SRC_DIR/../vnmik4-`date +%Y%m%d`.zip"
rm -fv $dest
stat_log "creating vnmik distro: $dest"
stat_log "start from SRC_DIR=$SRC_DIR"
zip -0r \
$dest \
./bin/ \
./vnmik.package/*$PKG_SUFFIX \
./*.bat \
-x "*svn*"
cd -
}
stat_log "library loaded: vnmik.package.make"