rev |
line source |
al@19811
|
1 --- libacpi-0.2.orig/libacpi.h
|
al@19811
|
2 +++ libacpi-0.2/libacpi.h
|
al@19811
|
3 @@ -12,6 +12,8 @@
|
al@19811
|
4 #define __LIBACPI_H__
|
al@19811
|
5
|
al@19811
|
6 #define PROC_ACPI "/proc/acpi/"
|
al@19811
|
7 +#define SYS_POWER "/sys/class/power_supply"
|
al@19811
|
8 +
|
al@19811
|
9 #define LINE_MAX 256
|
al@19811
|
10 #define MAX_NAME 512
|
al@19811
|
11 #define MAX_BUF 1024
|
al@19811
|
12 @@ -177,6 +179,7 @@
|
al@19811
|
13 int fan_count; /**< number of found fans */
|
al@19811
|
14 int temperature; /**< system temperature if we only have on thermal zone */
|
al@19811
|
15 adapter_t adapt; /**< ac adapter */
|
al@19811
|
16 + int sysstyle;
|
al@19811
|
17 } global_t;
|
al@19811
|
18
|
al@19811
|
19 /**
|
al@19811
|
20 @@ -239,6 +242,7 @@
|
al@19811
|
21 * Looks up if the ac adapter is plugged in or not
|
al@19811
|
22 * and sets the values in a struct
|
al@19811
|
23 * @param globals pointer to the global acpi structure
|
al@19811
|
24 + * @param sysstyle whether or not to use the /sys interface
|
al@19811
|
25 */
|
al@19811
|
26 void read_acpi_acstate(global_t *globals);
|
al@19811
|
27 /**
|
al@19811
|
28 --- libacpi-0.2.orig/libacpi.c
|
al@19811
|
29 +++ libacpi-0.2/libacpi.c
|
al@19811
|
30 @@ -14,8 +14,9 @@
|
al@19811
|
31 #include "libacpi.h"
|
al@19811
|
32 #include "list.h"
|
al@19811
|
33
|
al@19811
|
34 -static int read_acpi_battinfo(const int num);
|
al@19811
|
35 -static int read_acpi_battalarm(const int num);
|
al@19811
|
36 +
|
al@19811
|
37 +static int read_acpi_battinfo(const int num, const int sysstyle);
|
al@19811
|
38 +static int read_acpi_battalarm(const int num, const int sysstyle);
|
al@19811
|
39 static int read_acpi_battstate(const int num);
|
al@19811
|
40 static void read_acpi_thermalzones(global_t *globals);
|
al@19811
|
41
|
al@19811
|
42 @@ -144,8 +145,15 @@
|
al@19811
|
43 int i = 0;
|
al@19811
|
44
|
al@19811
|
45 globals->batt_count = 0;
|
al@19811
|
46 + globals->sysstyle = 0;
|
al@19811
|
47 if((lst = dir_list(PROC_ACPI "battery")) == NULL || !lst->top)
|
al@19811
|
48 - return NOT_SUPPORTED;
|
al@19811
|
49 + {
|
al@19811
|
50 + /* check for new Linux 2.6.24+ layout */
|
al@19811
|
51 + if((lst = dir_list(SYS_POWER)) == NULL || !lst->top)
|
al@19811
|
52 + return NOT_SUPPORTED;
|
al@19811
|
53 + else
|
al@19811
|
54 + globals->sysstyle = 1;
|
al@19811
|
55 + }
|
al@19811
|
56 for(node = lst->top; node; node=node->next){
|
al@19811
|
57 if((names[globals->batt_count] = strdup(node->name)) == NULL){
|
al@19811
|
58 delete_list(lst);
|
al@19811
|
59 @@ -174,11 +182,20 @@
|
al@19811
|
60 for (i=0; i < globals->batt_count && i < MAX_ITEMS; i++){
|
al@19811
|
61 binfo = &batteries[i];
|
al@19811
|
62 snprintf(binfo->name, MAX_NAME, "%s", names[i]);
|
al@19811
|
63 - snprintf(binfo->state_file, MAX_NAME, PROC_ACPI "battery/%s/state", names[i]);
|
al@19811
|
64 - snprintf(binfo->info_file, MAX_NAME, PROC_ACPI "battery/%s/info", names[i]);
|
al@19811
|
65 - snprintf(binfo->alarm_file, MAX_NAME, PROC_ACPI "battery/%s/alarm", names[i]);
|
al@19811
|
66 - read_acpi_battinfo(i);
|
al@19811
|
67 - read_acpi_battalarm(i);
|
al@19811
|
68 + if(globals->sysstyle)
|
al@19811
|
69 + {
|
al@19811
|
70 + snprintf(binfo->state_file, MAX_NAME, "/%s/present", names[i]);
|
al@19811
|
71 + snprintf(binfo->info_file, MAX_NAME, SYS_POWER "/%s", names[i]);
|
al@19811
|
72 + snprintf(binfo->alarm_file, MAX_NAME, SYS_POWER "/%s/alarm", names[i]);
|
al@19811
|
73 + }
|
al@19811
|
74 + else
|
al@19811
|
75 + {
|
al@19811
|
76 + snprintf(binfo->state_file, MAX_NAME, PROC_ACPI "battery/%s/state", names[i]);
|
al@19811
|
77 + snprintf(binfo->info_file, MAX_NAME, PROC_ACPI "battery/%s/info", names[i]);
|
al@19811
|
78 + snprintf(binfo->alarm_file, MAX_NAME, PROC_ACPI "battery/%s/alarm", names[i]);
|
al@19811
|
79 + }
|
al@19811
|
80 + read_acpi_battinfo(i, globals->sysstyle);
|
al@19811
|
81 + read_acpi_battalarm(i, globals->sysstyle);
|
al@19811
|
82 free(names[i]);
|
al@19811
|
83 }
|
al@19811
|
84 delete_list(lst);
|
al@19811
|
85 @@ -196,11 +213,22 @@
|
al@19811
|
86 ac->ac_state = P_ERR;
|
al@19811
|
87 return;
|
al@19811
|
88 }
|
al@19811
|
89 - if((tmp = scan_acpi_value(buf, "state:")) && !strncmp(tmp, "on-line", 7))
|
al@19811
|
90 - ac->ac_state = P_AC;
|
al@19811
|
91 - else if(tmp && !strncmp(tmp, "off-line", 8))
|
al@19811
|
92 - ac->ac_state = P_BATT;
|
al@19811
|
93 - else ac->ac_state = P_ERR;
|
al@19811
|
94 + if(globals->sysstyle)
|
al@19811
|
95 + {
|
al@19811
|
96 + if(!strcmp(buf, "1"))
|
al@19811
|
97 + ac->ac_state = P_AC;
|
al@19811
|
98 + else if(!strcmp(buf, "0"))
|
al@19811
|
99 + ac->ac_state = P_BATT;
|
al@19811
|
100 + else ac->ac_state = P_ERR;
|
al@19811
|
101 + }
|
al@19811
|
102 + else
|
al@19811
|
103 + {
|
al@19811
|
104 + if((tmp = scan_acpi_value(buf, "state:")) && !strncmp(tmp, "on-line", 7))
|
al@19811
|
105 + ac->ac_state = P_AC;
|
al@19811
|
106 + else if(tmp && !strncmp(tmp, "off-line", 8))
|
al@19811
|
107 + ac->ac_state = P_BATT;
|
al@19811
|
108 + else ac->ac_state = P_ERR;
|
al@19811
|
109 + }
|
al@19811
|
110 free(buf);
|
al@19811
|
111 free(tmp);
|
al@19811
|
112 }
|
al@19811
|
113 @@ -212,14 +240,22 @@
|
al@19811
|
114 list_t *lst = NULL;
|
al@19811
|
115 adapter_t *ac = &globals->adapt;
|
al@19811
|
116
|
al@19811
|
117 + globals->sysstyle = 0;
|
al@19811
|
118 if((lst = dir_list(PROC_ACPI "ac_adapter")) == NULL || !lst->top)
|
al@19811
|
119 - return NOT_SUPPORTED;
|
al@19811
|
120 -
|
al@19811
|
121 + {
|
al@19811
|
122 + if((lst = dir_list(SYS_POWER "/AC")) == NULL || !lst->top)
|
al@19811
|
123 + return NOT_SUPPORTED;
|
al@19811
|
124 + else
|
al@19811
|
125 + globals->sysstyle = 1;
|
al@19811
|
126 + }
|
al@19811
|
127 if((!lst->top->name || ((ac->name = strdup(lst->top->name)) == NULL))){
|
al@19811
|
128 delete_list(lst);
|
al@19811
|
129 return ALLOC_ERR;
|
al@19811
|
130 }
|
al@19811
|
131 - snprintf(ac->state_file, MAX_NAME, PROC_ACPI "ac_adapter/%s/state", ac->name);
|
al@19811
|
132 + if(globals->sysstyle)
|
al@19811
|
133 + snprintf(ac->state_file, MAX_NAME, SYS_POWER "/AC/online");
|
al@19811
|
134 + else
|
al@19811
|
135 + snprintf(ac->state_file, MAX_NAME, PROC_ACPI "ac_adapter/%s/state", ac->name);
|
al@19811
|
136 delete_list(lst);
|
al@19811
|
137 read_acpi_acstate(globals);
|
al@19811
|
138 return SUCCESS;
|
al@19811
|
139 @@ -450,7 +486,7 @@
|
al@19811
|
140
|
al@19811
|
141 /* read alarm capacity, return 0 on success, negative values on error */
|
al@19811
|
142 static int
|
al@19811
|
143 -read_acpi_battalarm(const int num){
|
al@19811
|
144 +read_acpi_battalarm(const int num, const int sysstyle){
|
al@19811
|
145 char *buf = NULL;
|
al@19811
|
146 char *tmp = NULL;
|
al@19811
|
147 battery_t *info = &batteries[num];
|
al@19811
|
148 @@ -458,10 +494,22 @@
|
al@19811
|
149 if((buf = get_acpi_content(info->alarm_file)) == NULL)
|
al@19811
|
150 return NOT_SUPPORTED;
|
al@19811
|
151
|
al@19811
|
152 - if((tmp = scan_acpi_value(buf, "alarm:")) && tmp[0] != 'u')
|
al@19811
|
153 - info->alarm = strtol(tmp, NULL, 10);
|
al@19811
|
154 + if(sysstyle)
|
al@19811
|
155 + {
|
al@19811
|
156 + if(!strcmp(buf, "0"))
|
al@19811
|
157 + info->alarm = 0;
|
al@19811
|
158 + else if(!strcmp(buf, "1"))
|
al@19811
|
159 + info->alarm = 1;
|
al@19811
|
160 + else
|
al@19811
|
161 + info->alarm = NOT_SUPPORTED;
|
al@19811
|
162 + }
|
al@19811
|
163 else
|
al@19811
|
164 - info->alarm = NOT_SUPPORTED;
|
al@19811
|
165 + {
|
al@19811
|
166 + if((tmp = scan_acpi_value(buf, "alarm:")) && tmp[0] != 'u')
|
al@19811
|
167 + info->alarm = strtol(tmp, NULL, 10);
|
al@19811
|
168 + else
|
al@19811
|
169 + info->alarm = NOT_SUPPORTED;
|
al@19811
|
170 + }
|
al@19811
|
171 free(buf);
|
al@19811
|
172 free(tmp);
|
al@19811
|
173 return SUCCESS;
|
al@19811
|
174 @@ -469,11 +517,58 @@
|
al@19811
|
175
|
al@19811
|
176 /* reads static values for a battery (info file), returns SUCCESS */
|
al@19811
|
177 static int
|
al@19811
|
178 -read_acpi_battinfo(const int num){
|
al@19811
|
179 +read_acpi_battinfo(const int num, const int sysstyle){
|
al@19811
|
180 char *buf = NULL;
|
al@19811
|
181 char *tmp = NULL;
|
al@19811
|
182 battery_t *info = &batteries[num];
|
al@19811
|
183 int i = 0;
|
al@19811
|
184 + char sysfile[MAX_NAME];
|
al@19811
|
185 +
|
al@19811
|
186 + if(sysstyle)
|
al@19811
|
187 + {
|
al@19811
|
188 + snprintf(sysfile, MAX_NAME, "%s/present", info->info_file);
|
al@19811
|
189 + if((buf = get_acpi_content(sysfile)) == NULL)
|
al@19811
|
190 + return NOT_SUPPORTED;
|
al@19811
|
191 + if(!strcmp(buf, "1")) {
|
al@19811
|
192 + info->present = 1;
|
al@19811
|
193 + } else {
|
al@19811
|
194 + info->present = 0;
|
al@19811
|
195 + return NOT_PRESENT;
|
al@19811
|
196 + }
|
al@19811
|
197 +
|
al@19811
|
198 + snprintf(sysfile, MAX_NAME, "%s/charge_full_design", info->info_file);
|
al@19811
|
199 + if((buf = get_acpi_content(sysfile)) == NULL)
|
al@19811
|
200 + return NOT_SUPPORTED;
|
al@19811
|
201 + info->design_cap = strtol(buf, NULL, 10);
|
al@19811
|
202 +
|
al@19811
|
203 + snprintf(sysfile, MAX_NAME, "%s/charge_full", info->info_file);
|
al@19811
|
204 + if((buf = get_acpi_content(sysfile)) == NULL)
|
al@19811
|
205 + return NOT_SUPPORTED;
|
al@19811
|
206 + info->last_full_cap = strtol(buf, NULL, 10);
|
al@19811
|
207 +
|
al@19811
|
208 + snprintf(sysfile, MAX_NAME, "%s/charge_now", info->info_file);
|
al@19811
|
209 + if((buf = get_acpi_content(sysfile)) == NULL)
|
al@19811
|
210 + return NOT_SUPPORTED;
|
al@19811
|
211 + info->remaining_cap = strtol(buf, NULL, 10);
|
al@19811
|
212 +
|
al@19811
|
213 + snprintf(sysfile, MAX_NAME, "%s/voltage_min_design", info->info_file);
|
al@19811
|
214 + if((buf = get_acpi_content(sysfile)) == NULL)
|
al@19811
|
215 + return NOT_SUPPORTED;
|
al@19811
|
216 + info->design_voltage = strtol(buf, NULL, 10);
|
al@19811
|
217 +
|
al@19811
|
218 + snprintf(sysfile, MAX_NAME, "%s/voltage_now", info->info_file);
|
al@19811
|
219 + if((buf = get_acpi_content(sysfile)) == NULL)
|
al@19811
|
220 + return NOT_SUPPORTED;
|
al@19811
|
221 + info->present_voltage = strtol(buf, NULL, 10);
|
al@19811
|
222 +
|
al@19811
|
223 + /* FIXME: is rate == current here? */
|
al@19811
|
224 + snprintf(sysfile, MAX_NAME, "%s/current_now", info->info_file);
|
al@19811
|
225 + if((buf = get_acpi_content(sysfile)) == NULL)
|
al@19811
|
226 + return NOT_SUPPORTED;
|
al@19811
|
227 + info->present_rate = strtol(buf, NULL, 10);
|
al@19811
|
228 +
|
al@19811
|
229 + return SUCCESS;
|
al@19811
|
230 + }
|
al@19811
|
231
|
al@19811
|
232 if((buf = get_acpi_content(info->info_file)) == NULL)
|
al@19811
|
233 return NOT_SUPPORTED;
|
al@19811
|
234 @@ -608,7 +703,7 @@
|
al@19811
|
235 read_acpi_batt(const int num){
|
al@19811
|
236 if(num > MAX_ITEMS) return ITEM_EXCEED;
|
al@19811
|
237 read_acpi_battstate(num);
|
al@19811
|
238 - read_acpi_battalarm(num);
|
al@19811
|
239 + read_acpi_battalarm(num, 0);
|
al@19811
|
240 calc_remain_perc(num);
|
al@19811
|
241 calc_remain_chargetime(num);
|
al@19811
|
242 calc_remain_time(num);
|
al@19811
|
243 --- libacpi-0.2.orig/test-libacpi.c
|
al@19811
|
244 +++ libacpi-0.2/test-libacpi.c
|
al@19811
|
245 @@ -46,6 +46,7 @@
|
al@19811
|
246 read_acpi_batt(i);
|
al@19811
|
247
|
al@19811
|
248 if(binfo->present)
|
al@19811
|
249 + {
|
al@19811
|
250 printf("\n%s:\tpresent: %d\n"
|
al@19811
|
251 "\tdesign capacity: %d\n"
|
al@19811
|
252 "\tlast full capacity: %d\n"
|
al@19811
|
253 @@ -65,6 +66,9 @@
|
al@19811
|
254 binfo->batt_state, binfo->percentage,
|
al@19811
|
255 binfo->charge_time / 60, binfo->charge_time % 60,
|
al@19811
|
256 binfo->remaining_time / 60, binfo->remaining_time % 60);
|
al@19811
|
257 + if(binfo->alarm)
|
al@19811
|
258 + printf("%s: Alarm!\n", binfo->name);
|
al@19811
|
259 + }
|
al@19811
|
260 }
|
al@19811
|
261 } else printf("Battery information:\tnot supported\n");
|
al@19811
|
262
|
al@19811
|
263 --- libacpi-0.2.orig/debian/control
|
al@19811
|
264 +++ libacpi-0.2/debian/control
|
al@19811
|
265 @@ -0,0 +1,30 @@
|
al@19811
|
266 +Source: libacpi
|
al@19811
|
267 +Priority: optional
|
al@19811
|
268 +Maintainer: Nico Golde <nion@debian.org>
|
al@19811
|
269 +Build-Depends: debhelper (>= 5)
|
al@19811
|
270 +Standards-Version: 3.7.3
|
al@19811
|
271 +Section: libs
|
al@19811
|
272 +Homepage: http://www.ngolde.de/libacpi.html
|
al@19811
|
273 +
|
al@19811
|
274 +Package: libacpi-dev
|
al@19811
|
275 +Section: libdevel
|
al@19811
|
276 +Architecture: i386 ia64 amd64
|
al@19811
|
277 +Depends: libacpi0 (= ${binary:Version})
|
al@19811
|
278 +Description: development files for libacpi
|
al@19811
|
279 + libacpi is a general purpose shared library for programs gathering
|
al@19811
|
280 + ACPI data on Linux. It implements thermal zones, battery information,
|
al@19811
|
281 + fan information and AC states.
|
al@19811
|
282 + .
|
al@19811
|
283 + This package contains the header files and static libraries needed to
|
al@19811
|
284 + compile applications or shared objects that use libacpi.
|
al@19811
|
285 +
|
al@19811
|
286 +Package: libacpi0
|
al@19811
|
287 +Section: libs
|
al@19811
|
288 +Architecture: i386 ia64 amd64
|
al@19811
|
289 +Depends: ${shlibs:Depends}, ${misc:Depends}
|
al@19811
|
290 +Description: general purpose library for ACPI
|
al@19811
|
291 + libacpi is a general purpose shared library for programs gathering
|
al@19811
|
292 + ACPI data on Linux. It implements thermal zones, battery information,
|
al@19811
|
293 + fan information and AC states.
|
al@19811
|
294 + .
|
al@19811
|
295 + This package contains the shared library for libacpi.
|
al@19811
|
296 --- libacpi-0.2.orig/debian/libacpi-dev.install
|
al@19811
|
297 +++ libacpi-0.2/debian/libacpi-dev.install
|
al@19811
|
298 @@ -0,0 +1,4 @@
|
al@19811
|
299 +usr/include/*
|
al@19811
|
300 +usr/lib/lib*.a
|
al@19811
|
301 +usr/lib/lib*.so
|
al@19811
|
302 +usr/share/man/man3/libacpi.3
|
al@19811
|
303 --- libacpi-0.2.orig/debian/compat
|
al@19811
|
304 +++ libacpi-0.2/debian/compat
|
al@19811
|
305 @@ -0,0 +1 @@
|
al@19811
|
306 +5
|
al@19811
|
307 --- libacpi-0.2.orig/debian/docs
|
al@19811
|
308 +++ libacpi-0.2/debian/docs
|
al@19811
|
309 @@ -0,0 +1 @@
|
al@19811
|
310 +README
|
al@19811
|
311 --- libacpi-0.2.orig/debian/changelog
|
al@19811
|
312 +++ libacpi-0.2/debian/changelog
|
al@19811
|
313 @@ -0,0 +1,44 @@
|
al@19811
|
314 +libacpi (0.2-4) unstable; urgency=low
|
al@19811
|
315 +
|
al@19811
|
316 + * Fix interface incompatibilities introduced by last patch (Closes: #464276).
|
al@19811
|
317 +
|
al@19811
|
318 + -- Nico Golde <nion@debian.org> Wed, 06 Feb 2008 11:31:13 +0100
|
al@19811
|
319 +
|
al@19811
|
320 +libacpi (0.2-3) unstable; urgency=low
|
al@19811
|
321 +
|
al@19811
|
322 + * Temporary patch libacpi to make battery and ac status work with
|
al@19811
|
323 + kernels >= 2.6.24. There will be a fixed upstream version
|
al@19811
|
324 + which uses sysfs and procfs as fallback soon. Many thanks
|
al@19811
|
325 + to Joseph Spillner for the patch! (Closes: #463986, #463982).
|
al@19811
|
326 +
|
al@19811
|
327 + -- Nico Golde <nion@debian.org> Mon, 04 Feb 2008 22:35:35 +0100
|
al@19811
|
328 +
|
al@19811
|
329 +libacpi (0.2-2) unstable; urgency=low
|
al@19811
|
330 +
|
al@19811
|
331 + * Bumped Standards Version, no changes needed.
|
al@19811
|
332 + * Switched from Homepage tag to Homepage control field.
|
al@19811
|
333 +
|
al@19811
|
334 + -- Nico Golde <nion@debian.org> Wed, 02 Jan 2008 14:42:01 +0100
|
al@19811
|
335 +
|
al@19811
|
336 +libacpi (0.2-1) unstable; urgency=low
|
al@19811
|
337 +
|
al@19811
|
338 + * New upstream release.
|
al@19811
|
339 + Fixed double header inclusion (Closes: #433399).
|
al@19811
|
340 +
|
al@19811
|
341 + -- Nico Golde <nion@debian.org> Sun, 29 Jul 2007 14:13:59 +0200
|
al@19811
|
342 +
|
al@19811
|
343 +libacpi (0.1-2) unstable; urgency=low
|
al@19811
|
344 +
|
al@19811
|
345 + * Just build this package for amd64,i386 and ia64 since
|
al@19811
|
346 + the other archs have on ACPI support (Closes: #432432).
|
al@19811
|
347 + * Switched from Source-Version to binary:Version.
|
al@19811
|
348 + * Do not suppress make clean output any longer.
|
al@19811
|
349 +
|
al@19811
|
350 + -- Nico Golde <nion@debian.org> Tue, 10 Jul 2007 18:18:08 +0200
|
al@19811
|
351 +
|
al@19811
|
352 +libacpi (0.1-1) unstable; urgency=low
|
al@19811
|
353 +
|
al@19811
|
354 + * Initial release (Closes: #429573).
|
al@19811
|
355 +
|
al@19811
|
356 + -- Nico Golde <nion@debian.org> Mon, 18 Jun 2007 22:11:10 +0200
|
al@19811
|
357 +
|
al@19811
|
358 --- libacpi-0.2.orig/debian/libacpi0.install
|
al@19811
|
359 +++ libacpi-0.2/debian/libacpi0.install
|
al@19811
|
360 @@ -0,0 +1 @@
|
al@19811
|
361 +usr/lib/lib*.so.*
|
al@19811
|
362 --- libacpi-0.2.orig/debian/copyright
|
al@19811
|
363 +++ libacpi-0.2/debian/copyright
|
al@19811
|
364 @@ -0,0 +1,34 @@
|
al@19811
|
365 +This package was debianized by Nico Golde <nion@debian.org> on
|
al@19811
|
366 +Mon, 18 Jun 2007 22:11:10 +0200.
|
al@19811
|
367 +
|
al@19811
|
368 +It was downloaded from http://www.ngolde.de/libacpi.html
|
al@19811
|
369 +
|
al@19811
|
370 +Upstream Author: Nico Golde <nico@ngolde.de>
|
al@19811
|
371 +
|
al@19811
|
372 +Copyright: 2007 Nico Golde
|
al@19811
|
373 +
|
al@19811
|
374 +License:
|
al@19811
|
375 +
|
al@19811
|
376 + Copyright (C) 2007 Nico Golde <nico@ngolde.de>
|
al@19811
|
377 +
|
al@19811
|
378 + Permission is hereby granted, free of charge, to any person obtaining a
|
al@19811
|
379 + copy of this software and associated documentation files (the
|
al@19811
|
380 + "Software"), to deal in the Software without restriction, including
|
al@19811
|
381 + without limitation the rights to use, copy, modify, merge, publish,
|
al@19811
|
382 + distribute, sublicense, and/or sell copies of the Software, and to
|
al@19811
|
383 + permit persons to whom the Software is furnished to do so, subject to
|
al@19811
|
384 + the following conditions:
|
al@19811
|
385 +
|
al@19811
|
386 + The above copyright notice and this permission notice shall be included
|
al@19811
|
387 + in all copies or substantial portions of the Software.
|
al@19811
|
388 +
|
al@19811
|
389 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
al@19811
|
390 + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
al@19811
|
391 + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
al@19811
|
392 + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
al@19811
|
393 + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
al@19811
|
394 + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
al@19811
|
395 + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
al@19811
|
396 +
|
al@19811
|
397 +The Debian packaging is (C) 2007, Nico Golde <nion@debian.org> and
|
al@19811
|
398 +is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
|
al@19811
|
399 --- libacpi-0.2.orig/debian/rules
|
al@19811
|
400 +++ libacpi-0.2/debian/rules
|
al@19811
|
401 @@ -0,0 +1,57 @@
|
al@19811
|
402 +#!/usr/bin/make -f
|
al@19811
|
403 +#export DH_VERBOSE=1
|
al@19811
|
404 +
|
al@19811
|
405 +CFLAGS = -Wall -g
|
al@19811
|
406 +
|
al@19811
|
407 +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
al@19811
|
408 + CFLAGS += -O0
|
al@19811
|
409 +else
|
al@19811
|
410 + CFLAGS += -O2
|
al@19811
|
411 +endif
|
al@19811
|
412 +
|
al@19811
|
413 +build: build-stamp
|
al@19811
|
414 +build-stamp:
|
al@19811
|
415 + dh_testdir
|
al@19811
|
416 + $(MAKE)
|
al@19811
|
417 +
|
al@19811
|
418 + touch $@
|
al@19811
|
419 +
|
al@19811
|
420 +clean:
|
al@19811
|
421 + dh_testdir
|
al@19811
|
422 + dh_testroot
|
al@19811
|
423 + rm -f build-stamp
|
al@19811
|
424 +
|
al@19811
|
425 + $(MAKE) clean
|
al@19811
|
426 + dh_clean
|
al@19811
|
427 +
|
al@19811
|
428 +install: build
|
al@19811
|
429 + dh_testdir
|
al@19811
|
430 + dh_testroot
|
al@19811
|
431 + dh_clean -k
|
al@19811
|
432 + dh_installdirs
|
al@19811
|
433 +
|
al@19811
|
434 + $(MAKE) DESTDIR=$(CURDIR)/debian/tmp PREFIX=/usr install
|
al@19811
|
435 +
|
al@19811
|
436 +binary-indep: build install
|
al@19811
|
437 +
|
al@19811
|
438 +binary-arch: build install
|
al@19811
|
439 + dh_testdir
|
al@19811
|
440 + dh_testroot
|
al@19811
|
441 + dh_installchangelogs CHANGES
|
al@19811
|
442 + dh_installdocs doc/
|
al@19811
|
443 + dh_installexamples test-libacpi.c
|
al@19811
|
444 + dh_install --sourcedir=debian/tmp --list-missing
|
al@19811
|
445 + dh_link
|
al@19811
|
446 + dh_strip
|
al@19811
|
447 + dh_compress
|
al@19811
|
448 + dh_fixperms
|
al@19811
|
449 + dh_makeshlibs
|
al@19811
|
450 + dh_makeshlibs
|
al@19811
|
451 + dh_installdeb
|
al@19811
|
452 + dh_shlibdeps
|
al@19811
|
453 + dh_gencontrol
|
al@19811
|
454 + dh_md5sums
|
al@19811
|
455 + dh_builddeb
|
al@19811
|
456 +
|
al@19811
|
457 +binary: binary-indep binary-arch
|
al@19811
|
458 +.PHONY: build clean binary-indep binary-arch binary install
|