LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File debian.rules of Package xchroot (Project home:estellnb:elstel)

#!/usr/bin/make -f
#tar -xzf %{source1}

VERSION := 2.3.3
SOURCE0 := ../SOURCES/xchroot-v$(VERSION)
SOURCE1 := ../SOURCES/xchroot-doc-2013-10-28.tar.gz
SOURCE2 := ../SOURCES/xchroot.8
#INST_DIR := $(CURDIR)/debian/tmp
INST_DIR := $(CURDIR)/debian/xchroot
#INST_DIR := $(DESTDIR)
MAN_DIR := /usr/share/man
DOC_DIR := /usr/share/doc


configure:
	echo BUILD_DIR=$(BUILD_DIR)
	echo INST_DIR=$(INST_DIR)

build:
	chmod +x $(SOURCE0)
	sed -n '1,8s#^.*(c) copyright by \(Elmar Stellnberger\), the original author: .*, [A-Za-z]\{3\} \(20[0-9]\{2\}\)\s*$$#copyright \2 \1#;T next; h; :next 2,8s#^.*current email: \([a-zA-Z0-9@.]*\);.*$$#<\1>#;T end;H;x;s#\n# #;s#$$#\n#;p; :end' <$(SOURCE0) >debian/copyright
	$(SOURCE0) --license >>debian/copyright
	sed -n '2,/^$$/p' <$(SOURCE0) | sed 's/^#//' | gzip -c -9 >changelog.gz
	gzip -c -9 <debian/changelog >changelog.Debian.gz
	tar -xvzf $(SOURCE1)
	cd www.elstel.org; mv auxil/* xchroot/; sed -i 's#/auxil/##' xchroot/*.html; cd -
	sed "s#/usr/share/doc\[/packages\]/xchroot#$(DOC_DIR)/xchroot#" $(SOURCE2) | gzip -c -9 >xchroot.8.gz

install:
	mkdir -p $(INST_DIR)/usr/sbin
	install $(SOURCE0) $(INST_DIR)/usr/sbin/xchroot
	mkdir -p $(INST_DIR)$(MAN_DIR)/man8/
	install -m 0644 xchroot.8.gz $(INST_DIR)$(MAN_DIR)/man8/

	mkdir -p $(INST_DIR)$(DOC_DIR)/xchroot
	cd www.elstel.org/xchroot; install * $(INST_DIR)$(DOC_DIR)/xchroot; cd -
	install changelog.gz $(INST_DIR)$(DOC_DIR)/xchroot
	install changelog.Debian.gz $(INST_DIR)$(DOC_DIR)/xchroot

binary: configure build install
	dh_testdir
	dh_testroot
	#dh_installchangelogs ChangeLog.gz
	dh_fixperms
	#dh_installman
	dh_installdocs
	dh_installdeb
	dh_md5sums
	dh_gencontrol
	dh_builddeb

build-arch: build
build-indep: build
binary-arch:
binary-indep:

clean:
	dh_testdir
	dh_testroot
	rm -f xchroot.8.gz changelog.gz
	rm -fr www.elstel.org
	dh_clean