NAME := system-lsb
SPECFILE = $(NAME).spec

SCRIPTS=lsb_start_daemon lsb_killproc lsb_pidofproc lsb_log_message

system-lsb.spec: system-lsb.spec.in mksystem-lsb
	@[ -f system-lsb.spec ] && mv system-lsb.spec system-lsb.spec.old || :
	./mksystem-lsb
	@[ -f system-lsb.spec.old ] && diff -u system-lsb.spec.old system-lsb.spec || :

dist: clean system-lsb.spec
	@VERSION=`awk '/^Version: / { print $$2 }' system-lsb.spec`; \
	mkdir system-lsb-$$VERSION; \
	find -type f -maxdepth 1 -exec cp {} system-lsb-$$VERSION \; ; \
	tar cjf system-lsb-$$VERSION.tar.bz2 system-lsb-$$VERSION; \
	rm -rf system-lsb-$$VERSION

clean:
	@rm -rf *~ .#* lsb-release* *.bz2 system-lsb.spec.old

install:
	mkdir -p -m 755 $(DESTDIR)/etc/system-lsb
	mkdir -p -m 755 $(DESTDIR)/lib/lsb
	for script in $(SCRIPTS) ; do \
	  install -m 755 $$script $(DESTDIR)/etc/system-lsb ;\
	done
	install -m 755 init-functions $(DESTDIR)/lib/lsb
