ifndef $(UNAME)
  UNAME = $(shell uname -r)
endif
ifndef $(KERN_DIR)
  KERN_DIR = /lib/modules/$(shell uname -r)/build
endif


all:
	@( echo "%define UNAME" $(UNAME) > spec; \
	   echo "%define KERN_DIR" $(KERN_DIR) >> spec; \
	   echo "" >> spec; \
	   cat spec.in >> spec )
	rpmbuild -bb spec

clean:
	rm -rf spec
