Browse Source

Added kstreamripper


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kstreamripper@1239912 283d02a7-25f6-0310-bc7c-ecb5cbfe19
tags/v3.5.13
tpearson 8 years ago
commit
2e77c0b4ce

+ 2
- 0
AUTHORS View File

@@ -0,0 +1,2 @@
1
+Michael Goettsche <mail@tuxipuxi.org>
2
+William Entriken <william.entriken@villanova.edu>

+ 340
- 0
COPYING View File

@@ -0,0 +1,340 @@
1
+		    GNU GENERAL PUBLIC LICENSE
2
+		       Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+			    Preamble
10
+
11
+  The licenses for most software are designed to take away your
12
+freedom to share and change it.  By contrast, the GNU General Public
13
+License is intended to guarantee your freedom to share and change free
14
+software--to make sure the software is free for all its users.  This
15
+General Public License applies to most of the Free Software
16
+Foundation's software and to any other program whose authors commit to
17
+using it.  (Some other Free Software Foundation software is covered by
18
+the GNU Library General Public License instead.)  You can apply it to
19
+your programs, too.
20
+
21
+  When we speak of free software, we are referring to freedom, not
22
+price.  Our General Public Licenses are designed to make sure that you
23
+have the freedom to distribute copies of free software (and charge for
24
+this service if you wish), that you receive source code or can get it
25
+if you want it, that you can change the software or use pieces of it
26
+in new free programs; and that you know you can do these things.
27
+
28
+  To protect your rights, we need to make restrictions that forbid
29
+anyone to deny you these rights or to ask you to surrender the rights.
30
+These restrictions translate to certain responsibilities for you if you
31
+distribute copies of the software, or if you modify it.
32
+
33
+  For example, if you distribute copies of such a program, whether
34
+gratis or for a fee, you must give the recipients all the rights that
35
+you have.  You must make sure that they, too, receive or can get the
36
+source code.  And you must show them these terms so they know their
37
+rights.
38
+
39
+  We protect your rights with two steps: (1) copyright the software, and
40
+(2) offer you this license which gives you legal permission to copy,
41
+distribute and/or modify the software.
42
+
43
+  Also, for each author's protection and ours, we want to make certain
44
+that everyone understands that there is no warranty for this free
45
+software.  If the software is modified by someone else and passed on, we
46
+want its recipients to know that what they have is not the original, so
47
+that any problems introduced by others will not reflect on the original
48
+authors' reputations.
49
+
50
+  Finally, any free program is threatened constantly by software
51
+patents.  We wish to avoid the danger that redistributors of a free
52
+program will individually obtain patent licenses, in effect making the
53
+program proprietary.  To prevent this, we have made it clear that any
54
+patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+  The precise terms and conditions for copying, distribution and
57
+modification follow.
58
+
59
+		    GNU GENERAL PUBLIC LICENSE
60
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+  0. This License applies to any program or other work which contains
63
+a notice placed by the copyright holder saying it may be distributed
64
+under the terms of this General Public License.  The "Program", below,
65
+refers to any such program or work, and a "work based on the Program"
66
+means either the Program or any derivative work under copyright law:
67
+that is to say, a work containing the Program or a portion of it,
68
+either verbatim or with modifications and/or translated into another
69
+language.  (Hereinafter, translation is included without limitation in
70
+the term "modification".)  Each licensee is addressed as "you".
71
+
72
+Activities other than copying, distribution and modification are not
73
+covered by this License; they are outside its scope.  The act of
74
+running the Program is not restricted, and the output from the Program
75
+is covered only if its contents constitute a work based on the
76
+Program (independent of having been made by running the Program).
77
+Whether that is true depends on what the Program does.
78
+
79
+  1. You may copy and distribute verbatim copies of the Program's
80
+source code as you receive it, in any medium, provided that you
81
+conspicuously and appropriately publish on each copy an appropriate
82
+copyright notice and disclaimer of warranty; keep intact all the
83
+notices that refer to this License and to the absence of any warranty;
84
+and give any other recipients of the Program a copy of this License
85
+along with the Program.
86
+
87
+You may charge a fee for the physical act of transferring a copy, and
88
+you may at your option offer warranty protection in exchange for a fee.
89
+
90
+  2. You may modify your copy or copies of the Program or any portion
91
+of it, thus forming a work based on the Program, and copy and
92
+distribute such modifications or work under the terms of Section 1
93
+above, provided that you also meet all of these conditions:
94
+
95
+    a) You must cause the modified files to carry prominent notices
96
+    stating that you changed the files and the date of any change.
97
+
98
+    b) You must cause any work that you distribute or publish, that in
99
+    whole or in part contains or is derived from the Program or any
100
+    part thereof, to be licensed as a whole at no charge to all third
101
+    parties under the terms of this License.
102
+
103
+    c) If the modified program normally reads commands interactively
104
+    when run, you must cause it, when started running for such
105
+    interactive use in the most ordinary way, to print or display an
106
+    announcement including an appropriate copyright notice and a
107
+    notice that there is no warranty (or else, saying that you provide
108
+    a warranty) and that users may redistribute the program under
109
+    these conditions, and telling the user how to view a copy of this
110
+    License.  (Exception: if the Program itself is interactive but
111
+    does not normally print such an announcement, your work based on
112
+    the Program is not required to print an announcement.)
113
+
114
+These requirements apply to the modified work as a whole.  If
115
+identifiable sections of that work are not derived from the Program,
116
+and can be reasonably considered independent and separate works in
117
+themselves, then this License, and its terms, do not apply to those
118
+sections when you distribute them as separate works.  But when you
119
+distribute the same sections as part of a whole which is a work based
120
+on the Program, the distribution of the whole must be on the terms of
121
+this License, whose permissions for other licensees extend to the
122
+entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+Thus, it is not the intent of this section to claim rights or contest
125
+your rights to work written entirely by you; rather, the intent is to
126
+exercise the right to control the distribution of derivative or
127
+collective works based on the Program.
128
+
129
+In addition, mere aggregation of another work not based on the Program
130
+with the Program (or with a work based on the Program) on a volume of
131
+a storage or distribution medium does not bring the other work under
132
+the scope of this License.
133
+
134
+  3. You may copy and distribute the Program (or a work based on it,
135
+under Section 2) in object code or executable form under the terms of
136
+Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+    a) Accompany it with the complete corresponding machine-readable
139
+    source code, which must be distributed under the terms of Sections
140
+    1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+    b) Accompany it with a written offer, valid for at least three
143
+    years, to give any third party, for a charge no more than your
144
+    cost of physically performing source distribution, a complete
145
+    machine-readable copy of the corresponding source code, to be
146
+    distributed under the terms of Sections 1 and 2 above on a medium
147
+    customarily used for software interchange; or,
148
+
149
+    c) Accompany it with the information you received as to the offer
150
+    to distribute corresponding source code.  (This alternative is
151
+    allowed only for noncommercial distribution and only if you
152
+    received the program in object code or executable form with such
153
+    an offer, in accord with Subsection b above.)
154
+
155
+The source code for a work means the preferred form of the work for
156
+making modifications to it.  For an executable work, complete source
157
+code means all the source code for all modules it contains, plus any
158
+associated interface definition files, plus the scripts used to
159
+control compilation and installation of the executable.  However, as a
160
+special exception, the source code distributed need not include
161
+anything that is normally distributed (in either source or binary
162
+form) with the major components (compiler, kernel, and so on) of the
163
+operating system on which the executable runs, unless that component
164
+itself accompanies the executable.
165
+
166
+If distribution of executable or object code is made by offering
167
+access to copy from a designated place, then offering equivalent
168
+access to copy the source code from the same place counts as
169
+distribution of the source code, even though third parties are not
170
+compelled to copy the source along with the object code.
171
+
172
+  4. You may not copy, modify, sublicense, or distribute the Program
173
+except as expressly provided under this License.  Any attempt
174
+otherwise to copy, modify, sublicense or distribute the Program is
175
+void, and will automatically terminate your rights under this License.
176
+However, parties who have received copies, or rights, from you under
177
+this License will not have their licenses terminated so long as such
178
+parties remain in full compliance.
179
+
180
+  5. You are not required to accept this License, since you have not
181
+signed it.  However, nothing else grants you permission to modify or
182
+distribute the Program or its derivative works.  These actions are
183
+prohibited by law if you do not accept this License.  Therefore, by
184
+modifying or distributing the Program (or any work based on the
185
+Program), you indicate your acceptance of this License to do so, and
186
+all its terms and conditions for copying, distributing or modifying
187
+the Program or works based on it.
188
+
189
+  6. Each time you redistribute the Program (or any work based on the
190
+Program), the recipient automatically receives a license from the
191
+original licensor to copy, distribute or modify the Program subject to
192
+these terms and conditions.  You may not impose any further
193
+restrictions on the recipients' exercise of the rights granted herein.
194
+You are not responsible for enforcing compliance by third parties to
195
+this License.
196
+
197
+  7. If, as a consequence of a court judgment or allegation of patent
198
+infringement or for any other reason (not limited to patent issues),
199
+conditions are imposed on you (whether by court order, agreement or
200
+otherwise) that contradict the conditions of this License, they do not
201
+excuse you from the conditions of this License.  If you cannot
202
+distribute so as to satisfy simultaneously your obligations under this
203
+License and any other pertinent obligations, then as a consequence you
204
+may not distribute the Program at all.  For example, if a patent
205
+license would not permit royalty-free redistribution of the Program by
206
+all those who receive copies directly or indirectly through you, then
207
+the only way you could satisfy both it and this License would be to
208
+refrain entirely from distribution of the Program.
209
+
210
+If any portion of this section is held invalid or unenforceable under
211
+any particular circumstance, the balance of the section is intended to
212
+apply and the section as a whole is intended to apply in other
213
+circumstances.
214
+
215
+It is not the purpose of this section to induce you to infringe any
216
+patents or other property right claims or to contest validity of any
217
+such claims; this section has the sole purpose of protecting the
218
+integrity of the free software distribution system, which is
219
+implemented by public license practices.  Many people have made
220
+generous contributions to the wide range of software distributed
221
+through that system in reliance on consistent application of that
222
+system; it is up to the author/donor to decide if he or she is willing
223
+to distribute software through any other system and a licensee cannot
224
+impose that choice.
225
+
226
+This section is intended to make thoroughly clear what is believed to
227
+be a consequence of the rest of this License.
228
+
229
+  8. If the distribution and/or use of the Program is restricted in
230
+certain countries either by patents or by copyrighted interfaces, the
231
+original copyright holder who places the Program under this License
232
+may add an explicit geographical distribution limitation excluding
233
+those countries, so that distribution is permitted only in or among
234
+countries not thus excluded.  In such case, this License incorporates
235
+the limitation as if written in the body of this License.
236
+
237
+  9. The Free Software Foundation may publish revised and/or new versions
238
+of the General Public License from time to time.  Such new versions will
239
+be similar in spirit to the present version, but may differ in detail to
240
+address new problems or concerns.
241
+
242
+Each version is given a distinguishing version number.  If the Program
243
+specifies a version number of this License which applies to it and "any
244
+later version", you have the option of following the terms and conditions
245
+either of that version or of any later version published by the Free
246
+Software Foundation.  If the Program does not specify a version number of
247
+this License, you may choose any version ever published by the Free Software
248
+Foundation.
249
+
250
+  10. If you wish to incorporate parts of the Program into other free
251
+programs whose distribution conditions are different, write to the author
252
+to ask for permission.  For software which is copyrighted by the Free
253
+Software Foundation, write to the Free Software Foundation; we sometimes
254
+make exceptions for this.  Our decision will be guided by the two goals
255
+of preserving the free status of all derivatives of our free software and
256
+of promoting the sharing and reuse of software generally.
257
+
258
+			    NO WARRANTY
259
+
260
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
262
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
266
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
267
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+REPAIR OR CORRECTION.
269
+
270
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+POSSIBILITY OF SUCH DAMAGES.
279
+
280
+		     END OF TERMS AND CONDITIONS
281
+
282
+	    How to Apply These Terms to Your New Programs
283
+
284
+  If you develop a new program, and you want it to be of the greatest
285
+possible use to the public, the best way to achieve this is to make it
286
+free software which everyone can redistribute and change under these terms.
287
+
288
+  To do so, attach the following notices to the program.  It is safest
289
+to attach them to the start of each source file to most effectively
290
+convey the exclusion of warranty; and each file should have at least
291
+the "copyright" line and a pointer to where the full notice is found.
292
+
293
+    <one line to give the program's name and a brief idea of what it does.>
294
+    Copyright (C) <year>  <name of author>
295
+
296
+    This program is free software; you can redistribute it and/or modify
297
+    it under the terms of the GNU General Public License as published by
298
+    the Free Software Foundation; either version 2 of the License, or
299
+    (at your option) any later version.
300
+
301
+    This program is distributed in the hope that it will be useful,
302
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
304
+    GNU General Public License for more details.
305
+
306
+    You should have received a copy of the GNU General Public License
307
+    along with this program; if not, write to the Free Software
308
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
309
+
310
+
311
+Also add information on how to contact you by electronic and paper mail.
312
+
313
+If the program is interactive, make it output a short notice like this
314
+when it starts in an interactive mode:
315
+
316
+    Gnomovision version 69, Copyright (C) year name of author
317
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318
+    This is free software, and you are welcome to redistribute it
319
+    under certain conditions; type `show c' for details.
320
+
321
+The hypothetical commands `show w' and `show c' should show the appropriate
322
+parts of the General Public License.  Of course, the commands you use may
323
+be called something other than `show w' and `show c'; they could even be
324
+mouse-clicks or menu items--whatever suits your program.
325
+
326
+You should also get your employer (if you work as a programmer) or your
327
+school, if any, to sign a "copyright disclaimer" for the program, if
328
+necessary.  Here is a sample; alter the names:
329
+
330
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
332
+
333
+  <signature of Ty Coon>, 1 April 1989
334
+  Ty Coon, President of Vice
335
+
336
+This General Public License does not permit incorporating your program into
337
+proprietary programs.  If your program is a subroutine library, you may
338
+consider it more useful to permit linking proprietary applications with the
339
+library.  If this is what you want to do, use the GNU Library General
340
+Public License instead of this License.

+ 1
- 0
ChangeLog View File

@@ -0,0 +1 @@
1
+ 

+ 234
- 0
Doxyfile View File

@@ -0,0 +1,234 @@
1
+# Doxyfile 1.3.3-Gideon
2
+
3
+#---------------------------------------------------------------------------
4
+# Project related configuration options
5
+#---------------------------------------------------------------------------
6
+PROJECT_NAME           = kstreamripper.kdevelop
7
+PROJECT_NUMBER         = 0.1
8
+OUTPUT_DIRECTORY       = 
9
+OUTPUT_LANGUAGE        = English
10
+USE_WINDOWS_ENCODING   = NO
11
+BRIEF_MEMBER_DESC      = YES
12
+REPEAT_BRIEF           = YES
13
+ALWAYS_DETAILED_SEC    = NO
14
+INLINE_INHERITED_MEMB  = NO
15
+FULL_PATH_NAMES        = NO
16
+STRIP_FROM_PATH        = 
17
+SHORT_NAMES            = NO
18
+JAVADOC_AUTOBRIEF      = NO
19
+MULTILINE_CPP_IS_BRIEF = NO
20
+DETAILS_AT_TOP         = NO
21
+INHERIT_DOCS           = YES
22
+DISTRIBUTE_GROUP_DOC   = NO
23
+TAB_SIZE               = 8
24
+ALIASES                = 
25
+OPTIMIZE_OUTPUT_FOR_C  = NO
26
+OPTIMIZE_OUTPUT_JAVA   = NO
27
+SUBGROUPING            = YES
28
+#---------------------------------------------------------------------------
29
+# Build related configuration options
30
+#---------------------------------------------------------------------------
31
+EXTRACT_ALL            = NO
32
+EXTRACT_PRIVATE        = NO
33
+EXTRACT_STATIC         = NO
34
+EXTRACT_LOCAL_CLASSES  = YES
35
+HIDE_UNDOC_MEMBERS     = NO
36
+HIDE_UNDOC_CLASSES     = NO
37
+HIDE_FRIEND_COMPOUNDS  = NO
38
+HIDE_IN_BODY_DOCS      = NO
39
+INTERNAL_DOCS          = NO
40
+CASE_SENSE_NAMES       = YES
41
+HIDE_SCOPE_NAMES       = NO
42
+SHOW_INCLUDE_FILES     = YES
43
+INLINE_INFO            = YES
44
+SORT_MEMBER_DOCS       = YES
45
+GENERATE_TODOLIST      = YES
46
+GENERATE_TESTLIST      = YES
47
+GENERATE_BUGLIST       = YES
48
+GENERATE_DEPRECATEDLIST= YES
49
+ENABLED_SECTIONS       = 
50
+MAX_INITIALIZER_LINES  = 30
51
+SHOW_USED_FILES        = YES
52
+#---------------------------------------------------------------------------
53
+# configuration options related to warning and progress messages
54
+#---------------------------------------------------------------------------
55
+QUIET                  = NO
56
+WARNINGS               = YES
57
+WARN_IF_UNDOCUMENTED   = YES
58
+WARN_IF_DOC_ERROR      = YES
59
+WARN_FORMAT            = "$file:$line: $text"
60
+WARN_LOGFILE           = 
61
+#---------------------------------------------------------------------------
62
+# configuration options related to the input files
63
+#---------------------------------------------------------------------------
64
+INPUT                  = /home/tuxipuxi/Documents/cpp/kde/kstreamripper
65
+FILE_PATTERNS          = *.c \
66
+                         *.cc \
67
+                         *.cxx \
68
+                         *.cpp \
69
+                         *.c++ \
70
+                         *.java \
71
+                         *.ii \
72
+                         *.ixx \
73
+                         *.ipp \
74
+                         *.i++ \
75
+                         *.inl \
76
+                         *.h \
77
+                         *.hh \
78
+                         *.hxx \
79
+                         *.hpp \
80
+                         *.h++ \
81
+                         *.idl \
82
+                         *.odl \
83
+                         *.cs \
84
+                         *.php \
85
+                         *.php3 \
86
+                         *.inc \
87
+                         *.C \
88
+                         *.H \
89
+                         *.tlh \
90
+                         *.diff \
91
+                         *.patch \
92
+                         *.moc \
93
+                         *.xpm \
94
+                         *.dox
95
+RECURSIVE              = yes
96
+EXCLUDE                = 
97
+EXCLUDE_SYMLINKS       = NO
98
+EXCLUDE_PATTERNS       = 
99
+EXAMPLE_PATH           = 
100
+EXAMPLE_PATTERNS       = *
101
+EXAMPLE_RECURSIVE      = NO
102
+IMAGE_PATH             = 
103
+INPUT_FILTER           = 
104
+FILTER_SOURCE_FILES    = NO
105
+#---------------------------------------------------------------------------
106
+# configuration options related to source browsing
107
+#---------------------------------------------------------------------------
108
+SOURCE_BROWSER         = NO
109
+INLINE_SOURCES         = NO
110
+STRIP_CODE_COMMENTS    = YES
111
+REFERENCED_BY_RELATION = YES
112
+REFERENCES_RELATION    = YES
113
+VERBATIM_HEADERS       = YES
114
+#---------------------------------------------------------------------------
115
+# configuration options related to the alphabetical class index
116
+#---------------------------------------------------------------------------
117
+ALPHABETICAL_INDEX     = NO
118
+COLS_IN_ALPHA_INDEX    = 5
119
+IGNORE_PREFIX          = 
120
+#---------------------------------------------------------------------------
121
+# configuration options related to the HTML output
122
+#---------------------------------------------------------------------------
123
+GENERATE_HTML          = YES
124
+HTML_OUTPUT            = html
125
+HTML_FILE_EXTENSION    = .html
126
+HTML_HEADER            = 
127
+HTML_FOOTER            = 
128
+HTML_STYLESHEET        = 
129
+HTML_ALIGN_MEMBERS     = YES
130
+GENERATE_HTMLHELP      = NO
131
+CHM_FILE               = 
132
+HHC_LOCATION           = 
133
+GENERATE_CHI           = NO
134
+BINARY_TOC             = NO
135
+TOC_EXPAND             = NO
136
+DISABLE_INDEX          = NO
137
+ENUM_VALUES_PER_LINE   = 4
138
+GENERATE_TREEVIEW      = NO
139
+TREEVIEW_WIDTH         = 250
140
+#---------------------------------------------------------------------------
141
+# configuration options related to the LaTeX output
142
+#---------------------------------------------------------------------------
143
+GENERATE_LATEX         = YES
144
+LATEX_OUTPUT           = latex
145
+LATEX_CMD_NAME         = latex
146
+MAKEINDEX_CMD_NAME     = makeindex
147
+COMPACT_LATEX          = NO
148
+PAPER_TYPE             = a4wide
149
+EXTRA_PACKAGES         = 
150
+LATEX_HEADER           = 
151
+PDF_HYPERLINKS         = NO
152
+USE_PDFLATEX           = NO
153
+LATEX_BATCHMODE        = NO
154
+LATEX_HIDE_INDICES     = NO
155
+#---------------------------------------------------------------------------
156
+# configuration options related to the RTF output
157
+#---------------------------------------------------------------------------
158
+GENERATE_RTF           = NO
159
+RTF_OUTPUT             = rtf
160
+COMPACT_RTF            = NO
161
+RTF_HYPERLINKS         = NO
162
+RTF_STYLESHEET_FILE    = 
163
+RTF_EXTENSIONS_FILE    = 
164
+#---------------------------------------------------------------------------
165
+# configuration options related to the man page output
166
+#---------------------------------------------------------------------------
167
+GENERATE_MAN           = NO
168
+MAN_OUTPUT             = man
169
+MAN_EXTENSION          = .3
170
+MAN_LINKS              = NO
171
+#---------------------------------------------------------------------------
172
+# configuration options related to the XML output
173
+#---------------------------------------------------------------------------
174
+GENERATE_XML           = yes
175
+XML_OUTPUT             = xml
176
+XML_SCHEMA             = 
177
+XML_DTD                = 
178
+#---------------------------------------------------------------------------
179
+# configuration options for the AutoGen Definitions output
180
+#---------------------------------------------------------------------------
181
+GENERATE_AUTOGEN_DEF   = NO
182
+#---------------------------------------------------------------------------
183
+# configuration options related to the Perl module output
184
+#---------------------------------------------------------------------------
185
+GENERATE_PERLMOD       = NO
186
+PERLMOD_LATEX          = NO
187
+PERLMOD_PRETTY         = YES
188
+PERLMOD_MAKEVAR_PREFIX = 
189
+#---------------------------------------------------------------------------
190
+# Configuration options related to the preprocessor   
191
+#---------------------------------------------------------------------------
192
+ENABLE_PREPROCESSING   = YES
193
+MACRO_EXPANSION        = NO
194
+EXPAND_ONLY_PREDEF     = NO
195
+SEARCH_INCLUDES        = YES
196
+INCLUDE_PATH           = 
197
+INCLUDE_FILE_PATTERNS  = 
198
+PREDEFINED             = 
199
+EXPAND_AS_DEFINED      = 
200
+SKIP_FUNCTION_MACROS   = YES
201
+#---------------------------------------------------------------------------
202
+# Configuration::addtions related to external references   
203
+#---------------------------------------------------------------------------
204
+TAGFILES               = 
205
+GENERATE_TAGFILE       = 
206
+ALLEXTERNALS           = NO
207
+EXTERNAL_GROUPS        = YES
208
+PERL_PATH              = /usr/bin/perl
209
+#---------------------------------------------------------------------------
210
+# Configuration options related to the dot tool   
211
+#---------------------------------------------------------------------------
212
+CLASS_DIAGRAMS         = YES
213
+HIDE_UNDOC_RELATIONS   = YES
214
+HAVE_DOT               = NO
215
+CLASS_GRAPH            = YES
216
+COLLABORATION_GRAPH    = YES
217
+UML_LOOK               = NO
218
+TEMPLATE_RELATIONS     = NO
219
+INCLUDE_GRAPH          = YES
220
+INCLUDED_BY_GRAPH      = YES
221
+CALL_GRAPH             = NO
222
+GRAPHICAL_HIERARCHY    = YES
223
+DOT_IMAGE_FORMAT       = png
224
+DOT_PATH               = 
225
+DOTFILE_DIRS           = 
226
+MAX_DOT_GRAPH_WIDTH    = 1024
227
+MAX_DOT_GRAPH_HEIGHT   = 1024
228
+MAX_DOT_GRAPH_DEPTH    = 1000
229
+GENERATE_LEGEND        = YES
230
+DOT_CLEANUP            = YES
231
+#---------------------------------------------------------------------------
232
+# Configuration::addtions related to the search engine   
233
+#---------------------------------------------------------------------------
234
+SEARCHENGINE           = NO

+ 84
- 0
INSTALL View File

@@ -0,0 +1,84 @@
1
+sctest REQUIREMENTS
2
+------------------------
3
+
4
+kde >= 3.2 is needed to run sctest
5
+
6
+To compile sctest, the kde development packages
7
+are needed: kdelibs-devel, kdebase-devel and python
8
+
9
+scons is also needed http://www.scons.org
10
+(this tool also used by Blender, ..)
11
+Make sure scons is at least v0.96.1, otherwise
12
+the compilation will fail. In case if you do not have
13
+it, a minimum distribution is provided (see SCONS below)
14
+
15
+-> One should only have to run :
16
+$ scons
17
+# scons install
18
+(do "scons install" as root - the menus may not
19
+show up if you skip this step)
20
+
21
+
22
+SCONS
23
+-----
24
+
25
+-> If scons is missing, use the one bundled with PROGRAMNAME :
26
+./unpack_local_scons.sh
27
+python scons.py
28
+python scons.py install
29
+(run the last command as root)
30
+
31
+
32
+-> For your convenience, a quick makefile is created :
33
+./unpack_local_scons.sh
34
+make
35
+make install
36
+
37
+
38
+USEFUL SCONS COMMANDS
39
+---------------------
40
+
41
+build the targets   : scons
42
+install them        : scons install
43
+clean the project   : scons -c
44
+uninstall           : scons -c install
45
+build in parallel   : scons -j2
46
+
47
+CONFIGURATION NOTES
48
+-------------------
49
+
50
+The installation scripts are relying on the kde-config program.
51
+The programs kde-config, qmake, uic and moc must be accesssible
52
+through your PATH.
53
+
54
+Qt and kde may not be installed as expected (in QTDIR and KDEDIR)
55
+So until kde-config is able to give that information, you may
56
+have to give those paths.
57
+
58
+Here are some examples :
59
+On Fedora/Redhat
60
+   scons configure kdeincludes=/usr/include/kde/
61
+On Debian
62
+   scons configure qtincludes=/usr/include/qt/ kdeinclude=/usr/include/kde/
63
+To install in some particular location with additional include paths
64
+   scons configure prefix=~/tmp extraincludes=/tmp/include:/usr/local/include
65
+
66
+For more options to tune the build look at the .py files available on 
67
+the top-level directory :
68
+generic.py, kde.py, ...
69
+
70
+The build system is based on bksys, a build system that replaces
71
+autoconf, automake and make in a row. Feel free to report your opinion
72
+about it to the authors.
73
+
74
+BUILDING RPMS OR DEBS WITH CHECKINSTALL
75
+---------------------------------------
76
+
77
+With checkinstall 1.6, use
78
+$ scons
79
+# checkinstall --fstrans=no --nodoc scons install
80
+# scons uninstall
81
+
82
+---------------------------------------
83
+enjoy KStreamRipper
84
+Michael Goettsche

+ 20
- 0
Makefile View File

@@ -0,0 +1,20 @@
1
+all:
2
+	@/usr/bin/scons -Q
3
+
4
+# it is also possible to use
5
+# @/usr/bin/scons -Q -j4
6
+
7
+install:
8
+	@/usr/bin/scons -Q install
9
+
10
+clean:
11
+	@/usr/bin/scons -Q -c
12
+
13
+uninstall:
14
+	@/usr/bin/scons -Q -c install
15
+
16
+dist:
17
+	@/usr/bin/scons -Q dist
18
+
19
+distclean:
20
+	@/usr/bin/scons -Q distclean

+ 1
- 0
NEWS View File

@@ -0,0 +1 @@
1
+ 

+ 1
- 0
README View File

@@ -0,0 +1 @@
1
+see INSTALL

+ 234
- 0
SConstruct View File

@@ -0,0 +1,234 @@
1
+#! /usr/bin/env python
2
+## The kde detection is located in kde.py (have a look!)
3
+## Delete the comments following as you see it fit
4
+
5
+"""
6
+scons files are python scripts, comments begin by a "#" symbol
7
+or are enclosed between sequences of triple quotes, so 
8
+this is a comment :)
9
+
10
+There is a lot of documentation and comments, but you can
11
+remove them when you convert your program
12
+"""
13
+
14
+"""
15
+----------------------------------
16
+How to enjoy bksys full and plenty
17
+(and forget about the autohell ? :)
18
+-----------------------------------
19
+
20
+The program scons is usually launched as "scons"
21
+When it is not intalled globally, one can run
22
+"python scons.py" instead (ie : to use the local scons 
23
+that comes with bksys - try ./unpack_local_scons.sh)
24
+
25
+To compile the project, you will then only need to launch
26
+scons on the top-level directory, the scripts find and
27
+cache the proper environment automatically :
28
+-> scons
29
+(or python scons.py)
30
+
31
+To clean the project
32
+-> scons -c
33
+(or python scons.py -c)
34
+
35
+To install the project
36
+-> scons install
37
+(or python scons.py scons install)
38
+
39
+To uninstall the project
40
+-> scons -c install
41
+
42
+To compile while being in a subdirectory
43
+-> cd src; scons -u
44
+
45
+To (re)configure the project and give particular arguments, use ie :
46
+-> scons configure debug=1
47
+-> scons configure prefix=/tmp/ita debug=full extraincludes=/usr/local/include:/tmp/include prefix=/usr/local
48
+or -> python scons.py configure debug=1
49
+etc ..
50
+The variables are saved automatically after the first run
51
+(look at kde.cache.py, ..)
52
+
53
+Here is a quick list of options used (look at generic.py and kde.py) :
54
+prefix
55
+exec_prefix
56
+datadir
57
+libdir
58
+kdeincludes
59
+qtincludes
60
+kdelibs
61
+qtlibs
62
+extraincludes (a list of paths separated by ':')
63
+
64
+"""
65
+
66
+###########################################
67
+## Common section, for loading the tools
68
+
69
+## Load the builders in config
70
+env = Environment(TARGS=COMMAND_LINE_TARGETS, ARGS=ARGUMENTS, tools=['default', 'generic', 'kde'], toolpath=['./', './admin'])
71
+#env = Environment(TARGS=COMMAND_LINE_TARGETS, ARGS=ARGUMENTS, tools=['default', 'generic', 'kde', 'cg'], toolpath=['./'])
72
+#env = Environment(TARGS=COMMAND_LINE_TARGETS, ARGS=ARGUMENTS, tools=['default', 'generic', 'kde', 'sound'], toolpath=['./'])
73
+#env = Environment(TARGS=COMMAND_LINE_TARGETS, ARGS=ARGUMENTS, tools=['default', 'generic', 'kde', 'libxml'], toolpath=['./'])
74
+
75
+## the configuration should be done by now, quit
76
+if 'configure' in COMMAND_LINE_TARGETS:
77
+	env.Exit(0)
78
+
79
+"""
80
+Overview of the module system :
81
+
82
+Each module (kde.py, generic.py, sound.py..) tries to load a stored 
83
+configuration when run. If the stored configuration does not exist
84
+or if 'configure' is given on the command line (scons configure), 
85
+the module launches the verifications and detectioins and stores 
86
+the results. Modules also call exit when the detection fail.
87
+
88
+For example, kde.py stores its config into kde.cache.py
89
+
90
+This has several advantages for both developers and users :
91
+  - Users do not have to run ./configure to compile
92
+  - The build is insensitive to environment changes
93
+  - The cache maintains the objects so the config can be changed often
94
+  - Each module adds its own help via env.Help("message")
95
+"""
96
+
97
+## Use the variables available in the environment - unsafe, but moc, meinproc need it :-/
98
+import os
99
+env.AppendUnique( ENV = os.environ )
100
+
101
+## The target make dist requires the python module shutil which is in 2.3
102
+env.EnsurePythonVersion(2, 3)
103
+
104
+## Bksys requires scons 0.96
105
+env.EnsureSConsVersion(0, 96)
106
+
107
+"""
108
+Explanation of the 'env = Environment...' line :
109
+* the command line arguments and targets are stored in env['TARGS'] and env['ARGS'] for use by the tools
110
+* the part 'tools=['default', 'generic ..' detect and load the necessary functions for doing the things
111
+* the part "toolpath=['./']" tells that the tools can be found in the current directory (generic.py, kde.py ..)
112
+"""
113
+
114
+"""
115
+To load more configuration modules one should only have to add the appropriate tool
116
+ie: to detect alsa and add the proper cflags, ldflags .. 
117
+    a file alsa.py file will be needed, and one should then use :
118
+    env = Environment(TARGS=COMMAND_LINE_TARGETS, ARGS=ARGUMENTS, tools=['default', 'generic', 'kde', 'alsa'], toolpath=['./'])
119
+
120
+You can also load environments that are targetted to different platforms
121
+ie: if os.sys.platform = "darwin":
122
+	env = Environment(...
123
+    elsif os.sys.platform = "linux":
124
+	env = Environment(...
125
+
126
+"""
127
+
128
+## Setup the cache directory - this avoids recompiling the same files over and over again
129
+## this is very handy when working with cvs
130
+env.CacheDir('cache')
131
+
132
+## Avoid spreading .sconsign files everywhere - keep this line
133
+env.SConsignFile('scons_signatures')
134
+
135
+## If you need more libs and they rely on pkg-config
136
+## ie: add support for GTK (source: the scons wiki on www.scons.org)
137
+# env.ParseConfig('pkg-config --cflags --libs gtk+-2.0')
138
+
139
+"""
140
+This tell scons that there are no rcs or sccs files - this trick 
141
+can speed up things a bit when having lots of #include
142
+in the source code and for network file systems
143
+"""
144
+env.SourceCode(".", None)
145
+
146
+dirs = [ '.', 'src', 'po', 'doc']
147
+
148
+for dir in dirs:
149
+	env.SourceCode(dir, None)
150
+
151
+## If we had only one program (named kvigor) to build, 
152
+## we could add before exporting the env (some kde 
153
+## helpers in kde.py need it) :
154
+# env['APPNAME'] = 'kvigor'
155
+
156
+## Use this define if you are using the kde translation scheme (.po files)
157
+env.Append( CPPFLAGS = ['-DQT_NO_TRANSLATION'] )
158
+
159
+## Add this define if you want to use qthreads
160
+#env.Append( CPPFLAGS = ['-DQT_THREAD_SUPPORT', '-D_REENTRANT'] )
161
+
162
+## To use kdDebug(intvalue)<<"some trace"<<endl; you need to define -DDEBUG - it is done
163
+## in generic.py automatically when you do scons configure debug=1
164
+
165
+## There are also many other defines :
166
+### -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION
167
+# where are they documented ? if you know, mail tnagyemail-mail@yahoo@fr please
168
+
169
+## Important : export the environment so that SConscript files can the 
170
+## configuration and builders in it
171
+Export("env")
172
+
173
+
174
+####################################################
175
+## Process the SConscript files to build the targets
176
+## the sconscript files are comparable to Makefile.am_s
177
+## except that no makefile is generated here :)
178
+
179
+env.SConscript("src/SConscript")
180
+env.SConscript("doc/SConscript")
181
+env.SConscript("po/SConscript")
182
+
183
+####################################################
184
+## Quick helper to distribute the program
185
+
186
+"""
187
+'scons dist' creates a tarball named bksys-version.tar.bz2 
188
+containing the source code - this is handy
189
+do not forget to remove the object files by scons -c
190
+"""
191
+
192
+### To make a tarball of your sctest
193
+if 'dist' in COMMAND_LINE_TARGETS:
194
+
195
+        APPNAME = 'sctest'
196
+        VERSION = os.popen("cat VERSION").read().rstrip()
197
+        FOLDER  = APPNAME+'-'+VERSION
198
+        ARCHIVE = FOLDER+'.tar.bz2'
199
+
200
+        GREEN  ="\033[92m"
201
+        NORMAL ="\033[0m"
202
+
203
+        import shutil
204
+        import glob
205
+
206
+        ## check if the temporary directory already exists
207
+        if os.path.isdir(FOLDER):
208
+                shutil.rmtree(FOLDER)
209
+
210
+        ## create a temporary directory
211
+        startdir = os.getcwd()
212
+        shutil.copytree(startdir, FOLDER)
213
+
214
+        ## remove the unnecessary files
215
+        os.popen("find "+FOLDER+" -name \"{arch}\" | xargs rm -rf")
216
+        os.popen("find "+FOLDER+" -name \".arch-ids\" | xargs rm -rf")
217
+        os.popen("find "+FOLDER+" -name \".arch-inventory\" | xargs rm -f")
218
+        os.popen("find "+FOLDER+" -name \"sconsign*\" | xargs rm -f")
219
+        os.popen("find "+FOLDER+" -name \"*cache*\" | xargs rm -rf")
220
+        os.popen("find "+FOLDER+" -name \"kdiss*-data\" | xargs rm -rf")
221
+        os.popen("find "+FOLDER+" -name \"*.pyc\" | xargs rm -f")
222
+        os.popen("rm -f "+FOLDER+"/config.py*")
223
+
224
+        ## make the tarball
225
+        print GREEN+"Writing archive "+ARCHIVE+NORMAL
226
+        os.popen("tar cjf "+ARCHIVE+" "+FOLDER)
227
+
228
+        ## remove the temporary directory
229
+        if os.path.isdir(FOLDER):
230
+                shutil.rmtree(FOLDER)
231
+
232
+        env.Default(None)
233
+        env.Exit(0)
234
+

+ 7
- 0
TODO View File

@@ -0,0 +1,7 @@
1
+--TODO--
2
+
3
+-implement stats widget
4
+-implement filtering( just ripping a special artist/song )
5
+-(receiving shoutcast list via web)
6
+
7
+ 

+ 161
- 0
admin/generic.py View File

@@ -0,0 +1,161 @@
1
+## Thomas Nagy, 2005
2
+
3
+"""
4
+Detect and store the most common options
5
+* kdecxxflags  : debug=1 (-g) or debug=full (-g3, slower)
6
+  else use the user CXXFLAGS if any, - or -O2 by default
7
+* prefix : the installation path
8
+* extraincludes : a list of paths separated by ':'
9
+ie: scons configure debug=full prefix=/usr/local extraincludes=/tmp/include:/usr/local
10
+"""
11
+
12
+BOLD   ="\033[1m"
13
+RED    ="\033[91m"
14
+GREEN  ="\033[92m"
15
+YELLOW ="\033[1m" #"\033[93m" # unreadable on white backgrounds
16
+CYAN   ="\033[96m"
17
+NORMAL ="\033[0m"
18
+
19
+import os
20
+
21
+def exists(env):
22
+	return true
23
+
24
+def generate(env):
25
+	env.Help("""
26
+"""+BOLD+
27
+"""*** Generic options ***
28
+-----------------------"""+NORMAL+"""
29
+"""+BOLD+"""* debug  """+NORMAL+""": debug=1 (-g) or debug=full (-g3, slower) else use environment CXXFLAGS, or -O2 by default
30
+"""+BOLD+"""* prefix """+NORMAL+""": the installation path
31
+"""+BOLD+"""* extraincludes """+NORMAL+""": a list of paths separated by ':'
32
+ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/include:/usr/local
33
+"""+NORMAL)
34
+
35
+	## Bksys requires scons 0.96
36
+	env.EnsureSConsVersion(0, 96)
37
+	
38
+	## Global cache directory
39
+	## Put all project files in it so a rm -rf cache will clean up the config
40
+	if not env.has_key('CACHEDIR'):
41
+		env['CACHEDIR'] = os.getcwd()+'/cache/'
42
+	if not os.path.isdir(env['CACHEDIR']):
43
+		os.mkdir(env['CACHEDIR'])
44
+	
45
+	## SCons cache directory
46
+	## this avoids recompiling the same files over and over again: very handy when working with cvs
47
+	env.CacheDir(os.getcwd()+'/cache/objects')
48
+
49
+	## Avoid spreading .sconsign files everywhere - keep this line
50
+	env.SConsignFile(env['CACHEDIR']+'/scons_signatures')
51
+	
52
+	# Special trick for installing rpms ...
53
+	env['DESTDIR']=''
54
+	if 'install' in env['TARGS'] and os.environ.has_key('DESTDIR'):
55
+		env['DESTDIR']=os.environ['DESTDIR']+'/'
56
+		print CYAN+'** Enabling DESTDIR for the project ** ' + NORMAL + env['DESTDIR']
57
+
58
+	# load the options
59
+	from SCons.Options import Options, PathOption
60
+	cachefile=env['CACHEDIR']+'generic.cache.py'
61
+	opts = Options(cachefile)
62
+	opts.AddOptions(
63
+		( 'KDECCFLAGS', 'C flags' ),
64
+		( 'KDECXXFLAGS', 'debug level for the project : full or just anything' ),
65
+		( 'KDELINKFLAGS', 'additional link flags' ),
66
+		( 'PREFIX', 'prefix for installation' ),
67
+		( 'EXTRAINCLUDES', 'extra include paths for the project' ),
68
+		( 'ISCONFIGURED', 'is the project configured' ),
69
+	)
70
+	opts.Update(env)
71
+	
72
+	# use this to avoid an error message 'how to make target configure ?'
73
+	env.Alias('configure', None)
74
+
75
+	import SCons.Util
76
+
77
+	# configure the environment if needed
78
+	if 'configure' in env['TARGS'] or not env.has_key('ISCONFIGURED'):
79
+		# be paranoid, unset existing variables
80
+		if env.has_key('KDECXXFLAGS'):
81
+			env.__delitem__('KDECXXFLAGS')
82
+		if env.has_key('KDECCFLAGS'):
83
+			env.__delitem__('KDECCFLAGS')
84
+		if env.has_key('KDELINKFLAGS'):
85
+			env.__delitem__('KDELINKFLAGS')
86
+		if env.has_key('PREFIX'):
87
+			env.__delitem__('PREFIX')
88
+		if env.has_key('EXTRAINCLUDES'):
89
+			env.__delitem__('EXTRAINCLUDES')
90
+		if env.has_key('ISCONFIGURED'):
91
+			env.__delitem__('ISCONFIGURED')
92
+
93
+		if env['ARGS'].get('debug', None):
94
+			debuglevel = env['ARGS'].get('debug', None)
95
+			print CYAN+'** Enabling debug for the project **' + NORMAL
96
+			if (debuglevel == "full"):
97
+				env['KDECXXFLAGS'] = ['-DDEBUG', '-g3']
98
+			else:
99
+				env['KDECXXFLAGS'] = ['-DDEBUG', '-g']
100
+		else:
101
+			if os.environ.has_key('CXXFLAGS'):
102
+				# user-defined flags (gentooers will be elighted)
103
+				env['KDECXXFLAGS'] = SCons.Util.CLVar( os.environ['CXXFLAGS'] )
104
+				env.Append( KDECXXFLAGS = ['-DNDEBUG', '-DNO_DEBUG'] )
105
+			else:
106
+				env.Append(KDECXXFLAGS = ['-O2', '-DNDEBUG', '-DNO_DEBUG'])
107
+
108
+		if os.environ.has_key('CFLAGS'):
109
+			env['KDECCFLAGS'] = SCons.Util.CLVar( os.environ['CFLAGS'] )
110
+
111
+		## FreeBSD settings (contributed by will at freebsd dot org)
112
+		if os.uname()[0] == "FreeBSD":
113
+		        if os.environ.has_key('PTHREAD_LIBS'):
114
+		                env.AppendUnique( KDELINKFLAGS = SCons.Util.CLVar( os.environ['PTHREAD_LIBS'] ) )
115
+		        else:
116
+		                syspf = os.popen('/sbin/sysctl kern.osreldate')
117
+		                osreldate = int(syspf.read().split()[1])
118
+		                syspf.close()
119
+		                if osreldate < 500016:
120
+		                        env.AppendUnique( KDELINKFLAGS = ['-pthread'])
121
+		                        env.AppendUnique( KDECXXFLAGS = ['-D_THREAD_SAFE'])
122
+		                elif osreldate < 502102:
123
+		                        env.AppendUnique( KDELINKFLAGS = ['-lc_r'])
124
+		                        env.AppendUnique( KDECXXFLAGS = ['-D_THREAD_SAFE'])
125
+		                else:
126
+		                        env.AppendUnique( KDELINKFLAGS = ['-pthread'])
127
+
128
+		# User-specified prefix
129
+		if env['ARGS'].get('prefix', None):
130
+			env['PREFIX'] = env['ARGS'].get('prefix', None)
131
+			print CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL
132
+		elif env.has_key('PREFIX'):
133
+			env.__delitem__('PREFIX')
134
+
135
+		# User-specified include paths
136
+		env['EXTRAINCLUDES'] = env['ARGS'].get('extraincludes', None)
137
+		if env['ARGS'].get('extraincludes', None):
138
+			print CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL
139
+		elif env.has_key('EXTRAINCLUDES'):
140
+			env.__delitem__('EXTRAINCLUDES')
141
+
142
+		env['ISCONFIGURED']=1
143
+
144
+		# And finally save the options in the cache
145
+		opts.Save(cachefile, env)
146
+
147
+	if env.has_key('KDECXXFLAGS'):
148
+                env.AppendUnique( CPPFLAGS = env['KDECXXFLAGS'] )
149
+
150
+	if env.has_key('KDECCFLAGS'):
151
+		env.AppendUnique( CCFLAGS = env['KDECCFLAGS'] )
152
+
153
+	if env.has_key('KDELINKFLAGS'):
154
+		env.AppendUnique( LINKFLAGS = env['KDELINKFLAGS'] )
155
+
156
+	if env.has_key('EXTRAINCLUDES'):
157
+		incpaths = []
158
+		for dir in str(env['EXTRAINCLUDES']).split(':'):
159
+			incpaths.append( dir )
160
+		env.Append(CPPPATH = incpaths)
161
+

+ 683
- 0
admin/kde.py View File

@@ -0,0 +1,683 @@
1
+#! /usr/bin/env python
2
+# more or less derived from scons qt.py
3
+# this version makes less scans over the data and is thus faster
4
+# it is less accurate however (when mocable classes become unmocable)
5
+# Thomas Nagy, 2004, 2005 <tnagy2^8@yahoo.fr>
6
+
7
+from time import *
8
+import SCons.Util
9
+import string
10
+
11
+import os, re
12
+
13
+BOLD   ="\033[1m"
14
+RED    ="\033[91m"
15
+GREEN  ="\033[92m"
16
+YELLOW ="\033[1m" #"\033[93m" # unreadable on white backgrounds
17
+CYAN   ="\033[96m"
18
+NORMAL ="\033[0m"
19
+
20
+# Returns the name of the shared object (i.e. libkdeui.so.4)
21
+# referenced by a libtool archive (like libkdeui.la)
22
+def getSOfromLA(lafile):
23
+        contents = open(lafile, 'r').read()
24
+        match = re.search("^dlname='([^']*)'$", contents, re.M)
25
+        if match:
26
+                return match.group(1)
27
+        return None
28
+
29
+def exists(env):
30
+	return True
31
+
32
+def detect_kde(env):
33
+	""" Detect the qt and kde environment using kde-config mostly """
34
+
35
+	prefix     = env['ARGS'].get('prefix', None)
36
+	execprefix = env['ARGS'].get('execprefix', None)
37
+	datadir    = env['ARGS'].get('datadir', None)
38
+	libdir     = env['ARGS'].get('libdir', None)
39
+	kdeincludes= env['ARGS'].get('kdeincludes', None)
40
+	kdelibs    = env['ARGS'].get('kdelibs', None)
41
+	qtincludes = env['ARGS'].get('qtincludes', None)
42
+	qtlibs     = env['ARGS'].get('qtlibs', None)
43
+
44
+	## Detect the kde libraries
45
+	print "Checking for kde-config           : ",
46
+	kde_config = os.popen("which kde-config 2>/dev/null").read().strip()
47
+	if len(kde_config):
48
+		print GREEN + "kde-config was found" + NORMAL
49
+	else:
50
+		print RED + "kde-config was NOT found in your PATH"+ NORMAL
51
+		print "Make sure kde is installed properly"
52
+		print "(missing package kdebase-devel?)"
53
+		env.Exit(1)
54
+	env['KDEDIR'] = os.popen('kde-config -prefix').read().strip()
55
+
56
+	print "Checking for kde version          : ",
57
+	kde_version = os.popen("kde-config --version|grep KDE").read().strip().split()[1]
58
+	if int(kde_version[0]) != 3 or int(kde_version[2]) < 2:
59
+		print RED + kde_version
60
+		print RED + "Your kde version can be too old" + NORMAL
61
+		print RED + "Please make sure kde is at least 3.2" + NORMAL
62
+	else:
63
+		print GREEN + kde_version + NORMAL
64
+
65
+	## Detect the qt library
66
+	print "Checking for the qt library       : ",
67
+	qtdir = os.getenv("QTDIR")
68
+	if qtdir:
69
+		print GREEN + "qt is in " + qtdir + NORMAL
70
+	else:
71
+		libdir = os.popen('kde-config --expandvars --install lib').read().strip()
72
+		libkdeuiSO = libdir+'/'+getSOfromLA(libdir+'/libkdeui.la')
73
+		m = re.search('(.*)/lib/libqt.*', os.popen('ldd '+libkdeuiSO+' | grep libqt').read().strip().split()[2])
74
+		if m:
75
+			qtdir = m.group(1)
76
+			print YELLOW+"qt was found as " + m.group(1) + NORMAL
77
+		else:
78
+			print RED+"qt was not found"+NORMAL
79
+			print RED+"Please set QTDIR first (/usr/lib/qt3?)"+NORMAL
80
+			env.Exit(1)
81
+	env['QTDIR'] = qtdir.strip()
82
+
83
+	## Find the necessary programs uic and moc
84
+	print "Checking for uic                  : ",
85
+	uic = qtdir + "/bin/uic"
86
+	if os.path.isfile(uic):
87
+		print GREEN+"uic was found as "+uic+NORMAL
88
+	else:
89
+		uic = os.popen("which uic 2>/dev/null").read().strip()
90
+		if len(uic):
91
+			print YELLOW+"uic was found as "+uic+NORMAL
92
+		else:
93
+			uic = os.popen("which uic 2>/dev/null").read().strip()
94
+			if len(uic):
95
+				print YELLOW+"uic was found as "+uic+NORMAL
96
+			else:
97
+				print RED+"uic was not found - set QTDIR put it in your PATH ?"+NORMAL
98
+				env.Exit(1)
99
+	env['QT_UIC'] = uic
100
+
101
+	print "Checking for moc                  : ",
102
+	moc = qtdir + "/bin/moc"
103
+	if os.path.isfile(moc):
104
+		print GREEN+"moc was found as "+moc+NORMAL
105
+	else:
106
+		moc = os.popen("which moc 2>/dev/null").read().strip()
107
+		if len(moc):
108
+			print YELLOW+"moc was found as "+moc+NORMAL
109
+		elif os.path.isfile("/usr/share/qt3/bin/moc"):
110
+			moc = "/usr/share/qt3/bin/moc"
111
+			print YELLOW+"moc was found as "+moc+NORMAL
112
+		else:
113
+			print RED+"moc was not found - set QTDIR or put it in your PATH ?"+NORMAL
114
+			env.Exit(1)
115
+	env['QT_MOC'] = moc
116
+
117
+	## check for the qt and kde includes
118
+	print "Checking for the qt includes      : ",
119
+	if qtincludes and os.path.isfile(qtincludes + "/qlayout.h"):
120
+		# The user told where to look for and it looks valid
121
+		print GREEN+"ok "+qtincludes+NORMAL
122
+	else:
123
+		if os.path.isfile(qtdir + "/include/qlayout.h"):
124
+			# Automatic detection
125
+			print GREEN+"ok "+qtdir + "/include/ "+NORMAL
126
+			qtincludes = qtdir + "/include/"
127
+		elif os.path.isfile("/usr/include/qt3/qlayout.h"):
128
+			# Debian probably
129
+			print YELLOW+"the qt headers were found in /usr/include/qt3/ "+NORMAL
130
+			qtincludes = "/usr/include/qt3"
131
+		else:
132
+			print RED+"the qt headers were not found"+NORMAL
133
+			env.Exit(1)
134
+
135
+	print "Checking for the kde includes     : ",
136
+	kdeprefix = os.popen("kde-config --prefix").read().strip()
137
+	if not kdeincludes:
138
+		kdeincludes = kdeprefix+"/include/"
139
+	if os.path.isfile(kdeincludes + "/klineedit.h"):
140
+		print GREEN+"ok "+kdeincludes+NORMAL
141
+	else:
142
+		if os.path.isfile(kdeprefix+"/include/kde/klineedit.h"):
143
+			# Debian, Fedora probably
144
+			print YELLOW+"the kde headers were found in "+kdeprefix+"/include/kde/"+NORMAL
145
+			kdeincludes = kdeprefix + "/include/kde/"
146
+		else:
147
+			print RED+"The kde includes were NOT found"+NORMAL
148
+			env.Exit(1)
149
+
150
+	if prefix:
151
+		## use the user-specified prefix
152
+		if not execprefix:
153
+			execprefix = prefix
154
+		if not datadir:
155
+			datadir = prefix+"/share"
156
+		if not libdir:
157
+			libdir = execprefix+"/lib"
158
+
159
+		subst_vars = lambda x: x.replace('${exec_prefix}',execprefix).replace('${datadir}',datadir).replace('${libdir}',libdir)
160
+		env['KDEBIN']   = subst_vars(os.popen('kde-config --install exe').read().strip())
161
+		env['KDEAPPS']  = subst_vars(os.popen('kde-config --install apps').read().strip())		
162
+		env['KDEDATA']  = subst_vars(os.popen('kde-config --install data').read().strip())
163
+		env['KDEMODULE']= subst_vars(os.popen('kde-config --install module').read().strip())
164
+		env['KDELOCALE']= subst_vars(os.popen('kde-config --install locale').read().strip())
165
+		env['KDEDOC']   = subst_vars(os.popen('kde-config --install html').read().strip())
166
+		env['KDEKCFG']  = subst_vars(os.popen('kde-config --install kcfg').read().strip())
167
+		env['KDEXDG']   = subst_vars(os.popen('kde-config --install xdgdata-apps').read().strip())
168
+		env['KDEMENU']  = subst_vars(os.popen('kde-config --install apps').read().strip())
169
+		env['KDEMIME']  = subst_vars(os.popen('kde-config --install mime').read().strip())
170
+		env['KDEICONS'] = subst_vars(os.popen('kde-config --install icon').read().strip())
171
+		env['KDESERV']  = subst_vars(os.popen('kde-config --install services').read().strip())
172
+	else:
173
+		# the user has given no prefix, install as a normal kde app
174
+		env['PREFIX'] = os.popen('kde-config --prefix').read().strip()
175
+		env['KDEBIN']   = os.popen('kde-config --expandvars --install exe').read().strip()
176
+		env['KDEAPPS']  = os.popen('kde-config --expandvars --install apps').read().strip()
177
+		env['KDEDATA']  = os.popen('kde-config --expandvars --install data').read().strip()
178
+		env['KDEMODULE']= os.popen('kde-config --expandvars --install module').read().strip()
179
+		env['KDELOCALE']= os.popen('kde-config --expandvars --install locale').read().strip()
180
+		env['KDEDOC']   = os.popen('kde-config --expandvars --install html').read().strip()
181
+		env['KDEKCFG']  = os.popen('kde-config --expandvars --install kcfg').read().strip()
182
+		env['KDEXDG']   = os.popen('kde-config --expandvars --install xdgdata-apps').read().strip()
183
+		env['KDEMENU']  = os.popen('kde-config --expandvars --install apps').read().strip()
184
+		env['KDEMIME']  = os.popen('kde-config --expandvars --install mime').read().strip()
185
+		env['KDEICONS'] = os.popen('kde-config --expandvars --install icon').read().strip()
186
+		env['KDESERV']  = os.popen('kde-config --expandvars --install services').read().strip()
187
+
188
+	env['QTPLUGINS']=os.popen('kde-config --expandvars --install qtplugins').read().strip()
189
+
190
+	## kde libs and includes
191
+	env['KDEINCLUDEPATH']= kdeincludes
192
+	if not kdelibs:
193
+		kdelibs = os.popen('kde-config --expandvars --install lib').read().strip()
194
+	env['KDELIBPATH']= kdelibs
195
+
196
+	## qt libs and includes
197
+	env['QTINCLUDEPATH']= qtincludes
198
+	if not qtlibs:
199
+		qtlibs = qtdir+"/lib"
200
+	env['QTLIBPATH']= qtlibs
201
+
202
+def mocscan(target, source, env):
203
+	splitext = SCons.Util.splitext
204
+
205
+	q_object_search = re.compile(r'[^A-Za-z0-9]Q_OBJECT[^A-Za-z0-9]')
206
+
207
+	for obj in source:
208
+
209
+		if not obj.has_builder():
210
+			# binary obj file provided
211
+			continue
212
+
213
+		cpp = obj.sources[0]
214
+		if not splitext(str(cpp))[1] == '.cpp':
215
+			# not a cplusplus source
216
+			continue
217
+
218
+		# if we have a .ui file, it is automatically handled by Uic
219
+		uiname = string.split(cpp.abspath, '.cpp')[0] + ".ui"
220
+		if os.path.isfile(uiname):
221
+			continue
222
+
223
+                hname = splitext(cpp.name)[0] + ".h"
224
+		h = SCons.Node.FS.find_file(hname, (cpp.get_dir(),) )
225
+
226
+		if h:
227
+			# h file with the Q_OBJECT macro found -> add .moc file
228
+			mocfile = string.split(cpp.abspath, '.cpp')[0] + ".moc"
229
+			# trick : check if the moc file already exists (avoid a scan)
230
+			if os.path.isfile(mocfile):
231
+				env.Moc(h)
232
+			elif q_object_search.search(h.get_contents()):
233
+				# FIXME : strong assumption
234
+				env.Moc(h)
235
+
236
+	return (target, source)
237
+
238
+def generate(env):
239
+
240
+	import SCons.Defaults
241
+	import SCons.Tool
242
+	env.Help("""
243
+"""+BOLD+
244
+"""*** KDE options ***
245
+-------------------"""+NORMAL+"""
246
+"""+BOLD+"""* prefix     """+NORMAL+""": base install path,         ie: /usr/local
247
+"""+BOLD+"""* execprefix """+NORMAL+""": install path for binaries, ie: /usr/bin
248
+"""+BOLD+"""* datadir    """+NORMAL+""": install path for the data, ie: /usr/local/share
249
+"""+BOLD+"""* libdir     """+NORMAL+""": install path for the libs, ie: /usr/lib
250
+"""+BOLD+"""* kdeincludes"""+NORMAL+""": path to the kde includes (/usr/include/kde on debian, ...)
251
+"""+BOLD+"""* qtincludes """+NORMAL+""": same punishment, for qt includes (/usr/include/qt on debian, ...)
252
+"""+BOLD+"""* kdelibs    """+NORMAL+""": path to the kde libs, for linking the programs
253
+"""+BOLD+"""* qtlibs     """+NORMAL+""": same punishment, for qt libraries
254
+ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
255
+"""+NORMAL)
256
+	
257
+	CLVar = SCons.Util.CLVar
258
+	splitext = SCons.Util.splitext
259
+	Builder = SCons.Builder.Builder
260
+	
261
+	# Detect the environment - replaces ./configure implicitely
262
+	# and store the options into a cache
263
+	from SCons.Options import Options
264
+	cachefile=env['CACHEDIR']+'/kde.cache.py'
265
+	opts = Options(cachefile)
266
+	opts.AddOptions(
267
+		( 'QTDIR', 'root of qt directory' ),
268
+		( 'QTLIBPATH', 'path to the qt libraries' ),
269
+		( 'QTINCLUDEPATH', 'path to the qt includes' ),
270
+		( 'QT_UIC', 'moc directory'),
271
+		( 'QT_MOC', 'moc executable command'),
272
+		( 'QTPLUGINS', 'uic executable command'),
273
+		( 'KDEDIR', 'root of kde directory' ),
274
+		( 'KDELIBPATH', 'path to the kde libs' ),
275
+		( 'KDEINCLUDEPATH', 'path to the kde includes' ),
276
+
277
+		( 'PREFIX', 'root of the program installation'),
278
+
279
+		( 'KDEBIN', 'installation path of the kde binaries'),
280
+		( 'KDEMODULE', 'installation path of the parts and libs'),
281
+		( 'KDEAPPS', ''),
282
+		( 'KDEDATA', 'installation path of the application data'),
283
+		( 'KDELOCALE', ''),
284
+		( 'KDEDOC', 'installation path of the application documentation'),
285
+		( 'KDEKCFG', 'installation path of the .kcfg files'),
286
+		( 'KDEXDG', 'installation path of the service types'),
287
+		( 'KDEMENU', ''),
288
+		( 'KDEMIME', 'installation path of to the mimetypes'),
289
+		( 'KDEICONS', ''),
290
+		( 'KDESERV', ''),
291
+	)
292
+	opts.Update(env)
293
+
294
+	# reconfigure when things are missing
295
+	if 'configure' in env['TARGS'] or not env.has_key('QTDIR') or not env.has_key('KDEDIR'):
296
+		detect_kde(env)
297
+
298
+	# finally save the configuration
299
+	opts.Save(cachefile, env)
300
+
301
+	## set default variables, one can override them in sconscript files
302
+	env.Append(CXXFLAGS = ['-I'+env['KDEINCLUDEPATH'], '-I'+env['QTINCLUDEPATH'] ])
303
+	env.Append(LIBPATH = [env['KDELIBPATH'], env['QTLIBPATH'] ])
304
+	
305
+	env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
306
+	
307
+	env['QT_AUTOSCAN']     = 1
308
+	env['QT_DEBUG']        = 0
309
+	
310
+	env['QT_UIC_HFLAGS']   = '-L $QTPLUGINS -nounload'
311
+	env['QT_UIC_CFLAGS']   = '$QT_UIC_HFLAGS -tr tr2i18n'
312
+	env['QT_LIBS']         = 'qt-mt'
313
+	
314
+	env['LIBTOOL_FLAGS']   = '--silent --mode=compile --tag=CXX'
315
+	
316
+	env['QT_UICIMPLPREFIX'] = ''
317
+	env['QT_UICIMPLSUFFIX'] = '.cpp'
318
+	env['QT_MOCHPREFIX']    = ''
319
+	env['QT_MOCHSUFFIX']    = '.moc'
320
+	env['KDE_KCFG_IMPLPREFIX'] = ''
321
+	env['KDE_KCFG_IMPL_HSUFFIX'] = '.h'
322
+	env['KDE_KCFG_IMPL_CSUFFIX'] = '.cpp'
323
+	env['KDE_SKEL_IMPL_SUFFIX']  = '.skel'
324
+	env['MEINPROC']              = 'meinproc'
325
+	env['MSGFMT']                = 'msgfmt'
326
+
327
+
328
+	###### ui file processing
329
+	def uicGenerator(target, source, env, for_signature):
330
+		act=[]
331
+		act.append('$QT_UIC $QT_UIC_HFLAGS -o '+target[0].path+' '+source[0].path)
332
+		act.append('rm -f '                           +target[1].path)
333
+		act.append('echo \'#include <klocale.h>\' >> '+target[1].path)
334
+		act.append('echo \'#include <kdialog.h>\' >> '+target[1].path)
335
+		act.append('$QT_UIC $QT_UIC_CFLAGS -impl '+target[0].path+' -o '+target[1].path+'.tmp '+source[0].path)
336
+		act.append('cat '+target[1].path+'.tmp >> '+target[1].path)
337
+		act.append('rm -f '+target[1].path+'.tmp')
338
+		act.append('echo \'#include "' + target[2].name + '"\' >> '+target[1].path)
339
+		act.append('$QT_MOC -o '+target[2].path+' '+target[0].path)
340
+		return act
341
+	
342
+	def uicEmitter(target, source, env):
343
+		adjustixes = SCons.Util.adjustixes
344
+		bs = SCons.Util.splitext(str(source[0].name))[0]
345
+		bs = os.path.join(str(target[0].get_dir()),bs)
346
+		# first target is automatically added by builder (.h file)
347
+		if len(target) < 2:
348
+			# second target is .cpp file
349
+			target.append(adjustixes(bs,
350
+				env.subst('$QT_UICIMPLPREFIX'),
351
+				env.subst('$QT_UICIMPLSUFFIX')))
352
+		if len(target) < 3:
353
+			# third target is .moc file
354
+			target.append(adjustixes(bs,
355
+				env.subst('$QT_MOCHPREFIX'),
356
+				env.subst('$QT_MOCHSUFFIX')))
357
+		return target, source
358
+	
359
+	UIC_BUILDER = Builder(
360
+		generator  = uicGenerator,
361
+		emitter    = uicEmitter,
362
+		suffix     = '.h',
363
+		src_suffix = '.ui' )
364
+	
365
+	###### moc file processing
366
+	env['QT_MOCCOM'] = ('$QT_MOC -o ${TARGETS[0]} $SOURCE')
367
+	
368
+	MOC_BUILDER = Builder(
369
+		action     = '$QT_MOCCOM',
370
+		suffix     = '.moc',
371
+		src_suffix = '.h' )
372
+	
373
+	MOCCPP_BUILDER = Builder(
374
+		action     = '$QT_MOCCOM',
375
+		suffix     = '_moc.cpp',
376
+		src_suffix = '.h' )
377
+	
378
+	###### kcfg file processing
379
+	def kcfgGenerator(target, source, env, for_signature):
380
+		act=[]
381
+		act.append('kconfig_compiler -d'+str(source[0].get_dir())+' '+source[1].path+' '+source[0].path)
382
+		return act
383
+	
384
+	def kcfgEmitter(target, source, env):
385
+		adjustixes = SCons.Util.adjustixes
386
+		bs = SCons.Util.splitext(str(source[0].name))[0]
387
+		bs = os.path.join(str(target[0].get_dir()),bs)
388
+		# first target is automatically added by builder (.h file)
389
+		if len(target) < 2:
390
+			# second target is .cpp file
391
+			target.append(adjustixes(bs, env.subst('$KDE_KCFG_IMPLPREFIX'), env.subst('$KDE_KCFG_IMPL_CSUFFIX')))
392
+	
393
+		if len(source) <2:
394
+			kcfgfilename = os.popen("cat "+str(source[0])+"|grep File|sed 's/File.*=//i'").read().rstrip()
395
+			source.append( str(source[0].get_dir())+'/'+kcfgfilename )
396
+		return target, source
397
+
398
+	KCFG_BUILDER = Builder(
399
+		generator  = kcfgGenerator,
400
+		emitter    = kcfgEmitter,
401
+		suffix     = '.h',
402
+		src_suffix = '.kcfgc' )
403
+	
404
+	###### dcop processing
405
+	def dcopGenerator(target, source, env, for_signature):
406
+		act=[]
407
+		act.append('dcopidl '+source[0].path+' > '+target[1].path+'|| ( rm -f '+target[1].path+' ; false )')
408
+		act.append('dcopidl2cpp --c++-suffix cpp --no-signals --no-stub '+target[1].path)
409
+		return act
410
+
411
+	def dcopEmitter(target, source, env):
412
+		bs = SCons.Util.splitext(str(source[0].name))[0]
413
+		bs = os.path.join(str(target[0].get_dir()),bs)
414
+		target.append(bs+'.kidl')
415
+		#target.append(bs+'_skel.cpp')
416
+		return target, source
417
+
418
+	DCOP_BUILDER = Builder(
419
+		generator  = dcopGenerator,
420
+		emitter    = dcopEmitter,
421
+		suffix     = '_skel.cpp',
422
+		src_suffix = '.h' )
423
+
424
+	###### documentation (meinproc) processing
425
+	MEINPROC_BUILDER = Builder(
426
+		action     = '$MEINPROC --check --cache $TARGET $SOURCE',
427
+		suffix     = '.cache.bz2',
428
+		src_suffix = '.docbook' )
429
+
430
+	###### translation files builder
431
+	TRANSFILES_BUILDER = Builder(
432
+		action     = '$MSGFMT $SOURCE -o $TARGET',
433
+		suffix     = '.gmo',
434
+		src_suffix = '.po' )
435
+
436
+	###### libtool file builder
437
+	def laGenerator(target, source, env, for_signature):
438
+		act=[]
439
+		act.append('echo "dlname=\''+source[0].name+'\'" > '+target[0].path)
440
+		act.append('echo "library_names=\''+source[0].name+' '+source[0].name+' '+source[0].name+'\'" >> '+target[0].path)
441
+		act.append('echo "old_library=\'\'">> '+target[0].path)
442
+		act.append('echo "dependency_libs=\'\'">> '+target[0].path)
443
+		act.append('echo "current=0">> '+target[0].path)
444
+		act.append('echo "age=0">> '+target[0].path)
445
+		act.append('echo "revision=0">> '+target[0].path)
446
+		act.append('echo "installed=yes">> '+target[0].path)
447
+		act.append('echo "shouldnotlink=no">> '+target[0].path)
448
+		act.append('echo "dlopen=\'\'">> '+target[0].path)
449
+		act.append('echo "dlpreopen=\'\'">> '+target[0].path)
450
+		act.append('echo "libdir=\''+env['KDEMODULE']+'\'" >> '+target[0].path)
451
+		return act
452
+	
453
+	LA_BUILDER = Builder(
454
+		generator  = laGenerator,
455
+		suffix     = '.la',
456
+		src_suffix = '.so' )
457
+	
458
+	##### register the builders
459
+	env['BUILDERS']['Uic']        = UIC_BUILDER
460
+	env['BUILDERS']['Moc']        = MOC_BUILDER
461
+	env['BUILDERS']['Moccpp']     = MOCCPP_BUILDER
462
+	env['BUILDERS']['Dcop']       = DCOP_BUILDER
463
+	env['BUILDERS']['Kcfg']       = KCFG_BUILDER
464
+	env['BUILDERS']['LaFile']     = LA_BUILDER
465
+	env['BUILDERS']['Meinproc']   = MEINPROC_BUILDER
466
+	env['BUILDERS']['Transfiles'] = TRANSFILES_BUILDER
467
+
468
+	static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
469
+	static_obj.src_builder.append('Uic')
470
+	shared_obj.src_builder.append('Uic')
471
+	static_obj.src_builder.append('Kcfg')
472
+	shared_obj.src_builder.append('Kcfg')
473
+	static_obj.src_builder.append('LaFile')
474
+	shared_obj.src_builder.append('LaFile')
475
+	static_obj.src_builder.append('Meinproc')
476
+	shared_obj.src_builder.append('Meinproc')
477
+	static_obj.src_builder.append('Transfiles')
478
+	shared_obj.src_builder.append('Transfiles')
479
+
480
+	## find the files to moc, dcop, and link against kde and qt
481
+        env.AppendUnique(PROGEMITTER=[mocscan], SHLIBEMITTER=[mocscan], LIBEMITTER =[mocscan])
482
+
483
+	###########################################
484
+	## Handy helpers for building kde programs
485
+	## You should not have to modify them ..
486
+
487
+	#import SCons.Util
488
+	skel_ext = [".skel", ".SKEL"]
489
+	def KDEfiles(lenv, target, source):
490
+		""" Returns a list of files for scons (handles kde tricks like .skel)
491
+		It also makes custom checks against double includes like : ['file.ui', 'file.cpp']
492
+		(file.cpp is already included because of file.ui) """
493
+
494
+		src=[]
495
+		ui_files=[]
496
+		kcfg_files=[]
497
+		skel_files=[]
498
+		other_files=[]
499
+
500
+		# For each file, check wether it is a dcop file or not, and create the complete list of sources
501
+		for file in source:
502
+			bs  = SCons.Util.splitext(file)[0]
503
+			ext = SCons.Util.splitext(file)[1]
504
+			if ext in skel_ext:
505
+				lenv.Dcop(bs+'.h')
506
+				src.append(bs+'_skel.cpp')
507
+			elif ext == ".moch":
508
+				lenv.Moccpp(bs+'.h')
509
+				src.append(bs+'_moc.cpp')
510
+			else:
511
+				src.append(file)
512
+
513
+			if ext == '.ui':
514
+				ui_files.append(bs)
515
+			elif ext == '.kcfgc':
516
+				kcfg_files.append(bs)
517
+			elif ext == '.skel':
518
+                                skel_files.append(bs)
519
+                        else:
520
+                                other_files.append(bs)
521
+		return src
522
+
523
+	"""
524
+	In the future, these functions will contain the code that will dump the
525
+	configuration for re-use from an IDE
526
+	"""
527
+	import glob
528
+	def KDEinstall(lenv, restype, subdir, files):
529
+		if not 'install' in env['TARGS']:
530
+			return
531
+		basedir=env['DESTDIR']
532
+		if len(restype)>0:
533
+			if not lenv.has_key(restype):
534
+				print RED+"unknown resource type "+restype+NORMAL
535
+			else:
536
+				basedir += lenv[restype]+'/'
537
+		#print file # <- useful to trace stuff :)
538
+		install_list =  env.Install(basedir+subdir, files)
539
+		env.Alias('install', install_list)
540
+		return install_list
541
+
542
+	def KDEinstallas(lenv, restype, destfile, file):
543
+		if not 'install' in env['TARGS']:
544
+			return
545
+		basedir=env['DESTDIR']
546
+		if len(restype)>0:
547
+			if not lenv.has_key(restype):
548
+				print RED+"unknown resource type "+restype+NORMAL
549
+			else:
550
+				basedir += lenv[restype]+'/'
551
+		install_list = env.InstallAs(basedir+destfile, file)
552
+		env.Alias('install', install_list)
553
+		return install_list
554
+
555
+	def KDEprogram(lenv, target, source):
556
+		""" Makes a kde program
557
+		The program is installed except if one sets env['NOAUTOINSTALL'] """
558
+		src = KDEfiles(lenv, target, source)
559
+		program_list = lenv.Program(target, src)
560
+		if not lenv.has_key('NOAUTOINSTALL'):
561
+			KDEinstall(lenv, 'KDEBIN', '', target)
562
+		return program_list
563
+
564
+	def KDEshlib(lenv, target, source, kdelib=0):
565
+		""" Makes a shared library for kde (.la file for klibloader)
566
+		The library is installed except if one sets env['NOAUTOINSTALL'] """
567
+		src = KDEfiles(lenv, target, source)
568
+		library_list = lenv.SharedLibrary(target, src)
569
+		lafile_list  = lenv.LaFile(target, library_list)
570
+		if not lenv.has_key('NOAUTOINSTALL'):
571
+			install_dir = 'KDEMODULE'
572
+			if kdelib==1:
573
+				install_dir = 'KDELIBPATH'
574
+			KDEinstall(lenv, install_dir, '', library_list)
575
+			KDEinstall(lenv, install_dir, '', lafile_list)
576
+		return library_list
577
+
578
+	def KDEstaticlib(lenv, target, source):
579
+		""" Makes a static library for kde - in practice you should not use static libraries
580
+		1. they take more memory than shared ones
581
+		2. makefile.am needed it because of limitations
582
+		(cannot handle sources in separate folders - takes extra processing) """
583
+		src = KDEfiles(lenv, target, source)
584
+		return lenv.StaticLibrary(target, src)
585
+		# do not install static libraries by default
586
+
587
+	def KDEaddflags_cxx(lenv, fl):
588
+		""" Compilation flags for C++ programs """
589
+		lenv.AppendUnique(CXXFLAGS = fl)
590
+
591
+	def KDEaddflags_c(lenv, fl):
592
+		""" Compilation flags for C programs """
593
+		lenv.AppendUnique(CFLAGS = fl)
594
+
595
+	def KDEaddflags_link(lenv, fl):
596
+		""" Add link flags - Use this if KDEaddlibs below is not enough """
597
+		lenv.AppendUnique(LINKFLAGS = fl)
598
+
599
+	def KDEaddlibs(lenv, libs):
600
+		""" Helper function """
601
+		lenv.AppendUnique(LIBS = libs)
602
+
603
+	def KDEaddpaths_includes(lenv, paths):
604
+		""" Add new include paths """
605
+		lenv.AppendUnique(CPPPATH = paths)
606
+
607
+	def KDEaddpaths_libs(lenv, paths):
608
+		""" Add paths to libraries """
609
+		lenv.AppendUnique(LIBPATH = paths)
610
+
611
+	def KDElang(lenv, folder, appname):
612
+		""" Process translations (.po files) in a po/ dir """
613
+		transfiles = glob.glob(folder+'/*.po')
614
+		for lang in transfiles:
615
+			result = lenv.Transfiles(lang)
616
+			country = SCons.Util.splitext(result[0].name)[0]
617
+			KDEinstallas(lenv, 'KDELOCALE', country+'/LC_MESSAGES/'+appname+'.mo', result)
618
+
619
+	def KDEicon(lenv, icname):
620
+		""" Emulates the behaviour of Makefile.am to install icons
621
+		Contributed by: "Andrey Golovizin" <grooz@gorodok@net> """
622
+		type_dic = { 'action' : 'actions', 'app' : 'apps', 'device' : 
623
+			'devices', 'filesys' : 'filesystems', 'mime' : 'mimetypes' } 
624
+		dir_dic = {
625
+		'los'  :'locolor/16x16',
626
+		'lom'  :'locolor/32x32',
627
+		'him'  :'hicolor/32x32',
628
+		'hil'  :'hicolor/48x48',
629
+		'lo16' :'locolor/16x16',
630
+		'lo22' :'locolor/22x22',
631
+		'lo32' :'locolor/32x32',
632
+		'hi16' :'hicolor/16x16',
633
+		'hi22' :'hicolor/22x22',
634
+		'hi32' :'hicolor/32x32',
635
+		'hi48' :'hicolor/48x48',
636
+		'hi64' :'hicolor/64x64',
637
+		'hi128':'hicolor/128x128',
638
+		'hisc' :'hicolor/scalable',
639
+		'cr16' :'crystalsvg/16x16',
640
+		'cr22' :'crystalsvg/22x22',
641
+		'cr32' :'crystalsvg/32x32',
642
+		'cr48' :'crystalsvg/48x48',
643
+		'cr64' :'crystalsvg/64x64',
644
+		'cr128':'crystalsvg/128x128',
645
+		'crsc' :'crystalsvg/scalable'
646
+		}
647
+
648
+		import glob
649
+		iconfiles = []
650
+		for ext in ['png', 'xpm', 'mng', 'svg', 'svgz']:
651
+			files = glob.glob('*-*-%s.%s' % (icname, ext))
652
+			iconfiles += files
653
+		for iconfile in iconfiles:
654
+			tmp = iconfile.split('-')
655
+			if len(tmp) != 3:
656
+				print RED + 'WARNING: icon filename has unknown format: ' + iconfile + NORMAL
657
+				continue
658
+			[icon_dir, icon_type, icon_filename] = tmp
659
+			try:
660
+				destfile = '%s/%s/%s/%s' % (lenv['KDEICONS'], dir_dic[icon_dir], type_dic[icon_type], icon_filename)
661
+			except KeyError:
662
+				print RED + 'WARNING: unknown icon type: ' + iconfile + NORMAL
663
+				continue
664
+			## do not use KDEinstallas here, as parsing from an ide will be necessary
665
+			if 'install' in env['TARGS']:
666
+				env.Alias('install', env.InstallAs( env['DESTDIR']+'/'+destfile, iconfile ) )
667
+
668
+	# Attach the functions to the environment so that sconscripts can use them
669
+	from SCons.Script.SConscript import SConsEnvironment
670
+	SConsEnvironment.KDEprogram = KDEprogram
671
+	SConsEnvironment.KDEshlib = KDEshlib
672
+	SConsEnvironment.KDEstaticlib = KDEstaticlib
673
+	SConsEnvironment.KDEinstall = KDEinstall
674
+	SConsEnvironment.KDEinstallas = KDEinstallas
675
+	SConsEnvironment.KDElang = KDElang
676
+	SConsEnvironment.KDEicon = KDEicon
677
+
678
+	SConsEnvironment.KDEaddflags_cxx = KDEaddflags_cxx
679
+	SConsEnvironment.KDEaddflags_c = KDEaddflags_c
680
+	SConsEnvironment.KDEaddflags_link = KDEaddflags_link
681
+	SConsEnvironment.KDEaddlibs = KDEaddlibs
682
+	SConsEnvironment.KDEaddpaths_includes = KDEaddpaths_includes
683
+	SConsEnvironment.KDEaddpaths_libs = KDEaddpaths_libs

+ 83
- 0
doc/SConscript View File

@@ -0,0 +1,83 @@
1
+#! /usr/bin/env python
2
+## This script demonstrates to build and install
3
+## the documentation of a kde program with scons
4
+##
5
+## Thomas Nagy, 2005
6
+
7
+## This file can be reused freely for any project (see COPYING)
8
+
9
+## First load the environment set in the top-level SConstruct file
10
+Import( 'env' )
11
+myenv=env.Copy()
12
+
13
+## The following looks complicated but it is not
14
+## We first define a function to install all files as documentation
15
+## The documentation is of course lying in subfolders from here
16
+## * normal files are installed under KDEDOC/destination
17
+## * meinproc files are not installed, but processed into a single 
18
+##   index.cache.bz2 which is installed afterwards
19
+
20
+## This is far more maintainable to have *one* file than
21
+## having lots of almost empty SConscript in several folders
22
+
23
+import os
24
+import sys
25
+import glob
26
+import SCons.Util
27
+
28
+## Define this to 1 if you are writing documentation else to 0 :)
29
+i_am_a_documentation_writer = 0
30
+
31
+## This function uses env imported above
32
+def processfolder(folder, lang, destination=""):
33
+	# folder is the folder to process
34
+	# lang is the language
35
+	# destination is the subdirectory in KDEDOC
36
+	
37
+	docfiles = glob.glob(folder+"/???*.*") # file files that are at least 4 chars wide :)
38
+
39
+	# warn about errors
40
+	#if len(lang) != 2:
41
+	#	print "error, lang must be a two-letter string, like 'en'"
42
+
43
+	# when the destination is not given, use the folder
44
+	if len(destination) == 0:
45
+		destination=folder
46
+	
47
+	docbook_list = []
48
+	for file in docfiles:
49
+
50
+		# do not process folders
51
+		if not os.path.isfile(file):
52
+			continue
53
+		# do not process the cache file
54
+		if file == 'index.cache.bz2':
55
+			continue
56
+		# ignore invalid files (TODO??)
57
+		if len( SCons.Util.splitext( file ) ) <= 1 :
58
+			continue
59
+
60
+		ext = SCons.Util.splitext( file )[1]
61
+		
62
+		# docbook files are processed by meinproc
63
+		if ext == '.docbook':
64
+			docbook_list.append( file )
65
+			continue
66
+
67
+		myenv.KDEinstall('KDEDOC', lang+'/'+destination, file)
68
+
69
+	# Now process the index.docbook files ..
70
+	if len(docbook_list) == 0:
71
+		return
72
+	if not os.path.isfile( folder+'index.docbook' ):
73
+		print "Error, index.docbook was not found in "+folder+'/index.docbook'
74
+		return
75
+	if i_am_a_documentation_writer:
76
+		for file in docbook_list:
77
+			myenv.Depends( folder+'index.cache.bz2', file )
78
+	myenv.Meinproc( folder+'/index.cache.bz2', folder+'/index.docbook' )
79
+	myenv.KDEinstall( 'KDEDOC', lang+'/'+destination, folder+'/index.cache.bz2' )
80
+
81
+## Use processfolder for each documentation directory
82
+processfolder('en/', 'en')
83
+

+ 101
- 0
doc/en/index.docbook View File

@@ -0,0 +1,101 @@
1
+<?xml version="1.0" ?>
2
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1.2-Based Variant V1.0//EN" "dtd/kdex.dtd" [
3
+  <!ENTITY kappname "&KStreamRipper;">
4
+  <!ENTITY % addindex "IGNORE">
5
+  <!ENTITY % English "INCLUDE" > <!-- change language only here -->   
6
+]>
7
+<!-- Important note: please use template.docbook instead of this file.
8
+     This is only the conversion of app.sgml into DocBook SGML.  
9
+     template.docbook gives you more information on what you can and
10
+     should do.  Thanks. --> 
11
+
12
+<book lang="&language;">
13
+
14
+  <bookinfo>
15
+    <title>The KStreamRipper Handbook</title>
16
+    <authorgroup>
17
+      <author>
18
+	<firstname></firstname>
19
+	<surname>Michael Goettsche</surname>
20
+	<affiliation><address><email>mail&#64;tuxipuxi&#46;de</email></address></affiliation>
21
+      </author>
22
+    </authorgroup>
23
+    <date>date</date>
24
+    <releaseinfo>0&#46;1</releaseinfo>
25
+    <abstract>
26
+      <para>SHORT DESCRIPTION GOES HERE</para>
27
+    </abstract>
28
+    <keywordset>
29
+      <keyword>KDE</keyword>
30
+      <keyword>KStreamRipper</keyword>
31
+    </keywordset>
32
+  </bookinfo>
33
+
34
+  <chapter id="introduction">
35
+    <title>Introduction</title>
36
+
37
+    <sect1 id="features">
38
+      <title>Features</title>
39
+      <para></para>
40
+    </sect1>
41
+  </chapter>
42
+
43
+  <chapter id="installation">
44
+    <title>Installation</title>
45
+
46
+    <sect1 id="how-to-obtain-KStreamRipper">
47
+      <title>How to obtain KStreamRipper</title>
48
+      <para></para>
49
+    </sect1>
50
+
51
+    <sect1 id="requirements">
52
+      <title>Requirements</title>
53
+      <para></para>
54
+    </sect1>
55
+
56
+    <sect1 id="compilation-and-installation">
57
+      <title>Compilation and Installation</title>
58
+
59
+      <para>Compiling KStreamRipper is very easy.  The following should do
60
+	it: <screen>
61
+<prompt>%</prompt> <userinput><command>./configure</command></userinput>
62
+<prompt>%</prompt> <userinput><command>make</command></userinput>
63
+<prompt>%</prompt> <userinput><command>make</command> install</userinput></screen>
64
+      </para>
65
+
66
+      <para>That should do it! Should you run into any problems,
67
+	please report them to the <ulink
68
+	url="mailto:mail&#64;tuxipuxi&#46;de">author</ulink></para>
69
+    </sect1>
70
+  </chapter>
71
+
72
+  <chapter id="using-KStreamRipper">
73
+    <title>Using KStreamRipper</title>
74
+    <para></para>
75
+  </chapter>
76
+
77
+  <chapter id="questionsanswersandtips">
78
+    <title>Questions, Answers, and Tips</title>
79
+
80
+    <qandaset id="faq">
81
+      <title>Frequently asked questions</title>
82
+      <qandaentry>
83
+	<question>
84
+	  <para>Question 1</para>
85
+	</question>
86
+	<answer>
87
+	  <para>The answer</para>
88
+	</answer>
89
+      </qandaentry>
90
+    </qandaset>
91
+
92
+  </chapter>
93
+</book>
94
+<!--
95
+Local Variables:
96
+mode: sgml
97
+sgml-omittag: nil
98
+sgml-shorttag: t
99
+sgml-general-insert-case: lower
100
+End:
101
+-->

+ 816
- 0
kde.py View File

@@ -0,0 +1,816 @@
1
+# Made from scons qt.py and (heavily) modified into kde.py
2
+# Thomas Nagy, 2004, 2005 <tnagy2^8@yahoo.fr>
3
+
4
+"""
5
+Run scons -h to display the associated help, or look below ..
6
+"""
7
+
8
+BOLD   ="\033[1m"
9
+RED    ="\033[91m"
10
+GREEN  ="\033[92m"
11
+YELLOW ="\033[1m" #"\033[93m" # unreadable on white backgrounds
12
+CYAN   ="\033[96m"
13
+NORMAL ="\033[0m"
14
+
15
+import os, re
16
+
17
+# Returns the name of the shared object (i.e. libkdeui.so.4)
18
+# referenced by a libtool archive (like libkdeui.la)
19
+def getSOfromLA(lafile):
20
+	contents = open(lafile, 'r').read()
21
+	match = re.search("^dlname='([^']*)'$", contents, re.M)
22
+	if match:
23
+		return match.group(1)
24
+	return None
25
+
26
+def exists(env):
27
+	return True
28
+
29
+def detect_kde(env):
30
+	""" Detect the qt and kde environment using kde-config mostly """
31
+
32
+	prefix      = env['ARGS'].get('prefix', None)
33
+	execprefix  = env['ARGS'].get('execprefix', None)
34
+	datadir     = env['ARGS'].get('datadir', None)
35
+	libdir      = env['ARGS'].get('libdir', None)
36
+	libsuffix   = env['ARGS'].get('libsuffix', '')
37
+	kdeincludes = env['ARGS'].get('kdeincludes', None)
38
+	kdelibs     = env['ARGS'].get('kdelibs', None)
39
+	qtincludes  = env['ARGS'].get('qtincludes', None)
40
+	qtlibs      = env['ARGS'].get('qtlibs', None)
41
+
42
+	if libdir:
43
+		libdir = libdir+libsuffix
44
+
45
+	## Detect the kde libraries
46
+	print "Checking for kde-config           : ",
47
+	kde_config = os.popen("which kde-config 2>/dev/null").read().strip()
48
+	if len(kde_config):
49
+		print GREEN+"kde-config was found"+NORMAL
50
+	else:
51
+		print RED+"kde-config was NOT found in your PATH"+NORMAL
52
+		print "Make sure kde is installed properly"
53
+		print "(missing package kdebase-devel?)"
54
+		env.Exit(1)
55
+	env['KDEDIR'] = os.popen('kde-config -prefix').read().strip()
56
+
57
+	print "Checking for kde version          : ",
58
+	kde_version = os.popen("kde-config --version|grep KDE").read().strip().split()[1]
59
+	try:
60
+		env['KDEm1']=int(kde_version[0])
61
+	except:
62
+		pass
63
+	try:
64
+		env['KDEm2']=int(kde_version[2])
65
+	except:
66
+		pass
67
+	try:
68
+		env['KDEm3']=int(kde_version[4])
69
+	except:
70
+		pass
71
+	if int(kde_version[0]) != 3 or int(kde_version[2]) < 2:
72
+		print RED+kde_version
73
+		print RED+"Your kde version can be too old"+NORMAL
74
+		print RED+"Please make sure kde is at least 3.2"+NORMAL
75
+	else:
76
+		print GREEN+kde_version+NORMAL
77
+
78
+	## Detect the qt library
79
+	print "Checking for the qt library       : ",
80
+	qtdir = os.getenv("QTDIR")
81
+	if qtdir:
82
+		print GREEN+"qt is in "+qtdir+NORMAL
83
+	else:
84
+		libdir = os.popen('kde-config --expandvars --install lib').read().strip()
85
+		libkdeuiSO = libdir+'/'+getSOfromLA(libdir+'/libkdeui.la')
86
+		m = re.search('(.*)/lib/libqt.*', os.popen('ldd ' + libkdeuiSO + ' | grep libqt').read().strip().split()[2])
87
+		if m:
88
+			qtdir = m.group(1)
89
+			print YELLOW+"qt was found as "+m.group(1)+NORMAL
90
+		else:
91
+			print RED+"qt was not found"+NORMAL
92
+			print RED+"Please set QTDIR first (/usr/lib/qt3?)"+NORMAL
93
+			env.Exit(1)
94
+	env['QTDIR'] = qtdir.strip()
95
+
96
+	## Find the necessary programs uic and moc
97
+	print "Checking for uic                  : ",
98
+	uic = qtdir + "/bin/uic"
99
+	if os.path.isfile(uic):
100
+		print GREEN+"uic was found as "+uic+NORMAL
101
+	else:
102
+		uic = os.popen("which uic 2>/dev/null").read().strip()
103
+		if len(uic):
104
+			print YELLOW+"uic was found as "+uic+NORMAL
105
+		else:
106
+			uic = os.popen("which uic 2>/dev/null").read().strip()
107
+			if len(uic):
108
+				print YELLOW+"uic was found as "+uic+NORMAL
109
+			else:
110
+				print RED+"uic was not found - set QTDIR put it in your PATH ?"+NORMAL
111
+				env.Exit(1)
112
+	env['QT_UIC'] = uic
113
+
114
+	print "Checking for moc                  : ",
115
+	moc = qtdir + "/bin/moc"
116
+	if os.path.isfile(moc):
117
+		print GREEN + "moc was found as " + moc + NORMAL
118
+	else:
119
+		moc = os.popen("which moc 2>/dev/null").read().strip()
120
+		if len(moc):
121
+			print YELLOW + "moc was found as " + moc + NORMAL
122
+		elif os.path.isfile("/usr/share/qt3/bin/moc"):
123
+			moc = "/usr/share/qt3/bin/moc"
124
+			print YELLOW + "moc was found as " + moc + NORMAL
125
+		else:
126
+			print RED + "moc was not found - set QTDIR or put it in your PATH ?" + NORMAL
127
+			env.Exit(1)
128
+	env['QT_MOC'] = moc
129
+
130
+	## check for the qt and kde includes
131
+	print "Checking for the qt includes      : ",
132
+	if qtincludes and os.path.isfile(qtincludes + "/qlayout.h"):
133
+		# The user told where to look for and it looks valid
134
+		print GREEN + "ok " + qtincludes + NORMAL
135
+	else:
136
+		if os.path.isfile(qtdir + "/include/qlayout.h"):
137
+			# Automatic detection
138
+			print GREEN + "ok " + qtdir + "/include/ " + NORMAL
139
+			qtincludes = qtdir + "/include/"
140
+		elif os.path.isfile("/usr/include/qt3/qlayout.h"):
141
+			# Debian probably
142
+			print YELLOW + "the qt headers were found in /usr/include/qt3/ " + NORMAL
143
+			qtincludes = "/usr/include/qt3"
144
+		else:
145
+			print RED + "the qt headers were not found" + NORMAL
146
+			env.Exit(1)
147
+
148
+	print "Checking for the kde includes     : ",
149
+	kdeprefix = os.popen("kde-config --prefix").read().strip()
150
+	if not kdeincludes:
151
+		kdeincludes = kdeprefix+"/include/"
152
+	if os.path.isfile(kdeincludes + "/klineedit.h"):
153
+		print GREEN + "ok " + kdeincludes + NORMAL
154
+	else:
155
+		if os.path.isfile(kdeprefix+"/include/kde/klineedit.h"):
156
+			# Debian, Fedora probably
157
+			print YELLOW + "the kde headers were found in " + kdeprefix + "/include/kde/" + NORMAL
158
+			kdeincludes = kdeprefix + "/include/kde/"
159
+		else:
160
+			print RED + "The kde includes were NOT found" + NORMAL
161
+			env.Exit(1)
162
+
163
+	if prefix:
164
+		## use the user-specified prefix
165
+		if not execprefix:
166
+			execprefix = prefix
167
+		if not datadir:
168
+			datadir=prefix+"/share"
169
+		if not libdir:
170
+			libdir=execprefix+"/lib"+libsuffix
171
+
172
+		subst_vars = lambda x: x.replace('${exec_prefix}', execprefix).replace('${datadir}',datadir).replace('${libdir}', libdir)
173
+		debian_fix = lambda x: x.replace('/usr/share', '${datadir}')
174
+		env['KDEBIN']   = subst_vars(os.popen('kde-config --install exe').read().strip())
175
+		env['KDEAPPS']  = subst_vars(os.popen('kde-config --install apps').read().strip())		
176
+		env['KDEDATA']  = subst_vars(os.popen('kde-config --install data').read().strip())
177
+		env['KDEMODULE']= subst_vars(os.popen('kde-config --install module').read().strip())
178
+		env['KDELOCALE']= subst_vars(os.popen('kde-config --install locale').read().strip())
179
+		env['KDEDOC']   = subst_vars( debian_fix(os.popen('kde-config --install html').read().strip()) )
180
+		env['KDEKCFG']  = subst_vars(os.popen('kde-config --install kcfg').read().strip())
181
+		env['KDEXDG']   = subst_vars(os.popen('kde-config --install xdgdata-apps').read().strip())
182
+		env['KDEXDGDIR']= subst_vars(os.popen('kde-config --install xdgdata-dirs').read().strip())
183
+		env['KDEMENU']  = subst_vars(os.popen('kde-config --install apps').read().strip())
184
+		env['KDEMIME']  = subst_vars(os.popen('kde-config --install mime').read().strip())
185
+		env['KDEICONS'] = subst_vars(os.popen('kde-config --install icon').read().strip())
186
+		env['KDESERV']  = subst_vars(os.popen('kde-config --install services').read().strip())
187
+	else:
188
+		# the user has given no prefix, install as a normal kde app
189
+		env['PREFIX'] = os.popen('kde-config --prefix').read().strip()
190
+		env['KDEBIN']   = os.popen('kde-config --expandvars --install exe').read().strip()
191
+		env['KDEAPPS']  = os.popen('kde-config --expandvars --install apps').read().strip()
192
+		env['KDEDATA']  = os.popen('kde-config --expandvars --install data').read().strip()
193
+		env['KDEMODULE']= os.popen('kde-config --expandvars --install module').read().strip()
194
+		env['KDELOCALE']= os.popen('kde-config --expandvars --install locale').read().strip()
195
+		env['KDEDOC']   = os.popen('kde-config --expandvars --install html').read().strip()
196
+		env['KDEKCFG']  = os.popen('kde-config --expandvars --install kcfg').read().strip()
197
+		env['KDEXDG']   = os.popen('kde-config --expandvars --install xdgdata-apps').read().strip()
198
+		env['KDEXDGDIR']= os.popen('kde-config --expandvars --install xdgdata-dirs').read().strip()
199
+		env['KDEMENU']  = os.popen('kde-config --expandvars --install apps').read().strip()
200
+		env['KDEMIME']  = os.popen('kde-config --expandvars --install mime').read().strip()
201
+		env['KDEICONS'] = os.popen('kde-config --expandvars --install icon').read().strip()
202
+		env['KDESERV']  = os.popen('kde-config --expandvars --install services').read().strip()
203
+
204
+	env['QTPLUGINS']=os.popen('kde-config --expandvars --install qtplugins').read().strip()
205
+
206
+	## kde libs and includes
207
+	env['KDEINCLUDEPATH']=kdeincludes
208
+	if not kdelibs:
209
+		kdelibs=os.popen('kde-config --expandvars --install lib').read().strip()
210
+	env['KDELIBPATH']=kdelibs
211
+
212
+	## qt libs and includes
213
+	env['QTINCLUDEPATH']=qtincludes
214
+	if not qtlibs:
215
+		qtlibs=qtdir+"/lib"
216
+	env['QTLIBPATH']=qtlibs
217
+
218
+def generate(env):
219
+	""""Set up the qt and kde environment and builders - the moc part is difficult to understand """
220
+	env.Help("""
221
+"""+BOLD+
222
+"""*** KDE options ***
223
+-------------------"""
224
++NORMAL+"""
225
+"""+BOLD+"""* prefix     """+NORMAL+""": base install path,         ie: /usr/local
226
+"""+BOLD+"""* execprefix """+NORMAL+""": install path for binaries, ie: /usr/bin
227
+"""+BOLD+"""* datadir    """+NORMAL+""": install path for the data, ie: /usr/local/share
228
+"""+BOLD+"""* libdir     """+NORMAL+""": install path for the libs, ie: /usr/lib
229
+"""+BOLD+"""* libsuffix  """+NORMAL+""": suffix of libraries on amd64, ie: 64, 32
230
+"""+BOLD+"""* kdeincludes"""+NORMAL+""": path to the kde includes (/usr/include/kde on debian, ...)
231
+"""+BOLD+"""* qtincludes """+NORMAL+""": same punishment, for qt includes (/usr/include/qt on debian, ...)
232
+"""+BOLD+"""* kdelibs    """+NORMAL+""": path to the kde libs, for linking the programs
233
+"""+BOLD+"""* qtlibs     """+NORMAL+""": same punishment, for qt libraries
234
+ie: """+BOLD+"""scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt
235
+"""+NORMAL)
236
+
237
+	import SCons.Defaults
238
+	import SCons.Tool
239
+	import SCons.Util
240
+
241
+	ui_extensions = [".ui"]
242
+	header_extensions = [".h", ".hxx", ".hpp", ".hh"]
243
+	source_extensions = [".cpp", ".cxx", ".cc"]
244
+
245
+	def find_file(filename, paths, node_factory):
246
+		retval = None
247
+		for dir in paths:
248
+			node = node_factory(filename, dir)
249
+			if node.rexists():
250
+				return node
251
+		return None
252
+
253
+	class _Metasources:
254
+		""" Callable class, which works as an emitter for Programs, SharedLibraries 
255
+		and StaticLibraries."""
256
+	
257
+		def __init__(self, objBuilderName):
258
+			self.objBuilderName = objBuilderName
259
+	
260
+		def __call__(self, target, source, env):
261
+			""" Smart autoscan function. Gets the list of objects for the Program
262
+			or Lib. Adds objects and builders for the special qt files. """
263
+			try:
264
+				if int(env.subst('$QT_AUTOSCAN')) == 0:
265
+					return target, source
266
+			except ValueError:
267
+				pass
268
+
269
+			try:
270
+				qtdebug = int(env.subst('$QT_DEBUG'))
271
+			except ValueError:
272
+				qtdebug = 0
273
+
274
+			# some shortcuts used in the scanner
275
+			FS = SCons.Node.FS.default_fs
276
+			splitext = SCons.Util.splitext
277
+			objBuilder = getattr(env, self.objBuilderName)
278
+	
279
+			# some regular expressions:
280
+			# Q_OBJECT detection
281
+			q_object_search = re.compile(r'[^A-Za-z0-9]Q_OBJECT[^A-Za-z0-9]')
282
+
283
+			# The following is kind of hacky to get builders working properly (FIXME) ??
284
+			objBuilderEnv = objBuilder.env
285
+			objBuilder.env = env
286
+			mocBuilderEnv = env.Moc.env
287
+			env.Moc.env = env
288
+
289
+			# make a deep copy for the result; MocH objects will be appended
290
+			out_sources = source[:]
291
+
292
+			for obj in source:
293
+				if not obj.has_builder():
294
+					# binary obj file provided
295
+					if qtdebug:
296
+						print "scons: qt: '%s' seems to be a binary. Discarded." % str(obj)
297
+					continue
298
+				cpp = obj.sources[0]
299
+				if not splitext(str(cpp))[1] in source_extensions:
300
+					if qtdebug:
301
+						print "scons: qt: '%s' is no cxx file. Discarded." % str(cpp)
302
+					# c or fortran source
303
+					continue
304
+				#cpp_contents = comment.sub('', cpp.get_contents())
305
+				cpp_contents = cpp.get_contents()
306
+	
307
+				h = None
308
+				ui = None
309
+	
310
+				for ui_ext in ui_extensions:
311
+					# try to find the ui file in the corresponding source directory
312
+					uiname = splitext(cpp.name)[0] + ui_ext
313
+					ui = find_file(uiname, (cpp.get_dir(),), FS.File)
314
+					if ui:
315
+						if qtdebug:
316
+							print "scons: qt: found .ui file of header" #% (str(h), str(cpp))
317
+							#h_contents = comment.sub('', h.get_contents())
318
+						break
319
+	
320
+				# if we have a .ui file, do not continue, it is automatically handled by Uic
321
+				if ui:
322
+					continue
323
+
324
+				for h_ext in header_extensions:
325
+					# try to find the header file in the corresponding source
326
+					# directory
327
+					hname = splitext(cpp.name)[0] + h_ext
328
+					h = find_file(hname, (cpp.get_dir(),), FS.File)
329
+					if h:
330
+						if qtdebug:
331
+							print "scons: qt: Scanning '%s' (header of '%s')" % (str(h), str(cpp))
332
+						#h_contents = comment.sub('', h.get_contents())
333
+						h_contents = h.get_contents()
334
+						break
335
+	
336
+				if not h and qtdebug:
337
+					print "scons: qt: no header for '%s'." % (str(cpp))
338
+				if h and q_object_search.search(h_contents):
339
+					# h file with the Q_OBJECT macro found -> add .moc or _moc.cpp file
340
+					moc_cpp = None
341
+
342
+					if env.has_key('NOMOCSCAN'):
343
+						moc_cpp = env.Moc(h)
344
+					else:
345
+						reg = '\n\s*#include\s*("|<)'+splitext(cpp.name)[0]+'.moc("|>)'
346
+						meta_object_search = re.compile(reg)
347
+						if meta_object_search.search(cpp_contents):
348
+							moc_cpp = env.Moc(h)
349
+						else:
350
+							moc_cpp = env.Moccpp(h)
351
+							moc_o = objBuilder(moc_cpp)
352
+							out_sources.append(moc_o)
353
+					if qtdebug:
354
+						print "scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp[0]))
355
+	
356
+				if cpp and q_object_search.search(cpp_contents):
357
+					print "error, bksys cannot handle cpp files with Q_OBJECT classes"
358
+					print "if you are sure this is a feature worth the effort, "
359
+					print "report this to the authors tnagyemail-mail yahoo.fr"
360
+
361
+			# restore the original env attributes (FIXME)
362
+			objBuilder.env = objBuilderEnv
363
+			env.Moc.env = mocBuilderEnv
364
+
365
+			return (target, out_sources)
366
+	
367
+	MetasourcesShared = _Metasources('SharedObject')
368
+	MetasourcesStatic = _Metasources('StaticObject')
369
+
370
+	CLVar = SCons.Util.CLVar
371
+	splitext = SCons.Util.splitext
372
+	Builder = SCons.Builder.Builder
373
+	
374
+	# Detect the environment - replaces ./configure implicitely and store the options into a cache
375
+	from SCons.Options import Options
376
+	cachefile=env['CACHEDIR']+'kde.cache.py'
377
+	opts = Options(cachefile)
378
+	opts.AddOptions(
379
+		('PREFIX', 'root of the program installation'),
380
+
381
+		('QTDIR', 'root of qt directory'),
382
+		('QTLIBPATH', 'path to the qt libraries'),
383
+		('QTINCLUDEPATH', 'path to the qt includes'),
384
+		('QT_UIC', 'moc directory'),
385
+		('QT_MOC', 'moc executable command'),
386
+		('QTPLUGINS', 'uic executable command'),
387
+		('KDEDIR', 'root of kde directory'),
388
+		('KDELIBPATH', 'path to the kde libs'),
389
+		('KDEINCLUDEPATH', 'path to the kde includes'),
390
+
391
+		('KDEBIN', 'installation path of the kde binaries'),
392
+		('KDEMODULE', 'installation path of the parts and libs'),
393
+		('KDEAPPS', ''),
394
+		('KDEDATA', 'installation path of the application data'),
395
+		('KDELOCALE', ''),
396
+		('KDEDOC', 'installation path of the application documentation'),
397
+		('KDEKCFG', 'installation path of the .kcfg files'),
398
+		('KDEXDG', 'installation path of the service types'),
399
+		('KDEXDGDIR', 'installation path of the xdg service directories'),
400
+		('KDEMENU', ''),
401
+		('KDEMIME', 'installation path of to the mimetypes'),
402
+		('KDEICONS', ''),
403
+		('KDEm1', ''),
404
+		('KDEm2', ''),
405
+		('KDEm3', ''),
406
+		('KDESERV', ''),
407
+	)
408
+	opts.Update(env)
409
+
410
+	# reconfigure when things are missing
411
+	if 'configure' in env['TARGS'] or not env.has_key('QTDIR') or not env.has_key('KDEDIR'):
412
+		detect_kde(env)
413
+
414
+	# finally save the configuration to the cache file
415
+	opts.Save(cachefile, env)
416
+
417
+	## set default variables, one can override them in sconscript files
418
+	env.Append(CXXFLAGS = ['-I'+env['KDEINCLUDEPATH'], '-I'+env['QTINCLUDEPATH'] ])
419
+	env.Append(LIBPATH = [env['KDELIBPATH'], env['QTLIBPATH'] ])
420
+	
421
+	env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
422
+	
423
+	env['QT_AUTOSCAN'] = 1
424
+	env['QT_DEBUG']    = 0
425
+	env['QT_UIC_HFLAGS']   = '-L $QTPLUGINS -nounload'
426
+	env['QT_UIC_CFLAGS']   = '$QT_UIC_HFLAGS -tr tr2i18n'
427
+	env['QT_LIBS']      = 'qt-mt'
428
+	env['QT_UICIMPLPREFIX'] = ''
429
+	env['QT_UICIMPLSUFFIX'] = '.cpp'
430
+
431
+	env['QT_MOCHPREFIX']    = ''
432
+	env['QT_MOCHSUFFIX']    = '.moc'
433
+	env['KDE_KCFG_IMPLPREFIX'] = ''
434
+	env['KDE_KCFG_IMPL_HSUFFIX'] = '.h'
435
+	env['KDE_KCFG_IMPL_CSUFFIX'] = '.cpp'
436
+	env['KDE_SKEL_IMPL_SUFFIX']  = '.skel'
437
+	env['MEINPROC']              = 'meinproc'
438
+	env['MSGFMT']                = 'msgfmt'
439
+
440
+	## ui file processing
441
+	def uicGenerator(target, source, env, for_signature):
442
+		act=[]
443
+		act.append('$QT_UIC $QT_UIC_HFLAGS -o '+target[0].path+' '+source[0].path)
444
+		act.append('rm -f '                           +target[1].path)
445
+		act.append('echo \'#include <klocale.h>\' >> '+target[1].path)
446
+		act.append('echo \'#include <kdialog.h>\' >> '+target[1].path)
447
+		act.append('$QT_UIC $QT_UIC_CFLAGS -impl '+target[0].path+' -o '+target[1].path+'.tmp '+source[0].path)
448
+		act.append('cat '+target[1].path+'.tmp >> '+target[1].path)
449
+		act.append('rm -f '+target[1].path+'.tmp')
450
+		act.append('echo \'#include "' + target[2].name + '"\' >> '+target[1].path)
451
+		act.append('$QT_MOC -o '+target[2].path+' '+target[0].path)
452
+		return act
453
+	
454
+	def uicEmitter(target, source, env):
455
+		adjustixes = SCons.Util.adjustixes
456
+		bs = SCons.Util.splitext(str(source[0].name))[0]
457
+		bs = os.path.join(str(target[0].get_dir()),bs)
458
+		# first target is automatically added by builder (.h file)
459
+		if len(target) < 2:
460
+			# second target is .cpp file
461
+			target.append(adjustixes(bs,
462
+				env.subst('$QT_UICIMPLPREFIX'),
463
+				env.subst('$QT_UICIMPLSUFFIX')))
464
+		if len(target) < 3:
465
+			# third target is .moc file
466
+			target.append(adjustixes(bs,
467
+				env.subst('$QT_MOCHPREFIX'),
468
+				env.subst('$QT_MOCHSUFFIX')))
469
+		return target, source
470
+	
471
+	UIC_BUILDER = Builder(
472
+		generator  = uicGenerator,
473
+		emitter    = uicEmitter,
474
+		suffix     = '.h',
475
+		src_suffix = '.ui')
476
+	
477
+	## moc file processing
478
+	env['QT_MOCCOM'] = ('$QT_MOC -o ${TARGETS[0]} $SOURCE')
479
+	
480
+	MOC_BUILDER = Builder(
481
+		action     = '$QT_MOCCOM',
482
+		suffix     = '.moc',
483
+		src_suffix = '.h')
484
+	
485
+	MOCCPP_BUILDER = Builder(
486
+		action     = '$QT_MOCCOM',
487
+		suffix     = '_moc.cpp',
488
+		src_suffix = '.h')
489
+	
490
+	## kcfg file processing
491
+	def kcfgGenerator(target, source, env, for_signature):
492
+		act=[]
493
+		act.append('kconfig_compiler -d'+str(source[0].get_dir())+' '+source[1].path+' '+source[0].path)
494
+		return act
495
+	
496
+	def kcfgEmitter(target, source, env):
497
+		adjustixes = SCons.Util.adjustixes
498
+		bs = SCons.Util.splitext(str(source[0].name))[0]
499
+		bs = os.path.join(str(target[0].get_dir()),bs)
500
+		# .h file is automatically added
501
+		if len(target) < 2:
502
+			# add .cpp file
503
+			target.append(adjustixes(bs, env.subst('$KDE_KCFG_IMPLPREFIX'), env.subst('$KDE_KCFG_IMPL_CSUFFIX')))
504
+	
505
+		if len(source) <2:
506
+			if not os.path.isfile(str(source[0])):
507
+				print RED+'kcfg file given'+str(source[0])+' does not exist !'+NORMAL
508
+				return target, source
509
+			kfcgfilename=""
510
+			kcfgFileDeclRx = re.compile("^[fF]ile\s*=\s*(.+)\s*$")
511
+			for line in file(str(source[0]), "r").readlines():
512
+				match = kcfgFileDeclRx.match(line.strip())
513
+				if match:
514
+					kcfgfilename = match.group(1)
515
+					break
516
+			source.append(str(source[0].get_dir())+'/'+kcfgfilename)
517
+		return target, source
518
+
519
+	KCFG_BUILDER = Builder(
520
+		generator  = kcfgGenerator,
521
+		emitter    = kcfgEmitter,
522
+		suffix     = '.h',
523
+		src_suffix = '.kcfgc')
524
+	
525
+	## dcop processing
526
+	def dcopGenerator(target, source, env, for_signature):
527
+		act=[]
528
+		act.append('dcopidl '+source[0].path+' > '+target[1].path+'|| ( rm -f '+target[1].path+' ; false)')
529
+		act.append('dcopidl2cpp --c++-suffix cpp --no-signals --no-stub '+target[1].path)
530
+		return act
531
+
532
+	def dcopEmitter(target, source, env):
533
+		bs = SCons.Util.splitext(str(source[0].name))[0]
534
+		bs = os.path.join(str(target[0].get_dir()),bs)
535
+		target.append(bs+'.kidl')
536
+		#target.append(bs+'_skel.cpp')
537
+		return target, source
538
+
539
+	DCOP_BUILDER = Builder(
540
+		generator  = dcopGenerator,
541
+		emitter    = dcopEmitter,
542
+		suffix     = '_skel.cpp',
543
+		src_suffix = '.h')
544
+
545
+	## documentation processing
546
+	MEINPROC_BUILDER = Builder(
547
+		action     = '$MEINPROC --check --cache $TARGET $SOURCE',
548
+		suffix     = '.cache.bz2')
549
+
550
+	## translation files builder
551
+	TRANSFILES_BUILDER = Builder(
552
+		action     = '$MSGFMT $SOURCE -o $TARGET',
553
+		suffix     = '.gmo',
554
+		src_suffix = '.po')
555
+
556
+	## libtool file builder
557
+	def laGenerator(target, source, env, for_signature):
558
+		act=[]
559
+		act.append('echo "dlname=\''+source[0].name+'\'" > '+target[0].path)
560
+		act.append('echo "library_names=\''+source[0].name+' '+source[0].name+' '+source[0].name+'\'" >> '+target[0].path)
561
+		act.append('echo "old_library=\'\'">> '+target[0].path)
562
+		act.append('echo "dependency_libs=\'\'">> '+target[0].path)
563
+		act.append('echo "current=0">> '+target[0].path)
564
+		act.append('echo "age=0">> '+target[0].path)
565
+		act.append('echo "revision=0">> '+target[0].path)