From 033a465431aa538b9850691b330255493ec0e2f1 Mon Sep 17 00:00:00 2001 From: zhouzilong Date: Thu, 10 Jun 2021 09:25:55 +0800 Subject: [PATCH] =?UTF-8?q?Add=20debian=20directory=EF=BC=8Csupport=20for?= =?UTF-8?q?=20building=20debian=20package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 5 +++++ debian/compat | 1 + debian/control | 14 ++++++++++++++ debian/copyright | 30 ++++++++++++++++++++++++++++++ debian/rtl8812au-dkms.postinst | 14 ++++++++++++++ debian/rtl8812au-dkms.prerm | 28 ++++++++++++++++++++++++++++ debian/rules | 21 +++++++++++++++++++++ debian/source/format | 1 + clean => module.clean | 0 9 files changed, 114 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/rtl8812au-dkms.postinst create mode 100644 debian/rtl8812au-dkms.prerm create mode 100755 debian/rules create mode 100644 debian/source/format rename clean => module.clean (100%) diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..21800ee --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +rtl8812au (4.2.2-1) unstable; urgency=medium + + * Add driver package to build DEB package support in Debian DKMS format. + + -- zhouzilong Wed, 09 Jun 2021 15:18:02 +0800 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b4de394 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +11 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..8fb14c2 --- /dev/null +++ b/debian/control @@ -0,0 +1,14 @@ +Source: rtl8812au +Section: misc +Priority: optional +Maintainer: zhouzilong +Build-Depends: debhelper (>= 11), dkms +Standards-Version: 4.1.3 +Homepage: https://github.com/gnab/rtl8812au + +Package: rtl8812au-dkms +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends}, dkms +Description: rtl8812au driver in DKMS format. + The rtl8812au driver provides the driver for Realtek 802.11ac (rtl8812au). + This package contains the DKMS files to build and install rtl8812au. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..ff03233 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,30 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: rtl8812au +Upstream-Contact: Ole Petter Bang +Source: https://github.com/gnab/rtl8812au + +Files: * +Copyright: 2013-2021 Ole Petter Bang +License: GPL-2.0+ + +Files: debian/* +Copyright: 2021 zhouzilong +License: GPL-2.0+ + +License: GPL-2.0+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + diff --git a/debian/rtl8812au-dkms.postinst b/debian/rtl8812au-dkms.postinst new file mode 100644 index 0000000..e98f52e --- /dev/null +++ b/debian/rtl8812au-dkms.postinst @@ -0,0 +1,14 @@ +#!/bin/bash + +DRV_NAME=8812au +DRV_VERSION=4.2.2 + + +dkms add -m ${DRV_NAME} -v ${DRV_VERSION} +dkms build -m ${DRV_NAME} -v ${DRV_VERSION} +dkms install -m ${DRV_NAME} -v ${DRV_VERSION} +RESULT=$? + +echo "Finished running dkms install steps." + +exit $RESULT diff --git a/debian/rtl8812au-dkms.prerm b/debian/rtl8812au-dkms.prerm new file mode 100644 index 0000000..7207270 --- /dev/null +++ b/debian/rtl8812au-dkms.prerm @@ -0,0 +1,28 @@ +#!/bin/sh + +NAME=8812au +VERSION=4.2.2 + +set -e + +case "$1" in + remove|upgrade|deconfigure) + if [ "`dkms status -m $NAME`" ]; then + dkms remove -m $NAME -v $VERSION --all + fi + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + + + +exit 0 + + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..e1b40b4 --- /dev/null +++ b/debian/rules @@ -0,0 +1,21 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +include /usr/share/dpkg/default.mk + +export DH_VERBOSE = 1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +VERSION ?= $(shell dpkg-parsechangelog | sed -rne 's/^Version: ([0-9.]+).*$$/\1/p') + +%: + dh $@ --with dkms + +override_dh_auto_install: + dh_install -prtl8812au-dkms `ls |grep -v debian |xargs` usr/src/8812au-$(VERSION) + +override_dh_dkms: + dh_dkms -V + +override_dh_auto_build: + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/clean b/module.clean similarity index 100% rename from clean rename to module.clean