Skip to content

Commit

Permalink
feat: add driver package to build DEB package support in Debian DKMS …
Browse files Browse the repository at this point in the history
…format

Log: add Debian packaging support
  • Loading branch information
刘鑫 committed May 15, 2021
1 parent b4d6cb1 commit ae5be09
Show file tree
Hide file tree
Showing 12 changed files with 162 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ modules.builtin
#
# Debian directory (make deb-pkg)
#
/debian/
# /debian/

#
# git files that we don't want to ignore even it they are dot-files
Expand Down
6 changes: 6 additions & 0 deletions debian/README.Debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
rtl8188eu for Debian
-------------------

<possible notes regarding this package - if none, delete this file>

-- liuxin <[email protected]> Sat, 15 May 2021 14:47:26 +0800
10 changes: 10 additions & 0 deletions debian/README.source
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> Sat, 15 May 2021 14:47:26 +0800

5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> Sat, 15 May 2021 14:47:26 +0800
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
22 changes: 22 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Source: rtl8188eu
Section: misc
Priority: optional
Maintainer: liuxin <[email protected]>
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 changes: 48 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
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 <[email protected]>
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 changes: 14 additions & 0 deletions debian/rtl8188eu-dkms.postinst
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 0 deletions debian/rtl8188eu-dkms.prerm
Original file line number Diff line number Diff line change
@@ -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 changes: 32 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
7 changes: 7 additions & 0 deletions dkms.conf
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit ae5be09

Please sign in to comment.