Skip to content

Commit

Permalink
Adds packaging process for debs and systemd service module
Browse files Browse the repository at this point in the history
  • Loading branch information
zachfeldman committed Oct 9, 2023
1 parent 7e61d58 commit 6243866
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
Binary file added framework-inputmodule-rs-0.0.1.deb
Binary file not shown.
8 changes: 8 additions & 0 deletions framework-inputmodule-rs.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=framework-inputmodule-rs runs Framework Laptop 16 input modules and keeps their firmware up to date

[Service]
ExecStart=/usr/bin/framework-inputmodule-rs led-matrix --clock

[Install]
WantedBy=multi-user.target
3 changes: 3 additions & 0 deletions postinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

cp -u ./ledmatrix/50-framework.rules /etc/udev/rules.d/
32 changes: 32 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -euxo pipefail

: 'Checking for fpm Ruby gem, installing if not present'
installed=`gem list -i fpm` || true

if [ $installed = 'false' ]; then
gem install fpm
fi

: 'Running the build'
cargo build

: "Packaging"
fpm \
-s dir -t deb \
-p framework-inputmodule-rs-0.0.1.deb \
--name framework-inputmodule-rs \
--version 0.0.1 \
--architecture all \
--description "framework-inputmodule-rs runs Framework Laptop 16 input modules and keeps their firmware up to date" \
--url "https://frame.work" \
--maintainer "Framework <support@frame.work>" \
--deb-systemd ./framework-inputmodule-rs.service \
--deb-systemd-enable \
--deb-systemd-auto-start \
--deb-systemd-restart-after-upgrade \
--after-install postinstall.sh \
target/x86_64-unknown-linux-gnu/debug/inputmodule-control=/usr/bin/framework-inputmodule-rs

: 'Packaging successful, install with "sudo dpkg -i <pkg-name>.deb"'

0 comments on commit 6243866

Please sign in to comment.