From: Elan Ruusamäe Date: Mon, 24 Nov 2014 19:32:59 +0000 (+0200) Subject: inline commonly used macros X-Git-Tag: auto/th/rpm-specdump-0.6-1 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=0cf659b540b752ae630b87c82052f76fc2855c62;p=packages%2Frpm-specdump.git inline commonly used macros --- diff --git a/rpm-specdump.c b/rpm-specdump.c index 9b473b5..f1a8200 100644 --- a/rpm-specdump.c +++ b/rpm-specdump.c @@ -285,6 +285,16 @@ struct Arguments args = { 0,0,0,-1,-1, {0,0,0}, 0 }; Spec s; addDefine(&args, "patch %{nil}"); + + // instead of requiring rpm-build, we include some "builtin" macros + addDefine(&args, "bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}"); + addDefine(&args, "bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}"); + addDefine(&args, "with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}"); + addDefine(&args, "without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}"); + + // include macros.perl, etc + addDefine(&args, "include() %{nil}"); + parseArgs(&args, argc, argv); if ((args.chroot && chroot(args.chroot)==-1) ||