opencontrail本地编译定义标签

来源:互联网 发布:万能蓝牙驱动软件 编辑:程序博客网 时间:2024/05/22 13:04

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




0 0