Version 0.5.11 Original Sources (woody release)
Package source: archive.debian.org
Signed-off-by: Georgios M. Zarkadas <gz@member.fsf.org>
Georgios M. Zarkadas
12 years ago
0 | GNU GENERAL PUBLIC LICENSE | |
1 | Version 2, June 1991 | |
2 | ||
3 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. | |
4 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
5 | Everyone is permitted to copy and distribute verbatim copies | |
6 | of this license document, but changing it is not allowed. | |
7 | ||
8 | Preamble | |
9 | ||
10 | The licenses for most software are designed to take away your | |
11 | freedom to share and change it. By contrast, the GNU General Public | |
12 | License is intended to guarantee your freedom to share and change free | |
13 | software--to make sure the software is free for all its users. This | |
14 | General Public License applies to most of the Free Software | |
15 | Foundation's software and to any other program whose authors commit to | |
16 | using it. (Some other Free Software Foundation software is covered by | |
17 | the GNU Library General Public License instead.) You can apply it to | |
18 | your programs, too. | |
19 | ||
20 | When we speak of free software, we are referring to freedom, not | |
21 | price. Our General Public Licenses are designed to make sure that you | |
22 | have the freedom to distribute copies of free software (and charge for | |
23 | this service if you wish), that you receive source code or can get it | |
24 | if you want it, that you can change the software or use pieces of it | |
25 | in new free programs; and that you know you can do these things. | |
26 | ||
27 | To protect your rights, we need to make restrictions that forbid | |
28 | anyone to deny you these rights or to ask you to surrender the rights. | |
29 | These restrictions translate to certain responsibilities for you if you | |
30 | distribute copies of the software, or if you modify it. | |
31 | ||
32 | For example, if you distribute copies of such a program, whether | |
33 | gratis or for a fee, you must give the recipients all the rights that | |
34 | you have. You must make sure that they, too, receive or can get the | |
35 | source code. And you must show them these terms so they know their | |
36 | rights. | |
37 | ||
38 | We protect your rights with two steps: (1) copyright the software, and | |
39 | (2) offer you this license which gives you legal permission to copy, | |
40 | distribute and/or modify the software. | |
41 | ||
42 | Also, for each author's protection and ours, we want to make certain | |
43 | that everyone understands that there is no warranty for this free | |
44 | software. If the software is modified by someone else and passed on, we | |
45 | want its recipients to know that what they have is not the original, so | |
46 | that any problems introduced by others will not reflect on the original | |
47 | authors' reputations. | |
48 | ||
49 | Finally, any free program is threatened constantly by software | |
50 | patents. We wish to avoid the danger that redistributors of a free | |
51 | program will individually obtain patent licenses, in effect making the | |
52 | program proprietary. To prevent this, we have made it clear that any | |
53 | patent must be licensed for everyone's free use or not licensed at all. | |
54 | ||
55 | The precise terms and conditions for copying, distribution and | |
56 | modification follow. | |
57 | ||
58 | GNU GENERAL PUBLIC LICENSE | |
59 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
60 | ||
61 | 0. This License applies to any program or other work which contains | |
62 | a notice placed by the copyright holder saying it may be distributed | |
63 | under the terms of this General Public License. The "Program", below, | |
64 | refers to any such program or work, and a "work based on the Program" | |
65 | means either the Program or any derivative work under copyright law: | |
66 | that is to say, a work containing the Program or a portion of it, | |
67 | either verbatim or with modifications and/or translated into another | |
68 | language. (Hereinafter, translation is included without limitation in | |
69 | the term "modification".) Each licensee is addressed as "you". | |
70 | ||
71 | Activities other than copying, distribution and modification are not | |
72 | covered by this License; they are outside its scope. The act of | |
73 | running the Program is not restricted, and the output from the Program | |
74 | is covered only if its contents constitute a work based on the | |
75 | Program (independent of having been made by running the Program). | |
76 | Whether that is true depends on what the Program does. | |
77 | ||
78 | 1. You may copy and distribute verbatim copies of the Program's | |
79 | source code as you receive it, in any medium, provided that you | |
80 | conspicuously and appropriately publish on each copy an appropriate | |
81 | copyright notice and disclaimer of warranty; keep intact all the | |
82 | notices that refer to this License and to the absence of any warranty; | |
83 | and give any other recipients of the Program a copy of this License | |
84 | along with the Program. | |
85 | ||
86 | You may charge a fee for the physical act of transferring a copy, and | |
87 | you may at your option offer warranty protection in exchange for a fee. | |
88 | ||
89 | 2. You may modify your copy or copies of the Program or any portion | |
90 | of it, thus forming a work based on the Program, and copy and | |
91 | distribute such modifications or work under the terms of Section 1 | |
92 | above, provided that you also meet all of these conditions: | |
93 | ||
94 | a) You must cause the modified files to carry prominent notices | |
95 | stating that you changed the files and the date of any change. | |
96 | ||
97 | b) You must cause any work that you distribute or publish, that in | |
98 | whole or in part contains or is derived from the Program or any | |
99 | part thereof, to be licensed as a whole at no charge to all third | |
100 | parties under the terms of this License. | |
101 | ||
102 | c) If the modified program normally reads commands interactively | |
103 | when run, you must cause it, when started running for such | |
104 | interactive use in the most ordinary way, to print or display an | |
105 | announcement including an appropriate copyright notice and a | |
106 | notice that there is no warranty (or else, saying that you provide | |
107 | a warranty) and that users may redistribute the program under | |
108 | these conditions, and telling the user how to view a copy of this | |
109 | License. (Exception: if the Program itself is interactive but | |
110 | does not normally print such an announcement, your work based on | |
111 | the Program is not required to print an announcement.) | |
112 | ||
113 | These requirements apply to the modified work as a whole. If | |
114 | identifiable sections of that work are not derived from the Program, | |
115 | and can be reasonably considered independent and separate works in | |
116 | themselves, then this License, and its terms, do not apply to those | |
117 | sections when you distribute them as separate works. But when you | |
118 | distribute the same sections as part of a whole which is a work based | |
119 | on the Program, the distribution of the whole must be on the terms of | |
120 | this License, whose permissions for other licensees extend to the | |
121 | entire whole, and thus to each and every part regardless of who wrote it. | |
122 | ||
123 | Thus, it is not the intent of this section to claim rights or contest | |
124 | your rights to work written entirely by you; rather, the intent is to | |
125 | exercise the right to control the distribution of derivative or | |
126 | collective works based on the Program. | |
127 | ||
128 | In addition, mere aggregation of another work not based on the Program | |
129 | with the Program (or with a work based on the Program) on a volume of | |
130 | a storage or distribution medium does not bring the other work under | |
131 | the scope of this License. | |
132 | ||
133 | 3. You may copy and distribute the Program (or a work based on it, | |
134 | under Section 2) in object code or executable form under the terms of | |
135 | Sections 1 and 2 above provided that you also do one of the following: | |
136 | ||
137 | a) Accompany it with the complete corresponding machine-readable | |
138 | source code, which must be distributed under the terms of Sections | |
139 | 1 and 2 above on a medium customarily used for software interchange; or, | |
140 | ||
141 | b) Accompany it with a written offer, valid for at least three | |
142 | years, to give any third party, for a charge no more than your | |
143 | cost of physically performing source distribution, a complete | |
144 | machine-readable copy of the corresponding source code, to be | |
145 | distributed under the terms of Sections 1 and 2 above on a medium | |
146 | customarily used for software interchange; or, | |
147 | ||
148 | c) Accompany it with the information you received as to the offer | |
149 | to distribute corresponding source code. (This alternative is | |
150 | allowed only for noncommercial distribution and only if you | |
151 | received the program in object code or executable form with such | |
152 | an offer, in accord with Subsection b above.) | |
153 | ||
154 | The source code for a work means the preferred form of the work for | |
155 | making modifications to it. For an executable work, complete source | |
156 | code means all the source code for all modules it contains, plus any | |
157 | associated interface definition files, plus the scripts used to | |
158 | control compilation and installation of the executable. However, as a | |
159 | special exception, the source code distributed need not include | |
160 | anything that is normally distributed (in either source or binary | |
161 | form) with the major components (compiler, kernel, and so on) of the | |
162 | operating system on which the executable runs, unless that component | |
163 | itself accompanies the executable. | |
164 | ||
165 | If distribution of executable or object code is made by offering | |
166 | access to copy from a designated place, then offering equivalent | |
167 | access to copy the source code from the same place counts as | |
168 | distribution of the source code, even though third parties are not | |
169 | compelled to copy the source along with the object code. | |
170 | ||
171 | 4. You may not copy, modify, sublicense, or distribute the Program | |
172 | except as expressly provided under this License. Any attempt | |
173 | otherwise to copy, modify, sublicense or distribute the Program is | |
174 | void, and will automatically terminate your rights under this License. | |
175 | However, parties who have received copies, or rights, from you under | |
176 | this License will not have their licenses terminated so long as such | |
177 | parties remain in full compliance. | |
178 | ||
179 | 5. You are not required to accept this License, since you have not | |
180 | signed it. However, nothing else grants you permission to modify or | |
181 | distribute the Program or its derivative works. These actions are | |
182 | prohibited by law if you do not accept this License. Therefore, by | |
183 | modifying or distributing the Program (or any work based on the | |
184 | Program), you indicate your acceptance of this License to do so, and | |
185 | all its terms and conditions for copying, distributing or modifying | |
186 | the Program or works based on it. | |
187 | ||
188 | 6. Each time you redistribute the Program (or any work based on the | |
189 | Program), the recipient automatically receives a license from the | |
190 | original licensor to copy, distribute or modify the Program subject to | |
191 | these terms and conditions. You may not impose any further | |
192 | restrictions on the recipients' exercise of the rights granted herein. | |
193 | You are not responsible for enforcing compliance by third parties to | |
194 | this License. | |
195 | ||
196 | 7. If, as a consequence of a court judgment or allegation of patent | |
197 | infringement or for any other reason (not limited to patent issues), | |
198 | conditions are imposed on you (whether by court order, agreement or | |
199 | otherwise) that contradict the conditions of this License, they do not | |
200 | excuse you from the conditions of this License. If you cannot | |
201 | distribute so as to satisfy simultaneously your obligations under this | |
202 | License and any other pertinent obligations, then as a consequence you | |
203 | may not distribute the Program at all. For example, if a patent | |
204 | license would not permit royalty-free redistribution of the Program by | |
205 | all those who receive copies directly or indirectly through you, then | |
206 | the only way you could satisfy both it and this License would be to | |
207 | refrain entirely from distribution of the Program. | |
208 | ||
209 | If any portion of this section is held invalid or unenforceable under | |
210 | any particular circumstance, the balance of the section is intended to | |
211 | apply and the section as a whole is intended to apply in other | |
212 | circumstances. | |
213 | ||
214 | It is not the purpose of this section to induce you to infringe any | |
215 | patents or other property right claims or to contest validity of any | |
216 | such claims; this section has the sole purpose of protecting the | |
217 | integrity of the free software distribution system, which is | |
218 | implemented by public license practices. Many people have made | |
219 | generous contributions to the wide range of software distributed | |
220 | through that system in reliance on consistent application of that | |
221 | system; it is up to the author/donor to decide if he or she is willing | |
222 | to distribute software through any other system and a licensee cannot | |
223 | impose that choice. | |
224 | ||
225 | This section is intended to make thoroughly clear what is believed to | |
226 | be a consequence of the rest of this License. | |
227 | ||
228 | 8. If the distribution and/or use of the Program is restricted in | |
229 | certain countries either by patents or by copyrighted interfaces, the | |
230 | original copyright holder who places the Program under this License | |
231 | may add an explicit geographical distribution limitation excluding | |
232 | those countries, so that distribution is permitted only in or among | |
233 | countries not thus excluded. In such case, this License incorporates | |
234 | the limitation as if written in the body of this License. | |
235 | ||
236 | 9. The Free Software Foundation may publish revised and/or new versions | |
237 | of the General Public License from time to time. Such new versions will | |
238 | be similar in spirit to the present version, but may differ in detail to | |
239 | address new problems or concerns. | |
240 | ||
241 | Each version is given a distinguishing version number. If the Program | |
242 | specifies a version number of this License which applies to it and "any | |
243 | later version", you have the option of following the terms and conditions | |
244 | either of that version or of any later version published by the Free | |
245 | Software Foundation. If the Program does not specify a version number of | |
246 | this License, you may choose any version ever published by the Free Software | |
247 | Foundation. | |
248 | ||
249 | 10. If you wish to incorporate parts of the Program into other free | |
250 | programs whose distribution conditions are different, write to the author | |
251 | to ask for permission. For software which is copyrighted by the Free | |
252 | Software Foundation, write to the Free Software Foundation; we sometimes | |
253 | make exceptions for this. Our decision will be guided by the two goals | |
254 | of preserving the free status of all derivatives of our free software and | |
255 | of promoting the sharing and reuse of software generally. | |
256 | ||
257 | NO WARRANTY | |
258 | ||
259 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | |
260 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | |
261 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | |
262 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | |
263 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
264 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | |
265 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | |
266 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | |
267 | REPAIR OR CORRECTION. | |
268 | ||
269 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
270 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |
271 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | |
272 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | |
273 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | |
274 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | |
275 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | |
276 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | |
277 | POSSIBILITY OF SUCH DAMAGES. | |
278 | ||
279 | END OF TERMS AND CONDITIONS | |
280 | ||
281 | How to Apply These Terms to Your New Programs | |
282 | ||
283 | If you develop a new program, and you want it to be of the greatest | |
284 | possible use to the public, the best way to achieve this is to make it | |
285 | free software which everyone can redistribute and change under these terms. | |
286 | ||
287 | To do so, attach the following notices to the program. It is safest | |
288 | to attach them to the start of each source file to most effectively | |
289 | convey the exclusion of warranty; and each file should have at least | |
290 | the "copyright" line and a pointer to where the full notice is found. | |
291 | ||
292 | <one line to give the program's name and a brief idea of what it does.> | |
293 | Copyright (C) <year> <name of author> | |
294 | ||
295 | This program is free software; you can redistribute it and/or modify | |
296 | it under the terms of the GNU General Public License as published by | |
297 | the Free Software Foundation; either version 2 of the License, or | |
298 | (at your option) any later version. | |
299 | ||
300 | This program is distributed in the hope that it will be useful, | |
301 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
302 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
303 | GNU General Public License for more details. | |
304 | ||
305 | You should have received a copy of the GNU General Public License | |
306 | along with this program; if not, write to the Free Software | |
307 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
308 | ||
309 | ||
310 | Also add information on how to contact you by electronic and paper mail. | |
311 | ||
312 | If the program is interactive, make it output a short notice like this | |
313 | when it starts in an interactive mode: | |
314 | ||
315 | Gnomovision version 69, Copyright (C) year name of author | |
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
317 | This is free software, and you are welcome to redistribute it | |
318 | under certain conditions; type `show c' for details. | |
319 | ||
320 | The hypothetical commands `show w' and `show c' should show the appropriate | |
321 | parts of the General Public License. Of course, the commands you use may | |
322 | be called something other than `show w' and `show c'; they could even be | |
323 | mouse-clicks or menu items--whatever suits your program. | |
324 | ||
325 | You should also get your employer (if you work as a programmer) or your | |
326 | school, if any, to sign a "copyright disclaimer" for the program, if | |
327 | necessary. Here is a sample; alter the names: | |
328 | ||
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program | |
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. | |
331 | ||
332 | <signature of Ty Coon>, 1 April 1989 | |
333 | Ty Coon, President of Vice | |
334 | ||
335 | This General Public License does not permit incorporating your program into | |
336 | proprietary programs. If your program is a subroutine library, you may | |
337 | consider it more useful to permit linking proprietary applications with the | |
338 | library. If this is what you want to do, use the GNU Library General | |
339 | Public License instead of this License. |
0 | Richard Kettlewell <rjk@greenend.org.uk> for: | |
1 | complaining about build commands outside of the build target (#115455) | |
2 | ||
3 | Bruce Stephens <bruce@cenderis.demon.co.uk> for: | |
4 | complaining about missing /var/lib/dhelp (#116490) | |
5 | ||
6 | Andreas Metzler <ametzler@downhill.at.eu.org> for: | |
7 | various hints about package improvements | |
8 | ||
9 | Julian Gilbey <jdg@debian.org> for: | |
10 | complaining about uncompressed changelog (#119759) | |
11 | ||
12 | Zlatko Calusic <zcalusic@iskon.hr> for: | |
13 | providing titles for additional directories (#121279) | |
14 | ||
15 | Chris Tillman <tillman@azstarnet.com> for: | |
16 | providing patch which adds --help option to dhelp script (#126583) | |
17 | providing sample implementation for the rewrite of the dhelp script | |
18 | ||
19 | Thomas Langen <langen@langensoft.de> for: | |
20 | reporting that gnome-help-browser is no longer a HTML browser (#143869) |
0 | Basic Installation | |
1 | ================== | |
2 | ||
3 | These are generic installation instructions. | |
4 | ||
5 | The `configure' shell script attempts to guess correct values for | |
6 | various system-dependent variables used during compilation. It uses | |
7 | those values to create a `Makefile' in each directory of the package. | |
8 | It may also create one or more `.h' files containing system-dependent | |
9 | definitions. Finally, it creates a shell script `config.status' that | |
10 | you can run in the future to recreate the current configuration, a file | |
11 | `config.cache' that saves the results of its tests to speed up | |
12 | reconfiguring, and a file `config.log' containing compiler output | |
13 | (useful mainly for debugging `configure'). | |
14 | ||
15 | If you need to do unusual things to compile the package, please try | |
16 | to figure out how `configure' could check whether to do them, and mail | |
17 | diffs or instructions to the address given in the `README' so they can | |
18 | be considered for the next release. If at some point `config.cache' | |
19 | contains results you don't want to keep, you may remove or edit it. | |
20 | ||
21 | The file `configure.in' is used to create `configure' by a program | |
22 | called `autoconf'. You only need `configure.in' if you want to change | |
23 | it or regenerate `configure' using a newer version of `autoconf'. | |
24 | ||
25 | The simplest way to compile this package is: | |
26 | ||
27 | 1. `cd' to the directory containing the package's source code and type | |
28 | `./configure' to configure the package for your system. If you're | |
29 | using `csh' on an old version of System V, you might need to type | |
30 | `sh ./configure' instead to prevent `csh' from trying to execute | |
31 | `configure' itself. | |
32 | ||
33 | Running `configure' takes awhile. While running, it prints some | |
34 | messages telling which features it is checking for. | |
35 | ||
36 | 2. Type `make' to compile the package. | |
37 | ||
38 | 3. Optionally, type `make check' to run any self-tests that come with | |
39 | the package. | |
40 | ||
41 | 4. Type `make install' to install the programs and any data files and | |
42 | documentation. | |
43 | ||
44 | 5. You can remove the program binaries and object files from the | |
45 | source code directory by typing `make clean'. To also remove the | |
46 | files that `configure' created (so you can compile the package for | |
47 | a different kind of computer), type `make distclean'. There is | |
48 | also a `make maintainer-clean' target, but that is intended mainly | |
49 | for the package's developers. If you use it, you may have to get | |
50 | all sorts of other programs in order to regenerate files that came | |
51 | with the distribution. | |
52 | ||
53 | Compilers and Options | |
54 | ===================== | |
55 | ||
56 | Some systems require unusual options for compilation or linking that | |
57 | the `configure' script does not know about. You can give `configure' | |
58 | initial values for variables by setting them in the environment. Using | |
59 | a Bourne-compatible shell, you can do that on the command line like | |
60 | this: | |
61 | CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure | |
62 | ||
63 | Or on systems that have the `env' program, you can do it like this: | |
64 | env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure | |
65 | ||
66 | Compiling For Multiple Architectures | |
67 | ==================================== | |
68 | ||
69 | You can compile the package for more than one kind of computer at the | |
70 | same time, by placing the object files for each architecture in their | |
71 | own directory. To do this, you must use a version of `make' that | |
72 | supports the `VPATH' variable, such as GNU `make'. `cd' to the | |
73 | directory where you want the object files and executables to go and run | |
74 | the `configure' script. `configure' automatically checks for the | |
75 | source code in the directory that `configure' is in and in `..'. | |
76 | ||
77 | If you have to use a `make' that does not supports the `VPATH' | |
78 | variable, you have to compile the package for one architecture at a time | |
79 | in the source code directory. After you have installed the package for | |
80 | one architecture, use `make distclean' before reconfiguring for another | |
81 | architecture. | |
82 | ||
83 | Installation Names | |
84 | ================== | |
85 | ||
86 | By default, `make install' will install the package's files in | |
87 | `/usr/local/bin', `/usr/local/man', etc. You can specify an | |
88 | installation prefix other than `/usr/local' by giving `configure' the | |
89 | option `--prefix=PATH'. | |
90 | ||
91 | You can specify separate installation prefixes for | |
92 | architecture-specific files and architecture-independent files. If you | |
93 | give `configure' the option `--exec-prefix=PATH', the package will use | |
94 | PATH as the prefix for installing programs and libraries. | |
95 | Documentation and other data files will still use the regular prefix. | |
96 | ||
97 | In addition, if you use an unusual directory layout you can give | |
98 | options like `--bindir=PATH' to specify different values for particular | |
99 | kinds of files. Run `configure --help' for a list of the directories | |
100 | you can set and what kinds of files go in them. | |
101 | ||
102 | If the package supports it, you can cause programs to be installed | |
103 | with an extra prefix or suffix on their names by giving `configure' the | |
104 | option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. | |
105 | ||
106 | Optional Features | |
107 | ================= | |
108 | ||
109 | Some packages pay attention to `--enable-FEATURE' options to | |
110 | `configure', where FEATURE indicates an optional part of the package. | |
111 | They may also pay attention to `--with-PACKAGE' options, where PACKAGE | |
112 | is something like `gnu-as' or `x' (for the X Window System). The | |
113 | `README' should mention any `--enable-' and `--with-' options that the | |
114 | package recognizes. | |
115 | ||
116 | For packages that use the X Window System, `configure' can usually | |
117 | find the X include and library files automatically, but if it doesn't, | |
118 | you can use the `configure' options `--x-includes=DIR' and | |
119 | `--x-libraries=DIR' to specify their locations. | |
120 | ||
121 | Specifying the System Type | |
122 | ========================== | |
123 | ||
124 | There may be some features `configure' can not figure out | |
125 | automatically, but needs to determine by the type of host the package | |
126 | will run on. Usually `configure' can figure that out, but if it prints | |
127 | a message saying it can not guess the host type, give it the | |
128 | `--host=TYPE' option. TYPE can either be a short name for the system | |
129 | type, such as `sun4', or a canonical name with three fields: | |
130 | CPU-COMPANY-SYSTEM | |
131 | ||
132 | See the file `config.sub' for the possible values of each field. If | |
133 | `config.sub' isn't included in this package, then this package doesn't | |
134 | need to know the host type. | |
135 | ||
136 | If you are building compiler tools for cross-compiling, you can also | |
137 | use the `--target=TYPE' option to select the type of system they will | |
138 | produce code for and the `--build=TYPE' option to select the type of | |
139 | system on which you are compiling the package. | |
140 | ||
141 | Sharing Defaults | |
142 | ================ | |
143 | ||
144 | If you want to set default values for `configure' scripts to share, | |
145 | you can create a site shell script called `config.site' that gives | |
146 | default values for variables like `CC', `cache_file', and `prefix'. | |
147 | `configure' looks for `PREFIX/share/config.site' if it exists, then | |
148 | `PREFIX/etc/config.site' if it exists. Or, you can set the | |
149 | `CONFIG_SITE' environment variable to the location of the site script. | |
150 | A warning: not all `configure' scripts look for a site script. | |
151 | ||
152 | Operation Controls | |
153 | ================== | |
154 | ||
155 | `configure' recognizes the following options to control how it | |
156 | operates. | |
157 | ||
158 | `--cache-file=FILE' | |
159 | Use and save the results of the tests in FILE instead of | |
160 | `./config.cache'. Set FILE to `/dev/null' to disable caching, for | |
161 | debugging `configure'. | |
162 | ||
163 | `--help' | |
164 | Print a summary of the options to `configure', and exit. | |
165 | ||
166 | `--quiet' | |
167 | `--silent' | |
168 | `-q' | |
169 | Do not print messages saying which checks are being made. To | |
170 | suppress all normal output, redirect it to `/dev/null' (any error | |
171 | messages will still be shown). | |
172 | ||
173 | `--srcdir=DIR' | |
174 | Look for the package's source code in directory DIR. Usually | |
175 | `configure' can determine that directory automatically. | |
176 | ||
177 | `--version' | |
178 | Print the version of Autoconf used to generate the `configure' | |
179 | script, and exit. | |
180 | ||
181 | `configure' also accepts some other, not widely useful, options. |
0 | DBLIB = $(shell if [ -f /usr/lib/libdb1.a ]; then echo -ldb1; else echo -ldb; fi) | |
1 | ||
2 | all: dhelp_parse.o | |
3 | gcc dhelp_parse.o -o dhelp_parse $(DBLIB) | |
4 | ||
5 | clean: | |
6 | rm -rf dhelp_parse dhelp_parse.o *~ core | |
7 | ||
8 | dhelp_parse.o: dhelp_parse.c | |
9 | gcc -g -O2 -c -Wall -o dhelp_parse.o dhelp_parse.c |
0 | # Makefile.am for dhelp project | |
1 | ||
2 | # Copyright (C) 2001 Stefan Hornburg (Racke) <racke@linuxia.de> | |
3 | ||
4 | # This file is free software; you can redistribute it and/or modify it | |
5 | # under the terms of the GNU General Public License as published by the | |
6 | # Free Software Foundation; either version 2, or (at your option) any | |
7 | # later version. | |
8 | ||
9 | # This file is distributed in the hope that it will be | |
10 | # useful, but WITHOUT ANY WARRANTY; without even the implied warranty | |
11 | # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | # General Public License for more details. | |
13 | ||
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this file; see the file COPYING. If not, write to the Free | |
16 | # Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
17 | ||
18 | # put Debian packaging files and other static stuff in the archive | |
19 | EXTRA_DIST=CREDITS debian dhelp dh_dhelp doc dsearch man | |
20 | ||
21 | # dhelp_parse rules | |
22 | sbin_PROGRAMS=dhelp_parse | |
23 | dhelp_parse_SOURCES=dhelp_parse.c | |
24 | ||
25 | # other scripts | |
26 | bin_SCRIPTS=dhelp dh_dhelp | |
27 | ||
28 | dist-hook: | |
29 | find $(distdir) -type d -name CVS -print | xargs rm -rf | |
30 |
0 | # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am | |
1 | ||
2 | # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. | |
3 | # This Makefile.in is free software; the Free Software Foundation | |
4 | # gives unlimited permission to copy and/or distribute it, | |
5 | # with or without modifications, as long as this notice is preserved. | |
6 | ||
7 | # This program is distributed in the hope that it will be useful, | |
8 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
9 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
10 | # PARTICULAR PURPOSE. | |
11 | ||
12 | # Makefile.am for dhelp project | |
13 | ||
14 | # Copyright (C) 2001 Stefan Hornburg (Racke) <racke@linuxia.de> | |
15 | ||
16 | # This file is free software; you can redistribute it and/or modify it | |
17 | # under the terms of the GNU General Public License as published by the | |
18 | # Free Software Foundation; either version 2, or (at your option) any | |
19 | # later version. | |
20 | ||
21 | # This file is distributed in the hope that it will be | |
22 | # useful, but WITHOUT ANY WARRANTY; without even the implied warranty | |
23 | # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
24 | # General Public License for more details. | |
25 | ||
26 | # You should have received a copy of the GNU General Public License | |
27 | # along with this file; see the file COPYING. If not, write to the Free | |
28 | # Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
29 | ||
30 | # put Debian packaging files and other static stuff in the archive | |
31 | ||
32 | ||
33 | SHELL = @SHELL@ | |
34 | ||
35 | srcdir = @srcdir@ | |
36 | top_srcdir = @top_srcdir@ | |
37 | VPATH = @srcdir@ | |
38 | prefix = @prefix@ | |
39 | exec_prefix = @exec_prefix@ | |
40 | ||
41 | bindir = @bindir@ | |
42 | sbindir = @sbindir@ | |
43 | libexecdir = @libexecdir@ | |
44 | datadir = @datadir@ | |
45 | sysconfdir = @sysconfdir@ | |
46 | sharedstatedir = @sharedstatedir@ | |
47 | localstatedir = @localstatedir@ | |
48 | libdir = @libdir@ | |
49 | infodir = @infodir@ | |
50 | mandir = @mandir@ | |
51 | includedir = @includedir@ | |
52 | oldincludedir = /usr/include | |
53 | ||
54 | DESTDIR = | |
55 | ||
56 | pkgdatadir = $(datadir)/@PACKAGE@ | |
57 | pkglibdir = $(libdir)/@PACKAGE@ | |
58 | pkgincludedir = $(includedir)/@PACKAGE@ | |
59 | ||
60 | top_builddir = . | |
61 | ||
62 | ACLOCAL = @ACLOCAL@ | |
63 | AUTOCONF = @AUTOCONF@ | |
64 | AUTOMAKE = @AUTOMAKE@ | |
65 | AUTOHEADER = @AUTOHEADER@ | |
66 | ||
67 | INSTALL = @INSTALL@ | |
68 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) | |
69 | INSTALL_DATA = @INSTALL_DATA@ | |
70 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
71 | transform = @program_transform_name@ | |
72 | ||
73 | NORMAL_INSTALL = : | |
74 | PRE_INSTALL = : | |
75 | POST_INSTALL = : | |
76 | NORMAL_UNINSTALL = : | |
77 | PRE_UNINSTALL = : | |
78 | POST_UNINSTALL = : | |
79 | CC = @CC@ | |
80 | MAKEINFO = @MAKEINFO@ | |
81 | PACKAGE = @PACKAGE@ | |
82 | VERSION = @VERSION@ | |
83 | ||
84 | EXTRA_DIST = CREDITS debian dhelp dh_dhelp doc dsearch man | |
85 | ||
86 | # dhelp_parse rules | |
87 | sbin_PROGRAMS = dhelp_parse | |
88 | dhelp_parse_SOURCES = dhelp_parse.c | |
89 | ||
90 | # other scripts | |
91 | bin_SCRIPTS = dhelp dh_dhelp | |
92 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | |
93 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs | |
94 | CONFIG_CLEAN_FILES = | |
95 | PROGRAMS = $(sbin_PROGRAMS) | |
96 | ||
97 | ||
98 | DEFS = @DEFS@ -I. -I$(srcdir) | |
99 | CPPFLAGS = @CPPFLAGS@ | |
100 | LDFLAGS = @LDFLAGS@ | |
101 | LIBS = @LIBS@ | |
102 | dhelp_parse_OBJECTS = dhelp_parse.o | |
103 | dhelp_parse_LDADD = $(LDADD) | |
104 | dhelp_parse_DEPENDENCIES = | |
105 | dhelp_parse_LDFLAGS = | |
106 | SCRIPTS = $(bin_SCRIPTS) | |
107 | ||
108 | CFLAGS = @CFLAGS@ | |
109 | COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | |
110 | CCLD = $(CC) | |
111 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ | |
112 | DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ | |
113 | Makefile.in NEWS aclocal.m4 configure configure.in install-sh missing \ | |
114 | mkinstalldirs | |
115 | ||
116 | ||
117 | DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) | |
118 | ||
119 | TAR = tar | |
120 | GZIP_ENV = --best | |
121 | SOURCES = $(dhelp_parse_SOURCES) | |
122 | OBJECTS = $(dhelp_parse_OBJECTS) | |
123 | ||
124 | all: all-redirect | |
125 | .SUFFIXES: | |
126 | .SUFFIXES: .S .c .o .s | |
127 | $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) | |
128 | cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile | |
129 | ||
130 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | |
131 | cd $(top_builddir) \ | |
132 | && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
133 | ||
134 | $(ACLOCAL_M4): configure.in | |
135 | cd $(srcdir) && $(ACLOCAL) | |
136 | ||
137 | config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES) | |
138 | $(SHELL) ./config.status --recheck | |
139 | $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) | |
140 | cd $(srcdir) && $(AUTOCONF) | |
141 | ||
142 | mostlyclean-sbinPROGRAMS: | |
143 | ||
144 | clean-sbinPROGRAMS: | |
145 | -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) | |
146 | ||
147 | distclean-sbinPROGRAMS: | |
148 | ||
149 | maintainer-clean-sbinPROGRAMS: | |
150 | ||
151 | install-sbinPROGRAMS: $(sbin_PROGRAMS) | |
152 | @$(NORMAL_INSTALL) | |
153 | $(mkinstalldirs) $(DESTDIR)$(sbindir) | |
154 | @list='$(sbin_PROGRAMS)'; for p in $$list; do \ | |
155 | if test -f $$p; then \ | |
156 | echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ | |
157 | $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ | |
158 | else :; fi; \ | |
159 | done | |
160 | ||
161 | uninstall-sbinPROGRAMS: | |
162 | @$(NORMAL_UNINSTALL) | |
163 | list='$(sbin_PROGRAMS)'; for p in $$list; do \ | |
164 | rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ | |
165 | done | |
166 | ||
167 | .c.o: | |
168 | $(COMPILE) -c $< | |
169 | ||
170 | .s.o: | |
171 | $(COMPILE) -c $< | |
172 | ||
173 | .S.o: | |
174 | $(COMPILE) -c $< | |
175 | ||
176 | mostlyclean-compile: | |
177 | -rm -f *.o core *.core | |
178 | ||
179 | clean-compile: | |
180 | ||
181 | distclean-compile: | |
182 | -rm -f *.tab.c | |
183 | ||
184 | maintainer-clean-compile: | |
185 | ||
186 | dhelp_parse: $(dhelp_parse_OBJECTS) $(dhelp_parse_DEPENDENCIES) | |
187 | @rm -f dhelp_parse | |
188 | $(LINK) $(dhelp_parse_LDFLAGS) $(dhelp_parse_OBJECTS) $(dhelp_parse_LDADD) $(LIBS) | |
189 | ||
190 | install-binSCRIPTS: $(bin_SCRIPTS) | |
191 | @$(NORMAL_INSTALL) | |
192 | $(mkinstalldirs) $(DESTDIR)$(bindir) | |
193 | @list='$(bin_SCRIPTS)'; for p in $$list; do \ | |
194 | if test -f $$p; then \ | |
195 | echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ | |
196 | $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ | |
197 | else if test -f $(srcdir)/$$p; then \ | |
198 | echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ | |
199 | $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ | |
200 | else :; fi; fi; \ | |
201 | done | |
202 | ||
203 | uninstall-binSCRIPTS: | |
204 | @$(NORMAL_UNINSTALL) | |
205 | list='$(bin_SCRIPTS)'; for p in $$list; do \ | |
206 | rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ | |
207 | done | |
208 | ||
209 | tags: TAGS | |
210 | ||
211 | ID: $(HEADERS) $(SOURCES) $(LISP) | |
212 | list='$(SOURCES) $(HEADERS)'; \ | |
213 | unique=`for i in $$list; do echo $$i; done | \ | |
214 | awk ' { files[$$0] = 1; } \ | |
215 | END { for (i in files) print i; }'`; \ | |
216 | here=`pwd` && cd $(srcdir) \ | |
217 | && mkid -f$$here/ID $$unique $(LISP) | |
218 | ||
219 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) | |
220 | tags=; \ | |
221 | here=`pwd`; \ | |
222 | list='$(SOURCES) $(HEADERS)'; \ | |
223 | unique=`for i in $$list; do echo $$i; done | \ | |
224 | awk ' { files[$$0] = 1; } \ | |
225 | END { for (i in files) print i; }'`; \ | |
226 | test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ | |
227 | || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) | |
228 | ||
229 | mostlyclean-tags: | |
230 | ||
231 | clean-tags: | |
232 | ||
233 | distclean-tags: | |
234 | -rm -f TAGS ID | |
235 | ||
236 | maintainer-clean-tags: | |
237 | ||
238 | distdir = $(PACKAGE)-$(VERSION) | |
239 | top_distdir = $(distdir) | |
240 | ||
241 | # This target untars the dist file and tries a VPATH configuration. Then | |
242 | # it guarantees that the distribution is self-contained by making another | |
243 | # tarfile. | |
244 | distcheck: dist | |
245 | -rm -rf $(distdir) | |
246 | GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz | |
247 | mkdir $(distdir)/=build | |
248 | mkdir $(distdir)/=inst | |
249 | dc_install_base=`cd $(distdir)/=inst && pwd`; \ | |
250 | cd $(distdir)/=build \ | |
251 | && ../configure --srcdir=.. --prefix=$$dc_install_base \ | |
252 | && $(MAKE) $(AM_MAKEFLAGS) \ | |
253 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ | |
254 | && $(MAKE) $(AM_MAKEFLAGS) check \ | |
255 | && $(MAKE) $(AM_MAKEFLAGS) install \ | |
256 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ | |
257 | && $(MAKE) $(AM_MAKEFLAGS) dist | |
258 | -rm -rf $(distdir) | |
259 | @banner="$(distdir).tar.gz is ready for distribution"; \ | |
260 | dashes=`echo "$$banner" | sed s/./=/g`; \ | |
261 | echo "$$dashes"; \ | |
262 | echo "$$banner"; \ | |
263 | echo "$$dashes" | |
264 | dist: distdir | |
265 | -chmod -R a+r $(distdir) | |
266 | GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) | |
267 | -rm -rf $(distdir) | |
268 | dist-all: distdir | |
269 | -chmod -R a+r $(distdir) | |
270 | GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) | |
271 | -rm -rf $(distdir) | |
272 | distdir: $(DISTFILES) | |
273 | -rm -rf $(distdir) | |
274 | mkdir $(distdir) | |
275 | -chmod 777 $(distdir) | |
276 | @for file in $(DISTFILES); do \ | |
277 | d=$(srcdir); \ | |
278 | if test -d $$d/$$file; then \ | |
279 | cp -pr $$d/$$file $(distdir)/$$file; \ | |
280 | else \ | |
281 | test -f $(distdir)/$$file \ | |
282 | || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ | |
283 | || cp -p $$d/$$file $(distdir)/$$file || :; \ | |
284 | fi; \ | |
285 | done | |
286 | $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook | |
287 | dhelp_parse.o: dhelp_parse.c | |
288 | ||
289 | info-am: | |
290 | info: info-am | |
291 | dvi-am: | |
292 | dvi: dvi-am | |
293 | check-am: all-am | |
294 | check: check-am | |
295 | installcheck-am: | |
296 | installcheck: installcheck-am | |
297 | install-exec-am: install-sbinPROGRAMS install-binSCRIPTS | |
298 | install-exec: install-exec-am | |
299 | ||
300 | install-data-am: | |
301 | install-data: install-data-am | |
302 | ||
303 | install-am: all-am | |
304 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | |
305 | install: install-am | |
306 | uninstall-am: uninstall-sbinPROGRAMS uninstall-binSCRIPTS | |
307 | uninstall: uninstall-am | |
308 | all-am: Makefile $(PROGRAMS) $(SCRIPTS) | |
309 | all-redirect: all-am | |
310 | install-strip: | |
311 | $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install | |
312 | installdirs: | |
313 | $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(bindir) | |
314 | ||
315 | ||
316 | mostlyclean-generic: | |
317 | ||
318 | clean-generic: | |
319 | ||
320 | distclean-generic: | |
321 | -rm -f Makefile $(CONFIG_CLEAN_FILES) | |
322 | -rm -f config.cache config.log stamp-h stamp-h[0-9]* | |
323 | ||
324 | maintainer-clean-generic: | |
325 | mostlyclean-am: mostlyclean-sbinPROGRAMS mostlyclean-compile \ | |
326 | mostlyclean-tags mostlyclean-generic | |
327 | ||
328 | mostlyclean: mostlyclean-am | |
329 | ||
330 | clean-am: clean-sbinPROGRAMS clean-compile clean-tags clean-generic \ | |
331 | mostlyclean-am | |
332 | ||
333 | clean: clean-am | |
334 | ||
335 | distclean-am: distclean-sbinPROGRAMS distclean-compile distclean-tags \ | |
336 | distclean-generic clean-am | |
337 | ||
338 | distclean: distclean-am | |
339 | -rm -f config.status | |
340 | ||
341 | maintainer-clean-am: maintainer-clean-sbinPROGRAMS \ | |
342 | maintainer-clean-compile maintainer-clean-tags \ | |
343 | maintainer-clean-generic distclean-am | |
344 | @echo "This command is intended for maintainers to use;" | |
345 | @echo "it deletes files that may require special tools to rebuild." | |
346 | ||
347 | maintainer-clean: maintainer-clean-am | |
348 | -rm -f config.status | |
349 | ||
350 | .PHONY: mostlyclean-sbinPROGRAMS distclean-sbinPROGRAMS \ | |
351 | clean-sbinPROGRAMS maintainer-clean-sbinPROGRAMS uninstall-sbinPROGRAMS \ | |
352 | install-sbinPROGRAMS mostlyclean-compile distclean-compile \ | |
353 | clean-compile maintainer-clean-compile uninstall-binSCRIPTS \ | |
354 | install-binSCRIPTS tags mostlyclean-tags distclean-tags clean-tags \ | |
355 | maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \ | |
356 | installcheck-am installcheck install-exec-am install-exec \ | |
357 | install-data-am install-data install-am install uninstall-am uninstall \ | |
358 | all-redirect all-am all installdirs mostlyclean-generic \ | |
359 | distclean-generic clean-generic maintainer-clean-generic clean \ | |
360 | mostlyclean distclean maintainer-clean | |
361 | ||
362 | ||
363 | dist-hook: | |
364 | find $(distdir) -type d -name CVS -print | xargs rm -rf | |
365 | ||
366 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | |
367 | # Otherwise a system limit (for SysV at least) may be exceeded. | |
368 | .NOEXPORT: |
0 | dnl aclocal.m4 generated automatically by aclocal 1.4-p4 | |
1 | ||
2 | dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. | |
3 | dnl This file is free software; the Free Software Foundation | |
4 | dnl gives unlimited permission to copy and/or distribute it, | |
5 | dnl with or without modifications, as long as this notice is preserved. | |
6 | ||
7 | dnl This program is distributed in the hope that it will be useful, | |
8 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
9 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
10 | dnl PARTICULAR PURPOSE. | |
11 | ||
12 | # Do all the work for Automake. This macro actually does too much -- | |
13 | # some checks are only needed if your package does certain things. | |
14 | # But this isn't really a big deal. | |
15 | ||
16 | # serial 1 | |
17 | ||
18 | dnl Usage: | |
19 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) | |
20 | ||
21 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
22 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
23 | PACKAGE=[$1] | |
24 | AC_SUBST(PACKAGE) | |
25 | VERSION=[$2] | |
26 | AC_SUBST(VERSION) | |
27 | dnl test to see if srcdir already configured | |
28 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
29 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) | |
30 | fi | |
31 | ifelse([$3],, | |
32 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) | |
33 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) | |
34 | AC_REQUIRE([AM_SANITY_CHECK]) | |
35 | AC_REQUIRE([AC_ARG_PROGRAM]) | |
36 | dnl FIXME This is truly gross. | |
37 | missing_dir=`cd $ac_aux_dir && pwd` | |
38 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) | |
39 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) | |
40 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) | |
41 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) | |
42 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) | |
43 | AC_REQUIRE([AC_PROG_MAKE_SET])]) | |
44 | ||
45 | # | |
46 | # Check to make sure that the build environment is sane. | |
47 | # | |
48 | ||
49 | AC_DEFUN(AM_SANITY_CHECK, | |
50 | [AC_MSG_CHECKING([whether build environment is sane]) | |
51 | # Just in case | |
52 | sleep 1 | |
53 | echo timestamp > conftestfile | |
54 | # Do `set' in a subshell so we don't clobber the current shell's | |
55 | # arguments. Must try -L first in case configure is actually a | |
56 | # symlink; some systems play weird games with the mod time of symlinks | |
57 | # (eg FreeBSD returns the mod time of the symlink's containing | |
58 | # directory). | |
59 | if ( | |
60 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
61 | if test "[$]*" = "X"; then | |
62 | # -L didn't work. | |
63 | set X `ls -t $srcdir/configure conftestfile` | |
64 | fi | |
65 | if test "[$]*" != "X $srcdir/configure conftestfile" \ | |
66 | && test "[$]*" != "X conftestfile $srcdir/configure"; then | |
67 | ||
68 | # If neither matched, then we have a broken ls. This can happen | |
69 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
70 | # broken ls alias from the environment. This has actually | |
71 | # happened. Such a system could not be considered "sane". | |
72 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken | |
73 | alias in your environment]) | |
74 | fi | |
75 | ||
76 | test "[$]2" = conftestfile | |
77 | ) | |
78 | then | |
79 | # Ok. | |
80 | : | |
81 | else | |
82 | AC_MSG_ERROR([newly created file is older than distributed files! | |
83 | Check your system clock]) | |
84 | fi | |
85 | rm -f conftest* | |
86 | AC_MSG_RESULT(yes)]) | |
87 | ||
88 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) | |
89 | dnl The program must properly implement --version. | |
90 | AC_DEFUN(AM_MISSING_PROG, | |
91 | [AC_MSG_CHECKING(for working $2) | |
92 | # Run test in a subshell; some versions of sh will print an error if | |
93 | # an executable is not found, even if stderr is redirected. | |
94 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
95 | if ($2 --version) < /dev/null > /dev/null 2>&1; then | |
96 | $1=$2 | |
97 | AC_MSG_RESULT(found) | |
98 | else | |
99 | $1="$3/missing $2" | |
100 | AC_MSG_RESULT(missing) | |
101 | fi | |
102 | AC_SUBST($1)]) | |
103 |
0 | #! /bin/sh | |
1 | ||
2 | # Guess values for system-dependent variables and create Makefiles. | |
3 | # Generated automatically using autoconf version 2.13 | |
4 | # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. | |
5 | # | |
6 | # This configure script is free software; the Free Software Foundation | |
7 | # gives unlimited permission to copy, distribute and modify it. | |
8 | ||
9 | # Defaults: | |
10 | ac_help= | |
11 | ac_default_prefix=/usr/local | |
12 | # Any additions from configure.in: | |
13 | ||
14 | # Initialize some variables set by options. | |
15 | # The variables have the same names as the options, with | |
16 | # dashes changed to underlines. | |
17 | build=NONE | |
18 | cache_file=./config.cache | |
19 | exec_prefix=NONE | |
20 | host=NONE | |
21 | no_create= | |
22 | nonopt=NONE | |
23 | no_recursion= | |
24 | prefix=NONE | |
25 | program_prefix=NONE | |
26 | program_suffix=NONE | |
27 | program_transform_name=s,x,x, | |
28 | silent= | |
29 | site= | |
30 | srcdir= | |
31 | target=NONE | |
32 | verbose= | |
33 | x_includes=NONE | |
34 | x_libraries=NONE | |
35 | bindir='${exec_prefix}/bin' | |
36 | sbindir='${exec_prefix}/sbin' | |
37 | libexecdir='${exec_prefix}/libexec' | |
38 | datadir='${prefix}/share' | |
39 | sysconfdir='${prefix}/etc' | |
40 | sharedstatedir='${prefix}/com' | |
41 | localstatedir='${prefix}/var' | |
42 | libdir='${exec_prefix}/lib' | |
43 | includedir='${prefix}/include' | |
44 | oldincludedir='/usr/include' | |
45 | infodir='${prefix}/info' | |
46 | mandir='${prefix}/man' | |
47 | ||
48 | # Initialize some other variables. | |
49 | subdirs= | |
50 | MFLAGS= MAKEFLAGS= | |
51 | SHELL=${CONFIG_SHELL-/bin/sh} | |
52 | # Maximum number of lines to put in a shell here document. | |
53 | ac_max_here_lines=12 | |
54 | ||
55 | ac_prev= | |
56 | for ac_option | |
57 | do | |
58 | ||
59 | # If the previous option needs an argument, assign it. | |
60 | if test -n "$ac_prev"; then | |
61 | eval "$ac_prev=\$ac_option" | |
62 | ac_prev= | |
63 | continue | |
64 | fi | |
65 | ||
66 | case "$ac_option" in | |
67 | -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; | |
68 | *) ac_optarg= ;; | |
69 | esac | |
70 | ||
71 | # Accept the important Cygnus configure options, so we can diagnose typos. | |
72 | ||
73 | case "$ac_option" in | |
74 | ||
75 | -bindir | --bindir | --bindi | --bind | --bin | --bi) | |
76 | ac_prev=bindir ;; | |
77 | -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) | |
78 | bindir="$ac_optarg" ;; | |
79 | ||
80 | -build | --build | --buil | --bui | --bu) | |
81 | ac_prev=build ;; | |
82 | -build=* | --build=* | --buil=* | --bui=* | --bu=*) | |
83 | build="$ac_optarg" ;; | |
84 | ||
85 | -cache-file | --cache-file | --cache-fil | --cache-fi \ | |
86 | | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) | |
87 | ac_prev=cache_file ;; | |
88 | -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | |
89 | | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) | |
90 | cache_file="$ac_optarg" ;; | |
91 | ||
92 | -datadir | --datadir | --datadi | --datad | --data | --dat | --da) | |
93 | ac_prev=datadir ;; | |
94 | -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | |
95 | | --da=*) | |
96 | datadir="$ac_optarg" ;; | |
97 | ||
98 | -disable-* | --disable-*) | |
99 | ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` | |
100 | # Reject names that are not valid shell variable names. | |
101 | if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then | |
102 | { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } | |
103 | fi | |
104 | ac_feature=`echo $ac_feature| sed 's/-/_/g'` | |
105 | eval "enable_${ac_feature}=no" ;; | |
106 | ||
107 | -enable-* | --enable-*) | |
108 | ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` | |
109 | # Reject names that are not valid shell variable names. | |
110 | if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then | |
111 | { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } | |
112 | fi | |
113 | ac_feature=`echo $ac_feature| sed 's/-/_/g'` | |
114 | case "$ac_option" in | |
115 | *=*) ;; | |
116 | *) ac_optarg=yes ;; | |
117 | esac | |
118 | eval "enable_${ac_feature}='$ac_optarg'" ;; | |
119 | ||
120 | -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | |
121 | | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | |
122 | | --exec | --exe | --ex) | |
123 | ac_prev=exec_prefix ;; | |
124 | -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | |
125 | | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | |
126 | | --exec=* | --exe=* | --ex=*) | |
127 | exec_prefix="$ac_optarg" ;; | |
128 | ||
129 | -gas | --gas | --ga | --g) | |
130 | # Obsolete; use --with-gas. | |
131 | with_gas=yes ;; | |
132 | ||
133 | -help | --help | --hel | --he) | |
134 | # Omit some internal or obsolete options to make the list less imposing. | |
135 | # This message is too long to be a string in the A/UX 3.1 sh. | |
136 | cat << EOF | |
137 | Usage: configure [options] [host] | |
138 | Options: [defaults in brackets after descriptions] | |
139 | Configuration: | |
140 | --cache-file=FILE cache test results in FILE | |
141 | --help print this message | |
142 | --no-create do not create output files | |
143 | --quiet, --silent do not print \`checking...' messages | |
144 | --version print the version of autoconf that created configure | |
145 | Directory and file names: | |
146 | --prefix=PREFIX install architecture-independent files in PREFIX | |
147 | [$ac_default_prefix] | |
148 | --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX | |
149 | [same as prefix] | |
150 | --bindir=DIR user executables in DIR [EPREFIX/bin] | |
151 | --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] | |
152 | --libexecdir=DIR program executables in DIR [EPREFIX/libexec] | |
153 | --datadir=DIR read-only architecture-independent data in DIR | |
154 | [PREFIX/share] | |
155 | --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] | |
156 | --sharedstatedir=DIR modifiable architecture-independent data in DIR | |
157 | [PREFIX/com] | |
158 | --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] | |
159 | --libdir=DIR object code libraries in DIR [EPREFIX/lib] | |
160 | --includedir=DIR C header files in DIR [PREFIX/include] | |
161 | --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] | |
162 | --infodir=DIR info documentation in DIR [PREFIX/info] | |
163 | --mandir=DIR man documentation in DIR [PREFIX/man] | |
164 | --srcdir=DIR find the sources in DIR [configure dir or ..] | |
165 | --program-prefix=PREFIX prepend PREFIX to installed program names | |
166 | --program-suffix=SUFFIX append SUFFIX to installed program names | |
167 | --program-transform-name=PROGRAM | |
168 | run sed PROGRAM on installed program names | |
169 | EOF | |
170 | cat << EOF | |
171 | Host type: | |
172 | --build=BUILD configure for building on BUILD [BUILD=HOST] | |
173 | --host=HOST configure for HOST [guessed] | |
174 | --target=TARGET configure for TARGET [TARGET=HOST] | |
175 | Features and packages: | |
176 | --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) | |
177 | --enable-FEATURE[=ARG] include FEATURE [ARG=yes] | |
178 | --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] | |
179 | --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) | |
180 | --x-includes=DIR X include files are in DIR | |
181 | --x-libraries=DIR X library files are in DIR | |
182 | EOF | |
183 | if test -n "$ac_help"; then | |
184 | echo "--enable and --with options recognized:$ac_help" | |
185 | fi | |
186 | exit 0 ;; | |
187 | ||
188 | -host | --host | --hos | --ho) | |
189 | ac_prev=host ;; | |
190 | -host=* | --host=* | --hos=* | --ho=*) | |
191 | host="$ac_optarg" ;; | |
192 | ||
193 | -includedir | --includedir | --includedi | --included | --include \ | |
194 | | --includ | --inclu | --incl | --inc) | |
195 | ac_prev=includedir ;; | |
196 | -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | |
197 | | --includ=* | --inclu=* | --incl=* | --inc=*) | |
198 | includedir="$ac_optarg" ;; | |
199 | ||
200 | -infodir | --infodir | --infodi | --infod | --info | --inf) | |
201 | ac_prev=infodir ;; | |
202 | -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) | |
203 | infodir="$ac_optarg" ;; | |
204 | ||
205 | -libdir | --libdir | --libdi | --libd) | |
206 | ac_prev=libdir ;; | |
207 | -libdir=* | --libdir=* | --libdi=* | --libd=*) | |
208 | libdir="$ac_optarg" ;; | |
209 | ||
210 | -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | |
211 | | --libexe | --libex | --libe) | |
212 | ac_prev=libexecdir ;; | |
213 | -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | |
214 | | --libexe=* | --libex=* | --libe=*) | |
215 | libexecdir="$ac_optarg" ;; | |
216 | ||
217 | -localstatedir | --localstatedir | --localstatedi | --localstated \ | |
218 | | --localstate | --localstat | --localsta | --localst \ | |
219 | | --locals | --local | --loca | --loc | --lo) | |
220 | ac_prev=localstatedir ;; | |
221 | -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | |
222 | | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | |
223 | | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) | |
224 | localstatedir="$ac_optarg" ;; | |
225 | ||
226 | -mandir | --mandir | --mandi | --mand | --man | --ma | --m) | |
227 | ac_prev=mandir ;; | |
228 | -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) | |
229 | mandir="$ac_optarg" ;; | |
230 | ||
231 | -nfp | --nfp | --nf) | |
232 | # Obsolete; use --without-fp. | |
233 | with_fp=no ;; | |
234 | ||
235 | -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | |
236 | | --no-cr | --no-c) | |
237 | no_create=yes ;; | |
238 | ||
239 | -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | |
240 | | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) | |
241 | no_recursion=yes ;; | |
242 | ||
243 | -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | |
244 | | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | |
245 | | --oldin | --oldi | --old | --ol | --o) | |
246 | ac_prev=oldincludedir ;; | |
247 | -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | |
248 | | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | |
249 | | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) | |
250 | oldincludedir="$ac_optarg" ;; | |
251 | ||
252 | -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) | |
253 | ac_prev=prefix ;; | |
254 | -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) | |
255 | prefix="$ac_optarg" ;; | |
256 | ||
257 | -program-prefix | --program-prefix | --program-prefi | --program-pref \ | |
258 | | --program-pre | --program-pr | --program-p) | |
259 | ac_prev=program_prefix ;; | |
260 | -program-prefix=* | --program-prefix=* | --program-prefi=* \ | |
261 | | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) | |
262 | program_prefix="$ac_optarg" ;; | |
263 | ||
264 | -program-suffix | --program-suffix | --program-suffi | --program-suff \ | |
265 | | --program-suf | --program-su | --program-s) | |
266 | ac_prev=program_suffix ;; | |
267 | -program-suffix=* | --program-suffix=* | --program-suffi=* \ | |
268 | | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) | |
269 | program_suffix="$ac_optarg" ;; | |
270 | ||
271 | -program-transform-name | --program-transform-name \ | |
272 | | --program-transform-nam | --program-transform-na \ | |
273 | | --program-transform-n | --program-transform- \ | |
274 | | --program-transform | --program-transfor \ | |
275 | | --program-transfo | --program-transf \ | |
276 | | --program-trans | --program-tran \ | |
277 | | --progr-tra | --program-tr | --program-t) | |
278 | ac_prev=program_transform_name ;; | |
279 | -program-transform-name=* | --program-transform-name=* \ | |
280 | | --program-transform-nam=* | --program-transform-na=* \ | |
281 | | --program-transform-n=* | --program-transform-=* \ | |
282 | | --program-transform=* | --program-transfor=* \ | |
283 | | --program-transfo=* | --program-transf=* \ | |
284 | | --program-trans=* | --program-tran=* \ | |
285 | | --progr-tra=* | --program-tr=* | --program-t=*) | |
286 | program_transform_name="$ac_optarg" ;; | |
287 | ||
288 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | |
289 | | -silent | --silent | --silen | --sile | --sil) | |
290 | silent=yes ;; | |
291 | ||
292 | -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) | |
293 | ac_prev=sbindir ;; | |
294 | -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | |
295 | | --sbi=* | --sb=*) | |
296 | sbindir="$ac_optarg" ;; | |
297 | ||
298 | -sharedstatedir | --sharedstatedir | --sharedstatedi \ | |
299 | | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | |
300 | | --sharedst | --shareds | --shared | --share | --shar \ | |
301 | | --sha | --sh) | |
302 | ac_prev=sharedstatedir ;; | |
303 | -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | |
304 | | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | |
305 | | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | |
306 | | --sha=* | --sh=*) | |
307 | sharedstatedir="$ac_optarg" ;; | |
308 | ||
309 | -site | --site | --sit) | |
310 | ac_prev=site ;; | |
311 | -site=* | --site=* | --sit=*) | |
312 | site="$ac_optarg" ;; | |
313 | ||
314 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) | |
315 | ac_prev=srcdir ;; | |
316 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) | |
317 | srcdir="$ac_optarg" ;; | |
318 | ||
319 | -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | |
320 | | --syscon | --sysco | --sysc | --sys | --sy) | |
321 | ac_prev=sysconfdir ;; | |
322 | -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | |
323 | | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) | |
324 | sysconfdir="$ac_optarg" ;; | |
325 | ||
326 | -target | --target | --targe | --targ | --tar | --ta | --t) | |
327 | ac_prev=target ;; | |
328 | -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) | |
329 | target="$ac_optarg" ;; | |
330 | ||
331 | -v | -verbose | --verbose | --verbos | --verbo | --verb) | |
332 | verbose=yes ;; | |
333 | ||
334 | -version | --version | --versio | --versi | --vers) | |
335 | echo "configure generated by autoconf version 2.13" | |
336 | exit 0 ;; | |
337 | ||
338 | -with-* | --with-*) | |
339 | ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` | |
340 | # Reject names that are not valid shell variable names. | |
341 | if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then | |
342 | { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } | |
343 | fi | |
344 | ac_package=`echo $ac_package| sed 's/-/_/g'` | |
345 | case "$ac_option" in | |
346 | *=*) ;; | |
347 | *) ac_optarg=yes ;; | |
348 | esac | |
349 | eval "with_${ac_package}='$ac_optarg'" ;; | |
350 | ||
351 | -without-* | --without-*) | |
352 | ac_package=`echo $ac_option|sed -e 's/-*without-//'` | |
353 | # Reject names that are not valid shell variable names. | |
354 | if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then | |
355 | { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } | |
356 | fi | |
357 | ac_package=`echo $ac_package| sed 's/-/_/g'` | |
358 | eval "with_${ac_package}=no" ;; | |
359 | ||
360 | --x) | |
361 | # Obsolete; use --with-x. | |
362 | with_x=yes ;; | |
363 | ||
364 | -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | |
365 | | --x-incl | --x-inc | --x-in | --x-i) | |
366 | ac_prev=x_includes ;; | |
367 | -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | |
368 | | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) | |
369 | x_includes="$ac_optarg" ;; | |
370 | ||
371 | -x-libraries | --x-libraries | --x-librarie | --x-librari \ | |
372 | | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) | |
373 | ac_prev=x_libraries ;; | |
374 | -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | |
375 | | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) | |
376 | x_libraries="$ac_optarg" ;; | |
377 | ||
378 | -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } | |
379 | ;; | |
380 | ||
381 | *) | |
382 | if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then | |
383 | echo "configure: warning: $ac_option: invalid host type" 1>&2 | |
384 | fi | |
385 | if test "x$nonopt" != xNONE; then | |
386 | { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } | |
387 | fi | |
388 | nonopt="$ac_option" | |
389 | ;; | |
390 | ||
391 | esac | |
392 | done | |
393 | ||
394 | if test -n "$ac_prev"; then | |
395 | { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } | |
396 | fi | |
397 | ||
398 | trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 | |
399 | ||
400 | # File descriptor usage: | |
401 | # 0 standard input | |
402 | # 1 file creation | |
403 | # 2 errors and warnings | |
404 | # 3 some systems may open it to /dev/tty | |
405 | # 4 used on the Kubota Titan | |
406 | # 6 checking for... messages and results | |
407 | # 5 compiler messages saved in config.log | |
408 | if test "$silent" = yes; then | |
409 | exec 6>/dev/null | |
410 | else | |
411 | exec 6>&1 | |
412 | fi | |
413 | exec 5>./config.log | |
414 | ||
415 | echo "\ | |
416 | This file contains any messages produced by compilers while | |
417 | running configure, to aid debugging if configure makes a mistake. | |
418 | " 1>&5 | |
419 | ||
420 | # Strip out --no-create and --no-recursion so they do not pile up. | |
421 | # Also quote any args containing shell metacharacters. | |
422 | ac_configure_args= | |
423 | for ac_arg | |
424 | do | |
425 | case "$ac_arg" in | |
426 | -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | |
427 | | --no-cr | --no-c) ;; | |
428 | -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | |
429 | | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; | |
430 | *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) | |
431 | ac_configure_args="$ac_configure_args '$ac_arg'" ;; | |
432 | *) ac_configure_args="$ac_configure_args $ac_arg" ;; | |
433 | esac | |
434 | done | |
435 | ||
436 | # NLS nuisances. | |
437 | # Only set these to C if already set. These must not be set unconditionally | |
438 | # because not all systems understand e.g. LANG=C (notably SCO). | |
439 | # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! | |
440 | # Non-C LC_CTYPE values break the ctype check. | |
441 | if test "${LANG+set}" = set; then LANG=C; export LANG; fi | |
442 | if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi | |
443 | if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi | |
444 | if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi | |
445 | ||
446 | # confdefs.h avoids OS command line length limits that DEFS can exceed. | |
447 | rm -rf conftest* confdefs.h | |
448 | # AIX cpp loses on an empty file, so make sure it contains at least a newline. | |
449 | echo > confdefs.h | |
450 | ||
451 | # A filename unique to this package, relative to the directory that | |
452 | # configure is in, which we can look for to find out if srcdir is correct. | |
453 | ac_unique_file=dhelp_parse.c | |
454 | ||
455 | # Find the source files, if location was not specified. | |
456 | if test -z "$srcdir"; then | |
457 | ac_srcdir_defaulted=yes | |
458 | # Try the directory containing this script, then its parent. | |
459 | ac_prog=$0 | |
460 | ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` | |
461 | test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. | |
462 | srcdir=$ac_confdir | |
463 | if test ! -r $srcdir/$ac_unique_file; then | |
464 | srcdir=.. | |
465 | fi | |
466 | else | |
467 | ac_srcdir_defaulted=no | |
468 | fi | |
469 | if test ! -r $srcdir/$ac_unique_file; then | |
470 | if test "$ac_srcdir_defaulted" = yes; then | |
471 | { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } | |
472 | else | |
473 | { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } | |
474 | fi | |
475 | fi | |
476 | srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` | |
477 | ||
478 | # Prefer explicitly selected file to automatically selected ones. | |
479 | if test -z "$CONFIG_SITE"; then | |
480 | if test "x$prefix" != xNONE; then | |
481 | CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" | |
482 | else | |
483 | CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" | |
484 | fi | |
485 | fi | |
486 | for ac_site_file in $CONFIG_SITE; do | |
487 | if test -r "$ac_site_file"; then | |
488 | echo "loading site script $ac_site_file" | |
489 | . "$ac_site_file" | |
490 | fi | |
491 | done | |
492 | ||
493 | if test -r "$cache_file"; then | |
494 | echo "loading cache $cache_file" | |
495 | . $cache_file | |
496 | else | |
497 | echo "creating cache $cache_file" | |
498 | > $cache_file | |
499 | fi | |
500 | ||
501 | ac_ext=c | |
502 | # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
503 | ac_cpp='$CPP $CPPFLAGS' | |
504 | ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | |
505 | ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | |
506 | cross_compiling=$ac_cv_prog_cc_cross | |
507 | ||
508 | ac_exeext= | |
509 | ac_objext=o | |
510 | if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then | |
511 | # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. | |
512 | if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then | |
513 | ac_n= ac_c=' | |
514 | ' ac_t=' ' | |
515 | else | |
516 | ac_n=-n ac_c= ac_t= | |
517 | fi | |
518 | else | |
519 | ac_n= ac_c='\c' ac_t= | |
520 | fi | |
521 | ||
522 | ||
523 | ac_aux_dir= | |
524 | for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do | |
525 | if test -f $ac_dir/install-sh; then | |
526 | ac_aux_dir=$ac_dir | |
527 | ac_install_sh="$ac_aux_dir/install-sh -c" | |
528 | break | |
529 | elif test -f $ac_dir/install.sh; then | |
530 | ac_aux_dir=$ac_dir | |
531 | ac_install_sh="$ac_aux_dir/install.sh -c" | |
532 | break | |
533 | fi | |
534 | done | |
535 | if test -z "$ac_aux_dir"; then | |
536 | { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } | |
537 | fi | |
538 | ac_config_guess=$ac_aux_dir/config.guess | |
539 | ac_config_sub=$ac_aux_dir/config.sub | |
540 | ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. | |
541 | ||
542 | # Find a good install program. We prefer a C program (faster), | |
543 | # so one script is as good as another. But avoid the broken or | |
544 | # incompatible versions: | |
545 | # SysV /etc/install, /usr/sbin/install | |
546 | # SunOS /usr/etc/install | |
547 | # IRIX /sbin/install | |
548 | # AIX /bin/install | |
549 | # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag | |
550 | # AFS /usr/afsws/bin/install, which mishandles nonexistent args | |
551 | # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" | |
552 | # ./install, which can be erroneously created by make from ./install.sh. | |
553 | echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 | |
554 | echo "configure:556: checking for a BSD compatible install" >&5 | |
555 | if test -z "$INSTALL"; then | |
556 | if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then | |
557 | echo $ac_n "(cached) $ac_c" 1>&6 | |
558 | else | |
559 | IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" | |
560 | for ac_dir in $PATH; do | |
561 | # Account for people who put trailing slashes in PATH elements. | |
562 | case "$ac_dir/" in | |
563 | /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; | |
564 | *) | |
565 | # OSF1 and SCO ODT 3.0 have their own names for install. | |
566 | # Don't use installbsd from OSF since it installs stuff as root | |
567 | # by default. | |
568 | for ac_prog in ginstall scoinst install; do | |
569 | if test -f $ac_dir/$ac_prog; then | |
570 | if test $ac_prog = install && | |
571 | grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then | |
572 | # AIX install. It has an incompatible calling convention. | |
573 | : | |
574 | else | |
575 | ac_cv_path_install="$ac_dir/$ac_prog -c" | |
576 | break 2 | |
577 | fi | |
578 | fi | |
579 | done | |
580 | ;; | |
581 | esac | |
582 | done | |
583 | IFS="$ac_save_IFS" | |
584 | ||
585 | fi | |
586 | if test "${ac_cv_path_install+set}" = set; then | |
587 | INSTALL="$ac_cv_path_install" | |
588 | else | |
589 | # As a last resort, use the slow shell script. We don't cache a | |
590 | # path for INSTALL within a source directory, because that will | |
591 | # break other packages using the cache if that directory is | |
592 | # removed, or if the path is relative. | |
593 | INSTALL="$ac_install_sh" | |
594 | fi | |
595 | fi | |
596 | echo "$ac_t""$INSTALL" 1>&6 | |
597 | ||
598 | # Use test -z because SunOS4 sh mishandles braces in ${var-val}. | |
599 | # It thinks the first close brace ends the variable substitution. | |
600 | test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' | |
601 | ||
602 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' | |
603 | ||
604 | test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' | |
605 | ||
606 | echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 | |
607 | echo "configure:609: checking whether build environment is sane" >&5 | |
608 | # Just in case | |
609 | sleep 1 | |
610 | echo timestamp > conftestfile | |
611 | # Do `set' in a subshell so we don't clobber the current shell's | |
612 | # arguments. Must try -L first in case configure is actually a | |
613 | # symlink; some systems play weird games with the mod time of symlinks | |
614 | # (eg FreeBSD returns the mod time of the symlink's containing | |
615 | # directory). | |
616 | if ( | |
617 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
618 | if test "$*" = "X"; then | |
619 | # -L didn't work. | |
620 | set X `ls -t $srcdir/configure conftestfile` | |
621 | fi | |
622 | if test "$*" != "X $srcdir/configure conftestfile" \ | |
623 | && test "$*" != "X conftestfile $srcdir/configure"; then | |
624 | ||
625 | # If neither matched, then we have a broken ls. This can happen | |
626 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
627 | # broken ls alias from the environment. This has actually | |
628 | # happened. Such a system could not be considered "sane". | |
629 | { echo "configure: error: ls -t appears to fail. Make sure there is not a broken | |
630 | alias in your environment" 1>&2; exit 1; } | |
631 | fi | |
632 | ||
633 | test "$2" = conftestfile | |
634 | ) | |
635 | then | |
636 | # Ok. | |
637 | : | |
638 | else | |
639 | { echo "configure: error: newly created file is older than distributed files! | |
640 | Check your system clock" 1>&2; exit 1; } | |
641 | fi | |
642 | rm -f conftest* | |
643 | echo "$ac_t""yes" 1>&6 | |
644 | if test "$program_transform_name" = s,x,x,; then | |
645 | program_transform_name= | |
646 | else | |
647 | # Double any \ or $. echo might interpret backslashes. | |
648 | cat <<\EOF_SED > conftestsed | |
649 | s,\\,\\\\,g; s,\$,$$,g | |
650 | EOF_SED | |
651 | program_transform_name="`echo $program_transform_name|sed -f conftestsed`" | |
652 | rm -f conftestsed | |
653 | fi | |
654 | test "$program_prefix" != NONE && | |
655 | program_transform_name="s,^,${program_prefix},; $program_transform_name" | |
656 | # Use a double $ so make ignores it. | |
657 | test "$program_suffix" != NONE && | |
658 | program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" | |
659 | ||
660 | # sed with no file args requires a program. | |
661 | test "$program_transform_name" = "" && program_transform_name="s,x,x," | |
662 | ||
663 | echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 | |
664 | echo "configure:666: checking whether ${MAKE-make} sets \${MAKE}" >&5 | |
665 | set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` | |
666 | if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then | |
667 | echo $ac_n "(cached) $ac_c" 1>&6 | |
668 | else | |
669 | cat > conftestmake <<\EOF | |
670 | all: | |
671 | @echo 'ac_maketemp="${MAKE}"' | |
672 | EOF | |
673 | # GNU make sometimes prints "make[1]: Entering...", which would confuse us. | |
674 | eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` | |
675 | if test -n "$ac_maketemp"; then | |
676 | eval ac_cv_prog_make_${ac_make}_set=yes | |
677 | else | |
678 | eval ac_cv_prog_make_${ac_make}_set=no | |
679 | fi | |
680 | rm -f conftestmake | |
681 | fi | |
682 | if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then | |
683 | echo "$ac_t""yes" 1>&6 | |
684 | SET_MAKE= | |
685 | else | |
686 | echo "$ac_t""no" 1>&6 | |
687 | SET_MAKE="MAKE=${MAKE-make}" | |
688 | fi | |
689 | ||
690 | ||
691 | PACKAGE=dhelp | |
692 | ||
693 | VERSION=0.5.11 | |
694 | ||
695 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
696 | { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } | |
697 | fi | |
698 | cat >> confdefs.h <<EOF | |
699 | #define PACKAGE "$PACKAGE" | |
700 | EOF | |
701 | ||
702 | cat >> confdefs.h <<EOF | |
703 | #define VERSION "$VERSION" | |
704 | EOF | |
705 | ||
706 | ||
707 | ||
708 | missing_dir=`cd $ac_aux_dir && pwd` | |
709 | echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 | |
710 | echo "configure:712: checking for working aclocal" >&5 | |
711 | # Run test in a subshell; some versions of sh will print an error if | |
712 | # an executable is not found, even if stderr is redirected. | |
713 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
714 | if (aclocal --version) < /dev/null > /dev/null 2>&1; then | |
715 | ACLOCAL=aclocal | |
716 | echo "$ac_t""found" 1>&6 | |
717 | else | |
718 | ACLOCAL="$missing_dir/missing aclocal" | |
719 | echo "$ac_t""missing" 1>&6 | |
720 | fi | |
721 | ||
722 | echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 | |
723 | echo "configure:725: checking for working autoconf" >&5 | |
724 | # Run test in a subshell; some versions of sh will print an error if | |
725 | # an executable is not found, even if stderr is redirected. | |
726 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
727 | if (autoconf --version) < /dev/null > /dev/null 2>&1; then | |
728 | AUTOCONF=autoconf | |
729 | echo "$ac_t""found" 1>&6 | |
730 | else | |
731 | AUTOCONF="$missing_dir/missing autoconf" | |
732 | echo "$ac_t""missing" 1>&6 | |
733 | fi | |
734 | ||
735 | echo $ac_n "checking for working automake""... $ac_c" 1>&6 | |
736 | echo "configure:738: checking for working automake" >&5 | |
737 | # Run test in a subshell; some versions of sh will print an error if | |
738 | # an executable is not found, even if stderr is redirected. | |
739 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
740 | if (automake --version) < /dev/null > /dev/null 2>&1; then | |
741 | AUTOMAKE=automake | |
742 | echo "$ac_t""found" 1>&6 | |
743 | else | |
744 | AUTOMAKE="$missing_dir/missing automake" | |
745 | echo "$ac_t""missing" 1>&6 | |
746 | fi | |
747 | ||
748 | echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 | |
749 | echo "configure:751: checking for working autoheader" >&5 | |
750 | # Run test in a subshell; some versions of sh will print an error if | |
751 | # an executable is not found, even if stderr is redirected. | |
752 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
753 | if (autoheader --version) < /dev/null > /dev/null 2>&1; then | |
754 | AUTOHEADER=autoheader | |
755 | echo "$ac_t""found" 1>&6 | |
756 | else | |
757 | AUTOHEADER="$missing_dir/missing autoheader" | |
758 | echo "$ac_t""missing" 1>&6 | |
759 | fi | |
760 | ||
761 | echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 | |
762 | echo "configure:764: checking for working makeinfo" >&5 | |
763 | # Run test in a subshell; some versions of sh will print an error if | |
764 | # an executable is not found, even if stderr is redirected. | |
765 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
766 | if (makeinfo --version) < /dev/null > /dev/null 2>&1; then | |
767 | MAKEINFO=makeinfo | |
768 | echo "$ac_t""found" 1>&6 | |
769 | else | |
770 | MAKEINFO="$missing_dir/missing makeinfo" | |
771 | echo "$ac_t""missing" 1>&6 | |
772 | fi | |
773 | ||
774 | ||
775 | ||
776 | # Extract the first word of "gcc", so it can be a program name with args. | |
777 | set dummy gcc; ac_word=$2 | |
778 | echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
779 | echo "configure:781: checking for $ac_word" >&5 | |
780 | if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then | |
781 | echo $ac_n "(cached) $ac_c" 1>&6 | |
782 | else | |
783 | if test -n "$CC"; then | |
784 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
785 | else | |
786 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" | |
787 | ac_dummy="$PATH" | |
788 | for ac_dir in $ac_dummy; do | |
789 | test -z "$ac_dir" && ac_dir=. | |
790 | if test -f $ac_dir/$ac_word; then | |
791 | ac_cv_prog_CC="gcc" | |
792 | break | |
793 | fi | |
794 | done | |
795 | IFS="$ac_save_ifs" | |
796 | fi | |
797 | fi | |
798 | CC="$ac_cv_prog_CC" | |
799 | if test -n "$CC"; then | |
800 | echo "$ac_t""$CC" 1>&6 | |
801 | else | |
802 | echo "$ac_t""no" 1>&6 | |
803 | fi | |
804 | ||
805 | if test -z "$CC"; then | |
806 | # Extract the first word of "cc", so it can be a program name with args. | |
807 | set dummy cc; ac_word=$2 | |
808 | echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
809 | echo "configure:811: checking for $ac_word" >&5 | |
810 | if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then | |
811 | echo $ac_n "(cached) $ac_c" 1>&6 | |
812 | else | |
813 | if test -n "$CC"; then | |
814 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
815 | else | |
816 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" | |
817 | ac_prog_rejected=no | |
818 | ac_dummy="$PATH" | |
819 | for ac_dir in $ac_dummy; do | |
820 | test -z "$ac_dir" && ac_dir=. | |
821 | if test -f $ac_dir/$ac_word; then | |
822 | if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then | |
823 | ac_prog_rejected=yes | |
824 | continue | |
825 | fi | |
826 | ac_cv_prog_CC="cc" | |
827 | break | |
828 | fi | |
829 | done | |
830 | IFS="$ac_save_ifs" | |
831 | if test $ac_prog_rejected = yes; then | |
832 | # We found a bogon in the path, so make sure we never use it. | |
833 | set dummy $ac_cv_prog_CC | |
834 | shift | |
835 | if test $# -gt 0; then | |
836 | # We chose a different compiler from the bogus one. | |
837 | # However, it has the same basename, so the bogon will be chosen | |
838 | # first if we set CC to just the basename; use the full file name. | |
839 | shift | |
840 | set dummy "$ac_dir/$ac_word" "$@" | |
841 | shift | |
842 | ac_cv_prog_CC="$@" | |
843 | fi | |
844 | fi | |
845 | fi | |
846 | fi | |
847 | CC="$ac_cv_prog_CC" | |
848 | if test -n "$CC"; then | |
849 | echo "$ac_t""$CC" 1>&6 | |
850 | else | |
851 | echo "$ac_t""no" 1>&6 | |
852 | fi | |
853 | ||
854 | if test -z "$CC"; then | |
855 | case "`uname -s`" in | |
856 | *win32* | *WIN32*) | |
857 | # Extract the first word of "cl", so it can be a program name with args. | |
858 | set dummy cl; ac_word=$2 | |
859 | echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
860 | echo "configure:862: checking for $ac_word" >&5 | |
861 | if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then | |
862 | echo $ac_n "(cached) $ac_c" 1>&6 | |
863 | else | |
864 | if test -n "$CC"; then | |
865 | ac_cv_prog_CC="$CC" # Let the user override the test. | |
866 | else | |
867 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" | |
868 | ac_dummy="$PATH" | |
869 | for ac_dir in $ac_dummy; do | |
870 | test -z "$ac_dir" && ac_dir=. | |
871 | if test -f $ac_dir/$ac_word; then | |
872 | ac_cv_prog_CC="cl" | |
873 | break | |
874 | fi | |
875 | done | |
876 | IFS="$ac_save_ifs" | |
877 | fi | |
878 | fi | |
879 | CC="$ac_cv_prog_CC" | |
880 | if test -n "$CC"; then | |
881 | echo "$ac_t""$CC" 1>&6 | |
882 | else | |
883 | echo "$ac_t""no" 1>&6 | |
884 | fi | |
885 | ;; | |
886 | esac | |
887 | fi | |
888 | test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } | |
889 | fi | |
890 | ||
891 | echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 | |
892 | echo "configure:894: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 | |
893 | ||
894 | ac_ext=c | |
895 | # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
896 | ac_cpp='$CPP $CPPFLAGS' | |
897 | ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | |
898 | ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | |
899 | cross_compiling=$ac_cv_prog_cc_cross | |
900 | ||
901 | cat > conftest.$ac_ext << EOF | |
902 | ||
903 | #line 905 "configure" | |
904 | #include "confdefs.h" | |
905 | ||
906 | main(){return(0);} | |
907 | EOF | |
908 | if { (eval echo configure:910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then | |
909 | ac_cv_prog_cc_works=yes | |
910 | # If we can't run a trivial program, we are probably using a cross compiler. | |
911 | if (./conftest; exit) 2>/dev/null; then | |
912 | ac_cv_prog_cc_cross=no | |
913 | else | |
914 | ac_cv_prog_cc_cross=yes | |
915 | fi | |
916 | else | |
917 | echo "configure: failed program was:" >&5 | |
918 | cat conftest.$ac_ext >&5 | |
919 | ac_cv_prog_cc_works=no | |
920 | fi | |
921 | rm -fr conftest* | |
922 | ac_ext=c | |
923 | # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
924 | ac_cpp='$CPP $CPPFLAGS' | |
925 | ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | |
926 | ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | |
927 | cross_compiling=$ac_cv_prog_cc_cross | |
928 | ||
929 | echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 | |
930 | if test $ac_cv_prog_cc_works = no; then | |
931 | { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } | |
932 | fi | |
933 | echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 | |
934 | echo "configure:936: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 | |
935 | echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 | |
936 | cross_compiling=$ac_cv_prog_cc_cross | |
937 | ||
938 | echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 | |
939 | echo "configure:941: checking whether we are using GNU C" >&5 | |
940 | if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then | |
941 | echo $ac_n "(cached) $ac_c" 1>&6 | |
942 | else | |
943 | cat > conftest.c <<EOF | |
944 | #ifdef __GNUC__ | |
945 | yes; | |
946 | #endif | |
947 | EOF | |
948 | if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:950: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then | |
949 | ac_cv_prog_gcc=yes | |
950 | else | |
951 | ac_cv_prog_gcc=no | |
952 | fi | |
953 | fi | |
954 | ||
955 | echo "$ac_t""$ac_cv_prog_gcc" 1>&6 | |
956 | ||
957 | if test $ac_cv_prog_gcc = yes; then | |
958 | GCC=yes | |
959 | else | |
960 | GCC= | |
961 | fi | |
962 | ||
963 | ac_test_CFLAGS="${CFLAGS+set}" | |
964 | ac_save_CFLAGS="$CFLAGS" | |
965 | CFLAGS= | |
966 | echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 | |
967 | echo "configure:969: checking whether ${CC-cc} accepts -g" >&5 | |
968 | if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then | |
969 | echo $ac_n "(cached) $ac_c" 1>&6 | |
970 | else | |
971 | echo 'void f(){}' > conftest.c | |
972 | if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then | |
973 | ac_cv_prog_cc_g=yes | |
974 | else | |
975 | ac_cv_prog_cc_g=no | |
976 | fi | |
977 | rm -f conftest* | |
978 | ||
979 | fi | |
980 | ||
981 | echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 | |
982 | if test "$ac_test_CFLAGS" = set; then | |
983 | CFLAGS="$ac_save_CFLAGS" | |
984 | elif test $ac_cv_prog_cc_g = yes; then | |
985 | if test "$GCC" = yes; then | |
986 | CFLAGS="-g -O2" | |
987 | else | |
988 | CFLAGS="-g" | |
989 | fi | |
990 | else | |
991 | if test "$GCC" = yes; then | |
992 | CFLAGS="-O2" | |
993 | else | |
994 | CFLAGS= | |
995 | fi | |
996 | fi | |
997 | ||
998 | ||
999 | echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 | |
1000 | echo "configure:1002: checking how to run the C preprocessor" >&5 | |
1001 | # On Suns, sometimes $CPP names a directory. | |
1002 | if test -n "$CPP" && test -d "$CPP"; then | |
1003 | CPP= | |
1004 | fi | |
1005 | if test -z "$CPP"; then | |
1006 | if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then | |
1007 | echo $ac_n "(cached) $ac_c" 1>&6 | |
1008 | else | |
1009 | # This must be in double quotes, not single quotes, because CPP may get | |
1010 | # substituted into the Makefile and "${CC-cc}" will confuse make. | |
1011 | CPP="${CC-cc} -E" | |
1012 | # On the NeXT, cc -E runs the code through the compiler's parser, | |
1013 | # not just through cpp. | |
1014 | cat > conftest.$ac_ext <<EOF | |
1015 | #line 1017 "configure" | |
1016 | #include "confdefs.h" | |
1017 | #include <assert.h> | |
1018 | Syntax Error | |
1019 | EOF | |
1020 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
1021 | { (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1022 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
1023 | if test -z "$ac_err"; then | |
1024 | : | |
1025 | else | |
1026 | echo "$ac_err" >&5 | |
1027 | echo "configure: failed program was:" >&5 | |
1028 | cat conftest.$ac_ext >&5 | |
1029 | rm -rf conftest* | |
1030 | CPP="${CC-cc} -E -traditional-cpp" | |
1031 | cat > conftest.$ac_ext <<EOF | |
1032 | #line 1034 "configure" | |
1033 | #include "confdefs.h" | |
1034 | #include <assert.h> | |
1035 | Syntax Error | |
1036 | EOF | |
1037 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
1038 | { (eval echo configure:1040: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1039 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
1040 | if test -z "$ac_err"; then | |
1041 | : | |
1042 | else | |
1043 | echo "$ac_err" >&5 | |
1044 | echo "configure: failed program was:" >&5 | |
1045 | cat conftest.$ac_ext >&5 | |
1046 | rm -rf conftest* | |
1047 | CPP="${CC-cc} -nologo -E" | |
1048 | cat > conftest.$ac_ext <<EOF | |
1049 | #line 1051 "configure" | |
1050 | #include "confdefs.h" | |
1051 | #include <assert.h> | |
1052 | Syntax Error | |
1053 | EOF | |
1054 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
1055 | { (eval echo configure:1057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1056 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
1057 | if test -z "$ac_err"; then | |
1058 | : | |
1059 | else | |
1060 | echo "$ac_err" >&5 | |
1061 | echo "configure: failed program was:" >&5 | |
1062 | cat conftest.$ac_ext >&5 | |
1063 | rm -rf conftest* | |
1064 | CPP=/lib/cpp | |
1065 | fi | |
1066 | rm -f conftest* | |
1067 | fi | |
1068 | rm -f conftest* | |
1069 | fi | |
1070 | rm -f conftest* | |
1071 | ac_cv_prog_CPP="$CPP" | |
1072 | fi | |
1073 | CPP="$ac_cv_prog_CPP" | |
1074 | else | |
1075 | ac_cv_prog_CPP="$CPP" | |
1076 | fi | |
1077 | echo "$ac_t""$CPP" 1>&6 | |
1078 | ||
1079 | for ac_hdr in db.h | |
1080 | do | |
1081 | ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` | |
1082 | echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 | |
1083 | echo "configure:1085: checking for $ac_hdr" >&5 | |
1084 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
1085 | echo $ac_n "(cached) $ac_c" 1>&6 | |
1086 | else | |
1087 | cat > conftest.$ac_ext <<EOF | |
1088 | #line 1090 "configure" | |
1089 | #include "confdefs.h" | |
1090 | #include <$ac_hdr> | |
1091 | EOF | |
1092 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
1093 | { (eval echo configure:1095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1094 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
1095 | if test -z "$ac_err"; then | |
1096 | rm -rf conftest* | |
1097 | eval "ac_cv_header_$ac_safe=yes" | |
1098 | else | |
1099 | echo "$ac_err" >&5 | |
1100 | echo "configure: failed program was:" >&5 | |
1101 | cat conftest.$ac_ext >&5 | |
1102 | rm -rf conftest* | |
1103 | eval "ac_cv_header_$ac_safe=no" | |
1104 | fi | |
1105 | rm -f conftest* | |
1106 | fi | |
1107 | if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then | |
1108 | echo "$ac_t""yes" 1>&6 | |
1109 | ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` | |
1110 | cat >> confdefs.h <<EOF | |
1111 | #define $ac_tr_hdr 1 | |
1112 | EOF | |
1113 | ||
1114 | else | |
1115 | echo "$ac_t""no" 1>&6 | |
1116 | fi | |
1117 | done | |
1118 | ||
1119 | echo $ac_n "checking for db_create in -ldb""... $ac_c" 1>&6 | |
1120 | echo "configure:1122: checking for db_create in -ldb" >&5 | |
1121 | ac_lib_var=`echo db'_'db_create | sed 'y%./+-%__p_%'` | |
1122 | if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then | |
1123 | echo $ac_n "(cached) $ac_c" 1>&6 | |
1124 | else | |
1125 | ac_save_LIBS="$LIBS" | |
1126 | LIBS="-ldb $LIBS" | |
1127 | cat > conftest.$ac_ext <<EOF | |
1128 | #line 1130 "configure" | |
1129 | #include "confdefs.h" | |
1130 | /* Override any gcc2 internal prototype to avoid an error. */ | |
1131 | /* We use char because int might match the return type of a gcc2 | |
1132 | builtin and then its argument prototype would still apply. */ | |
1133 | char db_create(); | |
1134 | ||
1135 | int main() { | |
1136 | db_create() | |
1137 | ; return 0; } | |
1138 | EOF | |
1139 | if { (eval echo configure:1141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then | |
1140 | rm -rf conftest* | |
1141 | eval "ac_cv_lib_$ac_lib_var=yes" | |
1142 | else | |
1143 | echo "configure: failed program was:" >&5 | |
1144 | cat conftest.$ac_ext >&5 | |
1145 | rm -rf conftest* | |
1146 | eval "ac_cv_lib_$ac_lib_var=no" | |
1147 | fi | |
1148 | rm -f conftest* | |
1149 | LIBS="$ac_save_LIBS" | |
1150 | ||
1151 | fi | |
1152 | if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then | |
1153 | echo "$ac_t""yes" 1>&6 | |
1154 | ac_tr_lib=HAVE_LIB`echo db | sed -e 's/[^a-zA-Z0-9_]/_/g' \ | |
1155 | -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` | |
1156 | cat >> confdefs.h <<EOF | |
1157 | #define $ac_tr_lib 1 | |
1158 | EOF | |
1159 | ||
1160 | LIBS="-ldb $LIBS" | |
1161 | ||
1162 | else | |
1163 | echo "$ac_t""no" 1>&6 | |
1164 | fi | |
1165 | ||
1166 | ||
1167 | trap '' 1 2 15 | |
1168 | cat > confcache <<\EOF | |
1169 | # This file is a shell script that caches the results of configure | |
1170 | # tests run on this system so they can be shared between configure | |
1171 | # scripts and configure runs. It is not useful on other systems. | |
1172 | # If it contains results you don't want to keep, you may remove or edit it. | |
1173 | # | |
1174 | # By default, configure uses ./config.cache as the cache file, | |
1175 | # creating it if it does not exist already. You can give configure | |
1176 | # the --cache-file=FILE option to use a different cache file; that is | |
1177 | # what configure does when it calls configure scripts in | |
1178 | # subdirectories, so they share the cache. | |
1179 | # Giving --cache-file=/dev/null disables caching, for debugging configure. | |
1180 | # config.status only pays attention to the cache file if you give it the | |
1181 | # --recheck option to rerun configure. | |
1182 | # | |
1183 | EOF | |
1184 | # The following way of writing the cache mishandles newlines in values, | |
1185 | # but we know of no workaround that is simple, portable, and efficient. | |
1186 | # So, don't put newlines in cache variables' values. | |
1187 | # Ultrix sh set writes to stderr and can't be redirected directly, | |
1188 | # and sets the high bit in the cache file unless we assign to the vars. | |
1189 | (set) 2>&1 | | |
1190 | case `(ac_space=' '; set | grep ac_space) 2>&1` in | |
1191 | *ac_space=\ *) | |
1192 | # `set' does not quote correctly, so add quotes (double-quote substitution | |
1193 | # turns \\\\ into \\, and sed turns \\ into \). | |
1194 | sed -n \ | |
1195 | -e "s/'/'\\\\''/g" \ | |
1196 | -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" | |
1197 | ;; | |
1198 | *) | |
1199 | # `set' quotes correctly as required by POSIX, so do not add quotes. | |
1200 | sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' | |
1201 | ;; | |
1202 | esac >> confcache | |
1203 | if cmp -s $cache_file confcache; then | |
1204 | : | |
1205 | else | |
1206 | if test -w $cache_file; then | |
1207 | echo "updating cache $cache_file" | |
1208 | cat confcache > $cache_file | |
1209 | else | |
1210 | echo "not updating unwritable cache $cache_file" | |
1211 | fi | |
1212 | fi | |
1213 | rm -f confcache | |
1214 | ||
1215 | trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 | |
1216 | ||
1217 | test "x$prefix" = xNONE && prefix=$ac_default_prefix | |
1218 | # Let make expand exec_prefix. | |
1219 | test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' | |
1220 | ||
1221 | # Any assignment to VPATH causes Sun make to only execute | |
1222 | # the first set of double-colon rules, so remove it if not needed. | |
1223 | # If there is a colon in the path, we need to keep it. | |
1224 | if test "x$srcdir" = x.; then | |
1225 | ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' | |
1226 | fi | |
1227 | ||
1228 | trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 | |
1229 | ||
1230 | # Transform confdefs.h into DEFS. | |
1231 | # Protect against shell expansion while executing Makefile rules. | |
1232 | # Protect against Makefile macro expansion. | |
1233 | cat > conftest.defs <<\EOF | |
1234 | s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g | |
1235 | s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g | |
1236 | s%\[%\\&%g | |
1237 | s%\]%\\&%g | |
1238 | s%\$%$$%g | |
1239 | EOF | |
1240 | DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` | |
1241 | rm -f conftest.defs | |
1242 | ||
1243 | ||
1244 | # Without the "./", some shells look in PATH for config.status. | |
1245 | : ${CONFIG_STATUS=./config.status} | |
1246 | ||
1247 | echo creating $CONFIG_STATUS | |
1248 | rm -f $CONFIG_STATUS | |
1249 | cat > $CONFIG_STATUS <<EOF | |
1250 | #! /bin/sh | |
1251 | # Generated automatically by configure. | |
1252 | # Run this file to recreate the current configuration. | |
1253 | # This directory was configured as follows, | |
1254 | # on host `(hostname || uname -n) 2>/dev/null | sed 1q`: | |
1255 | # | |
1256 | # $0 $ac_configure_args | |
1257 | # | |
1258 | # Compiler output produced by configure, useful for debugging | |
1259 | # configure, is in ./config.log if it exists. | |
1260 | ||
1261 | ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" | |
1262 | for ac_option | |
1263 | do | |
1264 | case "\$ac_option" in | |
1265 | -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) | |
1266 | echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" | |
1267 | exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; | |
1268 | -version | --version | --versio | --versi | --vers | --ver | --ve | --v) | |
1269 | echo "$CONFIG_STATUS generated by autoconf version 2.13" | |
1270 | exit 0 ;; | |
1271 | -help | --help | --hel | --he | --h) | |
1272 | echo "\$ac_cs_usage"; exit 0 ;; | |
1273 | *) echo "\$ac_cs_usage"; exit 1 ;; | |
1274 | esac | |
1275 | done | |
1276 | ||
1277 | ac_given_srcdir=$srcdir | |
1278 | ac_given_INSTALL="$INSTALL" | |
1279 | ||
1280 | trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 | |
1281 | EOF | |
1282 | cat >> $CONFIG_STATUS <<EOF | |
1283 | ||
1284 | # Protect against being on the right side of a sed subst in config.status. | |
1285 | sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; | |
1286 | s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF | |
1287 | $ac_vpsub | |
1288 | $extrasub | |
1289 | s%@SHELL@%$SHELL%g | |
1290 | s%@CFLAGS@%$CFLAGS%g | |
1291 | s%@CPPFLAGS@%$CPPFLAGS%g | |
1292 | s%@CXXFLAGS@%$CXXFLAGS%g | |
1293 | s%@FFLAGS@%$FFLAGS%g | |
1294 | s%@DEFS@%$DEFS%g | |
1295 | s%@LDFLAGS@%$LDFLAGS%g | |
1296 | s%@LIBS@%$LIBS%g | |
1297 | s%@exec_prefix@%$exec_prefix%g | |
1298 | s%@prefix@%$prefix%g | |
1299 | s%@program_transform_name@%$program_transform_name%g | |
1300 | s%@bindir@%$bindir%g | |
1301 | s%@sbindir@%$sbindir%g | |
1302 | s%@libexecdir@%$libexecdir%g | |
1303 | s%@datadir@%$datadir%g | |
1304 | s%@sysconfdir@%$sysconfdir%g | |
1305 | s%@sharedstatedir@%$sharedstatedir%g | |
1306 | s%@localstatedir@%$localstatedir%g | |
1307 | s%@libdir@%$libdir%g | |
1308 | s%@includedir@%$includedir%g | |
1309 | s%@oldincludedir@%$oldincludedir%g | |
1310 | s%@infodir@%$infodir%g | |
1311 | s%@mandir@%$mandir%g | |
1312 | s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g | |
1313 | s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g | |
1314 | s%@INSTALL_DATA@%$INSTALL_DATA%g | |
1315 | s%@PACKAGE@%$PACKAGE%g | |
1316 | s%@VERSION@%$VERSION%g | |
1317 | s%@ACLOCAL@%$ACLOCAL%g | |
1318 | s%@AUTOCONF@%$AUTOCONF%g | |
1319 | s%@AUTOMAKE@%$AUTOMAKE%g | |
1320 | s%@AUTOHEADER@%$AUTOHEADER%g | |
1321 | s%@MAKEINFO@%$MAKEINFO%g | |
1322 | s%@SET_MAKE@%$SET_MAKE%g | |
1323 | s%@CC@%$CC%g | |
1324 | s%@CPP@%$CPP%g | |
1325 | ||
1326 | CEOF | |
1327 | EOF | |
1328 | ||
1329 | cat >> $CONFIG_STATUS <<\EOF | |
1330 | ||
1331 | # Split the substitutions into bite-sized pieces for seds with | |
1332 | # small command number limits, like on Digital OSF/1 and HP-UX. | |
1333 | ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. | |
1334 | ac_file=1 # Number of current file. | |
1335 | ac_beg=1 # First line for current file. | |
1336 | ac_end=$ac_max_sed_cmds # Line after last line for current file. | |
1337 | ac_more_lines=: | |
1338 | ac_sed_cmds="" | |
1339 | while $ac_more_lines; do | |
1340 | if test $ac_beg -gt 1; then | |
1341 | sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file | |
1342 | else | |
1343 | sed "${ac_end}q" conftest.subs > conftest.s$ac_file | |
1344 | fi | |
1345 | if test ! -s conftest.s$ac_file; then | |
1346 | ac_more_lines=false | |
1347 | rm -f conftest.s$ac_file | |
1348 | else | |
1349 | if test -z "$ac_sed_cmds"; then | |
1350 | ac_sed_cmds="sed -f conftest.s$ac_file" | |
1351 | else | |
1352 | ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" | |
1353 | fi | |
1354 | ac_file=`expr $ac_file + 1` | |
1355 | ac_beg=$ac_end | |
1356 | ac_end=`expr $ac_end + $ac_max_sed_cmds` | |
1357 | fi | |
1358 | done | |
1359 | if test -z "$ac_sed_cmds"; then | |
1360 | ac_sed_cmds=cat | |
1361 | fi | |
1362 | EOF | |
1363 | ||
1364 | cat >> $CONFIG_STATUS <<EOF | |
1365 | ||
1366 | CONFIG_FILES=\${CONFIG_FILES-"Makefile"} | |
1367 | EOF | |
1368 | cat >> $CONFIG_STATUS <<\EOF | |
1369 | for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then | |
1370 | # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". | |
1371 | case "$ac_file" in | |
1372 | *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` | |
1373 | ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; | |
1374 | *) ac_file_in="${ac_file}.in" ;; | |
1375 | esac | |
1376 | ||
1377 | # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. | |
1378 | ||
1379 | # Remove last slash and all that follows it. Not all systems have dirname. | |
1380 | ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` | |
1381 | if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then | |
1382 | # The file is in a subdirectory. | |
1383 | test ! -d "$ac_dir" && mkdir "$ac_dir" | |
1384 | ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" | |
1385 | # A "../" for each directory in $ac_dir_suffix. | |
1386 | ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` | |
1387 | else | |
1388 | ac_dir_suffix= ac_dots= | |
1389 | fi | |
1390 | ||
1391 | case "$ac_given_srcdir" in | |
1392 | .) srcdir=. | |
1393 | if test -z "$ac_dots"; then top_srcdir=. | |
1394 | else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; | |
1395 | /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; | |
1396 | *) # Relative path. | |
1397 | srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" | |
1398 | top_srcdir="$ac_dots$ac_given_srcdir" ;; | |
1399 | esac | |
1400 | ||
1401 | case "$ac_given_INSTALL" in | |
1402 | [/$]*) INSTALL="$ac_given_INSTALL" ;; | |
1403 | *) INSTALL="$ac_dots$ac_given_INSTALL" ;; | |
1404 | esac | |
1405 | ||
1406 | echo creating "$ac_file" | |
1407 | rm -f "$ac_file" | |
1408 | configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." | |
1409 | case "$ac_file" in | |
1410 | *Makefile*) ac_comsub="1i\\ | |
1411 | # $configure_input" ;; | |
1412 | *) ac_comsub= ;; | |
1413 | esac | |
1414 | ||
1415 | ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` | |
1416 | sed -e "$ac_comsub | |
1417 | s%@configure_input@%$configure_input%g | |
1418 | s%@srcdir@%$srcdir%g | |
1419 | s%@top_srcdir@%$top_srcdir%g | |
1420 | s%@INSTALL@%$INSTALL%g | |
1421 | " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file | |
1422 | fi; done | |
1423 | rm -f conftest.s* | |
1424 | ||
1425 | EOF | |
1426 | cat >> $CONFIG_STATUS <<EOF | |
1427 | ||
1428 | EOF | |
1429 | cat >> $CONFIG_STATUS <<\EOF | |
1430 | ||
1431 | exit 0 | |
1432 | EOF | |
1433 | chmod +x $CONFIG_STATUS | |
1434 | rm -fr confdefs* $ac_clean_files | |
1435 | test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 | |
1436 |
0 | dnl configure.in for dhelp project | |
1 | ||
2 | dnl Copyright (C) 2001,2002 Stefan Hornburg (Racke) <racke@linuxia.de> | |
3 | ||
4 | dnl This file is free software; you can redistribute it and/or modify it | |
5 | dnl under the terms of the GNU General Public License as published by the | |
6 | dnl Free Software Foundation; either version 2, or (at your option) any | |
7 | dnl later version. | |
8 | ||
9 | dnl This file is distributed in the hope that it will be | |
10 | dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty | |
11 | dnl of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | dnl General Public License for more details. | |
13 | ||
14 | dnl You should have received a copy of the GNU General Public License | |
15 | dnl along with this file; see the file COPYING. If not, write to the Free | |
16 | dnl Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
17 | ||
18 | AC_INIT(dhelp_parse.c) | |
19 | AM_INIT_AUTOMAKE(dhelp,0.5.11) | |
20 | ||
21 | dnl Check for compiler | |
22 | AC_PROG_CC | |
23 | ||
24 | dnl Check for libraries | |
25 | AC_CHECK_HEADERS(db.h) | |
26 | AC_CHECK_LIB(db, db_create) | |
27 | ||
28 | AC_OUTPUT(Makefile) |
0 | ||
1 | dhelp | |
2 | ===== | |
3 | ||
4 | This program supports the new /usr/share/doc directory (FHS). | |
5 | To browse the old /usr/doc directory (FSSTND) build the index | |
6 | with the following command: | |
7 | ||
8 | dhelp_parse_fsstnd -r | |
9 | ||
10 | The index is created in /usr/doc/HTML/. | |
11 | ||
12 | If your native language is not English, Danish, German, Spanish, Italian | |
13 | or French it would be nice, if you could send me a translation of | |
14 | /usr/doc/share/dhelp/.dhelp, /usr/lib/cgi-bin/dsearch (%MESG) and | |
15 | dhelp_parse.c (function html_w_tail) for your language. Thank you :). | |
16 | ||
17 | Marco Budde (budde@debian.org) | |
18 |
0 | dhelp (0.5.11) unstable; urgency=medium | |
1 | ||
2 | * made "other documents" link relative (Closes: #82757) | |
3 | * avoid Perl warnings if browser undefined | |
4 | * really set the defaults for console/X browsers | |
5 | * removed gnome-help-browser from list of X browsers (Closes: #143869, | |
6 | thanks to Thomas Langen <langen@langensoft.de> for reporting it) | |
7 | ||
8 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Sun, 21 Apr 2002 15:57:26 +0200 | |
9 | ||
10 | dhelp (0.5.10) unstable; urgency=high | |
11 | ||
12 | * rewritten copyright file to comply with policy (Closes: #111762) | |
13 | ||
14 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Wed, 3 Apr 2002 13:36:24 +0200 | |
15 | ||
16 | dhelp (0.5.9) unstable; urgency=low | |
17 | ||
18 | * rewrite of the dhelp script: | |
19 | - checks now if a WWW server listening on the localhost (Closes: #36880) | |
20 | - browser is now configurable by debconf and configuration files | |
21 | (Closes: #80218) | |
22 | - provides a --help option now (thanks to Chris Tillman | |
23 | <tillman@azstarnet.com>, Closes: #126583) | |
24 | * use .png images instead of .gif ones (Closes: #116676) | |
25 | * more comprehensive description about accessing the online | |
26 | help system in debian/control (Closes: #106957) | |
27 | * directories database, help, misc and otherosfs added to debian/dhelp | |
28 | (Closes: #119709) | |
29 | ||
30 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Tue, 19 Mar 2002 16:43:39 +0100 | |
31 | ||
32 | dhelp (0.5.8) unstable; urgency=low | |
33 | ||
34 | * dsearch displays appropriate message now in case of missing search | |
35 | results (Closes: #67741, #123286) | |
36 | * made dhelp script working with search tokens again | |
37 | * removed obsolete dhelp_fsstnd | |
38 | ||
39 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Tue, 11 Dec 2001 15:44:16 +0100 | |
40 | ||
41 | dhelp (0.5.7) unstable; urgency=low | |
42 | ||
43 | * more titles added (Closes: #121279) | |
44 | * remove /usr/doc/HTML2 on postinst (again Closes: #84206) | |
45 | ||
46 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Fri, 7 Dec 2001 15:36:27 +0100 | |
47 | ||
48 | dhelp (0.5.6) unstable; urgency=low | |
49 | ||
50 | * use Debian logo from http://www.debian.org (Closes: #46338) | |
51 | * removed outdated README.debian (Closes: #119705) | |
52 | * run dh_compress (Closes: #119759) | |
53 | * remove /usr/doc/HTML2 on purge (Closes: #84206) | |
54 | ||
55 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Sat, 24 Nov 2001 16:52:32 +0100 | |
56 | ||
57 | dhelp (0.5.5) unstable; urgency=low | |
58 | ||
59 | * dsearch checks now if a search token is supplied (Closes: #34807) | |
60 | * added missing entries to dhelp's .dhelp (Closes: #117362) | |
61 | * added a warning if the title is missing | |
62 | * typo and email address fixed in dhelp.html | |
63 | ||
64 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Sun, 28 Oct 2001 11:19:45 +0100 | |
65 | ||
66 | dhelp (0.5.4) unstable; urgency=low | |
67 | ||
68 | * images were installed in a subdirectory of /usr/share/doc/dhelp, | |
69 | so they couldn't displayed in a browser accessing the dhelp pages | |
70 | ||
71 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Sun, 28 Oct 2001 11:05:39 +0100 | |
72 | ||
73 | dhelp (0.5.3) unstable; urgency=low | |
74 | ||
75 | * fixed a number of a places to stop dhelp_parse immediately if an error | |
76 | occurs | |
77 | * stop if string after <directory> in .dhelp starts with a slash | |
78 | (Closes: #21361) | |
79 | ||
80 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Sat, 27 Oct 2001 19:42:39 +0200 | |
81 | ||
82 | dhelp (0.5.2) unstable; urgency=low | |
83 | ||
84 | * call dh_installdirs to ensure that /var/lib/dhelp exists (Closes: #116490) | |
85 | * call make install instead of installing manually | |
86 | ||
87 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Sun, 21 Oct 2001 13:34:13 +0200 | |
88 | ||
89 | dhelp (0.5.1) unstable; urgency=low | |
90 | ||
91 | * chown of /var/lib/dhelp removed from postinst too (Closes: #60964) | |
92 | * removed old Debian Online Help from menu file | |
93 | * use Swish++ as search engine now (Closes: #57932, #63693, #92906, #111547) | |
94 | * moved build operations to build target (Closes: #115455) | |
95 | * CREDITS file added | |
96 | * use dh_clean instead of removing files manually | |
97 | * postinst rewritten, we no longer care about /usr/doc (Closes: #114922) | |
98 | ||
99 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Sat, 20 Oct 2001 13:12:00 +0200 | |
100 | ||
101 | dhelp (0.5.0) unstable; urgency=low | |
102 | ||
103 | * automake support added | |
104 | * removed dhelp_parse_fsstnd (Closes: #89073) | |
105 | * no longer give away /var/lib/dhelp to www-data (Closes: #60964) | |
106 | ||
107 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Thu, 4 Oct 2001 14:52:08 +0200 | |
108 | ||
109 | dhelp (0.3.24) unstable; urgency=low | |
110 | ||
111 | * Force usage of libdb3. (Closes: #112659) | |
112 | ||
113 | -- Stefan Hornburg (Racke) <racke@linuxia.de> Mon, 24 Sep 2001 13:08:33 +0200 | |
114 | ||
115 | dhelp (0.3.23.2) unstable frozen; urgency=low | |
116 | ||
117 | * NMU | |
118 | * include source this time. Closes: #104805. | |
119 | ||
120 | -- LaMont Jones <lamont@debian.org> Wed, 15 Aug 2001 23:45:58 -0600 | |
121 | ||
0 | 122 | dhelp (0.3.23) unstable frozen; urgency=low |
1 | 123 | |
2 | 124 | * dsearch: security fix for glimpse's temp files (#60853) |
270 | 392 | |
271 | 393 | -- Marco Budde <Budde@tu-harburg.d400.de> Wed, 25 Jun 1997 13:04:34 +0200 |
272 | 394 | |
273 | Local variables: | |
274 | mode: debian-changelog | |
275 | End: | |
395 |
0 | #! /usr/bin/perl | |
1 | # | |
2 | # Copyright 2002 by Stefan Hornburg (Racke) <racke@linuxia.de> | |
3 | # | |
4 | # This program is free software; you can redistribute it and/or modify | |
5 | # it under the terms of the GNU General Public License as published by | |
6 | # the Free Software Foundation; either version 2 of the License, or | |
7 | # (at your option) any later version. | |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public | |
15 | # License along with this program; if not, write to the Free | |
16 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
17 | # MA 02111-1307 USA. | |
18 | ||
19 | use strict; | |
20 | use warnings; | |
21 | ||
22 | # Source debconf library | |
23 | use Debconf::Client::ConfModule qw(:all); | |
24 | my ($status, $value); | |
25 | ||
26 | my @cbrowsers = grep {&available($_)} ('links', 'lynx', 'w3m'); | |
27 | my @xbrowsers = grep {&available($_)} ('galeon', 'konqueror', 'mozilla', 'netscape', 'opera'); | |
28 | ||
29 | # Set selection list and defaults for both display types | |
30 | subst('dhelp/www-browser-console', 'CBROWSERS', join(', ', @cbrowsers)); | |
31 | ($status, $value) = get('dhelp/www-browser-console'); | |
32 | if ($status) { | |
33 | die "Couldn't get debconf value for dhelp/www-browser-console\n"; | |
34 | } | |
35 | unless ($value) { | |
36 | set('dhelp/www-browser-console', 'lynx'); | |
37 | } | |
38 | ||
39 | subst('dhelp/www-browser-x', 'XBROWSERS', join(', ', @xbrowsers)); | |
40 | ($status, $value) = get('dhelp/www-browser-x'); | |
41 | if ($status) { | |
42 | die "Couldn't get debconf value for dhelp/www-browser-x\n"; | |
43 | } | |
44 | unless ($value) { | |
45 | set('dhelp/www-browser-x', 'mozilla'); | |
46 | } | |
47 | ||
48 | # Get console browser | |
49 | input('medium', 'dhelp/www-browser-console'); | |
50 | go(); | |
51 | ||
52 | input('medium', 'dhelp/www-browser-x'); | |
53 | go(); | |
54 | ||
55 | # Check for executable | |
56 | sub available { | |
57 | my $program = shift; | |
58 | ||
59 | for my $path ('/usr/bin','/usr/bin/X11') { | |
60 | return 1 if -X "$path/$program"; | |
61 | } | |
62 | } |
0 | 0 | Source: dhelp |
1 | 1 | Section: doc |
2 | 2 | Priority: optional |
3 | Maintainer: Marco Budde <budde@debian.org> | |
3 | Maintainer: Stefan Hornburg (Racke) <racke@linuxia.de> | |
4 | 4 | Standards-Version: 3.1.0.0 |
5 | Build-Depends: libdb3-dev, debhelper | |
5 | 6 | |
6 | 7 | Package: dhelp |
7 | Depends: ${shlibs:Depends} | |
8 | Depends: ${shlibs:Depends}, debconf, perl-modules | |
8 | 9 | Recommends: www-browser |
9 | Suggests: httpd, glimpse (>= 4.0-1), info2www, man2html | |
10 | Suggests: httpd, swish++, info2www, man2html | |
10 | 11 | Architecture: any |
11 | 12 | Description: online help system |
12 | 13 | Read all documentation with a WWW browser. dhelp builds a |
14 | 15 | a WWW server to read the documentation. dhelp offers a |
15 | 16 | very fast search in the HTML documents. |
16 | 17 | . |
17 | http://localhost/doc/HTML/index.html | |
18 | You can access the online help system with the dhelp | |
19 | program or with your browser. The URL to point your | |
20 | browser at is http://localhost/doc/HTML/index.html | |
21 | if you have a WWW server installed or | |
22 | file://localhost/usr/share/doc/HTML/index.html if not. |
0 | Copyright (c) 1997 by Marco Budde (Budde@tu-harburg.de) | |
0 | Maintainer: | |
1 | 1 | |
2 | dhelp is free software. You may copy it according to the | |
3 | GNU General Public License, version 2. A copy of the license | |
4 | is not included, but you can get one from most FTP sites that | |
5 | have GNU software, for example, prep.ai.mit.edu. | |
2 | 1997-2000 Marco Budde <Budde@tu-harburg.de> | |
3 | 2001-2002 Stefan Hornburg (Racke) <racke@linuxia.de> | |
6 | 4 | |
7 | The pictures are taken from apache's icon directory. | |
5 | Copyright: | |
8 | 6 | |
7 | This program is free software; you may redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 2, or (at your option) | |
10 | any later version. | |
11 | ||
12 | This is distributed in the hope that it will be useful, but without | |
13 | any warranty; without even the implied warranty of merchantability or | |
14 | fitness for a particular purpose. See the GNU General Public License | |
15 | for more details. | |
16 | ||
17 | A copy of the GNU General Public License is available as | |
18 | /usr/share/common-licenses/GPL in the Debian GNU/Linux distribution or on the | |
19 | World Wide Web at http://www.gnu.org/copyleft/gpl.html. You can also | |
20 | obtain it by writing to the Free Software Foundation, Inc., 59 Temple | |
21 | Place - Suite 330, Boston, MA 02111-1307, USA. | |
22 |
0 | #!/bin/sh | |
0 | #! /bin/sh | |
1 | # | |
2 | # Copyright 2001 by Stefan Hornburg (Racke) <racke@linuxia.de> | |
3 | # | |
4 | # This program is free software; you can redistribute it and/or modify | |
5 | # it under the terms of the GNU General Public License as published by | |
6 | # the Free Software Foundation; either version 2 of the License, or | |
7 | # (at your option) any later version. | |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public | |
15 | # License along with this program; if not, write to the Free | |
16 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
17 | # MA 02111-1307 USA. | |
1 | 18 | |
2 | # build glimpse full text search index | |
3 | ||
4 | if [ -f /usr/bin/glimpseindex ]; then | |
5 | if [ ! -d /var/lib/dhelp ]; then | |
6 | mkdir -p /var/lib/dhelp | |
7 | chown www-data.www-data /var/lib/dhelp | |
8 | fi | |
9 | ||
10 | echo "*html.gz gzip -d -c" > /var/lib/dhelp/.glimpse_filters | |
11 | ||
12 | cd / | |
13 | su www-data -c \ | |
14 | "find /usr/doc/ -name '*.html*' 2> /dev/null > /var/lib/dhelp/.glimpse_dhelp; \ | |
15 | find /usr/share/doc/ -name '*.html*' 2> /dev/null >> /var/lib/dhelp/.glimpse_dhelp; \ | |
16 | cat /var/lib/dhelp/.glimpse_dhelp | \ | |
17 | glimpseindex -F -X -H /var/lib/dhelp" > /dev/null | |
18 | ||
19 | rm -f /var/lib/dhelp/.glimpse_dhelp | |
20 | ||
21 | chmod 644 /var/lib/dhelp/.glimpse* | |
19 | if [ -d /var/lib/dhelp -a -d /usr/share/doc/HTML -a -x /usr/bin/index++ ]; then | |
20 | cd /var/lib/dhelp | |
21 | # Swish++ generates an index in the current directory | |
22 | /usr/bin/index++ --pattern 'html:*.html' /usr/share/doc/HTML | |
22 | 23 | fi |
23 |
0 | <item> | |
1 | <directory> | |
2 | <dirtitle>Debian Online Help | |
3 | </item> | |
4 | ||
0 | 5 | <item> |
1 | 6 | <directory>debian |
2 | 7 | <linkname>dhelp |
17 | 22 | </item> |
18 | 23 | |
19 | 24 | <item> |
25 | <directory>database | |
26 | <dirtitle>Databases | |
27 | </item> | |
28 | ||
29 | <item> | |
20 | 30 | <directory>devel |
21 | 31 | <dirtitle>Development |
22 | 32 | </item> |
23 | 33 | |
24 | 34 | <item> |
35 | <directory>docs | |
36 | <dirtitle>Documents | |
37 | </item> | |
38 | ||
39 | <item> | |
25 | 40 | <directory>editors |
26 | 41 | <dirtitle>Editors |
27 | 42 | </item> |
32 | 47 | </item> |
33 | 48 | |
34 | 49 | <item> |
50 | <directory>faq | |
51 | <dirtitle>FAQ | |
52 | </item> | |
53 | ||
54 | <item> | |
35 | 55 | <directory>games |
36 | 56 | <dirtitle>Games |
37 | 57 | </item> |
38 | 58 | |
39 | 59 | <item> |
40 | <directory>graphics | |
60 | <directory>gnome | |
61 | <dirtitle>Gnome | |
62 | </item> | |
63 | ||
64 | <item> | |
65 | <directory>graphics | |
41 | 66 | <dirtitle>Graphics |
42 | 67 | </item> |
43 | 68 | |
47 | 72 | </item> |
48 | 73 | |
49 | 74 | <item> |
75 | <directory>help | |
76 | <dirtitle>Help | |
77 | </item> | |
78 | ||
79 | <item> | |
50 | 80 | <directory>interpreters |
51 | 81 | <dirtitle>Interpreters |
52 | 82 | </item> |
62 | 92 | </item> |
63 | 93 | |
64 | 94 | <item> |
95 | <directory>misc | |
96 | <dirtitle>Miscellaneous | |
97 | </item> | |
98 | ||
99 | <item> | |
65 | 100 | <directory>net |
66 | 101 | <dirtitle>Networking |
67 | 102 | </item> |
68 | 103 | |
69 | 104 | <item> |
105 | <directory>otherosfs | |
106 | <dirtitle>Other Operating and File Systems | |
107 | </item> | |
108 | ||
109 | <item> | |
110 | <directory>programming | |
111 | <dirtitle>Programming | |
112 | </item> | |
113 | ||
114 | <item> | |
70 | 115 | <directory>news |
71 | 116 | <dirtitle>News |
72 | 117 | </item> |
82 | 127 | </item> |
83 | 128 | |
84 | 129 | <item> |
130 | <directory>system | |
131 | <dirtitle>System | |
132 | </item> | |
133 | ||
134 | <item> | |
135 | <directory>technical | |
136 | <dirtitle>Technical | |
137 | </item> | |
138 | ||
139 | <item> | |
85 | 140 | <directory>tex |
86 | 141 | <dirtitle>TeX |
87 | 142 | </item> |
92 | 147 | </item> |
93 | 148 | |
94 | 149 | <item> |
150 | <directory>tools | |
151 | <dirtitle>Tools | |
152 | </item> | |
153 | ||
154 | <item> | |
155 | <directory>unknown | |
156 | <dirtitle>Unknown | |
157 | </item> | |
158 | ||
159 | <item> | |
95 | 160 | <directory>utils |
96 | 161 | <dirtitle>Utilities |
97 | 162 | </item> |
98 | 163 | |
99 | 164 | <item> |
165 | <directory>viewers | |
166 | <dirtitle>Viewers | |
167 | </item> | |
168 | ||
169 | <item> | |
100 | 170 | <directory>web |
101 | 171 | <dirtitle>WWW |
102 | 172 | </item> |
107 | 177 | </item> |
108 | 178 | |
109 | 179 | <item> |
180 | <directory>xshells | |
181 | <dirtitle>Xshells | |
182 | </item> | |
183 | ||
184 | <item> | |
110 | 185 | <directory>HOWTO |
111 | 186 | <dirtitle>HOWTO |
112 | 187 | </item> |
2 | 2 | |
3 | 3 | ?package(dhelp):needs="text" section="Help" \ |
4 | 4 | title="Debian Online Help" command=/usr/bin/dhelp |
5 | ||
6 | ?package(dhelp):needs="X11" section="Help" \ | |
7 | title="Debian Online Help (old)" command=/usr/bin/dhelp_fsstnd | |
8 | ||
9 | ?package(dhelp):needs="text" section="Help" \ | |
10 | title="Debian Online Help (old)" command=/usr/bin/dhelp_fsstnd | |
11 | ||
12 |
0 | 0 | #!/bin/sh -e |
1 | # | |
2 | # Copyright 2001,2002 by Stefan Hornburg (Racke) <racke@linuxia.de> | |
3 | # | |
4 | # This program is free software; you can redistribute it and/or modify | |
5 | # it under the terms of the GNU General Public License as published by | |
6 | # the Free Software Foundation; either version 2 of the License, or | |
7 | # (at your option) any later version. | |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public | |
15 | # License along with this program; if not, write to the Free | |
16 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
17 | # MA 02111-1307 USA. | |
1 | 18 | |
2 | # policy 3.1.0.0: fsstnd -> fhs | |
19 | # source debconf library | |
20 | . /usr/share/debconf/confmodule | |
3 | 21 | |
4 | if [ "$1" = "configure" ]; then | |
5 | if [ -d /usr/doc -a ! -e /usr/doc/dhelp \ | |
6 | -a -d /usr/share/doc/dhelp ]; then | |
7 | ln -sf ../share/doc/dhelp /usr/doc/dhelp | |
8 | fi | |
9 | ||
10 | if [ -d /usr/doc -a ! -e /usr/doc/HTML ]; then | |
11 | ln -sf ../share/doc/HTML /usr/doc/HTML | |
12 | fi | |
22 | # create configuration directory if necessary | |
23 | if [ ! -d /etc/dhelp ]; then | |
24 | mkdir /etc/dhelp | |
13 | 25 | fi |
14 | 26 | |
15 | if [ -x /usr/sbin/dhelp_parse ]; then | |
16 | echo -n "Building HTML tree ..." | |
17 | /usr/sbin/dhelp_parse -r | |
18 | /usr/sbin/dhelp_parse_fsstnd -r | |
19 | echo " done" | |
27 | # store debconf configuration values in files there | |
28 | db_get dhelp/www-browser-console | |
29 | echo $RET > /etc/dhelp/www-browser-console | |
30 | db_get dhelp/www-browser-x | |
31 | echo $RET > /etc/dhelp/www-browser-x | |
32 | ||
33 | # remove /usr/doc/HTML2 if upgrading from old dhelp package | |
34 | if [ "$1" = configure -a -d /usr/doc/HTML2 ]; then | |
35 | rm -rf /usr/doc/HTML2 | |
20 | 36 | fi |
21 | 37 | |
22 | if [ -x /etc/cron.weekly/dhelp -a -x /usr/bin/glimpseindex ]; then | |
23 | echo "Starting glimpseindex ..." | |
38 | echo -n "Building HTML tree ..." | |
39 | /usr/sbin/dhelp_parse -r | |
40 | echo " done" | |
41 | ||
42 | if [ ! -f /var/lib/dhelp/swish++.index ]; then | |
24 | 43 | /etc/cron.weekly/dhelp 2>/dev/null >/dev/null & |
25 | 44 | fi |
26 | 45 | |
27 | 46 | #DEBHELPER# |
28 | ||
29 | echo "Run dhelp to read documentation or browse " | |
30 | echo "http://localhost/doc/HTML/index.html." | |
31 |
0 | #!/bin/sh -e | |
1 | # | |
2 | # Copyright 2002 by Stefan Hornburg (Racke) <racke@linuxia.de> | |
3 | # | |
4 | # This program is free software; you can redistribute it and/or modify | |
5 | # it under the terms of the GNU General Public License as published by | |
6 | # the Free Software Foundation; either version 2 of the License, or | |
7 | # (at your option) any later version. | |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public | |
15 | # License along with this program; if not, write to the Free | |
16 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
17 | # MA 02111-1307 USA. | |
18 | ||
19 | if [ "$1" = purge ]; then | |
20 | # remove files generated by postinst | |
21 | rm -rf /etc/dhelp | |
22 | fi | |
23 | ||
24 | #DEBHELPER# |
1 | 1 | # |
2 | 2 | # Invoke each target with `./debian/rules <target>'. All targets should be |
3 | 3 | # invoked with the package root as the current directory. |
4 | ||
5 | VERSION:=$(shell dpkg-parsechangelog | perl -ne 'print $$1 $$2 if /^Version: (.*?)-(.*)$$/') | |
4 | 6 | |
5 | 7 | # The name of the package |
6 | 8 | P = dhelp |
7 | 9 | |
8 | 10 | R = debian/tmp |
9 | 11 | |
10 | DIRECTORIES = \ | |
11 | $(R) \ | |
12 | $(R)/DEBIAN \ | |
13 | $(R)/usr \ | |
14 | $(R)/usr/bin \ | |
15 | $(R)/usr/share/doc/$(P) \ | |
16 | $(R)/usr/lib/cgi-bin \ | |
17 | $(R)/usr/share/man/man1 \ | |
18 | $(R)/usr/share/man/man8 \ | |
19 | $(R)/usr/share/man/de/man1 \ | |
20 | $(R)/usr/sbin \ | |
21 | $(R)/var/lib/dhelp | |
22 | ||
23 | $(DIRECTORIES): | |
24 | install -d -g root -o root -m 755 $@ | |
25 | chmod g-s $@ | |
26 | ||
27 | 12 | # Builds the binary package. |
28 | 13 | build: |
29 | 14 | $(checkdir) |
30 | touch build | |
31 | ||
32 | # Clean $(DIRECTORIES) | |
33 | clean-dir: | |
34 | $(checkdir) | |
35 | rm -rf $(R) | |
15 | ./configure --prefix=/usr | |
16 | make | |
36 | 17 | |
37 | 18 | # Undoes the effect of `make -f rules build'. |
38 | clean: clean-dir | |
19 | clean: | |
39 | 20 | $(checkdir) |
40 | 21 | [ ! -f Makefile ] || make clean |
41 | rm -f debian/files* debian/substvars core debian/*~ *~ doc/*~ build | |
42 | make -C fsstnd clean | |
43 | rm -f debian/post*.debhelper debian/pre*.debhelper | |
22 | dh_clean | |
44 | 23 | |
45 | 24 | # Makes a binary package. |
46 | binary-indep: $(DIRECTORIES) checkroot build | |
25 | binary-indep: checkroot build | |
47 | 26 | $(checkdir) |
48 | 27 | |
28 | binary-arch: checkroot build | |
29 | $(checkdir) | |
30 | dh_installdirs | |
31 | $(MAKE) DESTDIR=$(R) install | |
32 | # put version into dhelp script | |
33 | perl -i -pe "s/__VERSION__/$(shell dpkg-parsechangelog | perl -ne 'print $$1 if /^Version: (.*)$$/')/" $(R)/usr/bin/dhelp | |
34 | mkdir -p $(R)/usr/share/doc/$(P) | |
35 | cp doc/* $(R)/usr/share/doc/$(P) | |
36 | cp debian/dhelp $(R)/usr/share/doc/$(P)/.dhelp | |
37 | mkdir -p $(R)/usr/lib/cgi-bin | |
38 | cp dsearch $(R)/usr/lib/cgi-bin | |
49 | 39 | |
50 | binary-arch: $(DIRECTORIES) checkroot build | |
51 | $(checkdir) | |
52 | ||
53 | make | |
54 | cp dhelp_parse $(R)/usr/sbin | |
55 | cp dhelp dhelp_fsstnd dh_dhelp $(R)/usr/bin | |
56 | cp doc/* debian/THANKS $(R)/usr/share/doc/$(P) | |
57 | cp debian/dhelp $(R)/usr/share/doc/$(P)/.dhelp | |
58 | cp debian/{changelog,README.debian,copyright} $(R)/usr/share/doc/$(P) | |
59 | gzip -9 $(R)/usr/share/doc/$(P)/{changelog,README.debian,copyright} | |
60 | cp dsearch $(R)/usr/lib/cgi-bin | |
61 | cp man/{dhelp.1,dh_dhelp.1} $(R)/usr/share/man/man1/ | |
62 | cp man/dhelp_parse.8 $(R)/usr/share/man/man8/ | |
63 | cp man/de/dhelp.1 $(R)/usr/share/man/de/man1/ | |
64 | gzip $(R)/usr/share/man/man1/* $(R)/usr/share/man/man8/* | |
65 | gzip $(R)/usr/share/man/de/man1/* | |
66 | ||
67 | ||
68 | # old fsstnd support | |
69 | make -C fsstnd | |
70 | cp fsstnd/dhelp_parse_fsstnd $(R)/usr/sbin | |
71 | ||
40 | dh_installdebconf | |
72 | 41 | dh_shlibdeps |
73 | 42 | dh_strip |
43 | dh_installman man/dhelp.1 man/dh_dhelp.1 man/dhelp_parse.8 | |
44 | dh_installchangelogs | |
74 | 45 | dh_installcron |
46 | dh_installdocs CREDITS debian/THANKS | |
75 | 47 | dh_installmenu |
48 | ||
49 | dh_compress -X .dhelp | |
76 | 50 | dh_installdeb |
51 | dh_gencontrol | |
77 | 52 | dh_md5sums |
78 | ||
79 | dpkg-gencontrol | |
80 | chown -R root.root debian/tmp | |
81 | chown www-data.www-data $(R)/var/lib/dhelp | |
82 | chmod -R g-ws debian/tmp | |
83 | ||
84 | dpkg --build debian/tmp .. | |
53 | dh_builddeb | |
85 | 54 | |
86 | 55 | define checkdir |
87 | 56 | test -f debian/rules |
98 | 67 | $(checkdir) |
99 | 68 | test root = "`whoami`" |
100 | 69 | |
101 | .PHONY: binary binary-arch binary-indep clean checkroot | |
70 | .PHONY: build binary binary-arch binary-indep clean checkroot | |
102 | 71 | |
103 | 72 |
0 | #!/usr/bin/make -f | |
1 | # Sample debian.rules file - Copyright 1994,1995 by Ian Jackson. | |
2 | # | |
3 | # Invoke each target with `./debian/rules <target>'. All targets should be | |
4 | # invoked with the package root as the current directory. | |
5 | ||
6 | # The name of the package | |
7 | P = dhelp | |
8 | ||
9 | R = debian/tmp | |
10 | ||
11 | DIRECTORIES = \ | |
12 | $(R) \ | |
13 | $(R)/DEBIAN \ | |
14 | $(R)/usr \ | |
15 | $(R)/usr/bin \ | |
16 | $(R)/usr/share/doc/$(P) \ | |
17 | $(R)/usr/lib \ | |
18 | $(R)/usr/lib/cgi-bin \ | |
19 | $(R)/usr/share/man \ | |
20 | $(R)/usr/share/man/man1 \ | |
21 | $(R)/usr/share/man/man8 \ | |
22 | $(R)/usr/share/man/de_DE \ | |
23 | $(R)/usr/share/man/de_DE/man1 \ | |
24 | $(R)/usr/sbin \ | |
25 | $(R)/var \ | |
26 | $(R)/var/lib \ | |
27 | $(R)/var/lib/dhelp | |
28 | ||
29 | $(DIRECTORIES): | |
30 | install -d -g root -o root -m 755 $@ | |
31 | chmod g-s $@ | |
32 | ||
33 | # Builds the binary package. | |
34 | build: | |
35 | $(checkdir) | |
36 | touch build | |
37 | ||
38 | # Clean $(DIRECTORIES) | |
39 | clean-dir: | |
40 | $(checkdir) | |
41 | rm -rf $(R) | |
42 | ||
43 | # Undoes the effect of `make -f rules build'. | |
44 | clean: clean-dir | |
45 | $(checkdir) | |
46 | [ ! -f Makefile ] || make clean | |
47 | rm -f debian/files* debian/substvars core debian/*~ *~ doc/*~ build | |
48 | rm -f debian/*.debhelper | |
49 | ||
50 | # Makes a binary package. | |
51 | binary-indep: $(DIRECTORIES) checkroot build | |
52 | $(checkdir) | |
53 | ||
54 | ||
55 | binary-arch: $(DIRECTORIES) checkroot build | |
56 | $(checkdir) | |
57 | ||
58 | make | |
59 | # dh_installdirs | |
60 | dh_installchangelogs | |
61 | dh_installmenu | |
62 | dh_installcron | |
63 | ||
64 | dh_installdocs doc | |
65 | cp debian/dhelp $(R)/usr/share/doc/$(P)/.dhelp | |
66 | ||
67 | cp man/dhelp.1 $(R)/usr/share/man/man1/ | |
68 | cp man/dhelp_parse.8 $(R)/usr/share/man/man8/ | |
69 | cp man/de/dhelp.1 $(R)/usr/share/man/de_DE/man1/ | |
70 | ||
71 | cp dhelp_parse $(R)/usr/sbin | |
72 | cp dhelp dh_dhelp $(R)/usr/bin | |
73 | cp dsearch $(R)/usr/lib/cgi-bin | |
74 | ||
75 | dh_strip | |
76 | dh_compress -X.jpg | |
77 | dh_fixperms | |
78 | chown www-data.www-data $(R)/var/lib/dhelp | |
79 | ||
80 | dh_shlibdeps | |
81 | dh_gencontrol | |
82 | dh_installdeb | |
83 | dh_md5sums | |
84 | dh_builddeb | |
85 | ||
86 | ||
87 | ||
88 | define checkdir | |
89 | test -f debian/rules | |
90 | endef | |
91 | ||
92 | # Below here is fairly generic really | |
93 | ||
94 | binary: binary-indep binary-arch | |
95 | ||
96 | source diff: | |
97 | @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false | |
98 | ||
99 | checkroot: | |
100 | $(checkdir) | |
101 | test root = "`whoami`" | |
102 | ||
103 | .PHONY: binary binary-arch binary-indep clean checkroot | |
104 | ||
105 |
0 | Template: dhelp/www-browser-console | |
1 | Type: select | |
2 | Choices: ${CBROWSERS} | |
3 | Description: Dhelp console browser | |
4 | Please select the default console browser for dhelp. | |
5 | . | |
6 | Individual users can override this setting in ~/.dhelp/www-browser-console, | |
7 | e.g. with echo w3m > ~/.dhelp/www-browser-console. | |
8 | ||
9 | Template: dhelp/www-browser-x | |
10 | Type: select | |
11 | Choices: ${XBROWSERS} | |
12 | Description: Dhelp X Window System browser | |
13 | Please select the default X Window System browser for dhelp. | |
14 | . | |
15 | Individual users can override this setting in ~/.dhelp/www-browser-x, | |
16 | e.g. with echo galeon > ~/.dhelp/www-browser-x. |
0 | #!/bin/sh | |
1 | ||
2 | # which browser will we use? | |
3 | ||
4 | if [ "$DISPLAY" = "" ]; then | |
5 | if [ -x /usr/bin/lynx ]; then | |
6 | BROWSER=lynx | |
7 | else | |
8 | echo "dhelp: lynx not found" | |
9 | exit | |
10 | fi | |
11 | else | |
12 | BROWSER2=`which $BROWSER` | |
13 | if [ $? -eq 0 ]; then | |
14 | BROWSER=$BROWSER2 | |
15 | elif [ -x /usr/bin/X11/netscape ]; then | |
16 | BROWSER=netscape | |
17 | elif [ -x /usr/bin/X11/gzilla ]; then | |
18 | BROWSER=gzilla | |
19 | elif [ -x /usr/bin/gnome-help-browser ]; then | |
20 | BROWSER=gnome-help-browser | |
21 | elif [ -x /usr/bin/amaya ]; then | |
22 | BROWSER=amaya | |
23 | elif [ -x /usr/bin/X11/arena ]; then | |
24 | BROWSER=arena | |
25 | elif [ -x /usr/bin/mozilla ]; then | |
26 | BROWSER=mozilla | |
27 | ||
28 | else | |
29 | echo "dhelp: no X11 WWW browser found" | |
30 | echo ' Install a browser or use $BROWSER.' | |
31 | exit | |
32 | fi | |
33 | fi | |
34 | ||
35 | ||
36 | # use http? | |
37 | ||
38 | if [ -f /var/run/apache.pid ]; then | |
39 | HTTP="Apache"; | |
40 | DOCUMENT="http://localhost/doc/HTML/index.html"; | |
41 | elif [ -f /var/run/apache-ssl.pid ]; then | |
42 | HTTP="Apache SSL"; | |
43 | DOCUMENT="http://localhost/doc/HTML/index.html"; | |
44 | elif [ -f /var/run/aolserver/aolserver.pid ]; then | |
45 | HTTP="AOLserver"; | |
46 | DOCUMENT="http://localhost/doc/HTML/index.html"; | |
47 | else | |
48 | DOCUMENT="/usr/share/doc/HTML/index.html"; | |
49 | HTTP="FALSE"; | |
50 | fi | |
51 | ||
52 | ||
53 | # start browser or search engine | |
54 | ||
55 | echo -n "Starting ${BROWSER}"; | |
56 | ||
57 | if [ "$HTTP" = "FALSE" ]; then | |
58 | echo " (using local filesystem) ..."; | |
59 | else | |
60 | echo " (using HTTP ${HTTP}) ..."; | |
61 | fi | |
62 | ||
63 | if [ "$1" = "" ]; then | |
64 | if [ -f /usr/share/doc/HTML/index.html ]; then | |
65 | $BROWSER ${DOCUMENT}; | |
66 | else | |
67 | echo "dhelp: please run \"dhelp_parse -r\"" | |
68 | fi | |
69 | else | |
70 | TMPFILE=`tempfile -p dhelp -s .html` | |
71 | /usr/lib/cgi-bin/dsearch $1 | \ | |
72 | sed 's/\/doc/\/usr\/share\/doc/g' > ${TMPFILE} | |
73 | $BROWSER ${TMPFILE} | |
74 | rm -f ${TMPFILE} | |
75 | fi | |
76 | ||
77 | ||
78 | ||
0 | #!/usr/bin/perl -w | |
1 | # | |
2 | # Copyright 2002 by Stefan Hornburg (Racke) <racke@linuxia.de> | |
3 | # | |
4 | # Based on a sample implementation of Chris Tillman | |
5 | # <tillman@azstarnet.com>. | |
6 | # | |
7 | # This program is free software; you can redistribute it and/or modify | |
8 | # it under the terms of the GNU General Public License as published by | |
9 | # the Free Software Foundation; either version 2 of the License, or | |
10 | # (at your option) any later version. | |
11 | # | |
12 | # This program is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | # GNU General Public License for more details. | |
16 | # | |
17 | # You should have received a copy of the GNU General Public | |
18 | # License along with this program; if not, write to the Free | |
19 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
20 | # MA 02111-1307 USA. | |
21 | ||
22 | use strict; | |
23 | use warnings; | |
24 | ||
25 | # module setup | |
26 | use File::Spec; | |
27 | use File::Temp qw(tempfile); | |
28 | use IO::Socket; | |
29 | use Getopt::Long; | |
30 | use Pod::Usage; | |
31 | ||
32 | # version (replaced on packaging time) | |
33 | my $version = '__VERSION__'; | |
34 | ||
35 | # process commandline options | |
36 | my %opts; | |
37 | my $whandler = $SIG{__WARN__}; | |
38 | $SIG{__WARN__} = sub {print STDERR "$0: @_";}; | |
39 | unless (GetOptions(\%opts, | |
40 | 'file|f', | |
41 | 'help|h', | |
42 | 'version')) { | |
43 | die(pod2usage(1)); | |
44 | } | |
45 | ||
46 | if ($opts{help}) { | |
47 | pod2usage(1); | |
48 | exit 0; | |
49 | } elsif ($opts{version}) { | |
50 | print "dhelp version $version\n"; | |
51 | exit 0; | |
52 | } | |
53 | ||
54 | my $searchterm = shift; | |
55 | ||
56 | # home directory of the current user | |
57 | my $homedir; | |
58 | ||
59 | if (exists $ENV{'HOME'} && -d $ENV{'HOME'}) { | |
60 | $homedir = $ENV{'HOME'}; | |
61 | } else { | |
62 | $homedir = (getpwent()) [7]; | |
63 | } | |
64 | ||
65 | # determine browser to use | |
66 | my $browser; | |
67 | ||
68 | if ($ENV{'BROWSER'}) { | |
69 | # use user-supplied value | |
70 | $browser = $ENV{'BROWSER'}; | |
71 | } elsif ($ENV{'DISPLAY'}) { | |
72 | # X Window System in charge | |
73 | $browser = &conf_from_flist("$homedir/.dhelp/www-browser-x", | |
74 | '/etc/dhelp/www-browser-x'); | |
75 | } else { | |
76 | # Fallback to console browser | |
77 | $browser = &conf_from_flist("$homedir/.dhelp/www-browser-console", | |
78 | '/etc/dhelp/www-browser-console'); | |
79 | } | |
80 | ||
81 | unless ($browser) { | |
82 | die "$0: No browser defined.\n"; | |
83 | } | |
84 | ||
85 | unless (&available($browser)) { | |
86 | die "$0: Browser $browser not executable.\n"; | |
87 | } | |
88 | ||
89 | my $httpd_running = ''; | |
90 | ||
91 | unless ($opts{file}) { | |
92 | # check if there is a CGI capable WWW server running on the localhost | |
93 | my $testdoc = "/doc/HTML/index.html"; | |
94 | my $eol = "\015\012"; | |
95 | my $blank = $eol x 2; | |
96 | my $sock = IO::Socket::INET->new('127.0.0.1:80'); | |
97 | ||
98 | if ($sock) { | |
99 | $sock->autoflush(1); | |
100 | print $sock "HEAD $testdoc HTTP/1.0$eol"; | |
101 | print $sock "Host: localhost" . $blank; | |
102 | ||
103 | while (my $line = <$sock>) { | |
104 | if ($line =~ s/^Server: //) { | |
105 | $httpd_running = $line; | |
106 | } | |
107 | } | |
108 | close $sock; | |
109 | ||
110 | if ($httpd_running =~ /dhttpd/) { | |
111 | # this server is not CGI capable | |
112 | $httpd_running = ''; | |
113 | } | |
114 | } | |
115 | } | |
116 | ||
117 | my $document; | |
118 | ||
119 | if ($httpd_running) { | |
120 | # we can query the web server directly | |
121 | if ($searchterm) { | |
122 | $document="http://localhost/cgi-bin/dsearch?search=$searchterm"; | |
123 | } else { | |
124 | $document="http://localhost/doc/HTML/index.html"; | |
125 | } | |
126 | print "Starting $browser (using HTTP $httpd_running) ...\n"; | |
127 | } else { | |
128 | if ($searchterm) { | |
129 | my ($basedir) = File::Spec->tmpdir(); | |
130 | my ($fh, $tmpfile) = tempfile ('dhelp' . 'X' x 6, | |
131 | DIR => $basedir, | |
132 | SUFFIX => '.html', | |
133 | UNLINK => 1); | |
134 | print "Starting dsearch for $searchterm\n"; | |
135 | # call dsearch | |
136 | open (DSEARCH, "/usr/lib/cgi-bin/dsearch file=1 search=$searchterm|"); | |
137 | while (<DSEARCH>) { | |
138 | print $fh $_; | |
139 | } | |
140 | close (DSEARCH) || die "$0: dsearch failed\n"; | |
141 | system ( "$browser $tmpfile" ) and die( "${browser}: Failed to open $tmpfile: $!\n" ); | |
142 | exit 0; | |
143 | } else { | |
144 | $document="/usr/share/doc/HTML/index.html"; | |
145 | print "Starting $browser (using local filesystem) ...\n"; | |
146 | } | |
147 | } | |
148 | ||
149 | system ( "$browser $document" ) and die( "${browser}: Failed to open $document: $!\n" ); | |
150 | ||
151 | # -------------------------------------------- | |
152 | # FUNCTION: available PROGRAM | |
153 | # | |
154 | # Checks if PROGRAM is available for the user. | |
155 | # -------------------------------------------- | |
156 | ||
157 | sub available { | |
158 | my $program = shift; | |
159 | ||
160 | if ($program =~ m%/%) { | |
161 | # no need to search the path | |
162 | return -x $program; | |
163 | } | |
164 | ||
165 | for (split(/:/, $ENV{PATH})) { | |
166 | return 1 if -x "$_/$program"; | |
167 | } | |
168 | } | |
169 | ||
170 | # ------------------------------------------------------ | |
171 | # FUNCTION: conf_from_flist FILE [FILE ...] | |
172 | # | |
173 | # Takes a list of files. Reads the first string which is | |
174 | # not in a commented or empty line from the first | |
175 | # existing file in the list, strips surrounding blanks | |
176 | # and returns the resulting string. | |
177 | # ------------------------------------------------------ | |
178 | ||
179 | sub conf_from_flist { | |
180 | my $ret; | |
181 | ||
182 | for my $file (@_) { | |
183 | next unless -f $file; | |
184 | open (CONF, $file) | |
185 | || die "Couldn't open configuration file $file: $!\n"; | |
186 | while (<CONF>) { | |
187 | next if /^\#/; | |
188 | last if /\S/; | |
189 | chomp; | |
190 | } | |
191 | close (CONF); | |
192 | next unless defined $_; | |
193 | $ret = $_; | |
194 | $ret =~ s/^\s+//; | |
195 | $ret =~ s/\s+$//; | |
196 | return $ret; | |
197 | } | |
198 | } | |
199 | ||
200 | __END__ | |
201 | ||
202 | ||
203 | =head1 NAME | |
204 | ||
205 | dhelp: Accessing Debian Online Help System | |
206 | ||
207 | =head1 SYNOPSIS | |
208 | ||
209 | dhelp [ -h | -v | search-term ] | |
210 | dhelp -f | |
211 | ||
212 | =head1 OPTIONS | |
213 | ||
214 | =over 8 | |
215 | ||
216 | =item B<-f, --file> | |
217 | ||
218 | Direct the browser to use the local file system instead of | |
219 | contacting the local WWW server. | |
220 | ||
221 | =item B<-h, --help> | |
222 | ||
223 | Show a brief help message and exit. | |
224 | ||
225 | =item B<-v, --version> | |
226 | ||
227 | Show the program version number and exit. | |
228 | ||
229 | =back | |
230 | ||
231 | =head1 DESCRIPTION | |
232 | ||
233 | B<dhelp> presents a list of installed html documentation. The | |
234 | list can be browsed directly with Lynx, or if a web server | |
235 | is installed then any web browser can be used. | |
236 | ||
237 | In addition, you can search for terms indexed in the documentation | |
238 | using B<dhelp search-term> . | |
239 | ||
240 | =cut | |
241 | ||
242 |
0 | #!/bin/sh | |
1 | ||
2 | # which browser will we use? | |
3 | ||
4 | if [ "$DISPLAY" = "" ]; then | |
5 | if [ -x /usr/bin/lynx ]; then | |
6 | BROWSER=lynx | |
7 | else | |
8 | echo "dhelp: lynx not found" | |
9 | exit | |
10 | fi | |
11 | else | |
12 | BROWSER2=`which $BROWSER` | |
13 | if [ $? -eq 0 ]; then | |
14 | BROWSER=$BROWSER2 | |
15 | elif [ -x /usr/bin/X11/netscape ]; then | |
16 | BROWSER=netscape | |
17 | elif [ -x /usr/bin/X11/gzilla ]; then | |
18 | BROWSER=gzilla | |
19 | elif [ -x /usr/bin/gnome-help-browser ]; then | |
20 | BROWSER=gnome-help-browser | |
21 | elif [ -x /usr/bin/amaya ]; then | |
22 | BROWSER=amaya | |
23 | elif [ -x /usr/bin/X11/arena ]; then | |
24 | BROWSER=arena | |
25 | else | |
26 | echo "dhelp: no X11 WWW browser found" | |
27 | echo ' Install a browser or use $BROWSER.' | |
28 | exit | |
29 | fi | |
30 | fi | |
31 | ||
32 | ||
33 | # use http? | |
34 | ||
35 | if [ -f /var/run/apache.pid ]; then | |
36 | HTTP="Apache"; | |
37 | DOCUMENT="http://localhost/doc/HTML2/index.html"; | |
38 | elif [ -f /var/run/apache-ssl.pid ]; then | |
39 | HTTP="Apache SSL"; | |
40 | DOCUMENT="http://localhost/doc/HTML2/index.html"; | |
41 | elif [ -f /var/run/aolserver/aolserver.pid ]; then | |
42 | HTTP="AOLserver"; | |
43 | DOCUMENT="http://localhost/doc/HTML/index.html"; | |
44 | else | |
45 | DOCUMENT="/usr/doc/HTML2/index.html"; | |
46 | HTTP="FALSE"; | |
47 | fi | |
48 | ||
49 | ||
50 | # start browser or search engine | |
51 | ||
52 | echo -n "Starting ${BROWSER}"; | |
53 | ||
54 | if [ "$HTTP" = "FALSE" ]; then | |
55 | echo " (using local filesystem) ..."; | |
56 | else | |
57 | echo " (using HTTP ${HTTP}) ..."; | |
58 | fi | |
59 | ||
60 | if [ -f /usr/doc/HTML2/index.html ]; then | |
61 | $BROWSER ${DOCUMENT}; | |
62 | else | |
63 | echo "dhelp: please run \"dhelp_parse_fsstnd -r\"" | |
64 | fi | |
65 | ||
66 | ||
67 | ||
68 |
1 | 1 | *** dhelp *** |
2 | 2 | *** Debian online help system *** |
3 | 3 | ******************************************************************** |
4 | *** Copyright (c) 2001-02 by Stefan Hornburg (Racke) <racke@linuxia.de> | |
4 | 5 | *** Copyright (c) 1997-99 by Marco Budde (Budde@tu-harburg.de) *** |
5 | 6 | *** GNU GPL license *** |
6 | 7 | ******************************************************************** */ |
17 | 18 | #include <sys/param.h> |
18 | 19 | |
19 | 20 | #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 |
20 | #include <db1/db.h> | |
21 | #include <db_185.h> | |
21 | 22 | #else |
22 | 23 | #include <db.h> |
23 | 24 | #endif |
324 | 325 | clearerr (out); |
325 | 326 | |
326 | 327 | path_index_cwd (cwd); |
327 | db_title_read (tdb, cwd, zw2, sizeof (zw)); | |
328 | db_title_read (tdb, cwd, zw2, sizeof (zw)); | |
329 | if (strlen(zw2) == 0) | |
330 | { | |
331 | fprintf (stderr, "dhelp_parse: no title found for directory %s\n", | |
332 | cwd); | |
333 | } | |
328 | 334 | fprintf (out, "<HTML>\n\n<HEAD>\n<TITLE>%s</TITLE>\n" |
329 | "<LINK REV=made HREF=\"mailto:Budde@tu-harburg.de\">\n" | |
335 | "<LINK REV=made HREF=\"mailto:dhelp@packages.debian.org\">\n" | |
330 | 336 | "</HEAD>\n\n", zw2); |
331 | 337 | fprintf (out, "<BODY BGCOLOR=#FFFFFF>\n"); |
332 | 338 | |
333 | 339 | path_relative (zw); |
334 | strcat (zw, "dhelp/debian.jpg"); | |
335 | fprintf (out, "<IMG SRC=\"%s\" ALT=\"Debian GNU/Linux\"> \n", zw); | |
340 | fprintf (out, "<IMG SRC=\"%s%s\"> \n", zw, "dhelp/swirl.jpg"); | |
341 | fprintf (out, "<IMG SRC=\"%s%s\" ALT=\"Debian GNU/Linux\"> \n", zw, "dhelp/debian.jpg"); | |
336 | 342 | fprintf (out, "<H1>%s</H1>\n<P>\n", zw2); |
337 | 343 | fprintf (out, "<DL>\n"); |
338 | 344 | |
374 | 380 | "</FORM><BR>\n" |
375 | 381 | "[ <A HREF=\"/cgi-bin/info2www\">%s</A> | \n" |
376 | 382 | "<A HREF=\"/cgi-bin/man2html\">%s</A> | \n" |
377 | "<A HREF=\"/doc/\">%s</A> ]\n</CENTER>\n", | |
383 | "<A HREF=\"../\">%s</A> ]\n</CENTER>\n", | |
378 | 384 | search[i], info[i], man[i], other[i]); |
379 | 385 | fprintf (out, "</BODY></HTML>\n"); |
380 | 386 | |
389 | 395 | clearerr (out); |
390 | 396 | |
391 | 397 | path_relative (zw); |
392 | fprintf (out, "<DT><IMG SRC=\"%sdhelp/text.gif\">" | |
398 | fprintf (out, "<DT><IMG SRC=\"%sdhelp/text.png\">" | |
393 | 399 | " <A HREF=\"%s%s\"><FONT FACE=\"Helvetica, Arial\">" |
394 | 400 | "<B>%s</B></FONT></A><P></DT>\n" |
395 | 401 | " <DD>%s</DD>\n\n", |
459 | 465 | if ((out = fopen (zw, "w")) == NULL) |
460 | 466 | { |
461 | 467 | fprintf (stderr, "dhelp_parse: can't open %s\n", zw); |
462 | return (1); | |
468 | exit (1); | |
463 | 469 | } |
464 | 470 | html_w_head (out, tdb); |
465 | 471 | } |
469 | 475 | if ((out = fopen (zw, "a")) == NULL) |
470 | 476 | { |
471 | 477 | fprintf (stderr, "dhelp_parse: can't open %s\n", zw); |
472 | return (1); | |
478 | exit (1); | |
473 | 479 | } |
474 | 480 | } |
475 | 481 | dir = opendir (dirname); |
486 | 492 | if (S_ISDIR (buf.st_mode)) |
487 | 493 | { |
488 | 494 | path_relative (relpath); |
489 | fprintf (out, "<DT><IMG SRC=\"%sdhelp/folder.gif\">" | |
495 | fprintf (out, "<DT><IMG SRC=\"%sdhelp/folder.png\" ALT=\"\">" | |
490 | 496 | " <A HREF=\"%s/index.html\">" |
491 | 497 | "<FONT FACE=\"Helvetica, Arial\"><B>%s/</B></FONT>" |
492 | 498 | "</A></DT>\n" |
518 | 524 | |
519 | 525 | if ((db = db_open (O_RDONLY)) == NULL) |
520 | 526 | { |
521 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", DBNAME); | |
522 | exit (0); | |
527 | fprintf (stderr, "dhelp_parse: can't open %s\n", DBNAME); | |
528 | exit (1); | |
523 | 529 | } |
524 | 530 | if ((tdb = db_title_open (O_RDWR|O_CREAT)) == NULL) |
525 | 531 | { |
526 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", DBTITLE_NAME); | |
527 | exit (0); | |
532 | fprintf (stderr, "dhelp_parse: can't open %s\n", DBTITLE_NAME); | |
533 | exit (1); | |
528 | 534 | } |
529 | 535 | |
530 | 536 | rm_r (INDEXROOT); |
563 | 569 | |
564 | 570 | |
565 | 571 | |
566 | int get_item (FILE *fd, char *filename, tItem *item) | |
572 | int get_item (char *dhelpfilename, FILE *fd, char *filename, tItem *item) | |
567 | 573 | { |
568 | 574 | char zw[200]; |
569 | 575 | int cnt = 0; |
586 | 592 | if (strncmp ("<directory>", zw, 11) == 0) |
587 | 593 | { |
588 | 594 | strncpy (item->dir, zw+11, sizeof (item->dir)); |
595 | if (item->dir[0] == '/') | |
596 | { | |
597 | printf ("dhelp_parse: %s.dhelp: directory entry starts with /\n", dhelpfilename); | |
598 | exit (1); | |
599 | } | |
589 | 600 | item->dir[sizeof(item->dir)-1] = '\0'; |
590 | 601 | strdel (item->dir); |
591 | 602 | } |
640 | 651 | |
641 | 652 | if ((in = fopen (name, "r")) == NULL) |
642 | 653 | { |
643 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", name); | |
644 | return (1); | |
654 | fprintf (stderr, "dhelp_parse: can't open %s\n", name); | |
655 | exit (1); | |
645 | 656 | } |
646 | 657 | if ((db = db_open (O_RDWR|O_CREAT)) == NULL) |
647 | 658 | { |
648 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", DBNAME); | |
649 | return (1); | |
659 | fprintf (stderr, "dhelp_parse: can't open %s\n", DBNAME); | |
660 | exit (1); | |
650 | 661 | } |
651 | 662 | if ((db_title = db_title_open (O_RDWR|O_CREAT)) == NULL) |
652 | 663 | { |
653 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", DBTITLE_NAME); | |
654 | return (1); | |
664 | fprintf (stderr, "dhelp_parse: can't open %s\n", DBTITLE_NAME); | |
665 | exit (1); | |
655 | 666 | } |
656 | 667 | |
657 | 668 | /* relativen Pfad zum Dokument erzeugen */ |
662 | 673 | file_ptr++; |
663 | 674 | file_ptr [strlen(file_ptr)-6] = '\0'; |
664 | 675 | |
665 | while (!(get_item (in, file_ptr, &item))) | |
676 | while (!(get_item (name, in, file_ptr, &item))) | |
666 | 677 | { |
667 | 678 | if (item.file[0] != '\0') |
668 | 679 | db_write (db, &item); |
689 | 700 | |
690 | 701 | if ((in = fopen (name, "r")) == NULL) |
691 | 702 | { |
692 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", name); | |
693 | return (1); | |
703 | fprintf (stderr, "dhelp_parse: can't open %s\n", name); | |
704 | exit (1); | |
694 | 705 | } |
695 | 706 | if ((db = db_open (O_RDWR|O_CREAT)) == NULL) |
696 | 707 | { |
697 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", DBNAME); | |
698 | return (1); | |
708 | fprintf (stderr, "dhelp_parse: can't open %s\n", DBNAME); | |
709 | exit (1); | |
699 | 710 | } |
700 | 711 | |
701 | 712 | /* relativen Pfad zum Dokument erzeugen */ |
706 | 717 | file_ptr++; |
707 | 718 | file_ptr [strlen(file_ptr)-6] = '\0'; |
708 | 719 | |
709 | while (!(get_item (in, file_ptr, &item))) | |
720 | while (!(get_item (name, in, file_ptr, &item))) | |
710 | 721 | db_del (db, &item); |
711 | 722 | |
712 | 723 | fclose (in); |
Binary diff not shown
62 | 62 | not work:<P> |
63 | 63 | |
64 | 64 | <PRE> |
65 | <item><directoy>de/foo | |
65 | <item><directory>de/foo | |
66 | 66 | <dirtitle>The foo section |
67 | 67 | <linkname>foo |
68 | 68 | <filename>foo.html |
181 | 181 | HTML documentation to add dhelp support.<P> |
182 | 182 | |
183 | 183 | If you have any comments or problems please feel free to send |
184 | me an email: <A HREF="mailto:mbudde@sms.antar.com"> | |
185 | mbudde@sms.antar.com</A> | |
184 | an email to the dhelp package maintainer: | |
185 | <A HREF="mailto:dhelp@packages.debian.org">dhelp@packages.debian.org</A> | |
186 | 186 | |
187 | 187 | </BODY> |
188 | 188 | </HTML>⏎ |
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 | #!/usr/bin/perl -T | |
1 | ||
2 | # Copyright 1997-2000 by Marco Budde (Budde@tu-harburg.de) | |
3 | # GNU GPL license | |
0 | #! /usr/bin/perl -T | |
1 | # | |
2 | # Copyright 2001 by Stefan Hornburg (Racke) <racke@linuxia.de> | |
3 | # | |
4 | # This program is free software; you can redistribute it and/or modify | |
5 | # it under the terms of the GNU General Public License as published by | |
6 | # the Free Software Foundation; either version 2 of the License, or | |
7 | # (at your option) any later version. | |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public | |
15 | # License along with this program; if not, write to the Free | |
16 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
17 | # MA 02111-1307 USA. | |
4 | 18 | |
5 | 19 | $ENV{'PATH'} = '/bin'; |
6 | 20 | |
21 | use strict; | |
22 | use CGI qw/:standard/; | |
7 | 23 | |
8 | #################################### | |
9 | # some subroutines for cgi parsing # | |
10 | #################################### | |
24 | # Swish++ module | |
25 | use lib qw(/usr/lib/swish++); | |
11 | 26 | |
12 | sub url_decode | |
13 | { | |
14 | my $input = shift; | |
15 | $input =~ s/\+/ /g; | |
16 | $input =~ s/%([0-9A-Fa-f]{2})/pack("C", hex($1))/eg; | |
17 | if ($input =~ /^([-\@\w.öäüÖÄÜß]{3,})$/) # anti hacker test | |
18 | { | |
19 | return $1; | |
20 | } | |
21 | else | |
22 | { | |
23 | &error_message ('error_char'); | |
24 | } | |
27 | eval { | |
28 | require WWW; | |
29 | }; | |
30 | ||
31 | print header() unless param('file'); | |
32 | print start_html(-title=>'Debian Online Help: Search Result', | |
33 | -author=>'dhelp@packages.debian.org', | |
34 | -BGCOLOR=>'white'), "\n"; | |
35 | if (param('file')) { | |
36 | print img({src=>'file:/usr/share/doc/dhelp/debian.jpg',alt=>'Debian GNU/Linux'}), "\n"; | |
37 | } else { | |
38 | print img({src=>'/doc/dhelp/debian.jpg',alt=>'Debian GNU/Linux'}), "\n"; | |
39 | print p(); | |
25 | 40 | } |
26 | 41 | |
27 | ||
28 | sub parse_cgi | |
29 | { | |
30 | my $input = shift; | |
31 | my %FORM; | |
32 | my (@PAIRS, $pair); | |
33 | ||
34 | @PAIRS = split (/&/, $input); | |
35 | foreach $pair (@PAIRS) | |
36 | { | |
37 | ($key, $value) = split (/=/, $pair); | |
38 | $key = &url_decode ($key); | |
39 | $value = &url_decode ($value); | |
40 | if (defined $FORM {$key}) | |
41 | { | |
42 | $FORM {$key} .= "\0" . $value; | |
43 | } | |
44 | else | |
45 | { | |
46 | $FORM {$key} = $value; | |
47 | } | |
48 | } | |
49 | ||
50 | return %FORM; | |
42 | unless (-x '/usr/bin/search++') { | |
43 | print "No search engine installed.<BR>"; | |
44 | print end_html(); | |
45 | exit 0; | |
51 | 46 | } |
52 | 47 | |
53 | ||
54 | ######################## | |
55 | # message catalog # | |
56 | ######################## | |
57 | ||
58 | sub language | |
59 | { | |
60 | %MESG = ( 'headline', 'Search Results: ', | |
61 | 'title', 'Title', | |
62 | 'hits', 'Hits', | |
63 | 'error', 'Error', | |
64 | 'error_glimpse', 'Please install the glimpse package on this server!', | |
65 | 'error_char', 'Your search string includes illegal characters or is shorter than three characters!' ); | |
66 | ||
67 | if ($ENV {'HTTP_ACCEPT_LANGUAGE'} eq "de") | |
68 | { | |
69 | %MESG = ( 'headline', 'Suchergebnisse: ', | |
70 | 'title', 'Titel', | |
71 | 'hits', 'Treffer', | |
72 | 'error', 'Fehler', | |
73 | 'error_glimpse', | |
74 | 'Bitte installieren sie das glimpse Paket auf diesem Server!', | |
75 | 'error_char', 'Ihre Suchanfrage enthält unzulässige Buchstaben oder enthält weniger als drei Buchstaben!' ); | |
76 | } | |
77 | ||
78 | if ($ENV {'HTTP_ACCEPT_LANGUAGE'} eq "it") | |
79 | { | |
80 | %MESG = ( 'headline', 'Risultati della Ricerca: ', | |
81 | 'title', 'Titolo', | |
82 | 'hits', 'Hits', | |
83 | 'error', 'Errore', | |
84 | 'error_glimpse', | |
85 | 'Prego, installare il pacchetto glimpse su questo server!', | |
86 | 'error_char', | |
87 | 'La propria stringa di ricerca comprende caratteri illegali!' ); | |
88 | } | |
89 | ||
90 | if ($ENV {'HTTP_ACCEPT_LANGUAGE'} eq "es") | |
91 | { | |
92 | %MESG = ( 'headline', 'Resultados de la búsqueda: ', | |
93 | 'title', 'título', | |
94 | 'hits', 'aciertos', | |
95 | 'error', 'error', | |
96 | 'error_glimpse', | |
97 | '¡ Por favor, instale el paquete glimpse en este servidor!', | |
98 | 'error_char', '¡La cadena de búsqueda incluye caracteres ilegales!' ); | |
99 | } | |
100 | ||
101 | if ($ENV {'HTTP_ACCEPT_LANGUAGE'} eq "fr") | |
102 | { | |
103 | %MESG = ( 'headline', 'Résultats de la recherche : ', | |
104 | 'title', 'Titre', | |
105 | 'hits', 'Touches', | |
106 | 'error', 'Erreur', | |
107 | 'error_glimpse', | |
108 | 'Vous devriez (faire) installer le paquet «glimpse» sur ce serveur !', | |
109 | 'error_char', | |
110 | 'Votre chaîne de recherche contient des caractères illégaux !' ); | |
111 | } | |
112 | ||
113 | if ($ENV {'HTTP_ACCEPT_LANGUAGE'} eq "da") | |
114 | { | |
115 | %MESG = ( 'headline', 'Søge Resultater: ', | |
116 | 'title', 'Titel', | |
117 | 'hits', 'Træffere', | |
118 | 'error', 'Fejl', | |
119 | 'error_glimpse', | |
120 | 'Venligst installer glimpse pakken på denne server!', | |
121 | 'error_char', 'Din søge-streng indeholder ulovlige tegn!' ); | |
122 | } | |
123 | ||
48 | unless (-f '/var/lib/dhelp/swish++.index') { | |
49 | print "No search database found.<BR>"; | |
50 | print end_html(); | |
51 | exit 0; | |
124 | 52 | } |
125 | 53 | |
126 | ############################ | |
127 | # output error message # | |
128 | ############################ | |
129 | ||
130 | sub error_message | |
131 | { | |
132 | print <<"END"; | |
133 | <HTML> | |
134 | ||
135 | <HEAD> | |
136 | <TITLE>$MESG{'error'}</TITLE> | |
137 | </HEAD> | |
138 | ||
139 | <BODY BGCOLOR=#FFFFFF> | |
140 | <IMG SRC="/doc/dhelp/debian.jpg" ALT="Debian GNU/Linux"> | |
141 | <H1>$MESG{'error'}</H1> | |
142 | $MESG{$_[0]}<P> | |
143 | <HR> | |
144 | <ADDRESS> | |
145 | <A HREF="mailto:$ENV{'SERVER_ADMIN'}"> | |
146 | $ENV{'SERVER_ADMIN'}</A> | |
147 | </ADDRESS> | |
148 | </BODY> | |
149 | ||
150 | </HTML> | |
151 | END | |
152 | exit; | |
54 | if (param('search') !~ /^[A-Z0-9-_]*$/i) { | |
55 | print "Invalid characters in search.<BR>"; | |
56 | print end_html(); | |
57 | exit 0; | |
153 | 58 | } |
154 | 59 | |
60 | my $search = param('search'); | |
155 | 61 | |
156 | ############################# | |
157 | # is glimpse installed? # | |
158 | ############################# | |
159 | ||
160 | sub glimpse_installed | |
161 | { | |
162 | if (not -X '/usr/bin/glimpse') | |
163 | { | |
164 | &error_message ('error_glimpse'); | |
165 | } | |
62 | if ($search !~ /\S/) { | |
63 | print "Please specify a search token.<BR>"; | |
64 | print end_html(); | |
65 | exit 0; | |
166 | 66 | } |
167 | 67 | |
68 | # Pass parameters to Swish++ search program | |
69 | open (SEARCH, '-|') | |
70 | or exec '/usr/bin/search++', '-i', '/var/lib/dhelp/swish++.index', "$search"; | |
168 | 71 | |
169 | ##################### | |
170 | # sort hits # | |
171 | ##################### | |
72 | ## | |
73 | # Header HTML | |
74 | ## | |
75 | my $chunk = <<END; | |
76 | <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0> | |
77 | END | |
172 | 78 | |
173 | sub sort_vgl | |
174 | { | |
175 | $results{$b}[1] <=> $results{$a}[1]; | |
79 | ## | |
80 | # Read the search results back. | |
81 | ## | |
82 | my $ignored; | |
83 | while ( <SEARCH> ) { | |
84 | if ( /^\# ignored: / ) { | |
85 | ## | |
86 | # Get the ignored words so we can report them to the user. | |
87 | ## | |
88 | $ignored = $'; | |
89 | $ignored = s/\s+$//; | |
90 | next; | |
91 | } | |
92 | if ( /^\# results: (\d+)/ && ! $1) { | |
93 | $chunk = ''; | |
94 | if ($ignored) { | |
95 | print "No results (Ignored: $ignored).<BR>"; | |
96 | } else { | |
97 | print "No results.<BR>"; | |
98 | } | |
99 | last; | |
100 | } | |
101 | print $chunk; | |
102 | ## | |
103 | # Future releases of SWISH++ may emit other comments: ignore ones we | |
104 | # don't know about. | |
105 | ## | |
106 | next if /^\#/; | |
107 | ||
108 | my( $rank, $file, $size, $title ) = split( / /, $_, 4 ); | |
109 | ||
110 | my $desc = WWW::extract_description( "$file" ); | |
111 | WWW::hyperlink( $desc ); | |
112 | $size = int( $size / 1024 ); | |
113 | if ( $size ) { | |
114 | $size .= 'K'; | |
115 | } else { | |
116 | $size = '<1K'; | |
117 | } | |
118 | if (param('file')) { | |
119 | $file = "file:$file"; | |
120 | } else { | |
121 | $file =~ s%^/usr/share/%/%; | |
122 | } | |
123 | unless ($title =~ /\S/ ) { | |
124 | $title = $file; | |
125 | } | |
126 | $chunk = <<END; | |
127 | <TR VALIGN=top><TD ALIGN=right>$rank% </TD> | |
128 | <TD><DL><DT><B><A HREF="$file">$title</A></B> ($size)<DD>$desc</DL></TD> | |
129 | END | |
176 | 130 | } |
177 | 131 | |
132 | if ($chunk) { | |
133 | print "$chunk</TABLE>\n"; | |
134 | } | |
178 | 135 | |
179 | ###################### | |
180 | # search # | |
181 | ###################### | |
136 | close (SEARCH); | |
182 | 137 | |
183 | sub search | |
184 | { | |
185 | if (not mkdir "/tmp/dsearch.$$",0700) | |
186 | { | |
187 | exit 1; | |
188 | } | |
189 | @results = split (/\n/, | |
190 | `/usr/bin/glimpse -L 100000:1000 -i -U -c -H /var/lib/dhelp -T /tmp/dsearch.$$ "$FORM{'search'}"`); | |
191 | rmdir "/tmp/dsearch.$$"; | |
138 | print end_html(), "\n"; | |
192 | 139 | |
193 | foreach $line (@results) | |
194 | { | |
195 | if ($line =~ /(.+?)\s(.+):\s([0-9]*)/) | |
196 | { | |
197 | $a = $1; | |
198 | $b = $2; | |
199 | $c = $3; | |
200 | $a =~ s/\/usr\/share//; | |
201 | $a =~ s/\/usr//; | |
202 | $b =~ s/\\:/:/g; | |
203 | $results{$a} = [$b, $c]; | |
204 | } | |
205 | } | |
206 | ||
207 | print <<"ENDE"; | |
208 | ||
209 | <HTML> | |
210 | ||
211 | <HEAD> | |
212 | <TITLE>$MESG{'headline'} $FORM{'search'}</TITLE> | |
213 | </HEAD> | |
214 | ||
215 | <BODY BGCOLOR=#FFFFFF> | |
216 | <IMG SRC="/doc/dhelp/debian.jpg" ALT="Debian GNU/Linux"> | |
217 | <H1>$MESG{'headline'} $FORM{'search'}</H1> | |
218 | ||
219 | <TABLE CELLPADDING=5 BGCOLOR=#EEEEEE BORDER=0> | |
220 | <TR BGCOLOR=#EEC000> | |
221 | <TD><FONT COLOR=#FFFFFF SIZE=+1 FACE="Helvetica,Arial"><B> | |
222 | <CENTER>$MESG{'title'}</CENTER></B></FONT> | |
223 | <TD><FONT COLOR=#FFFFFF SIZE=+1 FACE="Helvetica,Arial"><B> | |
224 | <CENTER>$MESG{'hits'}</CENTER></B></FONT> | |
225 | ||
226 | ENDE | |
140 | __END__ | |
227 | 141 | |
228 | 142 | |
229 | foreach $key (sort sort_vgl keys %results) | |
230 | { | |
231 | printf ("<TR><TD><DL><DT><A HREF=\"%s\">%s</A><DD><I>%s</I></DL>\n", | |
232 | $key, $results{$key}[0], $key); | |
233 | printf (" <TD>%s\n", $results{$key}[1]); | |
234 | } | |
235 | printf ("</TABLE>\n"); | |
236 | ||
237 | printf ("</BODY>\n</HTML>\n"); | |
238 | } | |
239 | ||
240 | ||
241 | ################### | |
242 | # main # | |
243 | ################### | |
244 | ||
245 | &language; | |
246 | ||
247 | if (defined $ARGV[0]) | |
248 | { | |
249 | $ARGV[0] =~ /(.*)/; | |
250 | $FORM{'search'} = $1; | |
251 | } | |
252 | else | |
253 | { | |
254 | printf ("Content-type: text/html\n\n"); | |
255 | %FORM = &parse_cgi ($ENV {'QUERY_STRING'}); | |
256 | } | |
257 | ||
258 | &glimpse_installed; | |
259 | &search; | |
260 | ||
261 |
0 | DBLIB = $(shell if [ -f /usr/lib/libdb1.a ]; then echo -ldb1; else echo -ldb; fi) | |
1 | ||
2 | all: dhelp_parse.o | |
3 | gcc dhelp_parse.o -o dhelp_parse_fsstnd $(DBLIB) | |
4 | ||
5 | clean: | |
6 | rm -rf dhelp_parse_fsstnd dhelp_parse.o *~ core | |
7 | ||
8 | dhelp_parse.o: dhelp_parse.c | |
9 | gcc -g -O2 -c -Wall -o dhelp_parse.o dhelp_parse.c |
0 | /* ******************************************************************** | |
1 | *** dhelp *** | |
2 | *** Debian online help system *** | |
3 | ******************************************************************** | |
4 | *** Copyright (c) 1997-99 by Marco Budde (Budde@tu-harburg.de) *** | |
5 | *** GNU GPL license *** | |
6 | ******************************************************************** */ | |
7 | ||
8 | ||
9 | #include <stdio.h> | |
10 | #include <string.h> | |
11 | #include <stdlib.h> | |
12 | #include <unistd.h> | |
13 | #include <dirent.h> | |
14 | #include <sys/types.h> | |
15 | #include <fcntl.h> | |
16 | #include <sys/stat.h> | |
17 | #include <sys/param.h> | |
18 | ||
19 | #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 | |
20 | #include <db1/db.h> | |
21 | #else | |
22 | #include <db.h> | |
23 | #endif | |
24 | ||
25 | ||
26 | #define DOCDIR "/usr/doc" | |
27 | #define INDEXROOT "/usr/doc/HTML2" | |
28 | #define DBNAME "/var/lib/dhelp/dbase_fsstnd" | |
29 | #define DBTITLE_NAME "/var/lib/dhelp/titles_fsstnd" | |
30 | ||
31 | ||
32 | typedef struct | |
33 | { | |
34 | char dir[100]; /* section name */ | |
35 | char dtitle[100]; /* description of a section */ | |
36 | char name[50]; /* linkname */ | |
37 | char file[100]; /* name of a HTML file */ | |
38 | char descrip[1000]; /* description of item */ | |
39 | } tItem; | |
40 | ||
41 | ||
42 | /* ************************************ | |
43 | * Eingabe: String * | |
44 | * Ausgabe: Anzahl von / im String * | |
45 | ************************************ */ | |
46 | ||
47 | int strcnt (const char *s) | |
48 | { | |
49 | int i=0; | |
50 | ||
51 | for ( ; *s!='\0'; s++) | |
52 | if (*s == '/') | |
53 | i++; | |
54 | return i; | |
55 | } | |
56 | ||
57 | ||
58 | /* ******************************* | |
59 | * strdel: Ersetzt \n durch \0 * | |
60 | ******************************* */ | |
61 | ||
62 | void strdel (char *s) | |
63 | { | |
64 | for ( ; *s!='\n'; s++); | |
65 | *s = '\0'; | |
66 | } | |
67 | ||
68 | ||
69 | /* ************************************ | |
70 | * strpart: liefert Teilpfad aus in * | |
71 | ************************************ */ | |
72 | ||
73 | void strpart (const char *in, char *out) | |
74 | { | |
75 | for ( ; (*in!='\0')&&(*in!='/'); in++, out++) | |
76 | *out = *in; | |
77 | if (*in == '/') | |
78 | *out++ = *in++; | |
79 | *out++='\0'; /* richtig ? */ | |
80 | } | |
81 | ||
82 | ||
83 | /* ------------------------------------------------------------- */ | |
84 | ||
85 | char *path_index_cwd (char *buf) | |
86 | { | |
87 | char cwd[MAXPATHLEN]; | |
88 | char *cwd_ptr; | |
89 | char resolv_name[MAXPATHLEN]; | |
90 | ||
91 | realpath (INDEXROOT, resolv_name); | |
92 | cwd_ptr = getcwd (cwd, sizeof (cwd)) + strlen (resolv_name); | |
93 | if (strlen (cwd_ptr) > 0) | |
94 | cwd_ptr++; | |
95 | strcpy (buf, cwd_ptr); | |
96 | ||
97 | return (buf); | |
98 | } | |
99 | ||
100 | ||
101 | char *path_relative (char *buf) | |
102 | { | |
103 | char cwd[MAXPATHLEN]; | |
104 | int i; | |
105 | ||
106 | path_index_cwd (cwd); | |
107 | buf[0] = '\0'; | |
108 | if (strlen (cwd) != 0) | |
109 | for (i = 1; i < (strcnt (cwd) + 3); i++) | |
110 | strcat (buf, "../"); | |
111 | else | |
112 | strcpy (buf, "../"); | |
113 | return (buf); | |
114 | } | |
115 | ||
116 | ||
117 | void rm_r (char *dirname) | |
118 | { | |
119 | DIR *dir; | |
120 | struct dirent *dir_entry; | |
121 | struct stat buf; | |
122 | char zw[MAXPATHLEN]; | |
123 | ||
124 | if ((dir = opendir (dirname)) == NULL) | |
125 | return; | |
126 | ||
127 | while ((dir_entry = readdir (dir)) != NULL) | |
128 | { | |
129 | if (strcmp (dir_entry->d_name, ".") != 0 | |
130 | && (strcmp (dir_entry->d_name, "..") != 0)) | |
131 | { | |
132 | strcpy (zw, dirname); | |
133 | strcat (zw, "/"); | |
134 | strcat (zw, dir_entry->d_name); | |
135 | stat (zw, &buf); | |
136 | if (S_ISDIR (buf.st_mode)) | |
137 | { | |
138 | rm_r (zw); /* Unterverzeichnisse loeschen */ | |
139 | rmdir (zw); | |
140 | } | |
141 | else | |
142 | remove (zw); | |
143 | } | |
144 | } | |
145 | ||
146 | closedir (dir); | |
147 | } | |
148 | ||
149 | /* --------------------------------------------------------------- */ | |
150 | ||
151 | ||
152 | DB *db_title_open (int flags) | |
153 | { | |
154 | HASHINFO hash; | |
155 | ||
156 | #ifdef __alpha__ | |
157 | hash.bsize = 512; | |
158 | #else | |
159 | hash.bsize = 256; | |
160 | #endif | |
161 | hash.ffactor = 8; | |
162 | hash.nelem = 1; | |
163 | hash.cachesize = 5000; | |
164 | hash.hash = NULL; | |
165 | hash.lorder = 0; | |
166 | ||
167 | return (dbopen (DBTITLE_NAME, flags, 0644, DB_HASH, &hash)); | |
168 | } | |
169 | ||
170 | int db_title_write (DB *db, tItem *item) | |
171 | { | |
172 | DBT key, data; | |
173 | ||
174 | key.data = item->dir; | |
175 | key.size = strlen (item->dir) + 1; | |
176 | data.data = item->dtitle; | |
177 | data.size = strlen (item->dtitle) + 1; | |
178 | ||
179 | return ((db->put)(db, &key, &data, 0)); | |
180 | } | |
181 | ||
182 | int db_title_read (DB *db, char *dir, char *title, int size) | |
183 | { | |
184 | DBT key, data; | |
185 | int i; | |
186 | ||
187 | key.data = dir; | |
188 | key.size = strlen (dir) + 1; | |
189 | ||
190 | i = ((db->get)(db, &key, &data, 0)); | |
191 | ||
192 | switch (i) | |
193 | { | |
194 | case 0 : strncpy (title, data.data, size); | |
195 | break; | |
196 | case 1 : strcpy (title, ""); | |
197 | } | |
198 | ||
199 | return (i); | |
200 | } | |
201 | ||
202 | ||
203 | /* ---------------------------------------------------------------- */ | |
204 | ||
205 | typedef struct | |
206 | { | |
207 | char file[100]; | |
208 | char dir[100]; | |
209 | char name[50]; | |
210 | } tkey_data; | |
211 | ||
212 | int db_compare (const DBT *key1, const DBT *key2) | |
213 | { | |
214 | /* Ueberprueft, ob key1 groesser, kleiner oder gleich key2 ist */ | |
215 | ||
216 | /* muss wahrscheinlich geaendert werden! fidogate/ entfernen vor | |
217 | Vergleich */ | |
218 | ||
219 | tkey_data *data1, *data2; | |
220 | int i; | |
221 | ||
222 | data1 = key1->data; | |
223 | data2 = key2->data; | |
224 | ||
225 | i = strcmp (data1->dir, data2->dir); /* sortieren nach dir */ | |
226 | if (i == 0) | |
227 | return (strcmp (data1->name, data2->name)); /* sortieren nach name */ | |
228 | else | |
229 | return (i); | |
230 | } | |
231 | ||
232 | DB* db_open (int flags) | |
233 | { | |
234 | /* Oeffnet die Datenbank */ | |
235 | ||
236 | BTREEINFO btree; | |
237 | ||
238 | btree.flags = 0; | |
239 | btree.cachesize = 10000; | |
240 | btree.minkeypage = 0; | |
241 | btree.psize = 0; | |
242 | btree.compare = (int (*)(const DBT *, const DBT *))(db_compare); | |
243 | /* aendern!!! */ | |
244 | btree.prefix = NULL; | |
245 | btree.lorder = 0; | |
246 | ||
247 | return (dbopen (DBNAME, flags, 0644, DB_BTREE, &btree)); | |
248 | } | |
249 | ||
250 | int db_write (DB *db, tItem *item) | |
251 | { | |
252 | /* speichert einen dhelp Eintrag (item) in die Datenbank */ | |
253 | ||
254 | DBT key, data; | |
255 | tkey_data key_data; | |
256 | ||
257 | strcpy (key_data.file, item->file); | |
258 | strcpy (key_data.dir, item->dir); | |
259 | strcpy (key_data.name, item->name); | |
260 | ||
261 | key.data = &key_data; | |
262 | key.size = sizeof (key_data); | |
263 | data.data = item->descrip; /* ohne & richtig? */ | |
264 | data.size = sizeof (item->descrip); | |
265 | return ((db->put)(db, &key, &data, 0)); | |
266 | } | |
267 | ||
268 | ||
269 | int db_read (DB *db, tItem *item) | |
270 | { | |
271 | /* holt einen dhelp Eintrag aus der Datenbank */ | |
272 | ||
273 | DBT key, data; | |
274 | tkey_data *key_data; | |
275 | int i; | |
276 | ||
277 | i = (db->seq)(db, &key, &data, R_NEXT); | |
278 | ||
279 | if (i == 0) | |
280 | { | |
281 | key_data = key.data; | |
282 | strcpy (item->file, key_data->file); | |
283 | strcpy (item->dir, key_data->dir); | |
284 | strcpy (item->name, key_data->name); | |
285 | strcpy (item->descrip, data.data); | |
286 | } | |
287 | ||
288 | return (i); | |
289 | } | |
290 | ||
291 | int db_del (DB *db, tItem *item) | |
292 | { | |
293 | DBT key; | |
294 | tkey_data key_data; | |
295 | ||
296 | strcpy (key_data.file, item->file); | |
297 | strcpy (key_data.dir, item->dir); | |
298 | strcpy (key_data.name, item->name); | |
299 | ||
300 | key.data = &key_data; | |
301 | key.size = sizeof (key_data); | |
302 | ||
303 | return ((db->del)(db, &key, 0)); | |
304 | } | |
305 | ||
306 | /* --------------------------------------------------------------- */ | |
307 | ||
308 | void html_error (FILE *out) | |
309 | { | |
310 | if (ferror (out) != 0) | |
311 | { | |
312 | fprintf (stderr, "dhelp_parse: can't write index.html\n"); | |
313 | exit (1); | |
314 | } | |
315 | } | |
316 | ||
317 | ||
318 | void html_w_head (FILE *out, DB *tdb) | |
319 | { | |
320 | char zw[MAXPATHLEN], zw2[100]; | |
321 | char cwd[MAXPATHLEN]; | |
322 | ||
323 | clearerr (out); | |
324 | ||
325 | path_index_cwd (cwd); | |
326 | db_title_read (tdb, cwd, zw2, sizeof (zw)); | |
327 | fprintf (out, "<HTML>\n\n<HEAD>\n<TITLE>%s</TITLE>\n" | |
328 | "<LINK REV=made HREF=\"mailto:Budde@tu-harburg.de\">\n" | |
329 | "</HEAD>\n\n", zw2); | |
330 | fprintf (out, "<BODY BGCOLOR=#FFFFFF>\n"); | |
331 | ||
332 | path_relative (zw); | |
333 | strcat (zw, "dhelp/debian.jpg"); | |
334 | fprintf (out, "<IMG SRC=\"%s\" ALT=\"Debian GNU/Linux\"> \n", zw); | |
335 | fprintf (out, "<H1>%s</H1>\n<P>\n", zw2); | |
336 | fprintf (out, "<DL>\n"); | |
337 | ||
338 | html_error (out); | |
339 | } | |
340 | ||
341 | ||
342 | void html_w_tail (FILE *out) | |
343 | { | |
344 | char cwd[MAXPATHLEN]; | |
345 | int lang = 5; | |
346 | char *language[] = { "", "de/", "da/", "it/", "es/", "fr/" }; | |
347 | char *search[] = { "Search", "Suche", "Søg", "Ricerca", "Buscar", | |
348 | "Rechercher" }; | |
349 | char *info[] = { "info documents", "info Dokumente", "info dokumenter", | |
350 | "documenti info", "documentos info", "Pages info" }; | |
351 | char *man[] = { "man pages", "Handbücher", "manual", "pagine di manuale", | |
352 | "páginas de manual", "Pages de manuel" }; | |
353 | char *other[] = { "other documents", "andere Dokumente", "andre dokumenter", | |
354 | "altri documenti", "Otros documentos", | |
355 | "Autres documents" }; | |
356 | int i; | |
357 | ||
358 | clearerr (out); | |
359 | ||
360 | path_index_cwd (cwd); /* get language */ | |
361 | strcat (cwd, "/"); | |
362 | for (i=0; i <= lang; i++) | |
363 | if (!strncmp (cwd, language[i], 3)) | |
364 | break; | |
365 | if (i > lang) | |
366 | i = 0; | |
367 | ||
368 | fprintf (out, "</DL>\n"); | |
369 | fprintf (out, "<P>\n<CENTER>\n" | |
370 | "<FORM ACTION=\"/cgi-bin/dsearch\">\n" | |
371 | "<INPUT TYPE=\"text\" NAME=\"search\">\n" | |
372 | "<INPUT TYPE=\"submit\" VALUE=\"%s\">\n" | |
373 | "</FORM><BR>\n" | |
374 | "[ <A HREF=\"/cgi-bin/info2www\">%s</A> | \n" | |
375 | "<A HREF=\"/cgi-bin/man2html\">%s</A> | \n" | |
376 | "<A HREF=\"/doc/\">%s</A> ]\n</CENTER>\n", | |
377 | search[i], info[i], man[i], other[i]); | |
378 | fprintf (out, "</BODY></HTML>\n"); | |
379 | ||
380 | html_error (out); | |
381 | } | |
382 | ||
383 | ||
384 | void html_w_item (tItem *item, FILE *out) | |
385 | { | |
386 | char zw[MAXPATHLEN]; | |
387 | ||
388 | clearerr (out); | |
389 | ||
390 | path_relative (zw); | |
391 | fprintf (out, "<DT><IMG SRC=\"%sdhelp/text.gif\">" | |
392 | " <A HREF=\"%s%s\"><FONT FACE=\"Helvetica, Arial\">" | |
393 | "<B>%s</B></FONT></A><P></DT>\n" | |
394 | " <DD>%s</DD>\n\n", | |
395 | zw, zw, item->file, item->name, item->descrip); | |
396 | ||
397 | html_error (out); | |
398 | } | |
399 | ||
400 | ||
401 | int html_w_item_links (DB *db, DB *tdb, tItem *item) | |
402 | { | |
403 | char cwd[MAXPATHLEN]; | |
404 | char dir[MAXPATHLEN], *dir_ptr; | |
405 | FILE *out; | |
406 | ||
407 | path_index_cwd (cwd); | |
408 | dir_ptr = item->dir; /* richtig ? */ | |
409 | while (strcmp (cwd, item->dir)) | |
410 | { | |
411 | strpart (dir_ptr, dir); | |
412 | dir_ptr += strlen (dir); | |
413 | mkdir (dir, 0755); | |
414 | chdir (dir); | |
415 | path_index_cwd (cwd); | |
416 | } | |
417 | ||
418 | if ((out = fopen ("index.html", "w")) == NULL) | |
419 | { | |
420 | fprintf (stderr, "dhelp_parse: can't open index.html\n\n"); | |
421 | exit (1); | |
422 | } | |
423 | ||
424 | html_w_head (out, tdb); | |
425 | do | |
426 | { | |
427 | strcpy (dir, item->dir); | |
428 | html_w_item (item, out); | |
429 | if ((db_read (db, item)) != 0) | |
430 | { | |
431 | fclose (out); | |
432 | return (1); | |
433 | } | |
434 | } | |
435 | while (!strcmp (dir, item->dir)); | |
436 | fclose (out); | |
437 | ||
438 | return (0); | |
439 | } | |
440 | ||
441 | ||
442 | int html_w_dir_links (char *dirname, DB *tdb) | |
443 | { | |
444 | DIR *dir; | |
445 | FILE *out; | |
446 | struct dirent *dir_entry; | |
447 | struct stat buf; | |
448 | char zw[MAXPATHLEN]; | |
449 | char relpath[MAXPATHLEN]; | |
450 | ||
451 | strcpy (zw, dirname); | |
452 | strcat (zw, "/index.html"); | |
453 | ||
454 | chdir (dirname); /* ??? */ | |
455 | ||
456 | if ((out = fopen (zw, "r")) == NULL) /* existiert index.html bereits? */ | |
457 | { | |
458 | if ((out = fopen (zw, "w")) == NULL) | |
459 | { | |
460 | fprintf (stderr, "dhelp_parse: can't open %s\n", zw); | |
461 | return (1); | |
462 | } | |
463 | html_w_head (out, tdb); | |
464 | } | |
465 | else | |
466 | { | |
467 | fclose (out); | |
468 | if ((out = fopen (zw, "a")) == NULL) | |
469 | { | |
470 | fprintf (stderr, "dhelp_parse: can't open %s\n", zw); | |
471 | return (1); | |
472 | } | |
473 | } | |
474 | dir = opendir (dirname); | |
475 | ||
476 | while ((dir_entry = readdir (dir)) != NULL) | |
477 | { | |
478 | if (strcmp (dir_entry->d_name, ".") != 0 | |
479 | && strcmp (dir_entry->d_name, "..") != 0) | |
480 | { | |
481 | strcpy (zw, dirname); | |
482 | strcat (zw, "/"); | |
483 | strcat (zw, dir_entry->d_name); | |
484 | stat (zw, &buf); | |
485 | if (S_ISDIR (buf.st_mode)) | |
486 | { | |
487 | path_relative (relpath); | |
488 | fprintf (out, "<DT><IMG SRC=\"%sdhelp/folder.gif\">" | |
489 | " <A HREF=\"%s/index.html\">" | |
490 | "<FONT FACE=\"Helvetica, Arial\"><B>%s/</B></FONT>" | |
491 | "</A></DT>\n" | |
492 | " <DD></DD>\n\n", | |
493 | relpath, dir_entry->d_name, dir_entry->d_name); | |
494 | if (html_w_dir_links (zw, tdb)) | |
495 | { | |
496 | fclose (out); | |
497 | return (1); | |
498 | } | |
499 | chdir (".."); /* ??? */ | |
500 | } | |
501 | } | |
502 | } | |
503 | html_w_tail (out); | |
504 | ||
505 | fclose (out); | |
506 | closedir (dir); | |
507 | return (0); | |
508 | } | |
509 | ||
510 | ||
511 | void html_write (void) | |
512 | { | |
513 | tItem item; | |
514 | DB *db, *tdb; | |
515 | int i; | |
516 | FILE *out; | |
517 | ||
518 | if ((db = db_open (O_RDONLY)) == NULL) | |
519 | { | |
520 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", DBNAME); | |
521 | exit (0); | |
522 | } | |
523 | if ((tdb = db_title_open (O_RDONLY)) == NULL) | |
524 | { | |
525 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", DBTITLE_NAME); | |
526 | exit (0); | |
527 | } | |
528 | ||
529 | rm_r (INDEXROOT); | |
530 | mkdir (INDEXROOT, 0755); | |
531 | chdir (INDEXROOT); /* usr/doc/HTML */ | |
532 | ||
533 | if ((out = fopen ("README", "w")) != NULL) | |
534 | { | |
535 | fprintf (out, "\nDon't put files in this directory!\n" | |
536 | "dhelp will delete *all* files in this directory " | |
537 | "when creating a new index.\n\n" | |
538 | "Marco Budde (budde@debian.org)\n\n"); | |
539 | fclose (out); | |
540 | } | |
541 | ||
542 | db_read (db, &item); | |
543 | do | |
544 | { | |
545 | i = html_w_item_links (db, tdb, &item); | |
546 | chdir (INDEXROOT); | |
547 | } | |
548 | while (i == 0); | |
549 | ||
550 | if (html_w_dir_links (INDEXROOT, tdb)) | |
551 | { | |
552 | fprintf (stderr, "dhelp_parse: can't write index\n"); | |
553 | exit (1); | |
554 | } | |
555 | ||
556 | db->close (db); /* ??? */ | |
557 | tdb->close (tdb); /* ??? */ | |
558 | } | |
559 | ||
560 | ||
561 | /* --------------------------------------------------------------- */ | |
562 | ||
563 | ||
564 | ||
565 | int get_item (FILE *fd, char *filename, tItem *item) | |
566 | { | |
567 | char zw[200]; | |
568 | int cnt = 0; | |
569 | ||
570 | item->descrip[0]='\0'; | |
571 | item->dtitle[0]='\0'; | |
572 | item->file[0]='\0'; | |
573 | ||
574 | /* <item> == Start suchen */ | |
575 | do | |
576 | if ((fgets (zw, sizeof(zw), fd)) == NULL) | |
577 | return 1; | |
578 | while (strncmp ("<item>", zw, 6) != 0); | |
579 | ||
580 | /* Daten eines <item> parsen */ | |
581 | do | |
582 | { | |
583 | if ((fgets (zw, sizeof(zw), fd)) == NULL) | |
584 | return 1; | |
585 | if (strncmp ("<directory>", zw, 11) == 0) | |
586 | { | |
587 | strncpy (item->dir, zw+11, sizeof (item->dir)); | |
588 | item->dir[sizeof(item->dir)-1] = '\0'; | |
589 | strdel (item->dir); | |
590 | } | |
591 | if (strncmp ("<dirtitle>", zw, 10) == 0) | |
592 | { | |
593 | strncpy (item->dtitle, zw+10, sizeof (item->dtitle)); | |
594 | item->dtitle[sizeof(item->dtitle)-1] = '\0'; | |
595 | strdel (item->dtitle); | |
596 | } | |
597 | if (strncmp ("<linkname>", zw, 10) == 0) | |
598 | { | |
599 | strncpy (item->name, zw+10, sizeof (item->name)); | |
600 | item->name[sizeof(item->name)-1] = '\0'; | |
601 | strdel (item->name); | |
602 | } | |
603 | if (strncmp ("<filename>", zw, 10) == 0) | |
604 | { | |
605 | strcpy (item->file, filename); /* Verzeichnisname */ | |
606 | strncat (item->file, zw+10, sizeof (item->file) - strlen (filename)); | |
607 | item->file[sizeof(item->file)-1] = '\0'; | |
608 | strdel (item->file); | |
609 | } | |
610 | if (strncmp ("<description>", zw, 13) == 0) | |
611 | { | |
612 | fgets (zw, sizeof(zw), fd); | |
613 | while (strncmp ("</description>", zw, 14) != 0) | |
614 | { | |
615 | cnt = cnt + strlen (zw); | |
616 | if (cnt < sizeof (item->descrip)) | |
617 | { | |
618 | strcat (item->descrip, zw); | |
619 | item->descrip[sizeof(item->descrip)-1] = '\0'; | |
620 | } | |
621 | if ((fgets (zw, sizeof(zw), fd)) == NULL) | |
622 | return 1; | |
623 | } | |
624 | } | |
625 | } | |
626 | while (strncmp ("</item>", zw, 7) != 0); | |
627 | ||
628 | return 0; | |
629 | } | |
630 | ||
631 | ||
632 | int dhelp_add (char *name) | |
633 | { | |
634 | FILE *in; | |
635 | tItem item; | |
636 | DB *db, *db_title; | |
637 | char *file_ptr; | |
638 | char resolv_docdir[MAXPATHLEN]; | |
639 | ||
640 | if ((in = fopen (name, "r")) == NULL) | |
641 | { | |
642 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", name); | |
643 | return (1); | |
644 | } | |
645 | if ((db = db_open (O_RDWR|O_CREAT)) == NULL) | |
646 | { | |
647 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", DBNAME); | |
648 | return (1); | |
649 | } | |
650 | if ((db_title = db_title_open (O_RDWR|O_CREAT)) == NULL) | |
651 | { | |
652 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", DBTITLE_NAME); | |
653 | return (1); | |
654 | } | |
655 | ||
656 | /* relativen Pfad zum Dokument erzeugen */ | |
657 | ||
658 | realpath (DOCDIR, resolv_docdir); | |
659 | file_ptr = name; | |
660 | file_ptr += strlen (resolv_docdir); | |
661 | file_ptr++; | |
662 | file_ptr [strlen(file_ptr)-6] = '\0'; | |
663 | ||
664 | while (!(get_item (in, file_ptr, &item))) | |
665 | { | |
666 | if (item.file[0] != '\0') | |
667 | db_write (db, &item); | |
668 | if (item.dtitle[0] != '\0') | |
669 | db_title_write (db_title, &item); | |
670 | } | |
671 | ||
672 | fclose (in); | |
673 | db->close (db); | |
674 | db_title->close (db_title); | |
675 | ||
676 | return (0); | |
677 | } | |
678 | ||
679 | ||
680 | int dhelp_del (char *name) | |
681 | { | |
682 | FILE *in; | |
683 | tItem item; | |
684 | DB *db; | |
685 | char *file_ptr; | |
686 | char resolv_docdir[MAXPATHLEN]; | |
687 | ||
688 | if ((in = fopen (name, "r")) == NULL) | |
689 | { | |
690 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", name); | |
691 | return (1); | |
692 | } | |
693 | if ((db = db_open (O_RDWR|O_CREAT)) == NULL) | |
694 | { | |
695 | fprintf (stderr, "dhelp_parse: can't open %s\n\n", DBNAME); | |
696 | return (1); | |
697 | } | |
698 | ||
699 | /* relativen Pfad zum Dokument erzeugen */ | |
700 | ||
701 | realpath (DOCDIR, resolv_docdir); | |
702 | file_ptr = name; | |
703 | file_ptr += strlen (resolv_docdir); | |
704 | file_ptr++; | |
705 | file_ptr [strlen(file_ptr)-6] = '\0'; | |
706 | ||
707 | while (!(get_item (in, file_ptr, &item))) | |
708 | db_del (db, &item); | |
709 | ||
710 | fclose (in); | |
711 | db->close (db); | |
712 | ||
713 | return (0); | |
714 | } | |
715 | ||
716 | ||
717 | void dhelp_add_rec (char *dirname) | |
718 | { | |
719 | DIR *dir; | |
720 | struct dirent *dir_entry; | |
721 | struct stat buf; | |
722 | char zw[MAXPATHLEN]; | |
723 | ||
724 | dir = opendir (dirname); | |
725 | ||
726 | while ((dir_entry = readdir (dir)) != NULL) | |
727 | { | |
728 | if ((strcmp (dir_entry->d_name, ".") != 0) | |
729 | && (strcmp (dir_entry->d_name, "..") != 0)) | |
730 | { | |
731 | strcpy (zw, dirname); | |
732 | strcat (zw, "/"); | |
733 | strcat (zw, dir_entry->d_name); | |
734 | lstat (zw, &buf); | |
735 | if (S_ISDIR (buf.st_mode)) | |
736 | dhelp_add_rec (zw); | |
737 | else | |
738 | if (!strcmp (dir_entry->d_name, ".dhelp")) | |
739 | dhelp_add (zw); | |
740 | } | |
741 | } | |
742 | ||
743 | closedir (dir); | |
744 | } | |
745 | ||
746 | /* -------------------------------------------------------------- */ | |
747 | ||
748 | void help (void) | |
749 | { | |
750 | printf ("\nUsage: dhelp_parse <option> <directories>\n\n"); | |
751 | printf ("-a add dhelp file in <directories>\n"); | |
752 | printf ("-d del dhelp file in <directories>\n"); | |
753 | printf ("-r index all dhelp files in %s\n\n", DOCDIR); | |
754 | } | |
755 | ||
756 | ||
757 | int main (int argc, char *argv[]) | |
758 | { | |
759 | int i; | |
760 | char zw[MAXPATHLEN]; | |
761 | char resolv_name[MAXPATHLEN]; | |
762 | ||
763 | if ((argc < 2) || (strlen (argv[1]) != 2) || (argv[1][0] != '-')) | |
764 | { | |
765 | help(); | |
766 | return (1); | |
767 | } | |
768 | ||
769 | if (!strcmp (argv[1], "-r")) | |
770 | { | |
771 | remove (DBNAME); /* loesche db, um alte/falsche Eintraege | |
772 | zu loeschen */ | |
773 | realpath (DOCDIR, resolv_name); | |
774 | dhelp_add_rec (resolv_name); | |
775 | } | |
776 | else | |
777 | { | |
778 | mkdir ("/var/lib/dhelp/", 0755); | |
779 | for (i=2; i < argc; i++) | |
780 | { | |
781 | if (!strncmp (argv[i], DOCDIR, strlen (DOCDIR))) | |
782 | { | |
783 | strcpy (zw, argv[i]); | |
784 | strcat (zw, "/.dhelp"); | |
785 | realpath (zw, resolv_name); | |
786 | switch (argv[1][1]) | |
787 | { | |
788 | case 'a': dhelp_add (resolv_name); | |
789 | break; | |
790 | case 'd': dhelp_del (resolv_name); | |
791 | break; | |
792 | default: help (); | |
793 | } | |
794 | } | |
795 | else | |
796 | { | |
797 | fprintf (stderr, "dhelp_parse: You can add only directories " | |
798 | "under %s!\n\n", DOCDIR); | |
799 | return (1); | |
800 | } | |
801 | } | |
802 | } | |
803 | ||
804 | html_write (); | |
805 | ||
806 | return (0); | |
807 | } |
0 | #!/bin/sh | |
1 | # | |
2 | # install - install a program, script, or datafile | |
3 | # This comes from X11R5 (mit/util/scripts/install.sh). | |
4 | # | |
5 | # Copyright 1991 by the Massachusetts Institute of Technology | |
6 | # | |
7 | # Permission to use, copy, modify, distribute, and sell this software and its | |
8 | # documentation for any purpose is hereby granted without fee, provided that | |
9 | # the above copyright notice appear in all copies and that both that | |
10 | # copyright notice and this permission notice appear in supporting | |
11 | # documentation, and that the name of M.I.T. not be used in advertising or | |
12 | # publicity pertaining to distribution of the software without specific, | |
13 | # written prior permission. M.I.T. makes no representations about the | |
14 | # suitability of this software for any purpose. It is provided "as is" | |
15 | # without express or implied warranty. | |
16 | # | |
17 | # Calling this script install-sh is preferred over install.sh, to prevent | |
18 | # `make' implicit rules from creating a file called install from it | |
19 | # when there is no Makefile. | |
20 | # | |
21 | # This script is compatible with the BSD install script, but was written | |
22 | # from scratch. It can only install one file at a time, a restriction | |
23 | # shared with many OS's install programs. | |
24 | ||
25 | ||
26 | # set DOITPROG to echo to test this script | |
27 | ||
28 | # Don't use :- since 4.3BSD and earlier shells don't like it. | |
29 | doit="${DOITPROG-}" | |
30 | ||
31 | ||
32 | # put in absolute paths if you don't have them in your path; or use env. vars. | |
33 | ||
34 | mvprog="${MVPROG-mv}" | |
35 | cpprog="${CPPROG-cp}" | |
36 | chmodprog="${CHMODPROG-chmod}" | |
37 | chownprog="${CHOWNPROG-chown}" | |
38 | chgrpprog="${CHGRPPROG-chgrp}" | |
39 | stripprog="${STRIPPROG-strip}" | |
40 | rmprog="${RMPROG-rm}" | |
41 | mkdirprog="${MKDIRPROG-mkdir}" | |
42 | ||
43 | transformbasename="" | |
44 | transform_arg="" | |
45 | instcmd="$mvprog" | |
46 | chmodcmd="$chmodprog 0755" | |
47 | chowncmd="" | |
48 | chgrpcmd="" | |
49 | stripcmd="" | |
50 | rmcmd="$rmprog -f" | |
51 | mvcmd="$mvprog" | |
52 | src="" | |
53 | dst="" | |
54 | dir_arg="" | |
55 | ||
56 | while [ x"$1" != x ]; do | |
57 | case $1 in | |
58 | -c) instcmd="$cpprog" | |
59 | shift | |
60 | continue;; | |
61 | ||
62 | -d) dir_arg=true | |
63 | shift | |
64 | continue;; | |
65 | ||
66 | -m) chmodcmd="$chmodprog $2" | |
67 | shift | |
68 | shift | |
69 | continue;; | |
70 | ||
71 | -o) chowncmd="$chownprog $2" | |
72 | shift | |
73 | shift | |
74 | continue;; | |
75 | ||
76 | -g) chgrpcmd="$chgrpprog $2" | |
77 | shift | |
78 | shift | |
79 | continue;; | |
80 | ||
81 | -s) stripcmd="$stripprog" | |
82 | shift | |
83 | continue;; | |
84 | ||
85 | -t=*) transformarg=`echo $1 | sed 's/-t=//'` | |
86 | shift | |
87 | continue;; | |
88 | ||
89 | -b=*) transformbasename=`echo $1 | sed 's/-b=//'` | |
90 | shift | |
91 | continue;; | |
92 | ||
93 | *) if [ x"$src" = x ] | |
94 | then | |
95 | src=$1 | |
96 | else | |
97 | # this colon is to work around a 386BSD /bin/sh bug | |
98 | : | |
99 | dst=$1 | |
100 | fi | |
101 | shift | |
102 | continue;; | |
103 | esac | |
104 | done | |
105 | ||
106 | if [ x"$src" = x ] | |
107 | then | |
108 | echo "install: no input file specified" | |
109 | exit 1 | |
110 | else | |
111 | true | |
112 | fi | |
113 | ||
114 | if [ x"$dir_arg" != x ]; then | |
115 | dst=$src | |
116 | src="" | |
117 | ||
118 | if [ -d $dst ]; then | |
119 | instcmd=: | |
120 | chmodcmd="" | |
121 | else | |
122 | instcmd=mkdir | |
123 | fi | |
124 | else | |
125 | ||
126 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command | |
127 | # might cause directories to be created, which would be especially bad | |
128 | # if $src (and thus $dsttmp) contains '*'. | |
129 | ||
130 | if [ -f $src -o -d $src ] | |
131 | then | |
132 | true | |
133 | else | |
134 | echo "install: $src does not exist" | |
135 | exit 1 | |
136 | fi | |
137 | ||
138 | if [ x"$dst" = x ] | |
139 | then | |
140 | echo "install: no destination specified" | |
141 | exit 1 | |
142 | else | |
143 | true | |
144 | fi | |
145 | ||
146 | # If destination is a directory, append the input filename; if your system | |
147 | # does not like double slashes in filenames, you may need to add some logic | |
148 | ||
149 | if [ -d $dst ] | |
150 | then | |
151 | dst="$dst"/`basename $src` | |
152 | else | |
153 | true | |
154 | fi | |
155 | fi | |
156 | ||
157 | ## this sed command emulates the dirname command | |
158 | dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` | |
159 | ||
160 | # Make sure that the destination directory exists. | |
161 | # this part is taken from Noah Friedman's mkinstalldirs script | |
162 | ||
163 | # Skip lots of stat calls in the usual case. | |
164 | if [ ! -d "$dstdir" ]; then | |
165 | defaultIFS=' | |
166 | ' | |
167 | IFS="${IFS-${defaultIFS}}" | |
168 | ||
169 | oIFS="${IFS}" | |
170 | # Some sh's can't handle IFS=/ for some reason. | |
171 | IFS='%' | |
172 | set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` | |
173 | IFS="${oIFS}" | |
174 | ||
175 | pathcomp='' | |
176 | ||
177 | while [ $# -ne 0 ] ; do | |
178 | pathcomp="${pathcomp}${1}" | |
179 | shift | |
180 | ||
181 | if [ ! -d "${pathcomp}" ] ; | |
182 | then | |
183 | $mkdirprog "${pathcomp}" | |
184 | else | |
185 | true | |
186 | fi | |
187 | ||
188 | pathcomp="${pathcomp}/" | |
189 | done | |
190 | fi | |
191 | ||
192 | if [ x"$dir_arg" != x ] | |
193 | then | |
194 | $doit $instcmd $dst && | |
195 | ||
196 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && | |
197 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && | |
198 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && | |
199 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi | |
200 | else | |
201 | ||
202 | # If we're going to rename the final executable, determine the name now. | |
203 | ||
204 | if [ x"$transformarg" = x ] | |
205 | then | |
206 | dstfile=`basename $dst` | |
207 | else | |
208 | dstfile=`basename $dst $transformbasename | | |
209 | sed $transformarg`$transformbasename | |
210 | fi | |
211 | ||
212 | # don't allow the sed command to completely eliminate the filename | |
213 | ||
214 | if [ x"$dstfile" = x ] | |
215 | then | |
216 | dstfile=`basename $dst` | |
217 | else | |
218 | true | |
219 | fi | |
220 | ||
221 | # Make a temp file name in the proper directory. | |
222 | ||
223 | dsttmp=$dstdir/#inst.$$# | |
224 | ||
225 | # Move or copy the file name to the temp name | |
226 | ||
227 | $doit $instcmd $src $dsttmp && | |
228 | ||
229 | trap "rm -f ${dsttmp}" 0 && | |
230 | ||
231 | # and set any options; do chmod last to preserve setuid bits | |
232 | ||
233 | # If any of these fail, we abort the whole thing. If we want to | |
234 | # ignore errors from any of these, just make sure not to ignore | |
235 | # errors from the above "$doit $instcmd $src $dsttmp" command. | |
236 | ||
237 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && | |
238 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && | |
239 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && | |
240 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && | |
241 | ||
242 | # Now rename the file to the real destination. | |
243 | ||
244 | $doit $rmcmd -f $dstdir/$dstfile && | |
245 | $doit $mvcmd $dsttmp $dstdir/$dstfile | |
246 | ||
247 | fi && | |
248 | ||
249 | ||
250 | exit 0 |
51 | 51 | .br |
52 | 52 | fi |
53 | 53 | |
54 | If your package conforms to the Debian policy 3.1.0.0, | |
55 | you can use | |
56 | .B dhelp_parse | |
57 | and | |
58 | .B dhelp_parse_fsstnd. dhelp_parse | |
59 | is responsible for | |
60 | .I /usr/share/doc | |
61 | and | |
62 | .B dhelp_parse_fsstnd | |
63 | for | |
64 | .I /usr/doc. | |
65 | A policy 3.1.0.0 conforming package should | |
66 | .B not | |
67 | call | |
68 | .B dhelp_parse_fsstnd. | |
69 | ||
70 | 54 | Or you can use |
71 | 55 | .B dh_dhelp |
72 | 56 | in your |
0 | #! /bin/sh | |
1 | # Common stub for a few missing GNU programs while installing. | |
2 | # Copyright (C) 1996, 1997 Free Software Foundation, Inc. | |
3 | # Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996. | |
4 | ||
5 | # This program is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 2, or (at your option) | |
8 | # any later version. | |
9 | ||
10 | # This program is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | ||
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program; if not, write to the Free Software | |
17 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
18 | # 02111-1307, USA. | |
19 | ||
20 | if test $# -eq 0; then | |
21 | echo 1>&2 "Try \`$0 --help' for more information" | |
22 | exit 1 | |
23 | fi | |
24 | ||
25 | case "$1" in | |
26 | ||
27 | -h|--h|--he|--hel|--help) | |
28 | echo "\ | |
29 | $0 [OPTION]... PROGRAM [ARGUMENT]... | |
30 | ||
31 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an | |
32 | error status if there is no known handling for PROGRAM. | |
33 | ||
34 | Options: | |
35 | -h, --help display this help and exit | |
36 | -v, --version output version information and exit | |
37 | ||
38 | Supported PROGRAM values: | |
39 | aclocal touch file \`aclocal.m4' | |
40 | autoconf touch file \`configure' | |
41 | autoheader touch file \`config.h.in' | |
42 | automake touch all \`Makefile.in' files | |
43 | bison create \`y.tab.[ch]', if possible, from existing .[ch] | |
44 | flex create \`lex.yy.c', if possible, from existing .c | |
45 | lex create \`lex.yy.c', if possible, from existing .c | |
46 | makeinfo touch the output file | |
47 | yacc create \`y.tab.[ch]', if possible, from existing .[ch]" | |
48 | ;; | |
49 | ||
50 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) | |
51 | echo "missing - GNU libit 0.0" | |
52 | ;; | |
53 | ||
54 | -*) | |
55 | echo 1>&2 "$0: Unknown \`$1' option" | |
56 | echo 1>&2 "Try \`$0 --help' for more information" | |
57 | exit 1 | |
58 | ;; | |
59 | ||
60 | aclocal) | |
61 | echo 1>&2 "\ | |
62 | WARNING: \`$1' is missing on your system. You should only need it if | |
63 | you modified \`acinclude.m4' or \`configure.in'. You might want | |
64 | to install the \`Automake' and \`Perl' packages. Grab them from | |
65 | any GNU archive site." | |
66 | touch aclocal.m4 | |
67 | ;; | |
68 | ||
69 | autoconf) | |
70 | echo 1>&2 "\ | |
71 | WARNING: \`$1' is missing on your system. You should only need it if | |
72 | you modified \`configure.in'. You might want to install the | |
73 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU | |
74 | archive site." | |
75 | touch configure | |
76 | ;; | |
77 | ||
78 | autoheader) | |
79 | echo 1>&2 "\ | |
80 | WARNING: \`$1' is missing on your system. You should only need it if | |
81 | you modified \`acconfig.h' or \`configure.in'. You might want | |
82 | to install the \`Autoconf' and \`GNU m4' packages. Grab them | |
83 | from any GNU archive site." | |
84 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` | |
85 | test -z "$files" && files="config.h" | |
86 | touch_files= | |
87 | for f in $files; do | |
88 | case "$f" in | |
89 | *:*) touch_files="$touch_files "`echo "$f" | | |
90 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; | |
91 | *) touch_files="$touch_files $f.in";; | |
92 | esac | |
93 | done | |
94 | touch $touch_files | |
95 | ;; | |
96 | ||
97 | automake) | |
98 | echo 1>&2 "\ | |
99 | WARNING: \`$1' is missing on your system. You should only need it if | |
100 | you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. | |
101 | You might want to install the \`Automake' and \`Perl' packages. | |
102 | Grab them from any GNU archive site." | |
103 | find . -type f -name Makefile.am -print | | |
104 | sed 's/\.am$/.in/' | | |
105 | while read f; do touch "$f"; done | |
106 | ;; | |
107 | ||
108 | bison|yacc) | |
109 | echo 1>&2 "\ | |
110 | WARNING: \`$1' is missing on your system. You should only need it if | |
111 | you modified a \`.y' file. You may need the \`Bison' package | |
112 | in order for those modifications to take effect. You can get | |
113 | \`Bison' from any GNU archive site." | |
114 | rm -f y.tab.c y.tab.h | |
115 | if [ $# -ne 1 ]; then | |
116 | eval LASTARG="\${$#}" | |
117 | case "$LASTARG" in | |
118 | *.y) | |
119 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` | |
120 | if [ -f "$SRCFILE" ]; then | |
121 | cp "$SRCFILE" y.tab.c | |
122 | fi | |
123 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` | |
124 | if [ -f "$SRCFILE" ]; then | |
125 | cp "$SRCFILE" y.tab.h | |
126 | fi | |
127 | ;; | |
128 | esac | |
129 | fi | |
130 | if [ ! -f y.tab.h ]; then | |
131 | echo >y.tab.h | |
132 | fi | |
133 | if [ ! -f y.tab.c ]; then | |
134 | echo 'main() { return 0; }' >y.tab.c | |
135 | fi | |
136 | ;; | |
137 | ||
138 | lex|flex) | |
139 | echo 1>&2 "\ | |
140 | WARNING: \`$1' is missing on your system. You should only need it if | |
141 | you modified a \`.l' file. You may need the \`Flex' package | |
142 | in order for those modifications to take effect. You can get | |
143 | \`Flex' from any GNU archive site." | |
144 | rm -f lex.yy.c | |
145 | if [ $# -ne 1 ]; then | |
146 | eval LASTARG="\${$#}" | |
147 | case "$LASTARG" in | |
148 | *.l) | |
149 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` | |
150 | if [ -f "$SRCFILE" ]; then | |
151 | cp "$SRCFILE" lex.yy.c | |
152 | fi | |
153 | ;; | |
154 | esac | |
155 | fi | |
156 | if [ ! -f lex.yy.c ]; then | |
157 | echo 'main() { return 0; }' >lex.yy.c | |
158 | fi | |
159 | ;; | |
160 | ||
161 | makeinfo) | |
162 | echo 1>&2 "\ | |
163 | WARNING: \`$1' is missing on your system. You should only need it if | |
164 | you modified a \`.texi' or \`.texinfo' file, or any other file | |
165 | indirectly affecting the aspect of the manual. The spurious | |
166 | call might also be the consequence of using a buggy \`make' (AIX, | |
167 | DU, IRIX). You might want to install the \`Texinfo' package or | |
168 | the \`GNU make' package. Grab either from any GNU archive site." | |
169 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` | |
170 | if test -z "$file"; then | |
171 | file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` | |
172 | file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` | |
173 | fi | |
174 | touch $file | |
175 | ;; | |
176 | ||
177 | *) | |
178 | echo 1>&2 "\ | |
179 | WARNING: \`$1' is needed, and you do not seem to have it handy on your | |
180 | system. You might have modified some files without having the | |
181 | proper tools for further handling them. Check the \`README' file, | |
182 | it often tells you about the needed prerequirements for installing | |
183 | this package. You may also peek at any GNU archive site, in case | |
184 | some other package would contain this missing \`$1' program." | |
185 | exit 1 | |
186 | ;; | |
187 | esac | |
188 | ||
189 | exit 0 |
0 | #! /bin/sh | |
1 | # mkinstalldirs --- make directory hierarchy | |
2 | # Author: Noah Friedman <friedman@prep.ai.mit.edu> | |
3 | # Created: 1993-05-16 | |
4 | # Public domain | |
5 | ||
6 | # $Id: mkinstalldirs,v 1.1 2001/10/03 13:20:53 racke Exp $ | |
7 | ||
8 | errstatus=0 | |
9 | ||
10 | for file | |
11 | do | |
12 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` | |
13 | shift | |
14 | ||
15 | pathcomp= | |
16 | for d | |
17 | do | |
18 | pathcomp="$pathcomp$d" | |
19 | case "$pathcomp" in | |
20 | -* ) pathcomp=./$pathcomp ;; | |
21 | esac | |
22 | ||
23 | if test ! -d "$pathcomp"; then | |
24 | echo "mkdir $pathcomp" | |
25 | ||
26 | mkdir "$pathcomp" || lasterr=$? | |
27 | ||
28 | if test ! -d "$pathcomp"; then | |
29 | errstatus=$lasterr | |
30 | fi | |
31 | fi | |
32 | ||
33 | pathcomp="$pathcomp/" | |
34 | done | |
35 | done | |
36 | ||
37 | exit $errstatus | |
38 | ||
39 | # mkinstalldirs ends here |