aboutsummaryrefslogtreecommitdiffstats
path: root/main/lm_sensors/APKBUILD
blob: 9e5076d4acaf6e409ce9a6c2fd0f5792485f5dd0 (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
96
97
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lm_sensors
pkgver=3.3.5
pkgrel=2
pkgdesc="Collection of user space tools for general SMBus access and hardware monitoring."
url="http://www.lm-sensors.org/"
arch="all"
license="GPL"
depends="sysfsutils"
makedepends="perl rrdtool-dev bison flex"
subpackages="$pkgname-dev $pkgname-doc $pkgname-detect $pkgname-sensord"
#install=sensors.install
source="http://dl.lm-sensors.org/lm-sensors/releases/$pkgname-$pkgver.tar.bz2
	sensors-detect-alpine.patch
	musl-fix-includes.patch
	fancontrol.initd
	lm_sensors.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
	install -Dm755 lm_sensors.initd "$pkgdir"/etc/init.d/lm_sensors
}

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="da506dedceb41822e64865f6ba34828a  lm_sensors-3.3.5.tar.bz2
e507d7c34067c03602dd652f31f14f2f  sensors-detect-alpine.patch
9411b5410420df8251c6e6c9c958fd89  musl-fix-includes.patch
58f4c9193a903711ace7fa0754693bd2  fancontrol.initd
2c7e97203da2c39bc9fbfc2a4849cfd4  lm_sensors.initd
82e075236a61334abb3adf46280380d3  sensord.confd
6f3a880988e7cdbcb20870e3c6d1e554  sensord.initd"
sha256sums="5dae6a665e1150159a93743c4ff1943a7efe02cd9d3bb12c4805e7d7adcf4fcf  lm_sensors-3.3.5.tar.bz2
98fb317cca4650be2a842e28a36f8d69d7642d9f61cdf585eedc8cb93e7bfbf1  sensors-detect-alpine.patch
e9bf572221a262bb53cefc86bea4d3d957a1e7962e6b3c0c2917fb3945bb7545  musl-fix-includes.patch
b231b76d5b32bb303a8e42727f48a4405cec71eedfe392e837acba5e46532783  fancontrol.initd
9b018f9f7a0975988387858823fe59a5cd8af6413d8c3170db0e24aac6021ec3  lm_sensors.initd
02230edf5efbb0a4de3840cd76f9ebf431c57a246fa7388e9dbeb0fe26fe7b8d  sensord.confd
9f6d0e7bcdc1b4b3bc0835b40f246f7caf76e1b3bbfcf76a5d5b235eb8243d89  sensord.initd"
sha512sums="0874084c3dd40b93ed05e1955f76e35e78ac3ac2343341d8ab5412fd941ea300b3a4b1320bec3a5bfb07309e82f42cc5dac0a728cdfddac4053d4fdb96dc12e7  lm_sensors-3.3.5.tar.bz2
fc178b1019c0ec7c53758be471f5ae01294fd04dd93a5ba9453fc3ba23e38102711b042a09509394afe9e17167e55d210ae80af7b5a88ecb8af82e81d4dcafe5  sensors-detect-alpine.patch
333751cb580c94f2d32ef5520d2f2acc0ef7e1cd4a6390ea75cae4c755fbdfcade1805c979ba3319905f1267bdc120a6746e6f70d89e0c72a8c2faefd34a9e79  musl-fix-includes.patch
e74d23ed78e066b903eb73e82ab9125bbaf81d86608fb0695314be20e06b777972547889fcfdf8271bcfd53b76a6a9db295f614ce7b73ea31b4d589009a5eb90  fancontrol.initd
16b3c7f742c70abcd310928be32fc63b0d344447776bc380be20f8708fbb72bc9b07ddec5ad867cfdc44247474aea3ff5d4f8b405cab896c07791a7a1834db7f  lm_sensors.initd
a77d81ab7ded085ba19e4c637e93268f889ccb8ce9e008a210ae135cb6e2140be07e5d455cf7fcc1084fd57cfbfb3f2bb37207123aebe9566f78b5183806fd7d  sensord.confd
40db7fb8b64f918c9fd7b0eed19788e3d404d55e807ac86b92bc5ff81d51c97099986f79ee472b10018de1e866b1b09bbcca36132c7beeb8c7889ae5dbf8c274  sensord.initd"