$(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))))
### 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 <package-NEEDSPECK2MAKEHACK is set, we run spec2make with the --hack flag
define target_mk
MAKE/$(1).mk: $($(1).specpath) spec2make .rpmmacros
mkdir -p MAKE
- ./spec2make $($(1)-RPMFLAGS) $($(1).specpath) $(1) > 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))))
###
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
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
#ifndef PATH_MAX
#include <linux/limits.h>
#endif
-
extern size_t strnlen(const char *s, size_t maxlen);
/* the structure describing the options we take and the defaults */
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)<argc) {
- if(strncmp(argv[args],"--target",tlen)==0){
+ if (strcmp(argv[args],"--hack")==0) {
+ hack=1;
+ } else if (strcmp(argv[args],"--target")==0) {
char **dash;
/* get arch component of the --target option */
*
* Unfortunately, f8 + the RHEL kernel break this bit of cleverness. The following
* line returns false for the kernel-devel package even though it is not empty thereby breaking the build.
- * Rather than unfolding the kernel package macros in the current specfile, this hack should work till f8 dies its natural death. */
+ * Rather than unfolding the kernel package macros in the current specfile,
+ * this hack should work till f8 dies its natural death.
+ * Thierry : trigerring this based on the package's NEEDSPEC2MAKEHACK instead of hard-wiring it for kernel here
+ */
- if (pkg->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);