$(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,),)
+$(1).spec2makeflags := $(if $($(1)-WHITELIST-RPMS),--whitelist-rpms $($(1)-WHITELIST-RPMS),)
endef
$(foreach package, $(ALL), $(eval $(call stage1_package_vars,$(package))))
### this utility allows to extract various info from a spec file
### and to define them in makefiles
+# use the C code where it works as it's the original one, use the python code otherwise
spec2make: spec2make.c
- $(CC) -g -Wall $< -o $@ -lrpm -lrpmbuild -lrpmio -lpopt
+ $(CC) -g -Wall $< -o $@ -lrpm -lrpmbuild -lrpmio -lpopt || ln -s spec2make.py $@
### run spec2make on the spec file and include the result
# usage: spec2make package
$(foreach package,$(ALL),$(eval $(call target_mk,$(package))))
-# stores PLDISTRO in a file
+# stores env variables in a file
# this is done at stage1. later run wont get confused
SAVED_VARS=PLDISTRO PLDISTROTAGS build-SVNPATH PERSONALITY MAILTO BASE WEBPATH TESTBUILDURL WEBROOT
+# also remember variable settings in alias, like sfa-GITPATH=git://git.f-lab.fr/sfa.git@generic
+# but don't save stage1
+ASSIGNS=$(foreach chunk,$(MAKEFLAGS),$(if $(findstring =,$(chunk)),$(if $(findstring stage1,$(chunk)),,$(chunk)),,))
savedpldistro.mk:
@echo "# do not edit" > $@
@$(foreach var,$(SAVED_VARS),echo "$(var):=$($(var))" >> $@ ;)
@echo "# do not edit" > aliases
@echo -n "alias m=\"make " >> aliases
@$(foreach var,$(SAVED_VARS),echo -n " $(var)=$($(var))" >> aliases ;)
+ @echo -n $(ASSIGNS) >> aliases
@echo "\"" >> aliases
@echo "alias m1=\"m stage1=true\"" >> aliases