您的位置:首页 > 大数据 > 人工智能

opencontrail本地编译定义标签

2015-08-06 10:45 513 查看
OS:Centos66

症状:

opencontrail本地编译默认不使用TAG,而是使用编译时间做软件版本。

编译时间做软件版本的问题是:编译有先有后,先编译的对后编译的有依赖,且依赖关系里写明了依赖版本号,这导致依赖关系可能会错误。

处理:

如何让contrail编译出-39这样的版本?

export TAG=39

然后

make

原因:

1 spec文件中使用了

%if 0%{%_buildTag: 1}

做版本区别,如果if的结果是0,则使用时间做版本,如果if结果非0,则使用_buildTag

2 Makefile中对_buildTag做了如下定义

ifdef TAG

     G_VER += "-D_buildTag=$TAG"

这样的定义

所以TAG------>_buildTag-------->整个版本的版本号

关于spec中的条件宏的语法

%{?macro_to_test: expression}
This syntax tells RPM to expand the expression if the macro macro_to_test exists. If the macro macro_to_test does not exist, nothing will be output. You can also reverse this test. A leading exclamation point, !, tests for the non-existence
of a macro:
http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch10s06.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: