]> git.pld-linux.org Git - SPECS.git/blob - lm_sensors-config.spec
SPECS updated Mon 29 Apr 22:05:02 CEST 2024
[SPECS.git] / lm_sensors-config.spec
1 %define         cmodule         /etc/sysconfig/sensors_modules
2 %define         cdaemon         /etc/sysconfig/sensors
3 %define         smodule         /etc/rc.d/init.d/sensors_modules
4 %define         sdaemon         /etc/rc.d/init.d/sensors
5
6 Summary:        lm_sensors configuration files
7 Summary(pl.UTF-8):      Pliki konfiguracyjne lm_sensors
8 Name:           lm_sensors-config
9 Version:        0.0.1
10 Release:        1
11 License:        GPL
12 Group:          Applications/System
13 Source0:        sensors_modules.sysconfig
14 # Sources from 100 are motherboard specific %{_sysconfdir}/sensors files
15 Source100:      sensors.conf.epox-EP-8K9A
16 Source101:      sensors.conf.ecs-K7VTA3
17 Source102:      sensors.conf.ecs-KT600-A
18 Source103:      sensors.conf.foxconn-P9657AA
19 URL:            http://www.lm-sensors.org/wiki/Configurations
20 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22 %description
23 Configuration files for lm_sensors.
24
25 %description -l pl.UTF-8
26 Pliki konfiguracyjne lm_sensors.
27
28 %package epox-EP-8K9A
29 Summary:        lm_sensors configuration files for Epox EP-8K9A MBs
30 Summary(pl.UTF-8):      Pliki konfiguracyjne lm_sensors dla płyt głównych Epox EP-8K9A
31 Group:          Applications/System
32 Requires:       lm_sensors
33 Provides:       %{name}
34
35 %description epox-EP-8K9A
36 lm_sensors configuration files for Epox 8K9A series motherboards
37 (tested with EP-8K9AI motherboard).
38
39 %description epox-EP-8K9A -l pl.UTF-8
40 Pliki konfiguracyjne lm_sensors dla płyt głównych z serii Epox 8K9A
41 (testowane na płycie EP-8K9AI).
42
43 %package ecs-K7VTA3
44 Summary:        lm_sensors configuration files for ECS K7VTA3 MBs
45 Summary(pl.UTF-8):      Pliki konfiguracyjne lm_sensors dla płyt głównych ECS K7VTA3
46 Group:          Applications/System
47 Provides:       %{name}
48 Requires:       lm_sensors
49
50 %description ecs-K7VTA3
51 lm_sensors configuration files for ECS K7VTA3 series motherboards
52 (tested with K7VTA3 v. 5.0).
53
54 %description ecs-K7VTA3 -l pl.UTF-8
55 Pliki konfiguracyjne lm_sensors dla płyt głównych z serii ECS K7VTA3
56 (testowane na płycie K7VTA3 v. 5.0).
57
58 %package ecs-KT600-A
59 Summary:        lm_sensors configuration files for ECS KT600-A MBs
60 Summary(pl.UTF-8):      Pliki konfiguracyjne lm_sensors dla płyt głównych ECS KT600-A
61 Group:          Applications/System
62 Provides:       %{name}
63 Requires:       lm_sensors
64
65 %description ecs-KT600-A
66 lm_sensors configuration files for ECS KT600-A motherboard.
67
68 %description ecs-KT600-A -l pl.UTF-8
69 Pliki konfiguracyjne lm_sensors dla płyty głównej ECS KT600-A.
70
71 %package foxconn-P9657AA
72 Summary:        lm_sensors configuration files for Foxconn P9657AA MBs
73 Summary(pl.UTF-8):      Pliki konfiguracyjne lm_sensors dla płyt głównych Foxconn P9657AA
74 Group:          Applications/System
75 Provides:       %{name}
76 Requires:       lm_sensors
77 Requires:       kernel >= 2.6.24
78
79 %description foxconn-P9657AA
80 lm_sensors configuration files for Foxconn P9667AA motherboards.
81
82 %description foxconn-P9657AA -l pl.UTF-8
83 Pliki konfiguracyjne lm_sensors dla płyt głównych Foxconn P9667AA.
84
85 %prep
86 %setup -q -c -T
87 mkdir src
88 mkdir etc
89 mkdir sysconfig
90 cp %{SOURCE100} src
91 cp %{SOURCE101} src
92 cp %{SOURCE102} src
93 cp %{SOURCE103} src
94
95 %build
96 rm -f etc/* sysconfig/*
97
98 mk_filelist() {
99         cat > files.$1 << EOF
100 %defattr(644,root,root,755)
101 %%config(noreplace) %%verify(not md5 mtime size) %{_sysconfdir}/sensors.conf.$1
102 %%config(noreplace) %%verify(not md5 mtime size) /etc/sysconfig/sensors_modules.$1
103 %%ghost %{_sysconfdir}/sensors.conf
104 %%ghost /etc/sysconfig/sensors_modules
105 EOF
106 }
107
108 mk_post() {
109         cat > post.$1 << EOF
110 ln -sf %{_sysconfdir}/sensors.conf.$1 %{_sysconfdir}/sensors.conf
111 ln -sf /etc/sysconfig/sensors_modules.$1 /etc/sysconfig/sensors_modules
112 if [ -f "%{smodule}" ]; then
113         /sbin/chkconfig --add sensors_modules
114         %%service sensors_modules restart "sensors modules"
115 fi
116 if [ -f "%{sdaemon}" ]; then
117         /sbin/chkconfig --add sensors
118         %%service sensors restart "sensors daemon"
119 fi
120 EOF
121 }
122
123 mk_preun() {
124         cat > preun.$1 << EOF
125 if [ "$1" = "0" ]; then
126         if [ -f "%{sdaemon}" ]; then
127                 %%service sensors stop
128                 /sbin/chkconfig --del sensors
129         fi
130         if [ -f "%{smodule}" ]; then
131                 %%service sensors_modules stop
132                 /sbin/chkconfig --del sensors_modules
133         fi
134 fi
135 EOF
136 }
137
138 for FILE in src/sensors.conf.*
139 do
140         MB=`echo $FILE | sed s:src/sensors.conf.::`
141         mk_filelist $MB
142         mk_post $MB
143         mk_preun $MB
144         BUS=`cat $FILE | grep "^BUS="`
145         CHIP=`cat $FILE | grep "^CHIP="`
146         cat $FILE | egrep -v "^BUS=|^CHIP=" > etc/sensors.conf.$MB
147         cat %{SOURCE0} | \
148                 sed "s:^BUS=:$BUS:" | \
149                 sed "s:^CHIP=:$CHIP:" | \
150                 sed "s:#SENSORS_SET=1:SENSORS_SET=1:" \
151                 > sysconfig/sensors_modules.$MB
152 done
153
154 %install
155 rm -rf $RPM_BUILD_ROOT
156
157 install -d $RPM_BUILD_ROOT/etc/sysconfig
158 cp etc/* $RPM_BUILD_ROOT%{_sysconfdir}
159 cp sysconfig/* $RPM_BUILD_ROOT/etc/sysconfig
160
161 ln -sf /dev/null $RPM_BUILD_ROOT/etc/sysconfig/sensors_modules
162 ln -sf /dev/null $RPM_BUILD_ROOT%{_sysconfdir}/sensors.conf
163
164 %clean
165 rm -rf $RPM_BUILD_ROOT
166
167 %post   epox-EP-8K9A -f post.epox-EP-8K9A
168 %preun  epox-EP-8K9A -f preun.epox-EP-8K9A
169 %files  epox-EP-8K9A -f files.epox-EP-8K9A
170
171 %post   ecs-K7VTA3 -f post.ecs-K7VTA3
172 %preun  ecs-K7VTA3 -f preun.ecs-K7VTA3
173 %files  ecs-K7VTA3 -f files.ecs-K7VTA3
174
175 %post   ecs-KT600-A -f post.ecs-KT600-A
176 %preun  ecs-KT600-A -f preun.ecs-KT600-A
177 %files  ecs-KT600-A -f files.ecs-KT600-A
178
179 %post   foxconn-P9657AA -f post.foxconn-P9657AA
180 %preun  foxconn-P9657AA -f preun.foxconn-P9657AA
181 %files  foxconn-P9657AA -f files.foxconn-P9657AA
This page took 0.527237 seconds and 3 git commands to generate.