-
Notifications
You must be signed in to change notification settings - Fork 2
/
51-vim-MarkupSafe-Jinja2.sh
executable file
·121 lines (104 loc) · 3.51 KB
/
51-vim-MarkupSafe-Jinja2.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
#!/bin/bash
# QQ群:111601117、钉钉群:35948877
# 避免chroot后执行
id lfs >/dev/null 2>&1
if [ $? = 0 ]; then
source `dirname ${BASH_SOURCE[0]}`/lfs.sh
cp -v ${BASH_SOURCE[0]} $LFS/task.sh
sed "s/_LFS_VERSION/$(getConf LFS_VERSION)/g" -i $LFS/task.sh
sed "s/_LFS_BUILD_PROC/$LFS_BUILD_PROC/g" -i $LFS/task.sh
source `dirname ${BASH_SOURCE[0]}`/chroot.sh
rm -fv $LFS/task.sh
exit
fi
# 来自chroot之后的调用
pushd /sources/_LFS_VERSION
PKG_NAME=vim
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
if [ -z $PKG_PATH ]; then
tar -xpvf $(find . -maxdepth 1 -type f -name "$PKG_NAME-*.tar.*") --directory stage4
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
fi
if [ ! -f $PKG_PATH/_BUILD_DONE ]; then
pushd $PKG_PATH
# 修改 vimrc 配置文件的默认位置为 /etc
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
./configure --prefix=/usr
[ $? = 0 ] && make -j_LFS_BUILD_PROC
if [ $? = 0 ]; then
chown -Rv tester .
su tester -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log
read -p "$PKG_NAME CHECK DONE..."
fi
[ $? = 0 ] && make install
if [ $? = 0 ]; then
ln -sv vim /usr/bin/vi
for L in /usr/share/man/{,*/}man1/vim.1; do
ln -sv vim.1 $(dirname $L)/vi.1
done
ln -sv ../vim/vim90/doc /usr/share/doc/vim-9.0.0228
cat > /etc/vimrc << "EOF"
" Begin /etc/vimrc
" Ensure defaults are set before customizing settings, not after
source $VIMRUNTIME/defaults.vim
let skip_defaults_vim=1
set nocompatible
set backspace=2
set mouse=
syntax on
if (&term == "xterm") || (&term == "putty")
set background=dark
endif
" End /etc/vimrc
EOF
read -p "$PKG_NAME ALL DONE..."
touch _BUILD_DONE
else
pwd
exit 1
fi
popd
fi
popd
pushd /sources/_LFS_VERSION
PKG_NAME=MarkupSafe
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
if [ -z $PKG_PATH ]; then
tar -xpvf $(find . -maxdepth 1 -type f -name "$PKG_NAME-*.tar.*") --directory stage4
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
fi
if [ ! -f $PKG_PATH/_BUILD_DONE ]; then
pushd $PKG_PATH
pip3 wheel -w dist --no-build-isolation --no-deps $PWD
pip3 install --no-index --no-user --find-links dist Markupsafe
if [ $? = 0 ]; then
read -p "$PKG_NAME ALL DONE..."
touch _BUILD_DONE
else
pwd
exit 1
fi
popd
fi
popd
pushd /sources/_LFS_VERSION
PKG_NAME=Jinja2
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
if [ -z $PKG_PATH ]; then
tar -xpvf $(find . -maxdepth 1 -type f -name "$PKG_NAME-*.tar.*") --directory stage4
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
fi
if [ ! -f $PKG_PATH/_BUILD_DONE ]; then
pushd $PKG_PATH
pip3 wheel -w dist --no-build-isolation --no-deps $PWD
pip3 install --no-index --no-user --find-links dist Jinja2
if [ $? = 0 ]; then
read -p "$PKG_NAME ALL DONE..."
touch _BUILD_DONE
else
pwd
exit 1
fi
popd
fi
popd