summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2017-08-04 22:50:13 -0400
committerChris Severance2017-08-04 22:50:13 -0400
commit897b92da8d2210d5c1230d00fa09e11aef37e261 (patch)
treeb7698f6b1dc534de3cd09fd7b6d0c8b163cf4412
downloadaur-897b92da8d2210d5c1230d00fa09e11aef37e261.tar.gz
Initial Import
-rw-r--r--.SRCINFO22
-rw-r--r--PKGBUILD102
-rw-r--r--brainboxes-serial-pci-install.sh27
3 files changed, 151 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..92fa337e6434
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+# Generated by mksrcinfo v8
+# Sat Aug 5 02:50:02 UTC 2017
+pkgbase = brainboxes-serial-pci
+ pkgdesc = script to enable Brainboxes serial and parallel ports PCI PCIe Express PCMCIA PM UC CC-525 CC-530 PX-275 PX-279 PX-263 PX-295 PX-272 PX-306
+ pkgver = 0.0.20160614
+ pkgrel = 1
+ url = http://www.brainboxes.com/faq/items/where-can-i-find-the-latest-drivers-for-linux
+ install = brainboxes-serial-pci-install.sh
+ arch = any
+ license = GPL
+ makedepends = perl
+ makedepends = setserial
+ makedepends = pciutils
+ options = !strip
+ backup = etc/bbportinst.conf
+ backup = etc/bbportinst.local
+ backup = etc/modprobe.d/parport_bb.conf
+ source = http://www.brainboxes.com/files/pages/support/faqs/drivers%20and%20firmware/bbportinst.zip
+ sha256sums = d5ac2012bae944d398517511b55cd43d920c79de910cae8e60ca05eaa1408b70
+
+pkgname = brainboxes-serial-pci
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..629940773f32
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,102 @@
+# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
+
+# Brainboxes prefix list. Some but not all are supported by this driver.
+# BL - Bluetooth Serial Adapter
+# CC - PCI Serial Cards
+# ES - Ethernet to Serial
+# ED - Ethernet IO
+# IS - IntaShield uPCI Serial Cards
+# IX - IntaShield PCI Express Serial Cards
+# PM - Serial PC Card (PCMCIA)
+# PX - PCI Express Serial Cards
+# UC - uPCI Serial Cards
+# UP - uPCI Powered Serial Cards
+# US - USB to Serial
+# VX - Serial ExpressCard
+# XC - Serial Parallel ExpressCard
+
+# Some future supported models are found in $tf/13
+
+set -u
+pkgname='brainboxes-serial-pci'
+pkgver='0.0.20160614'
+pkgrel='1'
+pkgdesc='script to enable Brainboxes serial and parallel ports PCI PCIe Express PCMCIA PM UC CC-525 CC-530 PX-275 PX-279 PX-263 PX-295 PX-272 PX-306'
+arch=('any')
+url='http://www.brainboxes.com/faq/items/where-can-i-find-the-latest-drivers-for-linux'
+license=('GPL')
+makedepends=('perl' 'setserial' 'pciutils')
+backup=('etc/bbportinst'{.conf,.local} 'etc/modprobe.d/parport_bb.conf')
+options=('!strip')
+install="${pkgname}-install.sh"
+_srcdir='bbportinst'
+source=('http://www.brainboxes.com/files/pages/support/faqs/drivers%20and%20firmware/bbportinst.zip')
+sha256sums=('d5ac2012bae944d398517511b55cd43d920c79de910cae8e60ca05eaa1408b70')
+
+_servicename="${pkgname}.service"
+
+# We can't modify .install but we can stop and force the user to fix it.
+_install_check() {
+ local _ckvar
+ local _ckline
+ local _pkgname="${pkgname}"
+ for _ckvar in '_servicename'; do
+ _ckline="${_ckvar}='${!_ckvar}'"
+ if ! grep -q "^${_ckline}"'$' "${startdir}/${install}"; then
+ msg "${install} must be fixed"
+ echo "${_ckline}"
+ set +u
+ false
+ fi
+ done
+}
+
+prepare() {
+ set -u
+ _install_check
+ cd "${_srcdir}"
+
+ sed -e 's:\s*\r$::g' -i $(grep -rlFe $'\r')
+ chmod 755 'bbportinst'
+
+ # Fix path
+ sed -e 's:/bin/setserial:/usr/bin/setserial:g' -i 'bbportinst'
+ sed -e '# Custom shell script instead of rc.local' \
+ -e '/^boot_local_file =/ s:auto:/etc/bbportinst.local:g' \
+ -e '# This file isnt unique enough' \
+ -e '/^parport_conf_file =/ s:auto:/etc/modprobe.d/parport_bb.conf:g' \
+ -i 'bbportinst.conf'
+ set +u
+}
+
+package() {
+ set -u
+ cd "${_srcdir}"
+ install -Dpm744 'bbportinst' -t "${pkgdir}/usr/bin"
+ install -Dpm644 'bbportinst.conf' -t "${pkgdir}/etc"
+ install -Dm644 /dev/null "${pkgdir}/etc/bbportinst.local"
+ install -Dm644 /dev/null "${pkgdir}/etc/modprobe.d/parport_bb.conf"
+
+ # systemd service
+ install -Dm644 <(cat << EOF
+# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR
+# https://aur.archlinux.org/
+
+[Unit]
+Description=Configure BrainBoxes Serial Parallel Cards bbportinst
+After=network.target
+
+[Service]
+Type=notify
+ExecStart=/usr/bin/sh -c 'source /etc/bbportinst.conf; systemd-notify --ready'
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
+EOF
+ ) "${pkgdir}/usr/lib/systemd/system/${_servicename}"
+
+ set +u
+}
+
+set +u
diff --git a/brainboxes-serial-pci-install.sh b/brainboxes-serial-pci-install.sh
new file mode 100644
index 000000000000..529a2b7ea55e
--- /dev/null
+++ b/brainboxes-serial-pci-install.sh
@@ -0,0 +1,27 @@
+_servicename='brainboxes-serial-pci.service'
+
+post_install() {
+ set -u
+ systemctl daemon-reload
+ systemctl enable "${_servicename}"
+ systemctl start "${_servicename}"
+ echo 'To install your card'
+ echo ' sudo bbportinst; sudo bash -x /etc/bbportinst.local'
+ set +u
+}
+
+post_upgrade() {
+ systemctl daemon-reload
+}
+
+pre_remove() {
+ set -u
+ systemctl stop "${_servicename}"
+ systemctl disable "${_servicename}"
+ set +u
+}
+
+post_remove() {
+ systemctl daemon-reload
+ rm -f '/etc/bbportinst.local'{~,.pacsave} '/etc/modprobe.d/parport_bb.conf'{~,.pacsave}
+}