Skip to content

Commit

Permalink
Optimize Packaging Scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeChenL committed Dec 27, 2023
1 parent a0ae8f9 commit 5bf9f3f
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 28 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
with:
submodules: recursive
fetch-depth: 0
- name: Test
run: |
make deb
- name: Build
run: |
sudo apt-get update
Expand Down
21 changes: 16 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
4 changes: 2 additions & 2 deletions SOURCE
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
/*.debhelper.log
/*.debhelper
/*.substvars
SOURCE
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
radxa-overlays-dkms (1.0.0-1) UNRELEASED; urgency=medium
radxa-overlays (0.1.0) UNRELEASED; urgency=medium

* Initial release

Expand Down
2 changes: 1 addition & 1 deletion debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10
12
3 changes: 2 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: radxa-overlays-dkms
Source: radxa-overlays
Maintainer: "Radxa Computer Co., Ltd" <[email protected]>
Section: misc
Priority: optional
Expand All @@ -7,6 +7,7 @@ Build-Depends: debhelper (>=12~),
devscripts,
dh-sequence-dkms,
lintian,
dh-exec,

Package: radxa-overlays-dkms
Architecture: all
Expand Down
4 changes: 2 additions & 2 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 3 additions & 4 deletions debian/dkms
Original file line number Diff line number Diff line change
@@ -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
AUTOINSTALL="yes"
5 changes: 5 additions & 0 deletions debian/install
Original file line number Diff line number Diff line change
@@ -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}/
7 changes: 0 additions & 7 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -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"

2 changes: 1 addition & 1 deletion debian/source/format
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0 (quilt)
3.0 (native)
2 changes: 1 addition & 1 deletion debian/source/lintian-overrides
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.

0 comments on commit 5bf9f3f

Please sign in to comment.