-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added gpd-fan package, needed for the repository that is used in pacm…
…an when building the ISO
- Loading branch information
Showing
2 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Maintainer: <[email protected]> | ||
|
||
# Inspired by cawilliamson https://github.com/cawilliamson/ansible-gpdpocket | ||
|
||
pkgname=gpd-fan | ||
pkgver=0.1.0 | ||
pkgrel=1 | ||
arch=('x86_64') | ||
url="https://github.com/njkli/gpd-pocket" | ||
license=('MIT') | ||
provides=('gpd-fan') | ||
depends=('i2c-tools' 'thermald' 'tlp' 'gc' 'libatomic_ops' 'pcre' 'libevent' 'llvm-libs') | ||
makedepends=('crystal' 'shards') | ||
install=gpd-fan.install | ||
source=("${pkgname}::git://github.com/njkli/gpd-fan.git") | ||
sha256sums=('SKIP') | ||
|
||
pkgver() { | ||
printf "%s" "$(grep define_version ${srcdir}/${pkgname}/gpd-fan.cr | awk '{print $2}' | sed 's/\"//g')" | ||
} | ||
|
||
build() { | ||
cd "${srcdir}/${pkgname}" | ||
crystal deps | ||
msg 'Building binary...' | ||
crystal build --release --no-debug gpd-fan.cr | ||
} | ||
|
||
package() { | ||
mkdir -p $pkgdir/usr/bin | ||
mkdir -p $pkgdir/usr/lib/systemd/system | ||
mkdir -p $pkgdir/etc/default | ||
mkdir -p $pkgdir/usr/lib/systemd/system-sleep | ||
|
||
install -Dm0755 "$srcdir/${pkgname}/gpd-fan" "$pkgdir/usr/bin/gpd-fan" | ||
# TODO: Perhaps make it into systemd-timer instead? | ||
install -Dm0644 "$srcdir/${pkgname}/gpd-fan.service" "$pkgdir/usr/lib/systemd/system/gpd-fan.service" | ||
install -Dm0644 "$srcdir/${pkgname}/gpd-fan.example" "$pkgdir/etc/default/gpd-fan.example" | ||
install -Dm0755 "$srcdir/${pkgname}/gpd-fan.sleep" "$pkgdir/usr/lib/systemd/system-sleep/gpd-fan" | ||
} | ||
|
||
# vim:set ts=2 sw=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -*- shell-script -*- | ||
# Colored makepkg-like functions | ||
all_off="$(tput sgr0)" | ||
bold="${all_off}$(tput bold)" | ||
blue="${bold}$(tput setaf 4)" | ||
yellow="${bold}$(tput setaf 3)" | ||
|
||
msg_blue() { | ||
printf "${blue}==>${bold} $1${all_off}\n" | ||
} | ||
|
||
note() { | ||
printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n" | ||
} | ||
|
||
_update() { | ||
msg_blue "Restarting gpd-fan.service..." | ||
systemctl stop gpd-fan.service | ||
systemctl daemon-reload | ||
systemctl enable gpd-fan.service | ||
systemctl start gpd-fan.service | ||
note "See /etc/default/gpd-fan.example for customization!" | ||
} | ||
|
||
post_install() { | ||
_update | ||
} | ||
|
||
post_upgrade() { | ||
_update | ||
} | ||
|
||
post_remove() { | ||
systemctl stop gpd-fan.service | ||
systemctl daemon-reload | ||
msg_blue "Removed gpd-fan.service..." | ||
} |