Chinaunix首页 | 论坛 | 博客
  • 博客访问: 39730
  • 博文数量: 5
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 135
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-17 18:34
文章分类
文章存档

2011年(1)

2009年(2)

2008年(2)

我的朋友

分类:

2009-01-15 15:39:54

Circa 2001-Nov-24 15:20:18 -0600 dixit ka@us.ibm.com:

: I would like to create a binary RPM that is debuggable.  It looks : like the %install process is automatically stripping my binary files : and I would like to know how to turn that off.   It also looks like  : spec-helper is doing this for me and there may be options to turning : things on and off...but I have not been able to figure out how that : is done.

The exact details depend somewhat on what OS or distribution you're using RPM on.

In general, you'll need to redefine the default post-%install macros somehow.

Under Red Hat Linux on x86, the default post-%install macros look something like this (from /usr/lib/rpm/i386-redhat-linux/macros):

%__arch_install_post %{nil}

%__os_install_post \ /usr/lib/rpm/brp-compress \ /usr/lib/rpm/brp-strip \ /usr/lib/rpm/brp-strip-comment-note \ %{nil}

%__spec_install_post \ %{__arch_install_post} \ %{__os_install_post}

That is, %{__spec_install_post} combines the architecture-specific post-%install processing with the OS-specific post-%install processing. You probably don't need to be concerned with the architecture-specific post-%install processing.

/usr/lib/rpm/brp-compress compressing man and info pages (usually using gzip). For a debuggable package, you can probably leave that in.

/usr/lib/rpm/brp-strip is what strips the binaries; you'll want to leave it out.

/usr/lib/rpm/brp-strip-comment-note strips additional sections from ELF binaries (but only does so for already-stripped binaries). Even so, it's safest to leave it out of the post-%install if you know you don't want binaries stripped at all.

So, to keep binaries from being stripped under Red Hat Linux for x86, you would define the following macro somewhere in your specfile (near the top is good, preferably with a comment noting what it does):

%define __os_install_post /usr/lib/rpm/brp-compress

If you want to add additional commands, you'll need to put them on the same line separated by semicolons (%{__os_install_post} is executed by %{_buildshell}, which is usually /bin/sh or /bin/bash). For example:

%define __os_install_post /usr/lib/rpm/brp-compress; echo 'Not stripping.'

Depending upon what OS/arch you're using, you may need to use fancier logic to determine when to redefine __os_install_post or what to put in it.

: -- : \begindata{text,537605528}

[15 additional lines of signature...]

: \enddata{text,537605528}

You might consider reducing the size of your signature. 17 lines is a little much, especially when it's useless TeX....

阅读(1260) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~