自己动手源码包制作rpm 包 (二)
2013-09-13 21:23
399 查看
rpm 包制作2013 -9 -12 更新
比之前增加升级部分
#########################################
# Example spec file for zabbix
Summary: A Monitoring program
Name: ppszabbix
Version: 2.0.8
Release: 2
License: GPL
Group: Applications/Server
Source0: %{name}-%{version}.tar.gz
Source1: zabbix_agentd
URL: http://zabbix.org/ Packager: xbz
BuildPreReq: gcc,make
BuildRequires: /bin/cp,/bin/mkdir,/bin/rm
Requires:/bin/bash,/bin/sh
#Autoreq: 0 (如果不需要自动依赖就去掉注释)
#Autoreq: 0 #这里使用 0 关闭了自动标注本软件包需要的依赖关系的功能,使用 1 或者不写此行(默认)就是开启自动标注依赖关系的功能。自动依赖校验只会通过 pkgconfig 找出依赖的 .so 文件,而绝对不是软件包!可以通过命令反查生成的 rpm 包所依赖的这些 .so 文件属于哪个包,再把这些依赖的包的名称写进 spec,最后重新编译就行了。
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires(post): chkconfig
###注意定义路时一定不能有特殊字符
%define zabbixpath /opt/zabbix
%description
The ppszabbix is a distributed monitoring and control system
List of Improvements included into 2.0.8
added IP to the warning about ignored messages because of their size
updated Dutch translation; thanks to Zabbix translators
Complete List of Bug Fixes and Improvements included into 2.0.8
fixed processing of availability data by the server
added IP to the warning about ignored messages because of their size
updated Dutch translation; thanks to Zabbix translators
fixed template linking to proxy if the agent with the same name is auto-registered
fixed undefined indexes for triggers in Monitoring > Maps and Dashboard
fixed windows agent performance counters being capped to 100
fixed webtest item conversion in 1.8->2.0 database upgrade patch for mysql
fixed proc.mem calculations with getprocs() for AIX
fixed curl verify host option setting in ez texting
improved error messages from UnixODBC library for Database Monitor items
added configurable ODBC login timeout
%prep
#%setup -q
rm -rf $RPM_BUILD_DIR/zabbix-2.0.8
zcat $RPM_SOURCE_DIR/ppszabbix-2.0.8.tar.gz | tar -xvf -
%build
cd zabbix-2.0.8
./configure --prefix=/opt/zabbix --enable-agent
make
%install
cd zabbix-2.0.8
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/opt/zabbix/script
cp zabbix_agentd $RPM_BUILD_ROOT/opt/zabbix/script/
%pre
rm -rf %{zabbixpath}
%preun
if [ $1 == 0 ];then
if test $(pgrep -f zabbix_agentd | wc -l) -ne 0; then
/etc/init.d/zabbix_agentd stop
fi
fi
%post
USZA=`cat /etc/passwd|grep zabbix`
if [ -z $USZA ]
then
groupadd zabbix
useradd zabbix -g zabbix -s /sbin/nologin
fi
unset USZA
#mkdir -p /var/run/zabbix
#mkdir -p /var/log/zabbix
#chown -R zabbix:zabbix /var/run/zabbix
#chown -R zabbix:zabbix /var/log/zabbix
cp /opt/zabbix/script/zabbix_agentd /etc/init.d/
chmod 755 /etc/init.d/zabbix_agentd
chkconfig --add zabbix_agentd
chkconfig --level 35 zabbix_agentd on
/etc/init.d/zabbix_agentd start
%postun
if [ $1 == 0 ];then
echo "success uninstall"
fi
%clean
rm -rf $RPM_BUILD_ROOT
rm -rf %{_builddir}/%{name}-%{version}
%files
%{zabbixpath}
%changelog
* Thu Sep 12 2013 xbz <xuebaiji@qiyi.com>
- Add rpm package
%config(noreplace) /etc/yp.conf
#该配置文件不会覆盖已存在文件(被修改)覆盖已存在文件(没被修改),创建新的文件加上扩展后缀.rpmnew(被修改)
比之前增加升级部分
#########################################
# Example spec file for zabbix
Summary: A Monitoring program
Name: ppszabbix
Version: 2.0.8
Release: 2
License: GPL
Group: Applications/Server
Source0: %{name}-%{version}.tar.gz
Source1: zabbix_agentd
URL: http://zabbix.org/ Packager: xbz
BuildPreReq: gcc,make
BuildRequires: /bin/cp,/bin/mkdir,/bin/rm
Requires:/bin/bash,/bin/sh
#Autoreq: 0 (如果不需要自动依赖就去掉注释)
#Autoreq: 0 #这里使用 0 关闭了自动标注本软件包需要的依赖关系的功能,使用 1 或者不写此行(默认)就是开启自动标注依赖关系的功能。自动依赖校验只会通过 pkgconfig 找出依赖的 .so 文件,而绝对不是软件包!可以通过命令反查生成的 rpm 包所依赖的这些 .so 文件属于哪个包,再把这些依赖的包的名称写进 spec,最后重新编译就行了。
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires(post): chkconfig
###注意定义路时一定不能有特殊字符
%define zabbixpath /opt/zabbix
%description
The ppszabbix is a distributed monitoring and control system
List of Improvements included into 2.0.8
added IP to the warning about ignored messages because of their size
updated Dutch translation; thanks to Zabbix translators
Complete List of Bug Fixes and Improvements included into 2.0.8
fixed processing of availability data by the server
added IP to the warning about ignored messages because of their size
updated Dutch translation; thanks to Zabbix translators
fixed template linking to proxy if the agent with the same name is auto-registered
fixed undefined indexes for triggers in Monitoring > Maps and Dashboard
fixed windows agent performance counters being capped to 100
fixed webtest item conversion in 1.8->2.0 database upgrade patch for mysql
fixed proc.mem calculations with getprocs() for AIX
fixed curl verify host option setting in ez texting
improved error messages from UnixODBC library for Database Monitor items
added configurable ODBC login timeout
%prep
#%setup -q
rm -rf $RPM_BUILD_DIR/zabbix-2.0.8
zcat $RPM_SOURCE_DIR/ppszabbix-2.0.8.tar.gz | tar -xvf -
%build
cd zabbix-2.0.8
./configure --prefix=/opt/zabbix --enable-agent
make
%install
cd zabbix-2.0.8
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/opt/zabbix/script
cp zabbix_agentd $RPM_BUILD_ROOT/opt/zabbix/script/
%pre
rm -rf %{zabbixpath}
%preun
if [ $1 == 0 ];then
if test $(pgrep -f zabbix_agentd | wc -l) -ne 0; then
/etc/init.d/zabbix_agentd stop
fi
fi
%post
USZA=`cat /etc/passwd|grep zabbix`
if [ -z $USZA ]
then
groupadd zabbix
useradd zabbix -g zabbix -s /sbin/nologin
fi
unset USZA
#mkdir -p /var/run/zabbix
#mkdir -p /var/log/zabbix
#chown -R zabbix:zabbix /var/run/zabbix
#chown -R zabbix:zabbix /var/log/zabbix
cp /opt/zabbix/script/zabbix_agentd /etc/init.d/
chmod 755 /etc/init.d/zabbix_agentd
chkconfig --add zabbix_agentd
chkconfig --level 35 zabbix_agentd on
/etc/init.d/zabbix_agentd start
%postun
if [ $1 == 0 ];then
echo "success uninstall"
fi
%clean
rm -rf $RPM_BUILD_ROOT
rm -rf %{_builddir}/%{name}-%{version}
%files
%{zabbixpath}
%changelog
* Thu Sep 12 2013 xbz <xuebaiji@qiyi.com>
- Add rpm package
%config(noreplace) /etc/yp.conf
#该配置文件不会覆盖已存在文件(被修改)覆盖已存在文件(没被修改),创建新的文件加上扩展后缀.rpmnew(被修改)
相关文章推荐
- centos6.5下asterisk 13.3.2安装(分别从自己制作的rpm包和源码进行安装),支持mysql数据库
- 自己动手制作RPM包
- 自己动手编译Android源码
- [置顶] 自己动手写CSDN博客提取器源码分析之二:处理网页保存为doc文件
- 自己动手编译opencv源码(Win7 64位+Visual Studio2010+cmake2.8+OpenCV2.4.4)
- 自己动手编写CSDN博客备份工具-blogspider之源码分析(3)
- 自己动手编写CSDN博客备份工具-blogspider源码下载(4) .
- 自己动手实现图的BFS和DFS(附完整源码)转
- java集合之ArrayList源码解读 帮助大家自己动手写一个ArrayList
- moss点滴记录:自己动手制作moss 2007 sp1,基础更新,sp2安装包
- 动手制作自己的USB系统备份盘
- 自己动手编译最新Android源码及SDK
- 自己动手将在线文档制作成CHM文件
- 自己动手将在线文档制作成CHM文件
- [置顶] 自己动手写CSDN博客提取器源码分析之三:处理网页保存为pdf文件
- 自己动手制作QQ2009绿色免安装版制作小技巧
- 将源码包制作成RPM包
- 自己动手制作jquery插件之自动添加删除行的实现
- 自己动手制作jquery插件之自动添加删除行(下)
- dubbo实践(二)自己动手编译源码