summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorWilliam Gathoye2017-06-10 15:32:28 +0200
committerWilliam Gathoye2017-06-10 16:03:06 +0200
commit357441cdee702ce8adeb7d8ff24db3bc69cec7be (patch)
tree2e286451def898dca46e3b43b590c3cb825c8857 /PKGBUILD
parent275e4dae81d67f3c90335907a98b93e5f62b87ed (diff)
downloadaur-357441cdee702ce8adeb7d8ff24db3bc69cec7be.tar.gz
Get package features from asix-ax88179-dkms
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD64
1 files changed, 47 insertions, 17 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 05d9972f261..519706ec59b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=asix-dkms
pkgver=4.20.0
-pkgrel=1
+pkgrel=2
pkgdesc="Driver for USB ASIX Ethernet models AX88760 AX88772 AX88772A AX88772B AX88772C AX88178"
arch=('i686' 'x86_64')
@@ -18,18 +18,15 @@ depends=('dkms')
provides=('asix-dkms' 'asix-module')
conflicts=("asix-module")
-install=${pkgname}.install
-options=(!strip)
-
_filename="AX88772C_772B_772A_760_772_178_LINUX_DRIVER_v${pkgver}_Source"
source=(
"http://asix.com.tw/FrootAttach/driver/${_filename}.tar.gz"
- "dkms.conf"
- "asix-dkms.install")
+ 'asix-dkms.conf'
+)
sha512sums=(
'1c51cba49481b7a7273019c9ce6fdf988cfbeeb270cef78a5722439f8fd0e07e9e05bc4983b81998724413df803f3aabe5a75d0367a0423751115e4c2f64009d'
- 'c6230810dfe963452b89800f220713ef3c5539b27f5d2e94b302f51f3b5cd65ed364e7f326b2fb61fdfbe6b831909f2d50c88ce93c5805e3af3d280dc03f0fe1'
- '534ea77f5aa8a008be53def7d45c5ccc89b0b36402d97ebdb71def59882a0b3655d95f2cac9ae16480b5e9ecd562f7acb9ad1c38b5e7fd7b4aa5edf94de4e7e6')
+ 'ded1bed08f61ce207e394fc4f49345f0ea50639f53fb797907402b3503feecc485ba85fb799f2b3bc9c22cd4a250509c5eb99d4b36d42228a9475a9e7d67b293'
+)
package() {
# We are in the source directory ./src/
@@ -39,15 +36,48 @@ package() {
installDir="$pkgdir/usr/src/${pkgname%-dkms}-${pkgver}"
install -dm755 "$installDir"
- install -m644 "$srcdir/dkms.conf" "$installDir"
- install -dm755 "$pkgdir/etc/modprobe.d"
- install -dm755 "$pkgdir/etc/modules-load.d"
- # Set name and version
- sed -e "s/@_PKGBASE@/${pkgname%-dkms}/" \
- -e "s/@PKGVER@/$pkgver/" \
- -i "$installDir/dkms.conf"
+ # The kernel from kernel.org does provide an outdated module asix.
+ # Arch Linux packages that module in their default kernel (normal + lts).
+ # We need to blacklist this module. This makes sure it is not loaded as
+ # ours will be conflicting with the default module.
+ install -dm755 "${pkgdir}/etc/modprobe.d"
+ install -m644 /dev/null \
+ "${pkgdir}/etc/modprobe.d/blacklist-asix.conf"
+ printf "blacklist asix\n" \
+ > "${pkgdir}/etc/modprobe.d/blacklist-asix.conf"
+
+ # Load asix-dkms automatically at boot
+ install -dm755 "${pkgdir}/etc/modules-load.d"
+ install -m644 /dev/null \
+ "${pkgdir}/etc/modules-load.d/asix-dkms.conf"
+ printf "${pkgname}\n" \
+ > "${pkgdir}/etc/modules-load.d/asix-dkms.conf"
+
+ # Patch dkms file and rename it to the mandatory dkms.conf filename.
+ install -m644 "${pkgname}.conf" "${installDir}/dkms.conf"
+ sed -e "s/@PKGVER@/${pkgver}/" \
+ -i "${installDir}/dkms.conf"
+
+ # Install module source
+ cd "${srcdir}/${_filename}"
+
+ # We could use a simple 'cp' here as even if we have a custom umask,
+ # makepkg is redefining his own umask value 0022.
+ # src.: https://git.archlinux.org/pacman.git/tree/scripts/makepkg.sh.in?id=4f2fea240d3039294f6614003206a3dd1f67cfc5#n1255
+ # Also, if we were using a simple 'cp', we would have relied upon upstream
+ # providing a tar archive with the rights we want (755 for folders and 644
+ # for files). While this is currently the case for now, if upstream does
+ # not respect these rights, here, we are making sure we have the rights we
+ # want.
+ # And use a 'while' loop with 'read' and process substitution to harden
+ # this script when special chars are used.
+ # src.: http://mywiki.wooledge.org/BashPitfalls#line-92
+ while IFS= read -r -d '' d; do
+ install -dm755 "${installDir}/$d"
+ done < <(find . -type d -print0)
- # Copy sources (including Makefile)
- cp -r "${_filename}"/* "$installDir/"
+ while IFS= read -r -d '' f; do
+ install -m644 "${srcdir}/${_filename}/$f" "${installDir}/$f"
+ done < <(find . -type f -print0)
}