feat: add driver package to build DEB package support in Debian DKMS format

Log: add Debian packaging support
This commit is contained in:
刘鑫 2021-05-15 16:42:04 +08:00
parent b4d6cb1d6f
commit ae5be09bbc
12 changed files with 162 additions and 1 deletions

2
.gitignore vendored
View file

@ -48,7 +48,7 @@ modules.builtin
# #
# Debian directory (make deb-pkg) # Debian directory (make deb-pkg)
# #
/debian/ # /debian/
# #
# git files that we don't want to ignore even it they are dot-files # git files that we don't want to ignore even it they are dot-files

6
debian/README.Debian vendored Normal file
View file

@ -0,0 +1,6 @@
rtl8188eu for Debian
-------------------
<possible notes regarding this package - if none, delete this file>
-- liuxin <liuxin@uniontech.com> Sat, 15 May 2021 14:47:26 +0800

10
debian/README.source vendored Normal file
View file

@ -0,0 +1,10 @@
rtl8188eu for Debian
-------------------
<this file describes information about the source package, see Debian policy
manual section 4.14. You WILL either need to modify or delete this file>
-- liuxin <liuxin@uniontech.com> Sat, 15 May 2021 14:47:26 +0800

5
debian/changelog vendored Normal file
View file

@ -0,0 +1,5 @@
rtl8188eu (4.1.4-1) unstable; urgency=medium
* Add driver package to build DEB package support in Debian DKMS format.
-- liuxin <liuxin@uniontech.com> Sat, 15 May 2021 14:47:26 +0800

1
debian/compat vendored Normal file
View file

@ -0,0 +1 @@
11

22
debian/control vendored Normal file
View file

@ -0,0 +1,22 @@
Source: rtl8188eu
Section: misc
Priority: optional
Maintainer: liuxin <liuxin@uniontech.com>
Build-Depends: debhelper (>= 11),
dkms,
bc,
module-assistant,
build-essential
Standards-Version: 4.1.3
Vcs-Browser: https://github.com/lwfinger/rtl8188eu
Vcs-Git: https://github.com/lwfinger/rtl8188eu.git
Package: rtl8188eu-dkms
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: DKMS files to build and install rtl8188ec
The rtl8188ec driver provides the driver for USB wifi adapter.
This package contains the DKMS files to build and install rtl8188ec.
To install this package, you have to install the header files for your
current kernel manually (usually included in the "linux-headers-<your
architecture>").

48
debian/copyright vendored Normal file
View file

@ -0,0 +1,48 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: rtl8188eu
Source: https://github.com/lwfinger/rtl8188eu
Files: *
Copyright: 2021 lwfinger <Larry.Finger@lwfinger.net>
License: GPL-2.0+
This program 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 program 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 <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General Public
License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2021 liuxin <liuxin@uniontech.com>
License: GPL-2+
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 <https://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid picking licenses with terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.

14
debian/rtl8188eu-dkms.postinst vendored Normal file
View file

@ -0,0 +1,14 @@
#!/bin/bash
DRV_NAME=8188eu
DRV_VERSION=4.1.4
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

15
debian/rtl8188eu-dkms.prerm vendored Normal file
View file

@ -0,0 +1,15 @@
#!/bin/bash
DRV_NAME=8188eu
DRV_VERSION=4.1.4
dkms remove ${DRV_NAME}/${DRV_VERSION} --all
RESULT=$?
if [[ "$RESULT" != "0" ]]; then
echo "Error occurred while running dkms remove." 2>&1
else
echo "Finished running dkms removal steps."
fi
exit $RESULT

32
debian/rules vendored Executable file
View file

@ -0,0 +1,32 @@
#!/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 -prtl8188eu-dkms -X.o -X.ko hostapd-0.8/ usr/src/8188eu-$(VERSION)
dh_install -prtl8188eu-dkms -X.o -X.ko include/ usr/src/8188eu-$(VERSION)
dh_install -prtl8188eu-dkms -X.o -X.ko os_dep/ usr/src/8188eu-$(VERSION)
dh_install -prtl8188eu-dkms -X.o -X.ko core/ usr/src/8188eu-$(VERSION)
dh_install -prtl8188eu-dkms -X.o -X.ko .git/ usr/src/8188eu-$(VERSION)
dh_install -prtl8188eu-dkms -X.o -X.ko hal/ usr/src/8188eu-$(VERSION)
dh_install -prtl8188eu-dkms rtl_hostapd.conf usr/src/8188eu-$(VERSION)
dh_install -prtl8188eu-dkms rtl8188eufw.bin usr/src/8188eu-$(VERSION)
dh_install -prtl8188eu-dkms control_ap usr/src/8188eu-$(VERSION)
dh_install -prtl8188eu-dkms dkms.conf usr/src/8188eu-$(VERSION)
dh_install -prtl8188eu-dkms Makefile usr/src/8188eu-$(VERSION)
override_dh_dkms:
dh_dkms -V
override_dh_auto_build:
:

1
debian/source/format vendored Normal file
View file

@ -0,0 +1 @@
3.0 (quilt)

7
dkms.conf Normal file
View file

@ -0,0 +1,7 @@
PACKAGE_NAME="rtl8188eu"
PACKAGE_VERSION="4.1.4"
BUILT_MODULE_NAME[0]="8188eu"
MAKE="'make' -j$(nproc) KVER=$kernelver"
CLEAN="'make' clean"
DEST_MODULE_LOCATION[0]="/updates/dkms"
AUTOINSTALL="YES"