82 lines
2.4 KiB
Makefile
Executable File
82 lines
2.4 KiB
Makefile
Executable File
#!/usr/bin/make -f
|
|
|
|
SHELL := sh -e
|
|
|
|
include debian/rules.defs
|
|
|
|
VERSION_DEBIAN_BINNMU := $(shell echo "$(DEB_VERSION)" | sed -ne 's,.*\+b\(.*\)$$,\1,p')
|
|
|
|
MAKEFLAGS += $(subst parallel=,-j,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
|
|
|
|
build: build-arch build-indep
|
|
|
|
build-arch: debian/control
|
|
dh_testdir
|
|
$(MAKE) -f debian/rules.gen build-arch
|
|
|
|
build-indep: debian/control
|
|
dh_testdir
|
|
$(MAKE) -f debian/rules.gen build-indep
|
|
|
|
DIR_ORIG = ../orig/$(DEB_SOURCE)-$(DEB_VERSION_UPSTREAM)
|
|
TAR_ORIG_NAME = $(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM).orig.tar.xz
|
|
TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME)))
|
|
|
|
orig: $(DIR_ORIG)
|
|
rsync --delete --exclude /debian --exclude .svk --exclude .svn --exclude .git --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
|
|
QUILT_PATCHES='$(CURDIR)/debian/patches' QUILT_PC=.pc quilt push --quiltrc - -a -q --fuzz=0
|
|
|
|
$(DIR_ORIG):
|
|
ifeq ($(TAR_ORIG),)
|
|
$(error Cannot find orig tarball $(TAR_ORIG_NAME))
|
|
else
|
|
mkdir -p ../orig
|
|
tar -C ../orig -xaf $(TAR_ORIG)
|
|
endif
|
|
|
|
maintainerclean:
|
|
rm -f debian/control debian/control.md5sum debian/rules.gen
|
|
rm -rf $(filter-out debian .svk .svn .git, $(wildcard * .[^.]*))
|
|
|
|
clean: debian/control
|
|
dh_testdir
|
|
make -C $(BUILD_DIR) clean top_srcdir=$(CURDIR)
|
|
rm -rf $(STAMPS_DIR) debian/lib/python/debian_linux/__pycache__ debian/*-tmp
|
|
dh_clean
|
|
|
|
binary-indep:
|
|
dh_testdir
|
|
$(MAKE) -f debian/rules.gen binary-indep
|
|
|
|
binary-arch:
|
|
dh_testdir
|
|
$(MAKE) -f debian/rules.gen binary-arch
|
|
|
|
binary: binary-indep binary-arch
|
|
|
|
CONTROL_FILES = debian/changelog $(wildcard debian/templates/control.*)
|
|
debian/control debian/rules.gen: debian/bin/gencontrol.py $(CONTROL_FILES)
|
|
ifeq ($(wildcard debian/control.md5sum),)
|
|
$(MAKE) -f debian/rules debian/control-real
|
|
else ifeq ($(VERSION_DEBIAN_BINNMU),)
|
|
md5sum --check debian/control.md5sum --status || \
|
|
$(MAKE) -f debian/rules debian/control-real
|
|
else
|
|
grep -v debian/changelog debian/control.md5sum | md5sum --check - --status || \
|
|
$(MAKE) -f debian/rules debian/control-real
|
|
endif
|
|
|
|
debian/control-real: debian/bin/gencontrol.py $(CONTROL_FILES)
|
|
chmod +x $<
|
|
$<
|
|
md5sum $^ > debian/control.md5sum
|
|
@echo
|
|
@echo This target is made to fail intentionally, to make sure
|
|
@echo that it is NEVER run during the automated build. Please
|
|
@echo ignore the following error, the debian/control file has
|
|
@echo been generated SUCCESSFULLY.
|
|
@echo
|
|
exit 1
|
|
|
|
.PHONY: clean build setup binary-indep binary-arch binary
|