1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
DEBVERS ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
VERSION ?= $(shell echo '$(DEBVERS)' | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//')
DEBFLAVOR ?= $(shell dpkg-parsechangelog | grep -E ^Distribution: | cut -d" " -f2)
DEBPKGNAME ?= $(shell dpkg-parsechangelog | grep -E ^Source: | cut -d" " -f2)
DEBIAN_BRANCH ?= $(shell cat debian/gbp.conf | grep debian-branch | cut -d'=' -f2 | awk '{print $1}')
GIT_TAG ?= $(shell echo '$(VERSION)' | sed -e 's/~/_/')
export DH_OPTIONS
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DH_INSTALL_FILES = $(basename $(wildcard debian/*.install.in))
export LIBDIR = /usr/lib/$(DEB_HOST_MULTIARCH)
export SHLIBDIR = /lib/$(DEB_HOST_MULTIARCH)
export LIBNAME = lib
export LIBEXECDIR = /lib/rc
ifeq (linux,$(DEB_HOST_ARCH_OS))
export MKAUDIT = yes
export MKPAM = pam
export MKSELINUX = yes
endif
%:
dh $@
%.install: %.install.in
sed -e 's;@SHLIBDIR@;$(SHLIBDIR);g' -e 's;@LIBDIR@;$(LIBDIR);g' <$< >$@
override_dh_auto_clean:
dh_auto_clean
rm -f $(DH_INSTALL_FILES)
rm -f src/test/librc.funcs.hidden.list
install-arch: build-arch $(DH_INSTALL_FILES)
dh $@ $(DH_OPTIONS)
install-indep: build-indep $(DH_INSTALL_FILES)
dh $@ $(DH_OPTIONS)
override_dh_installmenu:
for file in start-stop-daemon runscript rc service ; do \
rm -f $(CURDIR)/debian/openrc/sbin/$${file} ; \
done
rm -rf $(CURDIR)/debian/openrc/etc/pam.d/
for file in service.8 service.8.gz start-stop-daemon.8 start-stop-daemon.8.gz ; do \
rm -f $(CURDIR)/debian/openrc/usr/share/man/man8/$${file} ; \
done
set -e && for i in sysctl.d local.d conf.d ; do \
rm -rf $(CURDIR)/debian/openrc/etc/$${i} ; \
done
find $(CURDIR)/debian/openrc/etc/init.d/* -name savecache -or -name rc -or -name rcS -prune -o -exec rm -f {} +
for dir in boot default sysinit shutdown; do \
rm -f $(CURDIR)/debian/openrc/etc/runlevels/$${dir}/* ; \
done
get-upstream-sources:
git remote add upstream git://github.com/OpenRC/openrc.git || true
git fetch upstream
if ! git checkout master ; then \
echo "No upstream branch: checking out" ; \
git checkout -b master upstream/master ; \
fi
git checkout $(DEBIAN_BRANCH)
make-orig-file:
if [ ! -f ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] ; then \
git archive --prefix=$(DEBPKGNAME)-$(GIT_TAG)/ $(GIT_TAG) | xz >../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ; \
fi
[ ! -e ../build-area ] && mkdir ../build-area || true
[ ! -e ../build-area/$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] && cp ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ../build-area || true
.PHONY: override_dh_auto_clean install-arch install-indep get-upstream-sources make-orig-file
|