summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis Polti2016-01-22 01:14:30 +0100
committerAlexis Polti2016-01-22 01:14:30 +0100
commit1f79409501a2b02f50218f74ed55dc0073840555 (patch)
treefe9219b26804f97dba19eab0c6415c5dbad2efe1
downloadaur-1f79409501a2b02f50218f74ed55dc0073840555.tar.gz
Initial version of official Segger Jlink tools
-rw-r--r--.SRCINFO26
-rw-r--r--99-jlink.rules.patch22
-rw-r--r--PKGBUILD62
-rw-r--r--jlink-software-and-documentation.install42
4 files changed, 152 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..486561f23f79
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+# Generated by mksrcinfo v8
+# Fri Jan 22 00:08:33 UTC 2016
+pkgbase = jlink-software-and-documentation
+ pkgdesc = Official Segger JLink software & documentation pack for Linux
+ pkgver = 5.10g
+ pkgrel = 1
+ url = https://www.segger.com/jlink-software.html
+ install = jlink-software-and-documentation.install
+ arch = i686
+ arch = x86_64
+ groups = jlink-tools
+ license = custom
+ depends = glibc
+ conflicts = j-link-software-and-documentation
+ conflicts = jlink
+ replaces = j-link-software-and-documentation
+ replaces = jlink
+ source = 99-jlink.rules.patch
+ md5sums = 9250383b1a8ba81d06e7479c48b571ac
+ source_i686 = JLink_Linux_510g_i686.tgz::https://www.segger.com/jlink-software.html?step=1&file=JLinkLinuxTGZ32_510g
+ md5sums_i686 = 5969ff903263c2efbc43cae11a1bd8e7
+ source_x86_64 = JLink_Linux_510g_x86_64.tgz::https://www.segger.com/jlink-software.html?step=1&file=JLinkLinuxTGZ64_510g
+ md5sums_x86_64 = 387771245e86d8e5462c993c2065948e
+
+pkgname = jlink-software-and-documentation
+
diff --git a/99-jlink.rules.patch b/99-jlink.rules.patch
new file mode 100644
index 000000000000..35c7a0a5fd08
--- /dev/null
+++ b/99-jlink.rules.patch
@@ -0,0 +1,22 @@
+--- 99-jlink.rules 2016-01-21 23:16:01.893833667 +0100
++++ 99-jlink.rules.new 2016-01-21 23:16:41.974037640 +0100
+@@ -6,15 +6,15 @@
+ # Matches are AND combined, meaning: a==b,c==d,do stuff
+ # results in: if (a == b) && (c == d) -> do stuff
+ #
+-BUS!="usb", ACTION!="add", SUBSYSTEM!=="usb_device", GOTO="jlink_rules_end"
++ACTION!="add", SUBSYSTEM!=="usb_device", GOTO="jlink_rules_end"
+ #
+ # Give all users read and write access.
+ # Note: NOT all combinations are supported by J-Link right now. Some are reserved for future use, but already added here
+ #
+ # 0x0101 - J-Link (default)
+-# 0x0102 - J-Link USBAddr = 1 (obsolete)
+-# 0x0103 - J-Link USBAddr = 2 (obsolete)
+-# 0x0104 - J-Link USBAddr = 3 (obsolete)
++# 0x0102 - J-Link USBAddr = 1 (obsolete)
++# 0x0103 - J-Link USBAddr = 2 (obsolete)
++# 0x0104 - J-Link USBAddr = 3 (obsolete)
+ # 0x0105 - CDC + J-Link
+ # 0x0106 - CDC
+ # 0x0107 - RNDIS + J-Link
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6b0a9aa54c8d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,62 @@
+# Maintainer: Alexis Polti <ArchSegger at gmail dot com>
+
+pkgname=jlink-software-and-documentation
+pkgver=5.10g
+pkgrel=1
+pkgdesc="Official Segger JLink software & documentation pack for Linux"
+arch=('i686' 'x86_64')
+license=('custom')
+groups=('jlink-tools')
+depends=('glibc')
+source_x86_64=("JLink_Linux_${pkgver/./}_x86_64.tgz::https://www.segger.com/jlink-software.html?step=1&file=JLinkLinuxTGZ64_${pkgver/./}")
+source_i686=("JLink_Linux_${pkgver/./}_i686.tgz::https://www.segger.com/jlink-software.html?step=1&file=JLinkLinuxTGZ32_${pkgver/./}")
+source=('99-jlink.rules.patch')
+md5sums=('9250383b1a8ba81d06e7479c48b571ac')
+md5sums_i686=('5969ff903263c2efbc43cae11a1bd8e7')
+md5sums_x86_64=('387771245e86d8e5462c993c2065948e')
+install=$pkgname.install
+url=("https://www.segger.com/jlink-software.html")
+conflicts=("j-link-software-and-documentation" "jlink")
+replaces=("j-link-software-and-documentation" "jlink")
+DLAGENTS=("https::/usr/bin/env curl -o %o -d agree=1 -d confirm=yes ")
+_carch=${CARCH}
+if [ ${CARCH} = "i686" ]; then
+ _carch="i386"
+fi
+
+_jlinkdir=JLink_Linux_V${pkgver/./}_${_carch}
+
+prepare() {
+ # Remove `BUS!="usb"` from udev rules. BUS isn't valid anymore
+ cd ${srcdir}/${_jlinkdir}
+ patch -uN 99-jlink.rules ../99-jlink.rules.patch
+}
+
+package(){
+ # Match package placement from their .deb, in /opt
+ install -dm755 "${pkgdir}/opt/SEGGER/${_jlinkdir}" \
+ "${pkgdir}/usr/share/licenses/${pkgname}" \
+ "${pkgdir}/usr/lib/" \
+ "${pkgdir}/usr/bin/" \
+ "${pkgdir}/etc/udev/rules.d/" \
+ "${pkgdir}/usr/share/doc/${pkgname}/"
+
+ cd ${srcdir}/${_jlinkdir}
+
+ # Bulk copy everything
+ cp --preserve=mode -r J* Doc Samples README.txt "${pkgdir}/opt/SEGGER/${_jlinkdir}"
+
+ # Create links where needed
+ ln -s /opt/SEGGER/${_jlinkdir}/Doc/License.txt "${pkgdir}/usr/share/licenses/${pkgname}/"
+ install -Dm644 99-jlink.rules "${pkgdir}/etc/udev/rules.d/"
+ install -Dm755 libjlinkarm.so.*.* "${pkgdir}/usr/lib/"
+ ln -s "/usr/lib/libjlinkarm.so.*.*" "${pkgdir}/usr/lib/libjlinkarm.so.${pkgver:0:1}"
+
+ for f in J*; do
+ ln -s /opt/SEGGER/${_jlinkdir}/"$f" "${pkgdir}/usr/bin"
+ done
+
+ for f in Doc/*; do
+ ln -s /opt/SEGGER/${_jlinkdir}/"$f" "${pkgdir}/usr/share/doc/${pkgname}"
+ done
+}
diff --git a/jlink-software-and-documentation.install b/jlink-software-and-documentation.install
new file mode 100644
index 000000000000..b84cb8cc1c8b
--- /dev/null
+++ b/jlink-software-and-documentation.install
@@ -0,0 +1,42 @@
+msg() {
+ # check if messages are to be printed using color
+ unset ALL_OFF BOLD BLUE GREEN RED YELLOW
+ # prefer terminal safe colored and bold text when tput is supported
+ if tput setaf 0 &>/dev/null; then
+ ALL_OFF="$(tput sgr0)"
+ BOLD="$(tput bold)"
+ BLUE="${BOLD}$(tput setaf 4)"
+ GREEN="${BOLD}$(tput setaf 2)"
+ RED="${BOLD}$(tput setaf 1)"
+ YELLOW="${BOLD}$(tput setaf 3)"
+ else
+ ALL_OFF="\e[0m"
+ BOLD="\e[1m"
+ BLUE="${BOLD}\e[34m"
+ GREEN="${BOLD}\e[32m"
+ RED="${BOLD}\e[31m"
+ YELLOW="${BOLD}\e[33m"
+ fi
+
+ local mesg=$1; shift
+ printf "${RED} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
+}
+
+license() {
+ msg "By installing this software you agree to the term of the Segger license."
+ msg "See /usr/share/licenses/jlink-software-and-documentation/License.txt"
+ msg "SEGGER J-Link software may only be used with original SEGGER products and authorized OEM products."
+ msg "The use of the licensed software to operate SEGGER product clones is prohibited and illegal."
+}
+
+pre_install(){
+ license
+}
+
+pre_upgrade() {
+ license
+}
+
+post_install() {
+ udevadm control --reload
+}