【编译打包】Atlas-2.2.1-2.el7.centos.src.rpm
2015-11-26 13:25
423 查看
Atlas 是奇虎360 开源的一个数据库中间件,基于mysql-proxy,做了大量改造,是一个适合国情的高性能的mysql中间件。
官方提供源码下载和rpm下载,但是发现没有SRPM源码包,于是研究了一番,发现了不少问题,自行实现了spec文件,主要解决如下问题:
1、依赖包问题
2、实现了标准的init脚本,去掉了丑陋的mysql-proxyd
3、使用普通用户权限运行mysql-proxy
4、同时支持CentOS 6和CentOS 7
5、文件路径按照Linux 目录树标准FHS进行分布(/usr/local不符合rpm规范)
6、支持开发包(github上有人提问找不到头文件)
本着GPL精神,我希望将成果贡献给官方,以改进安装体验。Atlas.spec文件内容如下:
注:
1、官方只提供el6的rpm包,但是在CentOS 6上编译,会有依赖不足的问题,glib2版本必须大于2.32.0(CentOS 6官方自带的是2.28.8),于是我将cenots 7的glib2 (2.40.0版本)向下移植到了centos 6,用于解决依赖问题。具体见下面的链接。
百度网盘地址:http://pan.baidu.com/s/1pJpJzo3
官方提供源码下载和rpm下载,但是发现没有SRPM源码包,于是研究了一番,发现了不少问题,自行实现了spec文件,主要解决如下问题:
1、依赖包问题
2、实现了标准的init脚本,去掉了丑陋的mysql-proxyd
3、使用普通用户权限运行mysql-proxy
4、同时支持CentOS 6和CentOS 7
5、文件路径按照Linux 目录树标准FHS进行分布(/usr/local不符合rpm规范)
6、支持开发包(github上有人提问找不到头文件)
本着GPL精神,我希望将成果贡献给官方,以改进安装体验。Atlas.spec文件内容如下:
%global _enable_debug_package 0 %global debug_package %{nil} %global __os_install_post /usr/lib/rpm/brp-compress %{nil} Name: Atlas Version: 2.2.1 Release: 2%{?dist} Summary: A Proxy for the MySQL Client/Server protocol License: GPL URL: https://github.com/Qihoo360/Atlas Source0: %{name}-%{version}.tar.gz Source1: mysql-proxy.cnf Source2: mysql-proxy.init BuildRequires: flex,libtool BuildRequires: glib2-devel >= 2.32.0 BuildRequires: jemalloc-devel BuildRequires: libevent-devel BuildRequires: lua-devel >= 5.1 BuildRequires: mysql-devel BuildRequires: openssl-devel BuildRequires: pkgconfig Requires: openssl Requires: jemalloc Requires: mysql Requires: lua >= 5.1 Requires: glib2 Conflicts: mysql-proxy ExcludeArch: x86 %description Atlas is a MySQL protocol-based database middleware project developed and maintained by infrastructure team of the Web platform Department in QIHU 360 SOFTWARE CO. LIMITED(NYSE:QIHU). It fixed lots of bugs and added lot of new functions on the basis of MySQL-Proxy 0.8.2. Currently the project has been widely applied in QIHU, many MySQL business has connected to the Atlas platform. The number of read and write requests forwarded by Atlas has reached billions. %package devel Summary: Development files for Atlas Requires: Atlas = %{version}-%{release} %description devel Development files for Atlas %prep %setup -q %build %configure \ --with-lua \ CFLAGS="$CFLAGS -DHAVE_LUA_H" \ LDFLAGS="$LDFLAGS -lm -ldl -lcrypto -ljemalloc" make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT %{__make} DESTDIR=$RPM_BUILD_ROOT install %{__mkdir} -p $RPM_BUILD_ROOT%{_localstatedir}/log/mysql-proxy %{__mkdir} -p $RPM_BUILD_ROOT%{_sysconfdir}/mysql-proxy %{__mkdir} -p $RPM_BUILD_ROOT%{_initrddir} %{__install} -m 644 -p %{SOURCE1} \ $RPM_BUILD_ROOT%{_sysconfdir}/mysql-proxy/mysql-proxy.cnf %{__install} -m755 %{SOURCE2} \ $RPM_BUILD_ROOT%{_initrddir}/mysql-proxy %clean %{__rm} -rf $RPM_BUILD_ROOT make -s clean %pre getent group mysql >/dev/null || groupadd -g 27 -o -r mysql getent passwd mysql >/dev/null || \ useradd -u 27 -M -N -o -r -g mysql -s /bin/bash \ -d /var/lib/mysql mysql exit 0 %post ldconfig chkconfig --add mysql-proxy || : #fix lib path %{__ln_s} -f %{_libdir}/mysql-proxy /usr/lib/mysql-proxy || : %postun ldconfig chkconfig --del mysql-proxy || : unlink /usr/lib/mysql-proxy || : %files %defattr(-,root,root,-) %{_bindir}/mysql-proxy %{_bindir}/encrypt %{_bindir}/mysql-binlog-dump %{_bindir}/mysql-myisam-dump %exclude %{_bindir}/mysql-proxyd %config(noreplace) %{_sysconfdir}/mysql-proxy/mysql-proxy.cnf %{_initrddir}/mysql-proxy %dir %attr(0755,mysql,mysql) %{_localstatedir}/log/mysql-proxy %dir %{_libdir}/mysql-proxy %{_libdir}/mysql-proxy/lua/* %{_libdir}/mysql-proxy/plugins/* %{_libdir}/libmysql-* %{_libdir}/libsql-* %doc examples/ %files devel %defattr(-,root,root,-) %{_includedir}/*.h %{_libdir}/pkgconfig/mysql-chassis.pc %{_libdir}/pkgconfig/mysql-proxy.pc %changelog * Thu Dec 3 2015 Purple Grape <purplegrape4@gmail.com> - 2.2.1-2 - fix lib path * Thu Nov 26 2015 Purple Grape <purplegrape4@gmail.com> - 2.2.1-1 - fresh build
注:
1、官方只提供el6的rpm包,但是在CentOS 6上编译,会有依赖不足的问题,glib2版本必须大于2.32.0(CentOS 6官方自带的是2.28.8),于是我将cenots 7的glib2 (2.40.0版本)向下移植到了centos 6,用于解决依赖问题。具体见下面的链接。
百度网盘地址:http://pan.baidu.com/s/1pJpJzo3
相关文章推荐
- atlas+mysql实现主从复制和读写分离(二)
- Mysql中间件研究(Atlas,cobar,TDDL)
- 拆分TexturePacker打包的大图
- 如何添加Mobile Atlas Creator的自定义地图源
- NGUI atlas sprite 类似ANDROID 点9图的设置
- Unity中手动合并图集
- 使用Atlas实现读写分离
- atlas聊天记录记载
- Atlas 安装
- Atlas Samples & Suse Linux 10.1
- 有感Atlas - 优点、缺点、学习
- 和之前的版本相比,昨天Release的Atlas Control Toolkit变化不可谓不大
- 一个我在研究Atlas Control Toolkit时做的尝试:ImageGalleryExtender
- 本地化与Atlas对于本地化的支持
- 为VS.NET 2005增加Atlas Scripts的代码提示功能
- 另一种Atlas Scripts Intellisense的方法以及对比与分析
- 使用Atlas创建自己的Client Control
- 不看不知道,一看吓一跳,Atlas中有些Bug还真让人无语。
- [E-book Download] - OReilly Programming Atlas Sep 2006
- 深入Atlas系列:Web Sevices Access in Atlas(1) - 客户端支持