1
0
Fork 0

added archlinux package

This commit is contained in:
Sangbum Kim 2017-09-05 01:32:58 +09:00
parent be2e961fb1
commit 23b76f349e
2 changed files with 66 additions and 1 deletions

64
PKGBUILD Normal file
View File

@ -0,0 +1,64 @@
# Maintainer: surefire@cryptomile.net
pkgname=cpu_ctrl
pkgver=0+be2e961+
pkgrel=1
pkgdesc="ipmi cpu fan control with core sensor"
arch=('i686' 'x86_64')
url="https://amuz.es/src/infra/cpu_ctrl"
license=('GPL')
conflicts=('cpu_ctrl')
provides=('cpu_ctrl')
replaces=('cpu_ctrl')
options=('!buildflags')
makedepends=('go' 'git')
source=('git+https://amuz.es/src/infra/cpu_ctrl.git'
'cpu_ctrl.service'
)
md5sums=('SKIP'
'979850d8d2adb3ef068c4c08b351ecef')
prepare() {
export GOPATH="${srcdir}/gopath"
export GOBIN="$GOPATH/bin"
export PATH=$GOBIN:$PATH
mkdir -p "$GOPATH/src/amuz.es/src/infra"
go get -u github.com/kardianos/govendor
ln -sfT "$srcdir/$pkgname" "$GOPATH/src/amuz.es/src/infra/$pkgname"
}
pkgver() {
cd "${srcdir}/${pkgname}"
printf '%s+%s+%s' \
$(sed -e 's,/,+,g; s, ,,g' templates/.VERSION) \
$(git rev-list --count HEAD...$(git log --pretty=format:%H -n 1 -- templates/.VERSION)) \
$(git rev-parse --short HEAD) \
;
}
build() {
cd "${GOPATH}/src/amuz.es/src/infra/$pkgname"
rm -rf vendor
mkdir vendor
govendor init
govendor fetch -v +missing
BINARY=cpu_ctrl
VERSION=`git describe --always`
BUILD=`date +%FT%T%z`
export LDFLAGS=
export CGO_ENABLED=0
go build -o ${BINARY}
strip -x ${BINARY}
}
package() {
cd "${GOPATH}/src/amuz.es/src/infra/$pkgname"
install -Dm0755 -t "$pkgdir/usr/bin" ./cpu_ctrl
install -Dm0644 -t "$pkgdir/usr/lib/systemd/system" "$srcdir/cpu_ctrl.service"
}

View File

@ -31,12 +31,13 @@ var (
)
type notifyType string
const (
DaemonStarted notifyType = "READY=1"
DaemonStopping notifyType = "STOPPING=1"
)
var sockPath string
func NotifyDaemon(status notifyType) {
daemon.SdNotify(false, string(status))