一、下载 clickhouse 源码包
git clone --recurse-submodules -b v1.1.54385-stable https://github.com/yandex/ClickHouse.git -b 指定版本
改目录名字:
mv ClickHouse clickhouse-v1.1.54385-stable 打包
tar zcvf clickhouse-v1.1.54385-stable.tar.gz clickhouse-v1.1.54385-stable
二、下载src.rpm
稍后补到百度云盘里,如果忘了,需要的请联系我:
https://pan.baidu.com/s/1C4uEQF_ZnEcp0PUrul_-ag
有打好的rpm包可以直接使用
三、安装src.rpm
rpm -ivh xxx.src.rpm
四、换源码
进入到rpmbuild目录 删除自带的tar包,换成刚才下载的
cd ~/rpmbuild/SOURCES/
rm clickhouse-vx.x.xxx-stable.tar.gz
mv xxx/clickhouse-v1.1.54385-stable.tar.gz xxx/rpmbuild/SOURCES/
五、修改spec文件
cd ~/rpmbuild/SPECS
vim clickhouse.spec 修改
Version
Packager
%changelog
等信息
六、安装依赖
centos7的依赖安装
yum install libtool-ltdl-devel libicu-devel openssl-devel unixODBC-devel readline-devel
yum search epel
yum install -y epel-release
yum install centos-release-scl-rh
yum install devtoolset-7-gcc devtoolset-7-gcc-c++ cmake3
七、打包
安装rpmbuild
yum install rpm-build
rpmbuild -ba clickhouse.spec (spec文件名) 打包好的rpm包在 /root/rpmbuild/RPMS 下