From 548c6e6ad3bc706f2b327e9147c4d5e7f0a69108 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 17 Feb 2011 12:59:06 +0100 Subject: [PATCH] previous hack in spec2make was too intrusive rely on -NEEDSPEC2MAKE flag to enable spec2make hacky behaviour, on f8 and centos5 only this should affect only the k32-{f8,c5} combinations --- Makefile | 5 ++++- onelab-k32-tags.mk | 4 ++-- planetlab-k32-tags.mk | 2 ++ spec2make.c | 15 +++++++++------ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index a843b22f..62711055 100644 --- a/Makefile +++ b/Makefile @@ -295,6 +295,7 @@ $(1).module := $(firstword $($(1)-MODULES)) $(1).specpath := SPECS/$(notdir $($(1)-SPEC)) $(1).moduledir := MODULES/$$($(1).module) $(1).codespec := MODULES/$$($(1).module)/$($(1)-SPEC) +$(1).spec2makeflags := $(if $($(1)-NEEDSPEC2MAKEHACK),$(if $(filter $(DISTRONAME),f8 centos5),--hack,),) endef $(foreach package, $(ALL), $(eval $(call stage1_package_vars,$(package)))) @@ -427,10 +428,12 @@ spec2make: spec2make.c ### run spec2make on the spec file and include the result # usage: spec2make package +# with old rpms (f8&c5) and too recent specfiles (the kernel), we need a patch to spec2make +# so when MAKE/$(1).mk || { rm MAKE/$(1).mk; exit 1; } + ./spec2make $($(1).spec2makeflags) $($(1)-RPMFLAGS) $($(1).specpath) $(1) > MAKE/$(1).mk || { rm MAKE/$(1).mk; exit 1; } endef $(foreach package,$(ALL),$(eval $(call target_mk,$(package)))) diff --git a/onelab-k32-tags.mk b/onelab-k32-tags.mk index 7754dec2..2eaea6f1 100644 --- a/onelab-k32-tags.mk +++ b/onelab-k32-tags.mk @@ -3,8 +3,8 @@ ### linux-2.6-BRANCH := rhel6 linux-2.6-GITPATH := git://git.planet-lab.org/linux-2.6.git@linux-2.6-32-11 -# spec2make does not know how to interpret that -#kernel-RPMFLAGS += --without debug +# enable hack in spec2make on f8 and centos5 +kernel-NEEDSPEC2MAKEHACK := yes kernel-DEVEL-RPMS += elfutils-libelf-devel madwifi-GITPATH := git://git.onelab.eu/madwifi.git@madwifi-4132-2 iptables-BUILD-FROM-SRPM := yes # tmp diff --git a/planetlab-k32-tags.mk b/planetlab-k32-tags.mk index d446876d..8f869bcf 100644 --- a/planetlab-k32-tags.mk +++ b/planetlab-k32-tags.mk @@ -3,6 +3,8 @@ mkinitrd-GITPATH := git://git.planet-lab.org/mkinitrd.git@mkinitrd-5.1.19.6-0 linux-2.6-BRANCH := rhel6 linux-2.6-GITPATH := git://git.planet-lab.org/linux-2.6.git@linux-2.6-32-11 +# enable hack in spec2make on f8 and centos5 +kernel-NEEDSPEC2MAKEHACK := yes kernel-DEVEL-RPMS += elfutils-libelf-devel madwifi-GITPATH := git://git.planet-lab.org/madwifi.git@madwifi-4132-2 iptables-GITPATH := git://git.planet-lab.org/iptables.git@iptables-1.4.10-2 diff --git a/spec2make.c b/spec2make.c index 1d68503b..f4572088 100644 --- a/spec2make.c +++ b/spec2make.c @@ -27,7 +27,6 @@ #ifndef PATH_MAX #include #endif - extern size_t strnlen(const char *s, size_t maxlen); /* the structure describing the options we take and the defaults */ @@ -81,12 +80,13 @@ main(int argc, char *argv[]) int alen, i; char *target = NULL; int args = 1; - int tlen = strlen("--target"); - + int hack=0; /* walk argv list looking for --target */ while ((args+1)fileList || !strncmp(name,"kernel",sizeof("kernel")-1)) { + if (pkg->fileList || hack) { /* attach (add) rpm path to package */ printf("%s.rpms += RPMS/%s/%s-%s-%s.%s.rpm\n", package_name, arch, name, version, release, arch); -- 2.43.0