@@ -56,23 +56,27 @@ check_command "dch" "debhelper"
56
56
check_command " lsb_release" " lsb-release"
57
57
58
58
pecl_name=" cassandra"
59
- pecl_version=$( header_version " ../version.h" )
60
59
version=$( header_version_full " ../version.h" )
61
60
release=1
62
61
dist=$( lsb_release -s -c)
63
62
base=" php-driver-$version "
64
63
files=" config.m4 php_driver.c php_driver.h php_driver_globals.h php_driver_types.h version.h src util"
65
64
66
- echo " Building version $version "
67
65
68
- libuv_version=$( dpkg -s libuv | grep ' Version' | awk ' { print $2 }' )
66
+ if [[ -z $1 ]]; then
67
+ php_version=$( php-config --version | sed -rn ' s/^([0-9]+)\.([0-9]+)(.*)/\1.\2/p' )
68
+ else
69
+ php_version=$1
70
+ fi
71
+
72
+ debian_dir=" debian-php$php_version "
69
73
70
- if [[ -e $libuv_version ]]; then
71
- echo " 'libuv' required, but not installed "
72
- exit 1
74
+ if [[ ! -e $debian_dir ]]; then
75
+ echo " PHP $php_version not supported "
76
+ exit - 1
73
77
fi
74
78
75
- echo " Using libuv version $libuv_version "
79
+ echo " Building version $ version with PHP $php_version "
76
80
77
81
if [[ -d build ]]; then
78
82
read -p " Build directory exists, remove? [y|n] " -n 1 -r
84
88
mkdir -p " build/$base "
85
89
86
90
echo " Copying files"
87
- mkdir -p " build/$base /$pecl_name -$pecl_version "
88
91
cp ../package.xml " build/$base "
89
92
for file in $files ; do
90
- cp -r " ../$file " " build/$base /$pecl_name - $pecl_version / $ file"
93
+ cp -r " ../$file " " build/$base /$file "
91
94
done
92
- cp -r debian " build/$base "
95
+
96
+ cp -r $debian_dir " build/$base /debian"
93
97
94
98
pushd " build/$base "
95
99
echo " Updating changlog"
96
- dch -m -v " $version -$release " -D $dist " Version $version "
97
-
100
+ dch -M --create --package " php$php_version -cassandra-driver" -v " $version -$release " -D $dist " Version $version "
98
101
echo " Building package:"
99
102
nprocs=$( grep -e ' ^processor' -c /proc/cpuinfo)
100
- DEB_BUILD_OPTIONS=" parallel=$nprocs " debuild -i -b -uc -us
103
+ DEB_BUILD_OPTIONS=" parallel=$nprocs " debuild -e PHP_VERSION=" $php_version " -i -b -uc -us
104
+
101
105
popd
0 commit comments