summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lambiris2019-05-13 20:42:44 -0400
committerTony Lambiris2019-05-13 20:42:44 -0400
commit5206b7b7f18923fc06cd30bf16a67f44f2cb0a88 (patch)
treedb0da7b45a692d2165e6affb7d1e899d2610e197
downloadaur-5206b7b7f18923fc06cd30bf16a67f44f2cb0a88.tar.gz
Initial commit
-rw-r--r--.SRCINFO22
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD45
-rw-r--r--system76-firmware-daemon.install57
4 files changed, 129 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2449befd1c28
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = system76-firmware-daemon-git
+ pkgdesc = System76 Firmware Daemon provides a daemon for installing firmware updates.
+ pkgver = 1.0.5.r0.gc85943a
+ pkgrel = 1
+ url = https://github.com/pop-os/system76-firmware
+ install = system76-firmware-daemon.install
+ arch = any
+ license = GPL
+ makedepends = rust
+ depends = dbus
+ depends = systemd
+ depends = openssl-1.0
+ provides = system76-firmware-daemon
+ conflicts = system76-driver<=17.10.32
+ conflicts = system76-firmware-daemon
+ source = system76-firmware-daemon-git::git://github.com/pop-os/system76-firmware.git
+ source = system76-firmware-daemon.install
+ sha256sums = SKIP
+ sha256sums = 1d2604a2d4273adf05752529d6af917abba7e64d9e04e3519d9c438632cfcf5b
+
+pkgname = system76-firmware-daemon-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..a2c6cc20c081
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+src
+pkg
+system76-firmware-daemon-git
+*pkg.tar.xz
+tags
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..7d87f334a5de
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: Tony Lambiris <tony@criticalstack.com>
+
+pkgname=system76-firmware-daemon-git
+pkgver=1.0.5.r0.gc85943a
+pkgrel=1
+pkgdesc="System76 Firmware Daemon provides a daemon for installing firmware updates."
+arch=('any')
+url="https://github.com/pop-os/system76-firmware"
+license=('GPL')
+install=system76-firmware-daemon.install
+depends=('dbus' 'systemd' 'openssl-1.0')
+makedepends=('rust')
+conflicts=('system76-driver<=17.10.32' 'system76-firmware-daemon')
+provides=('system76-firmware-daemon')
+source=("${pkgname}::git://github.com/pop-os/system76-firmware.git"
+ "system76-firmware-daemon.install")
+sha256sums=('SKIP'
+ '1d2604a2d4273adf05752529d6af917abba7e64d9e04e3519d9c438632cfcf5b')
+
+pkgver() {
+ cd "${srcdir}/${pkgname}"
+
+ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+build() {
+ cd "${srcdir}/${pkgname}"
+
+ # Build and install base package
+ #OPENSSL_LIB_DIR="/usr/lib/openssl-1.0" OPENSSL_INCLUDE_DIR="/usr/include/openssl-1.0" cargo build --release --verbose
+ cargo build --release
+}
+
+package() {
+ cd "${srcdir}/${pkgname}"
+
+ # Install daemons
+ install -m755 -D target/release/system76-firmware-daemon ${pkgdir}/usr/lib/system76-firmware/system76-firmware-daemon
+
+ # Install systemd unit files
+ install -m644 -D debian/system76-firmware-daemon.service ${pkgdir}/usr/lib/systemd/system/system76-firmware-daemon.service
+
+ # Install scripts and configuration
+ install -m755 -D data/system76-firmware-daemon.conf ${pkgdir}/usr/share/dbus-1/system.d/system76-firmware-daemon.conf
+}
diff --git a/system76-firmware-daemon.install b/system76-firmware-daemon.install
new file mode 100644
index 000000000000..89f0bc8341cc
--- /dev/null
+++ b/system76-firmware-daemon.install
@@ -0,0 +1,57 @@
+_service="system76-firmware-daemon.service"
+
+_stop_service() {
+ /usr/bin/systemctl stop $_service &>/dev/null
+}
+
+_disable_service() {
+ /usr/bin/systemctl disable $_service &>/dev/null
+ /usr/bin/systemctl reset-failed $_service &>/dev/null
+}
+
+_restore_service() {
+ /usr/bin/systemctl -q is-enabled $service &>/dev/null && \
+ /usr/bin/systemctl restart $service &>/dev/null
+}
+
+_package_message() {
+ cat <<-EOT
+
+ The System76 Firmware package provides the following system services:
+
+ system76-firmware-daemon.service -- System76 service that exposes a DBUS API for handling firmware updates.
+
+ EOT
+}
+
+post_install() {
+ /usr/bin/systemctl daemon-reload &>/dev/null
+
+ _package_message
+}
+
+pre_upgrade() {
+ _stop_service
+}
+
+post_upgrade() {
+ /usr/bin/systemctl daemon-reload &>/dev/null
+
+ _restore_service
+ _package_message
+}
+
+pre_remove() {
+ _stop_service
+ _disable_service
+}
+
+post_remove() {
+ /usr/bin/systemctl daemon-reload &>/dev/null
+
+ cat <<-EOT
+
+ Be sure to stop and disable all running System76 user services.
+
+ EOT
+}