From 7d233e283eb7dfe405f01c6c75c9443cf76307ee Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Mon, 20 Jan 2003 20:06:50 +0000 Subject: [PATCH] add brp-implant-ident-static, which requires mktemp --- brp-implant-ident-static | 34 ++++++++++++++++++++++++++++++++++ macros | 1 + redhat-rpm-config.spec | 6 +++++- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100755 brp-implant-ident-static diff --git a/brp-implant-ident-static b/brp-implant-ident-static new file mode 100755 index 0000000..4a26cea --- /dev/null +++ b/brp-implant-ident-static @@ -0,0 +1,34 @@ +#!/bin/bash + +# If using normal root, avoid changing anything. +if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then + exit 0 +fi + +tempdir=`mktemp -d /tmp/implant-ident-XXXXXX` +if test -z "$tempdir" ; then + exit 1 +fi + +cleanup() { + rm -f $tempdir/* + rmdir $tempdir +} +trap cleanup 0 1 2 3 4 5 6 7 8 9 11 13 14 15 + +for library in `find $RPM_BUILD_ROOT -type f -exec file \{\} \; | grep 'current ar archive' | sed 's,:.*,,g' ` ; do + pushd $tempdir > /dev/null + if test -n "$RPM_BUILD_ROOT" ; then + cleanedlibrary=`echo "$library" | sed s,"$RPM_BUILD_ROOT",,g` + else + cleanedlibrary="$library" + fi + ar x "$library" + for object in *.o ; do + echo '$RPM: '${RPM_PACKAGE_NAME:-UNKNOWN_NAME}-${RPM_PACKAGE_VERSION:-UNKNOWN_VERSION}-${RPM_PACKAGE_RELEASE:-UNKNOWN_RELEASE}:"$cleanedlibrary":"$object"' $' > __x_rpm_ident_string.txt + objcopy --add-section .rodata=__x_rpm_ident_string.txt "$object" + ar r "$library" "$object" + done + rm -f *.o + popd > /dev/null +done diff --git a/macros b/macros index 9d73673..a10dcd5 100644 --- a/macros +++ b/macros @@ -85,6 +85,7 @@ /usr/lib/rpm/redhat/brp-strip %{__strip} \ /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \ /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \ + /usr/lib/rpm/redhat/brp-implant-ident-static \ %{nil} %__spec_install_post\ diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index 3c614d6..1c0422b 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -1,12 +1,13 @@ Summary: Red Hat specific rpm configuration files. Name: redhat-rpm-config -Version: 8.0.17 +Version: 8.0.18 Release: 1 License: GPL Group: Development/System Source: redhat-rpm-config-%{version}.tar.gz BuildArch: noarch #Requires: rpmbuild(VendorConfig) <= 4.1 +Requires: mktemp BuildRoot: %{_tmppath}/%{name}-root %description @@ -27,6 +28,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_prefix}/lib/rpm/redhat %changelog +* Thu Jan 16 2003 Nalin Dahyabhai 8.0.18-1 +- add brp-implant-ident-static, which requires mktemp + * Thu Jan 9 2003 Bill Nottingham 8.0.17-1 - add brp-strip-static-archive from rpm-4.2-0.54