Skip to content

Packaging process and systemd service #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Adds packaging process for debs and systemd service module
  • Loading branch information
zachfeldman committed Oct 9, 2023
commit 6243866d8826cf06e46b4ed87cdec91533cd9b58
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"'