ifeq (release,$(DEB_BUILD_VARIANT))
PKG_VERSION := `dpkg-parsechangelog -c0 -SVersion`
PKG_OTHER_VARIANT := iocaine-nightly
PACKAGE := iocaine
else
_UPSTREAM_VERSION := `dpkg-parsechangelog -c0 -SVersion | sed -e 's,-[0-9]$$,,'`
PKG_VERSION := $(_UPSTREAM_VERSION)+nightly~${GITHUB_RUN_NUMBER}.g${GITHUB_SHA}-1
PKG_OTHER_VARIANT := iocaine
PACKAGE := iocaine-nightly
endif
PKG_DIR := ${CURDIR}/debian/${PACKAGE}
binary: binary-arch binary-indep
build: build-arch build-indep
clean:
rm -rf debian/iocaine debian/iocaine-nightly
binary-arch: build-arch
test -e debian/control
install -d "${PKG_DIR}/usr/bin" \
"${PKG_DIR}/usr/share/doc/${PACKAGE}" \
"${PKG_DIR}/etc/iocaine" \
"${PKG_DIR}/usr/lib/systemd/system" \
"${PKG_DIR}/usr/share/lintian/overrides"
install -s --strip-program="debian/llvm-strip" -m 0755 result/bin/iocaine "${PKG_DIR}/usr/bin/"
install -m 0644 data/iocaine.service "${PKG_DIR}/usr/lib/systemd/system/"
install -m 0644 data/defaults/config.kdl "${PKG_DIR}/etc/iocaine/"
install -m 0644 data/defaults/README.md "${PKG_DIR}/usr/share/doc/${PACKAGE}/README.qmk.md"
install -m 0644 CHANGELOG.md "${PKG_DIR}/usr/share/doc/${PACKAGE}/changelog"
install -d "${PKG_DIR}/usr/share/man/man1"
install -m 0644 man/*.1 -t "${PKG_DIR}/usr/share/man/man1"
install -m 0644 debian/changelog "${PKG_DIR}/usr/share/doc/${PACKAGE}/changelog.Debian"
install -m 0644 debian/copyright "${PKG_DIR}/usr/share/doc/${PACKAGE}/copyright"
install -m 0644 debian/${PACKAGE}.lintian-overrides "${PKG_DIR}/usr/share/lintian/overrides/${PACKAGE}"
gzip -9nf "${PKG_DIR}/usr/share/doc/${PACKAGE}/changelog" \
"${PKG_DIR}/usr/share/doc/${PACKAGE}/changelog.Debian" \
"${PKG_DIR}/usr/share/doc/${PACKAGE}/README.qmk.md" \
"${PKG_DIR}"/usr/share/man/man1/*.1
find "${PKG_DIR}" -print0 | xargs -0r chown --no-dereference 0:0
install -d "${PKG_DIR}/DEBIAN"
install -m 0644 debian/iocaine.conffiles "${PKG_DIR}/DEBIAN/conffiles"
install -m 0755 debian/iocaine.prerm "${PKG_DIR}/DEBIAN/prerm"
install -m 0755 debian/iocaine.postinst "${PKG_DIR}/DEBIAN/postinst"
install -m 0755 debian/iocaine.postrm "${PKG_DIR}/DEBIAN/postrm"
cd "${PKG_DIR}" >/dev/null ;\
find * -type f ! -regex '^DEBIAN/.*' -print0 | xargs -r0 md5sum >DEBIAN/md5sums
dpkg-gencontrol -P${PACKAGE} -P${PKG_DIR} -v${PKG_VERSION} \
-Viocaine:otherVariant=$(PKG_OTHER_VARIANT) \
-Viocaine:package=${PACKAGE}
dpkg --build "${PKG_DIR}" ..
build-arch:
test -e debian/control
test -e result/bin/iocaine
build-indep binary-indep:
.PHONY: clean binary build binary-arch build-arch build-indep