set defaults in the specfile
[linux-2.6.git] / Makefile
index fd36706..7796405 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ AWK     = awk
 SHA1SUM        = sha1sum
 SED    = sed
 
+# this is passed on the command line as the full path to <build>/SPECS/kernel.spec
 SPECFILE = kernel.spec
 
 # Thierry - when called from within the build, PWD is /build
@@ -73,22 +74,23 @@ new-sources: download-sources
        done
 
 PREPARCH ?= noarch
-RPMDIRDEFS = --define "_sourcedir $(PWD)" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
+RPMDIRDEFS = --define "_sourcedir $(PWD)/SOURCES" --define "_builddir $(PWD)" --define "_srcrpmdir $(PWD)" --define "_rpmdir $(PWD)"
 trees: sources
        rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bp --target $(PREPARCH) $(SPECFILE)
 
 # use the stock source rpm, unwrap it,
+# copy the downloaded material
 # install our own specfile and patched patches
 # and patch configs for IPV6
 # then rewrap with rpm
 srpm: sources
-       mkdir SOURCES SRPMS
+       mkdir -p SOURCES SRPMS
        (cd SOURCES; rpm2cpio ../$(SOURCE_RPM) | cpio -diu; \
-        cp ../$(SPECFILE) . ; cp ../linux*.patch . ; \
+        cp ../$(notdir $(SPECFILE)) . ; cp ../linux*.patch . ; \
+        for downloaded in $(SOURCEFILES) ; do cp ../$$downloaded . ; done ; \
         sed -i -e s,CONFIG_IPV6=m,CONFIG_IPV6=y, config-generic)
        ./rpmmacros.sh
-       export HOME=$(shell pwd) ; rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs SOURCES/$(SPECFILE)
-       cp $(SOURCE_RPM) $(EXPECTED_SRPM)
+       export HOME=$(shell pwd) ; rpmbuild $(RPMDIRDEFS) $(RPMDEFS) --nodeps -bs $(SPECFILE)
 
 TARGET ?= $(shell uname -m)
 rpm: sources