From 5bf9f3f9ea7f7dd8cc15114eca7d213c1711e9d0 Mon Sep 17 00:00:00 2001 From: CodeChenL <2540735020@qq.com> Date: Wed, 27 Dec 2023 14:31:23 +0800 Subject: [PATCH] Optimize Packaging Scripts --- .github/workflows/release.yml | 3 --- Makefile | 21 ++++++++++++++++----- SOURCE | 4 ++-- debian/.gitignore | 1 + debian/changelog | 2 +- debian/compat | 2 +- debian/control | 3 ++- debian/copyright | 4 ++-- debian/dkms | 7 +++---- debian/install | 5 +++++ debian/rules | 7 ------- debian/source/format | 2 +- debian/source/lintian-overrides | 2 +- radxa-overlays-dkms.ko => radxa-overlays.ko | 0 14 files changed, 35 insertions(+), 28 deletions(-) create mode 100755 debian/install rename radxa-overlays-dkms.ko => radxa-overlays.ko (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 80dae5cb..7a2f00db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,9 +18,6 @@ jobs: with: submodules: recursive fetch-depth: 0 - - name: Test - run: | - make deb - name: Build run: | sudo apt-get update diff --git a/Makefile b/Makefile index a10ef0eb..fbd16d5a 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,9 @@ DTBO-ROCKCHIP := $(addprefix arch/arm64/boot/dts/rockchip/overlays/,$(dtb-rockch DTBO := $(DTBO-AMLOGIC) $(DTBO-ROCKCHIP) TMP := $(addsuffix .tmp,$(DTBO)) + +VERSION := 0.1.0 + .PHONY: all all: build @@ -34,15 +37,23 @@ distclean: clean .PHONY: clean clean: rm -rf $(DTBO) $(TMP) + rm -rf debian/.debhelper debian/radxa-overlays-dkms debian/debhelper-build-stamp debian/files debian/*.debhelper.log debian/*.*.debhelper debian/*.substvars + +DOCS := SOURCE +.PHONY: build-doc +build-doc: $(DOCS) + +.PHONY: SOURCE +SOURCE: + echo -e "git clone $(shell git remote get-url origin)\ngit checkout $(shell git rev-parse HEAD)" > "$@" # # Release # .PHONY: dch -dch: debian/changelog - gbp dch --debian-branch=main - +dch: debian/changelog build-doc + EDITOR=true gbp dch --commit --debian-branch=main --release --dch-opt=--upstream .PHONY: deb -deb: debian - debuild --no-lintian --lintian-hook "lintian --fail-on error,warning --suppress-tags bad-distribution-in-changes-file -- %p_%v_*.changes" --no-sign -b +deb: debian build-doc + debuild --set-envvar DEB_RADXA_OVERLAYS_VERSION="$(VERSION)" --no-lintian --lintian-hook "lintian --fail-on error,warning --suppress-tags bad-distribution-in-changes-file -- %p_%v_*.changes" --no-sign -b diff --git a/SOURCE b/SOURCE index ee5a6ad5..519272de 100644 --- a/SOURCE +++ b/SOURCE @@ -1,2 +1,2 @@ -git clone https://github.com/radxa/overlays.git -git checkout 491532d1cb65b7fa4c398e53a679e0784ffb347b +git clone https://github.com/CodeChenL/overlays.git +git checkout 21122cea85f6155a8d4e0845e129306acf28fcfc diff --git a/debian/.gitignore b/debian/.gitignore index b6841b61..5b900605 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -5,3 +5,4 @@ /*.debhelper.log /*.debhelper /*.substvars +SOURCE \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index ac686dd5..9ca6e1e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -radxa-overlays-dkms (1.0.0-1) UNRELEASED; urgency=medium +radxa-overlays (0.1.0) UNRELEASED; urgency=medium * Initial release diff --git a/debian/compat b/debian/compat index f599e28b..48082f72 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -10 +12 diff --git a/debian/control b/debian/control index 18c8c8eb..401addf6 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: radxa-overlays-dkms +Source: radxa-overlays Maintainer: "Radxa Computer Co., Ltd" Section: misc Priority: optional @@ -7,6 +7,7 @@ Build-Depends: debhelper (>=12~), devscripts, dh-sequence-dkms, lintian, + dh-exec, Package: radxa-overlays-dkms Architecture: all diff --git a/debian/copyright b/debian/copyright index d0f1454a..2b0c1844 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,6 +1,6 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: overlay -Source: https://github.com/radxa-pkg/overlay +Upstream-Name: overlays +Source: https://github.com/radxa-pkg/overlays Files: * Copyright: © 2022 Radxa Computer Co., Ltd diff --git a/debian/dkms b/debian/dkms index a23b67fa..3489405e 100644 --- a/debian/dkms +++ b/debian/dkms @@ -1,7 +1,6 @@ -PACKAGE_NAME="radxa-overlays-dkms" +PACKAGE_NAME="radxa-overlays" PACKAGE_VERSION="#MODULE_VERSION#" -DEST_MODULE_LOCATION[0]="/kernel" +DEST_MODULE_LOCATION[0]="/updates/dkms" MAKE="make all" CLEAN="make clean" -AUTOINSTALL="yes" -FORCE=true \ No newline at end of file +AUTOINSTALL="yes" \ No newline at end of file diff --git a/debian/install b/debian/install new file mode 100755 index 00000000..39befeb0 --- /dev/null +++ b/debian/install @@ -0,0 +1,5 @@ +#!/usr/bin/dh-exec + +arch usr/src/radxa-overlays-${DEB_RADXA_OVERLAYS_VERSION}/ +radxa-overlays.ko usr/src/radxa-overlays-${DEB_RADXA_OVERLAYS_VERSION}/ +Makefile usr/src/radxa-overlays-${DEB_RADXA_OVERLAYS_VERSION}/ \ No newline at end of file diff --git a/debian/rules b/debian/rules index 0a390847..8901b935 100755 --- a/debian/rules +++ b/debian/rules @@ -6,19 +6,12 @@ include /usr/share/dpkg/architecture.mk %: dh $@ -override_dh_install: - dh_install -p radxa-overlays-dkms arch usr/src/radxa-overlays-dkms-$(DEB_VERSION) - dh_install -p radxa-overlays-dkms radxa-overlays-dkms.ko usr/src/radxa-overlays-dkms-$(DEB_VERSION) - dh_install -p radxa-overlays-dkms Makefile usr/src/radxa-overlays-dkms-$(DEB_VERSION) - override_dh_dkms: dh_dkms -V $(DEB_VERSION) override_dh_builddeb: dh_builddeb -- -Zxz -override_dh_lintian: - dh_lintian override_dh_auto_build: echo "disable dh_auto_build" diff --git a/debian/source/format b/debian/source/format index 163aaf8d..89ae9db8 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides index 7d998616..1bdac0c8 100644 --- a/debian/source/lintian-overrides +++ b/debian/source/lintian-overrides @@ -1,4 +1,4 @@ # Our package is built on GitHub-hosted runner, # which uses Ubuntu, and will default to zstd compression. # This is currently not supported in Debian. -radxa-overlays-dkms source: custom-compression-in-debian-rules +radxa-overlays source: custom-compression-in-debian-rules diff --git a/radxa-overlays-dkms.ko b/radxa-overlays.ko similarity index 100% rename from radxa-overlays-dkms.ko rename to radxa-overlays.ko