-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlamoBuild.python_version-0.1.1
More file actions
executable file
·110 lines (97 loc) · 2.8 KB
/
PlamoBuild.python_version-0.1.1
File metadata and controls
executable file
·110 lines (97 loc) · 2.8 KB
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
#!/bin/sh
##############################################################
pkgbase="python_version"
vers="0.1.1"
url="https://github.com/keleshev/version/archive/0.1.1.tar.gz"
verify=""
digest=""
arch=`uname -m`
build=B1
src="version-0.1.1"
OPT_CONFIG=""
DOCS="LICENSE-MIT README.md"
patchfiles=""
# specifies files that are not in source archive and patchfiles
addfiles=""
compress=txz
##############################################################
source /usr/share/plamobuild_functions.sh
# このスクリプトで使う1文字変数の意味
#
# $W : このスクリプトを動かすカレントディレクトリ
# $S : ソースコードのあるディレクトリ(デフォルト: $W/${src})
# $B : ビルド用ディレクトリ(デフォルト: /tmp/build)
# $P : ビルドしたファイルをインストールするディレクトリ(デフォルト: $W/work)
if [ $# -eq 0 ] ; then
opt_download=0 ; opt_config=1 ; opt_build=1 ; opt_package=1
else
opt_download=0 ; opt_config=0 ; opt_build=0 ; opt_package=0
for i in $@ ; do
case $i in
download) opt_download=1 ;;
config) opt_config=1 ;;
build) opt_build=1 ;;
package) opt_package=1 ;;
esac
done
fi
if [ $opt_download -eq 1 ] ; then
download_sources
fi
if [ $opt_config -eq 1 ] ; then
for f in $addfiles $patchfiles
do
if [ ! -f $f ]; then
echo "Required file ($f) is missing."
exit 255
fi
done
######################################################################
# source copy build. patch apply in build dir
######################################################################
if [ -d $B ] ; then rm -rf $B ; fi ; cp -a $S $B
cd $B
for patch in $patchfiles ; do
patch -p1 < $W/$patch
done
# if [ -f autogen.sh ] ; then
# sh ./autogen.sh
# fi
export PKG_CONFIG_PATH=/usr/${libdir}/pkgconfig:/usr/share/pkgconfig
export LDFLAGS='-Wl,--as-needed'
python2 setup.py config
if [ $? != 0 ]; then
echo "configure error. $0 script stop"
exit 255
fi
fi
if [ $opt_build -eq 1 ] ; then
cd $B
python2 setup.py build
if [ $? != 0 ]; then
echo "build error. $0 script stop"
exit 255
fi
fi
if [ $opt_package -eq 1 ] ; then
check_root
if [ -d $P ] ; then rm -rf $P ; fi ; mkdir -p $P
cd $B
python2 setup.py install --root $P --prefix=/usr
################################
# install tweaks
# strip binaries, delete locale except ja, compress man,
# install docs and patches, compress them and chown root.root
################################
install_tweak
#############################
# convert symlink to null file and
# add "ln -sf" command into install/doinst.sh
################################
convert_links
cd $P
/sbin/makepkg ../$pkg.$compress <<EOF
y
1
EOF
fi