aboutsummaryrefslogtreecommitdiffstats
path: root/main/lm_sensors/APKBUILD
blob: 301452c53aba8e477c4fd91d33c63d343fe75248 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lm_sensors
pkgver=3.4.0
pkgrel=3
pkgdesc="Collection of user space tools for general SMBus access and hardware monitoring."
url="http://www.lm-sensors.org/"
arch="all"
license="GPL"
depends="bash sysfsutils"
makedepends="perl rrdtool-dev bison flex"
subpackages="$pkgname-dev $pkgname-doc $pkgname-detect $pkgname-sensord"
#install=sensors.install

# 2015-11-11 (bpiotrowski): upstream website is down, Fedora mirrored the file
#source="http://dl.lm-sensors.org/lm-sensors/releases/$pkgname-$pkgver.tar.bz2
source="http://pkgs.fedoraproject.org/repo/pkgs/lm_sensors/lm_sensors-3.4.0.tar.bz2/c03675ae9d43d60322110c679416901a/lm_sensors-3.4.0.tar.bz2
	sensors-detect-alpine.patch
	musl-fix-includes.patch
	fancontrol.initd
	sensord.confd
	sensord.initd
	"

_builddir="$srcdir"/$pkgname-$pkgver

prepare() {
	cd "$_builddir"
	sed -i -e 's:^# \(PROG_EXTRA\):\1:' Makefile
	# Respect LDFLAGS
	sed -i -e 's/\$(LIBDIR)$/\$(LIBDIR) \$(LDFLAGS)/g' Makefile
	sed -i -e 's/\$(LIBSHSONAME) -o/$(LIBSHSONAME) \$(LDFLAGS) -o/g' \
		lib/Module.mk

	# do not check for libiconv in ldconfig cache
	sed -i -e 's/^LIBICONV.*/LIBICONV ?=/' prog/sensors/Module.mk || return 1

	for i in ../*.patch; do
		msg "Applying $i"
		patch -p1 < $i || return 1
	done
}

build() {
	cd "$_builddir"
	export CFLAGS="$CFLAGS -fno-stack-protector"
	make PREFIX=/usr user || return 1
}

package() {
	cd "$_builddir"
	make PROG_EXTRA:=sensord user_install \
		PREFIX=/usr \
		MANDIR=/usr/share/man \
		DESTDIR="$pkgdir" || return 1

	cd "$srcdir"
	install -Dm755 fancontrol.initd "$pkgdir"/etc/init.d/fancontrol
}

detect() {
	depends="perl"
	pkgdesc="Detection/migration scripts for lm_sensors"
	mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/sbin
	cd "$pkgdir"
	mv usr/bin/sensors-conf-convert "$subpkgdir"/usr/bin/
	mv usr/sbin/sensors-detect "$subpkgdir"/usr/bin/
}

sensord() {
	pkgdesc="sensord daemon"
	cd $_builddir
	mkdir -p "$subpkgdir"/usr/sbin
	mv "$pkgdir"/usr/sbin/sensord "$subpkgdir"/usr/sbin/sensord || return 1
	install -Dm755 "$srcdir"/sensord.initd "$subpkgdir"/etc/init.d/sensord
	install -Dm755 "$srcdir"/sensord.confd "$subpkgdir"/etc/conf.d/sensord
}

md5sums="c03675ae9d43d60322110c679416901a  lm_sensors-3.4.0.tar.bz2
8e508dcb4e35c2b05154ea0efae08a19  sensors-detect-alpine.patch
9411b5410420df8251c6e6c9c958fd89  musl-fix-includes.patch
a0d35e054e9b0abb286c71f2212515f7  fancontrol.initd
82e075236a61334abb3adf46280380d3  sensord.confd
8e4b68b7cf6d3f29a320af2dc2f5c1eb  sensord.initd"
sha256sums="e0579016081a262dd23eafe1d22b41ebde78921e73a1dcef71e05e424340061f  lm_sensors-3.4.0.tar.bz2
8a18ea7ebea7b85f8ef518adba4445f08002b5a749b74bae174fc6496c818b5b  sensors-detect-alpine.patch
e9bf572221a262bb53cefc86bea4d3d957a1e7962e6b3c0c2917fb3945bb7545  musl-fix-includes.patch
1b108ed9e856bd1defdfe94ee6d299c50cc09bac1b70f865d83542ac7ae7c98c  fancontrol.initd
02230edf5efbb0a4de3840cd76f9ebf431c57a246fa7388e9dbeb0fe26fe7b8d  sensord.confd
756ca3a1e138d10dd73246df3c3ff174330f351e7c4ca15e4bf888a0e3bb162a  sensord.initd"
sha512sums="993064bd14b855c1ae8c057e89313df5b3d5efe441fb2e8c3e508f42bb15658564df2563fac8fabbdb0d650dfdbc694037736c748d45cb9d85dfb8fb5a3d1ea9  lm_sensors-3.4.0.tar.bz2
794cf2aaa2a9e809c6b67f4c888a89064bba3e5b9333a9f0101a92372c25012e506fa48e86523f57cf30e5c2a808bc38058fd8640c870ea6b48faab44794cfbb  sensors-detect-alpine.patch
333751cb580c94f2d32ef5520d2f2acc0ef7e1cd4a6390ea75cae4c755fbdfcade1805c979ba3319905f1267bdc120a6746e6f70d89e0c72a8c2faefd34a9e79  musl-fix-includes.patch
04756c3844033dc7897e1348181140a43f8470c1bb863f1524b21bbe6be2f13fbf17ac3a68270c96a70d8c148124fea569d1ef75619bbe383e15ec705ea18b21  fancontrol.initd
a77d81ab7ded085ba19e4c637e93268f889ccb8ce9e008a210ae135cb6e2140be07e5d455cf7fcc1084fd57cfbfb3f2bb37207123aebe9566f78b5183806fd7d  sensord.confd
9ba515ce646a45c4604ca5be266e9caf2a0742cc6c3742301c302495ff3d63f1d58db54d2d9e898ac7ced0e5cf7c516b9ee6653e7940efc60eb333b0c0dafa36  sensord.initd"