tools-make/spec-debug-rules.template

65 lines
1.5 KiB
Text
Raw Normal View History

#
# Setup sources
#
%prep
%setup -n %{gs_name}-%{gs_version}
#
# Build commands
#
%build
if [ -z "$GNUSTEP_SYSTEM_ROOT" ]; then
. %{gs_root}/Makefiles/GNUstep.sh
fi
if [ "%{gs_configure}" = "YES" ]; then
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{gs_root}
fi
make debug=no
make debug=yes
#
# Install commands (generate file list too)
#
%install
if [ -z "$GNUSTEP_SYSTEM_ROOT" ]; then
. %{gs_root}/Makefiles/GNUstep.sh
fi
# build the non debugging file list
mkdir tmp-rpm-build-%{gs_name}
make debug=no \
GNUSTEP_INSTALL_BASE=`pwd`/tmp-rpm-build-%{gs_name}/ \
GNUSTEP_INSTALLATION_DIR=`pwd`/tmp-rpm-build-%{gs_name}/%{gs_install_dir} \
filelist=yes install
rm -rf tmp-rpm-build-%{gs_name}
# build the debugging file list
make debug=yes \
GNUSTEP_INSTALL_BASE=$RPM_BUILD_ROOT \
GNUSTEP_INSTALLATION_DIR=$RPM_BUILD_ROOT%{gs_install_dir} \
filelist=yes install
# Now filter the debugging file list against the non debugging one
#
# We use `grep':
# `-f file-list' gets the lines to match from file-list
# `-x' gets only matches which match whole lines
# `-v' inverts the matching, so lines which do not match are outputted
#
mv file-list-debug file-list.tmp
grep -f file-list -v -x file-list.tmp >> file-list-debug.tmp
rm -f file-list.tmp
echo "%attr (-, root, root)" > file-list-debug
cat file-list-debug.tmp >> file-list-debug
rm -f file-list-debug.tmp
#
# Clean commands
#
%clean
rm -rf $RPM_BUILD_ROOT
#
# File list (generated by `%install')
#
%files -f file-list-debug