summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2018-05-10 23:30:05 -0400
committerChris Severance2018-05-10 23:30:05 -0400
commitdd7706481ee0c5e25259a50dd3408f08f9c8fc18 (patch)
tree2c3d9fba527725f17d06f942d402df60fac621f6
parent5d7046f0d2495cf7c5c0e970b67db4bd8aa25bfd (diff)
downloadaur-dd7706481ee0c5e25259a50dd3408f08f9c8fc18.tar.gz
autu: Update to 7.28-2
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD68
2 files changed, 63 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a75b4a7bed7..0b43ed5b17d 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Thu May 10 18:06:14 UTC 2018
+# Fri May 11 03:30:04 UTC 2018
pkgbase = nslink
pkgdesc = tty driver and firmware update for Comtrol DeviceMaster, RTS, LT, PRO, 500, UP, RPSH-SI, RPSH, and Serial port Hub console terminal device server
pkgver = 7.28
- pkgrel = 1
+ pkgrel = 2
url = http://www.comtrol.com/
install = nslink-install.sh
arch = i686
@@ -26,9 +26,11 @@ pkgbase = nslink
source = http://downloads.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-7.28.tar.gz
source = http://downloads.comtrol.com/dev_mstr/rts/utility/linux_firmware_uploader/DM-Firmware-Updater-1.06.tar.gz
source = dmupdate.py.usage.patch
+ source = http://downloads.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-7.26.tar.gz
sha256sums = 900d0681a86d0732cf3e71e56a013456d5a77a68f7faa2afb955e275f73353fb
sha256sums = d21c5eeefdbf08a202a230454f0bf702221686ba3e663eb41852719bb20b75fb
sha256sums = 5a4e2713a8d1fe0eebd94fc843839ce5daa647f9fa7d88f62507e660ae111073
+ sha256sums = 5c00939eb945c98336211cd61408b5a8623b01a7059356e663ccc638b0d159fb
pkgname = nslink
diff --git a/PKGBUILD b/PKGBUILD
index 8630250e9fa..64c5dec0439 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -10,7 +10,6 @@ _opt_DKMS=1 # This can be toggled between installs
# Todo: nslinktool Config Driver needs an up down button to reorder entries
# Todo: TUI firmware updater.
# Todo: Comtrol icons for nslinktool and the firmware updater
-# Todo: The IP is backwards in /proc/driver/nslink/status
# Todo: nslinktool set the mouse pointer to a spinning circle far too long after startup
# Uninstall cleanup: sudo rm -f /etc/nslink.conf*
@@ -21,7 +20,7 @@ _opt_DKMS=1 # This can be toggled between installs
set -u
pkgname='nslink'
pkgver='7.28'
-pkgrel='1'
+pkgrel='2'
pkgdesc='tty driver and firmware update for Comtrol DeviceMaster, RTS, LT, PRO, 500, UP, RPSH-SI, RPSH, and Serial port Hub console terminal device server'
# UP is not explicitly supported by NS-Link, only by the firmware updater.
_pkgdescshort="Comtrol DeviceMaster ${pkgname} TTY driver"
@@ -32,12 +31,12 @@ depends=('glibc' 'openssl' 'python2' 'sed' 'groff' 'tcl' 'tk' 'util-linux') # py
optdepends=(
'gksu: NS-Link Manager GUI'
)
-backup=("etc/nslink.conf")
+backup=('etc/nslink.conf')
options=('!zipman')
install="${pkgname}-install.sh"
_verwatch=('http://downloads.comtrol.com/html/DM_PRO_RTS_SERIALHUB_drivers.htm' '.*/devicemaster-linux-\([0-9\.]\+\)\.tar\.gz' 'l')
_srcdir="devicemaster-linux-${pkgver}"
-_srcdir2="DM-Firmware-Updater-1.06" # http://downloads.comtrol.com/html/DM_PRO_RTS_SERIALHUB_pvdx2.htm
+_srcdir2='DM-Firmware-Updater-1.06' # http://downloads.comtrol.com/html/DM_PRO_RTS_SERIALHUB_pvdx2.htm
#source=("ftp://ftp.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-${pkgver}.tar.gz")
source=("http://downloads.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-${pkgver}.tar.gz")
#source+=('ftp://ftp.comtrol.com/dev_mstr/rts/utility/linux_firmware_uploader/DM-Firmware-Updater-1.06.tar.gz')
@@ -45,7 +44,8 @@ source+=('http://downloads.comtrol.com/dev_mstr/rts/utility/linux_firmware_uploa
source+=('dmupdate.py.usage.patch')
sha256sums=('900d0681a86d0732cf3e71e56a013456d5a77a68f7faa2afb955e275f73353fb'
'd21c5eeefdbf08a202a230454f0bf702221686ba3e663eb41852719bb20b75fb'
- '5a4e2713a8d1fe0eebd94fc843839ce5daa647f9fa7d88f62507e660ae111073')
+ '5a4e2713a8d1fe0eebd94fc843839ce5daa647f9fa7d88f62507e660ae111073'
+ '5c00939eb945c98336211cd61408b5a8623b01a7059356e663ccc638b0d159fb')
if [ "${_opt_DKMS}" -ne 0 ]; then
depends+=('linux' 'dkms' 'linux-headers')
@@ -53,6 +53,19 @@ else
makedepends+=('linux-headers')
fi
+_opt_LEGACY_VER=''
+# Install both versions so dkms gets the right version for each kernel
+if [ "${_opt_DKMS}" -ne 0 ]; then
+ # 7.26 supports Kernels 2.6.33 through 4.14.x
+ # 7.28 supports Kernels 4.15 through 4.17.x.
+ _opt_LEGACY_VER='7.26'
+ if [ "$(vercmp "${pkgver}" "${_opt_LEGACY_VER}")" -gt 0 ]; then
+ source+=("http://downloads.comtrol.com/dev_mstr/rts/drivers/linux/devicemaster-linux-${_opt_LEGACY_VER}.tar.gz")
+ else
+ _opt_LEGACY_VER=''
+ fi
+fi
+
prepare() {
set -u
cd "${_srcdir}"
@@ -192,10 +205,10 @@ EOF
# DKMS
if [ "${_opt_DKMS}" -ne 0 ]; then
- rm -rf "${pkgdir}/usr/lib/modules/"
+ rm -r "${pkgdir}/usr/lib/modules/"
local _dkms="${pkgdir}/usr/src/${pkgname}-${pkgver}"
#install -d "${_dkms}"
- install -Dpm644 'nslink.h' 'nslink_int.h' 'version.h' 'nslink.c' 'Makefile' -t "${_dkms}/"
+
install -Dm644 <(cat << EOF
# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR
# https://aur.archlinux.org/
@@ -213,14 +226,50 @@ CLEAN[0]="make -j1 clean"
DEST_MODULE_LOCATION[0]="/kernel/drivers/misc"
EOF
) "${_dkms}/dkms.conf"
- #make -C "${_dkms}/" clean
+_fn_dkmsinst() {
+ install -Dpm644 'nslink.h' 'nslink_int.h' 'version.h' 'nslink.c' 'Makefile' -t "$1"
+ #make -C "$1" clean
sed -e '# No DKMS instructions say to do this but it works and keeps the MAKE line real simple' \
-e 's:$(shell uname -r):$(KERNELRELEASE):g' \
-e 's:`uname -r`:$(KERNELRELEASE):g' \
-e 's:$(KVER):$(KERNELRELEASE):g' \
-e '# Get rid of make lines so make all makes the module' \
-e 's:^\s\+make\s:#&:g' \
- -i "${_dkms}/Makefile"
+ -i "$1/Makefile"
+}
+ if [ -z "${_opt_LEGACY_VER}" ]; then
+ _fn_dkmsinst "${_dkms}"
+ else
+ # It is not necessary to install files to ${_dkms} for pacman -Qo
+ # The cp does not happen in /usr/src but in /var/lib/dkms where dkms cleans everything up
+ _fn_dkmsinst "${_dkms}/${pkgver}"
+
+ # Install a custom make helper that selects source based on kernel version
+ sed -e "/^MAKE/ s:make :${_dkms#${pkgdir}}/makedkms.sh"' KERNELRELEASE=$kernelver :g' -i "${_dkms}/dkms.conf"
+ install -Dm744 <(cat << EOF
+#!/usr/bin/bash
+
+set -e
+set -u
+
+kv="\$*" # \$@ is not what we want here.
+kv="\${kv##*KERNELRELEASE=}"
+kv="\${kv%% *}"
+
+if [ "\$(vercmp "\${kv}" '4.15')" -lt 0 ]; then
+ cp -p '${_opt_LEGACY_VER}'/* .
+else
+ cp -p '${pkgver}'/* .
+fi
+make "\$@"
+EOF
+ ) "${_dkms}/makedkms.sh"
+
+ # Install legacy code
+ pushd "${srcdir}/${_srcdir//${pkgver}/${_opt_LEGACY_VER}}" > /dev/null
+ _fn_dkmsinst "${_dkms}/${_opt_LEGACY_VER}"
+ popd > /dev/null
+ fi
fi
# Install firmware updaters
@@ -242,6 +291,7 @@ Categories=Application;Utilities;
MimeType=application/x-executable
EOF
) "${pkgdir}/usr/share/applications/DM-Firmware-Updater.py.desktop"
+
set +u
}