add brp-implant-ident-static, which requires mktemp

This commit is contained in:
Nalin Dahyabhai 2003-01-20 20:06:50 +00:00
parent fd6018eddb
commit 7d233e283e
3 changed files with 40 additions and 1 deletions

34
brp-implant-ident-static Executable file
View File

@ -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

1
macros
View File

@ -85,6 +85,7 @@
/usr/lib/rpm/redhat/brp-strip %{__strip} \ /usr/lib/rpm/redhat/brp-strip %{__strip} \
/usr/lib/rpm/redhat/brp-strip-static-archive %{__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-strip-comment-note %{__strip} %{__objdump} \
/usr/lib/rpm/redhat/brp-implant-ident-static \
%{nil} %{nil}
%__spec_install_post\ %__spec_install_post\

View File

@ -1,12 +1,13 @@
Summary: Red Hat specific rpm configuration files. Summary: Red Hat specific rpm configuration files.
Name: redhat-rpm-config Name: redhat-rpm-config
Version: 8.0.17 Version: 8.0.18
Release: 1 Release: 1
License: GPL License: GPL
Group: Development/System Group: Development/System
Source: redhat-rpm-config-%{version}.tar.gz Source: redhat-rpm-config-%{version}.tar.gz
BuildArch: noarch BuildArch: noarch
#Requires: rpmbuild(VendorConfig) <= 4.1 #Requires: rpmbuild(VendorConfig) <= 4.1
Requires: mktemp
BuildRoot: %{_tmppath}/%{name}-root BuildRoot: %{_tmppath}/%{name}-root
%description %description
@ -27,6 +28,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_prefix}/lib/rpm/redhat %{_prefix}/lib/rpm/redhat
%changelog %changelog
* Thu Jan 16 2003 Nalin Dahyabhai <nalin@redhat.com> 8.0.18-1
- add brp-implant-ident-static, which requires mktemp
* Thu Jan 9 2003 Bill Nottingham <notting@redhat.com> 8.0.17-1 * Thu Jan 9 2003 Bill Nottingham <notting@redhat.com> 8.0.17-1
- add brp-strip-static-archive from rpm-4.2-0.54 - add brp-strip-static-archive from rpm-4.2-0.54