[packages/unscd] allow debug build (via rpmbuild -debug), defaults off now

glen glen at pld-linux.org
Tue Sep 4 23:00:21 CEST 2012


commit 3ec8870b929758d111381d3764c3eb459871dfda
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Wed Sep 5 00:00:18 2012 +0300

    allow debug build (via rpmbuild -debug), defaults off now

 unscd.spec | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/unscd.spec b/unscd.spec
index 000274e..410da9b 100644
--- a/unscd.spec
+++ b/unscd.spec
@@ -49,15 +49,17 @@ nscd.
 
 %prep
 %setup -qcT
-sed -ne '/Description:/,/\*\*\*/p' %{SOURCE0} > README
+%{__sed} -ne '/Description:/,/\*\*\*/p' %{SOURCE0} > README
+
+%{__sed} -e '/#define DEBUG_BUILD/ s,^,// ,' %{SOURCE0} > %{name}.c
 
 %build
-%{__cc} -o nscd %{rpmcflags} -Os %{rpmcppflags} %{rpmldflags} -Wall -Wunused-parameter -Wl,--sort-section -Wl,alignment -Wl,--sort-common %{SOURCE0}
+%{__cc} -o %{name} %{rpmcflags} %{!?debug:-Os} %{rpmcppflags} -DDEBUG_BUILD=0%{?debug:1} %{rpmldflags} -Wall -Wunused-parameter -Wl,--sort-section -Wl,alignment -Wl,--sort-common %{name}.c
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man8,/var/log,/var/run/nscd,/etc/{logrotate.d,rc.d/init.d,sysconfig},%{systemdtmpfilesdir}}
-install -p nscd $RPM_BUILD_ROOT%{_sbindir}
+install -p %{name} $RPM_BUILD_ROOT%{_sbindir}/nscd
 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/nscd
 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_mandir}/man8
 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/nscd
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/unscd.git/commitdiff/3ec8870b929758d111381d3764c3eb459871dfda



More information about the pld-cvs-commit mailing list