summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GNUnet Install/COPYING339
-rw-r--r--GNUnet Install/Description.plist10
-rw-r--r--GNUnet Install/ReadMe.rtf7
-rwxr-xr-xGNUnet Install/build-package.sh53
-rw-r--r--GNUnet Setup Assistant/COPYING339
-rw-r--r--GNUnet Setup Assistant/English.lproj/InfoPlist.stringsbin0 -> 216 bytes
-rw-r--r--GNUnet Setup Assistant/English.lproj/MainMenu.nib/classes.nib86
-rw-r--r--GNUnet Setup Assistant/English.lproj/MainMenu.nib/info.nib22
-rw-r--r--GNUnet Setup Assistant/English.lproj/MainMenu.nib/keyedobjects.nibbin0 -> 53885 bytes
-rw-r--r--GNUnet Setup Assistant/GNDatastorePage.h26
-rw-r--r--GNUnet Setup Assistant/GNDatastorePage.m82
-rw-r--r--GNUnet Setup Assistant/GNFinishPage.h25
-rw-r--r--GNUnet Setup Assistant/GNFinishPage.m46
-rw-r--r--GNUnet Setup Assistant/GNLoadLimitPage.h28
-rw-r--r--GNUnet Setup Assistant/GNLoadLimitPage.m114
-rw-r--r--GNUnet Setup Assistant/GNNetworkConnectionPage.h26
-rw-r--r--GNUnet Setup Assistant/GNNetworkConnectionPage.m115
-rw-r--r--GNUnet Setup Assistant/GNServiceAccountPage.h26
-rw-r--r--GNUnet Setup Assistant/GNServiceAccountPage.m122
-rw-r--r--GNUnet Setup Assistant/GNSetupAssistant.h60
-rw-r--r--GNUnet Setup Assistant/GNSetupAssistant.m510
-rw-r--r--GNUnet Setup Assistant/GNUnet Setup Assistant.xcodeproj/project.pbxproj326
-rw-r--r--GNUnet Setup Assistant/GNUnetSetupAssistant-icon.icnsbin0 -> 29445 bytes
-rw-r--r--GNUnet Setup Assistant/GNWelcomePage.h23
-rw-r--r--GNUnet Setup Assistant/GNWelcomePage.m30
-rw-r--r--GNUnet Setup Assistant/Info.plist30
-rw-r--r--GNUnet Setup Assistant/Package/Description.plist10
-rw-r--r--GNUnet Setup Assistant/Package/IFRequirement.stringsbin0 -> 506 bytes
-rw-r--r--GNUnet Setup Assistant/Package/Info.plist40
-rwxr-xr-xGNUnet Setup Assistant/build-package.sh33
-rw-r--r--GNUnet Setup Assistant/main.m16
-rw-r--r--GNUnet Setup/COPYING339
-rw-r--r--GNUnet Setup/English.lproj/InfoPlist.stringsbin0 -> 216 bytes
-rw-r--r--GNUnet Setup/English.lproj/MainMenu.nib/classes.nib21
-rw-r--r--GNUnet Setup/English.lproj/MainMenu.nib/info.nib22
-rw-r--r--GNUnet Setup/English.lproj/MainMenu.nib/keyedobjects.nibbin0 -> 12327 bytes
-rw-r--r--GNUnet Setup/GNSetup.h79
-rw-r--r--GNUnet Setup/GNSetup.m763
-rw-r--r--GNUnet Setup/GNUnet Setup.xcodeproj/project.pbxproj287
-rw-r--r--GNUnet Setup/GNUnetSetup-icon.icnsbin0 -> 29445 bytes
-rw-r--r--GNUnet Setup/Info.plist30
-rw-r--r--GNUnet Setup/Package/Description.plist10
-rw-r--r--GNUnet Setup/Package/IFRequirement.stringsbin0 -> 506 bytes
-rw-r--r--GNUnet Setup/Package/Info.plist40
-rwxr-xr-xGNUnet Setup/build-package.sh33
-rw-r--r--GNUnet Setup/main.m16
46 files changed, 4184 insertions, 0 deletions
diff --git a/GNUnet Install/COPYING b/GNUnet Install/COPYING
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/GNUnet Install/COPYING
@@ -0,0 +1,339 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991
3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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
12freedom to share and change it. By contrast, the GNU General Public
13License is intended to guarantee your freedom to share and change free
14software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by
18the GNU Lesser General Public License instead.) You can apply it to
19your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22price. Our General Public Licenses are designed to make sure that you
23have the freedom to distribute copies of free software (and charge for
24this service if you wish), that you receive source code or can get it
25if you want it, that you can change the software or use pieces of it
26in 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
29anyone to deny you these rights or to ask you to surrender the rights.
30These restrictions translate to certain responsibilities for you if you
31distribute copies of the software, or if you modify it.
32
33 For example, if you distribute copies of such a program, whether
34gratis or for a fee, you must give the recipients all the rights that
35you have. You must make sure that they, too, receive or can get the
36source code. And you must show them these terms so they know their
37rights.
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,
41distribute and/or modify the software.
42
43 Also, for each author's protection and ours, we want to make certain
44that everyone understands that there is no warranty for this free
45software. If the software is modified by someone else and passed on, we
46want its recipients to know that what they have is not the original, so
47that any problems introduced by others will not reflect on the original
48authors' reputations.
49
50 Finally, any free program is threatened constantly by software
51patents. We wish to avoid the danger that redistributors of a free
52program will individually obtain patent licenses, in effect making the
53program proprietary. To prevent this, we have made it clear that any
54patent must be licensed for everyone's free use or not licensed at all.
55
56 The precise terms and conditions for copying, distribution and
57modification 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
63a notice placed by the copyright holder saying it may be distributed
64under the terms of this General Public License. The "Program", below,
65refers to any such program or work, and a "work based on the Program"
66means either the Program or any derivative work under copyright law:
67that is to say, a work containing the Program or a portion of it,
68either verbatim or with modifications and/or translated into another
69language. (Hereinafter, translation is included without limitation in
70the term "modification".) Each licensee is addressed as "you".
71
72Activities other than copying, distribution and modification are not
73covered by this License; they are outside its scope. The act of
74running the Program is not restricted, and the output from the Program
75is covered only if its contents constitute a work based on the
76Program (independent of having been made by running the Program).
77Whether that is true depends on what the Program does.
78
79 1. You may copy and distribute verbatim copies of the Program's
80source code as you receive it, in any medium, provided that you
81conspicuously and appropriately publish on each copy an appropriate
82copyright notice and disclaimer of warranty; keep intact all the
83notices that refer to this License and to the absence of any warranty;
84and give any other recipients of the Program a copy of this License
85along with the Program.
86
87You may charge a fee for the physical act of transferring a copy, and
88you 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
91of it, thus forming a work based on the Program, and copy and
92distribute such modifications or work under the terms of Section 1
93above, 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
114These requirements apply to the modified work as a whole. If
115identifiable sections of that work are not derived from the Program,
116and can be reasonably considered independent and separate works in
117themselves, then this License, and its terms, do not apply to those
118sections when you distribute them as separate works. But when you
119distribute the same sections as part of a whole which is a work based
120on the Program, the distribution of the whole must be on the terms of
121this License, whose permissions for other licensees extend to the
122entire whole, and thus to each and every part regardless of who wrote it.
123
124Thus, it is not the intent of this section to claim rights or contest
125your rights to work written entirely by you; rather, the intent is to
126exercise the right to control the distribution of derivative or
127collective works based on the Program.
128
129In addition, mere aggregation of another work not based on the Program
130with the Program (or with a work based on the Program) on a volume of
131a storage or distribution medium does not bring the other work under
132the scope of this License.
133
134 3. You may copy and distribute the Program (or a work based on it,
135under Section 2) in object code or executable form under the terms of
136Sections 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
155The source code for a work means the preferred form of the work for
156making modifications to it. For an executable work, complete source
157code means all the source code for all modules it contains, plus any
158associated interface definition files, plus the scripts used to
159control compilation and installation of the executable. However, as a
160special exception, the source code distributed need not include
161anything that is normally distributed (in either source or binary
162form) with the major components (compiler, kernel, and so on) of the
163operating system on which the executable runs, unless that component
164itself accompanies the executable.
165
166If distribution of executable or object code is made by offering
167access to copy from a designated place, then offering equivalent
168access to copy the source code from the same place counts as
169distribution of the source code, even though third parties are not
170compelled to copy the source along with the object code.
171
172 4. You may not copy, modify, sublicense, or distribute the Program
173except as expressly provided under this License. Any attempt
174otherwise to copy, modify, sublicense or distribute the Program is
175void, and will automatically terminate your rights under this License.
176However, parties who have received copies, or rights, from you under
177this License will not have their licenses terminated so long as such
178parties remain in full compliance.
179
180 5. You are not required to accept this License, since you have not
181signed it. However, nothing else grants you permission to modify or
182distribute the Program or its derivative works. These actions are
183prohibited by law if you do not accept this License. Therefore, by
184modifying or distributing the Program (or any work based on the
185Program), you indicate your acceptance of this License to do so, and
186all its terms and conditions for copying, distributing or modifying
187the Program or works based on it.
188
189 6. Each time you redistribute the Program (or any work based on the
190Program), the recipient automatically receives a license from the
191original licensor to copy, distribute or modify the Program subject to
192these terms and conditions. You may not impose any further
193restrictions on the recipients' exercise of the rights granted herein.
194You are not responsible for enforcing compliance by third parties to
195this License.
196
197 7. If, as a consequence of a court judgment or allegation of patent
198infringement or for any other reason (not limited to patent issues),
199conditions are imposed on you (whether by court order, agreement or
200otherwise) that contradict the conditions of this License, they do not
201excuse you from the conditions of this License. If you cannot
202distribute so as to satisfy simultaneously your obligations under this
203License and any other pertinent obligations, then as a consequence you
204may not distribute the Program at all. For example, if a patent
205license would not permit royalty-free redistribution of the Program by
206all those who receive copies directly or indirectly through you, then
207the only way you could satisfy both it and this License would be to
208refrain entirely from distribution of the Program.
209
210If any portion of this section is held invalid or unenforceable under
211any particular circumstance, the balance of the section is intended to
212apply and the section as a whole is intended to apply in other
213circumstances.
214
215It is not the purpose of this section to induce you to infringe any
216patents or other property right claims or to contest validity of any
217such claims; this section has the sole purpose of protecting the
218integrity of the free software distribution system, which is
219implemented by public license practices. Many people have made
220generous contributions to the wide range of software distributed
221through that system in reliance on consistent application of that
222system; it is up to the author/donor to decide if he or she is willing
223to distribute software through any other system and a licensee cannot
224impose that choice.
225
226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License.
228
229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License
232may add an explicit geographical distribution limitation excluding
233those countries, so that distribution is permitted only in or among
234countries not thus excluded. In such case, this License incorporates
235the limitation as if written in the body of this License.
236
237 9. The Free Software Foundation may publish revised and/or new versions
238of the General Public License from time to time. Such new versions will
239be similar in spirit to the present version, but may differ in detail to
240address new problems or concerns.
241
242Each version is given a distinguishing version number. If the Program
243specifies a version number of this License which applies to it and "any
244later version", you have the option of following the terms and conditions
245either of that version or of any later version published by the Free
246Software Foundation. If the Program does not specify a version number of
247this License, you may choose any version ever published by the Free Software
248Foundation.
249
250 10. If you wish to incorporate parts of the Program into other free
251programs whose distribution conditions are different, write to the author
252to ask for permission. For software which is copyrighted by the Free
253Software Foundation, write to the Free Software Foundation; we sometimes
254make exceptions for this. Our decision will be guided by the two goals
255of preserving the free status of all derivatives of our free software and
256of 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
261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268REPAIR OR CORRECTION.
269
270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278POSSIBILITY 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
285possible use to the public, the best way to achieve this is to make it
286free 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
289to attach them to the start of each source file to most effectively
290convey the exclusion of warranty; and each file should have at least
291the "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 along
307 with this program; if not, write to the Free Software Foundation, Inc.,
308 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
310Also add information on how to contact you by electronic and paper mail.
311
312If the program is interactive, make it output a short notice like this
313when it starts in an interactive mode:
314
315 Gnomovision version 69, Copyright (C) year name of author
316 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 This is free software, and you are welcome to redistribute it
318 under certain conditions; type `show c' for details.
319
320The hypothetical commands `show w' and `show c' should show the appropriate
321parts of the General Public License. Of course, the commands you use may
322be called something other than `show w' and `show c'; they could even be
323mouse-clicks or menu items--whatever suits your program.
324
325You should also get your employer (if you work as a programmer) or your
326school, if any, to sign a "copyright disclaimer" for the program, if
327necessary. Here is a sample; alter the names:
328
329 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
332 <signature of Ty Coon>, 1 April 1989
333 Ty Coon, President of Vice
334
335This General Public License does not permit incorporating your program into
336proprietary programs. If your program is a subroutine library, you may
337consider it more useful to permit linking proprietary applications with the
338library. If this is what you want to do, use the GNU Lesser General
339Public License instead of this License.
diff --git a/GNUnet Install/Description.plist b/GNUnet Install/Description.plist
new file mode 100644
index 0000000..ead59ac
--- /dev/null
+++ b/GNUnet Install/Description.plist
@@ -0,0 +1,10 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>IFPkgDescriptionDescription</key>
6 <string>GNUnet is a framework for secure peer-to-peer networking that does not use any centralized or otherwise trusted services.</string>
7 <key>IFPkgDescriptionTitle</key>
8 <string>GNUnet</string>
9</dict>
10</plist>
diff --git a/GNUnet Install/ReadMe.rtf b/GNUnet Install/ReadMe.rtf
new file mode 100644
index 0000000..1651908
--- /dev/null
+++ b/GNUnet Install/ReadMe.rtf
@@ -0,0 +1,7 @@
1{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf480
2{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
3{\colortbl;\red255\green255\blue255;}
4\paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0
5\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
6
7\f0\fs24 \cf0 This package contains Extractor (libextractor) and GNUnet frameworks and graphical user interfaces for using and setting up GNUnet. The frameworks are installed to /Library/Frameworks and the user interfaces to /Applications/GNUnet. } \ No newline at end of file
diff --git a/GNUnet Install/build-package.sh b/GNUnet Install/build-package.sh
new file mode 100755
index 0000000..4f79b7a
--- /dev/null
+++ b/GNUnet Install/build-package.sh
@@ -0,0 +1,53 @@
1PACKAGE_VERSION="0.8.0c-1"
2
3BUILD_DIR="/tmp/GNUnetInstall-build"
4RESOURCE_DIR="${BUILD_DIR}/Resources"
5COMPONENT_DIR="${BUILD_DIR}/Packages"
6PACKAGE_DIR="${BUILD_DIR}/Package"
7PACKAGE_NAME="${PACKAGE_DIR}/GNUnetInstall.mpkg"
8DMG_NAME="$BUILD_DIR/GNUnetInstall-${PACKAGE_VERSION}.dmg"
9
10PACKAGEMAKER="/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
11
12# copy component packages to build dir
13sudo rm -rf "${BUILD_DIR}"
14if [ -e "${COMPONENT_DIR}" ] ; then
15 sudo rm -rf "${COMPONENT_DIR}"
16fi
17mkdir -p "${COMPONENT_DIR}"
18for pkg in "/tmp/Extractor-build/Package/Extractor.pkg" \
19 "/tmp/GNUnet-build/Package/GNUnet.pkg" \
20 "/tmp/GNUnetSetup-build/Package/GNUnetSetup.pkg" \
21 "/tmp/GNUnetSetupAssistant-build/Package/GNUnetSetupAssistant.pkg"
22do
23 sudo cp -PR "$pkg" ${COMPONENT_DIR}
24done
25
26# copy package/installer resources
27if [ -e "${RESOURCE_DIR}" ] ; then
28 rm -rf "${RESOURCE_DIR}"
29fi
30mkdir -p "${RESOURCE_DIR}"
31cp COPYING "${RESOURCE_DIR}/License.txt"
32cp ReadMe.rtf "${RESOURCE_DIR}/"
33
34
35# create package
36if [ -e "${PACKAGE_DIR}" ] ; then
37 sudo rm -rf "${PACKAGE_DIR}"
38fi
39mkdir -p "${PACKAGE_DIR}"
40
41sudo $PACKAGEMAKER -build -v -p "${PACKAGE_NAME}" -mi "${COMPONENT_DIR}" -r "${RESOURCE_DIR}" -d ./Description.plist
42
43sudo cp "/tmp/Extractor-build/Package/README.txt" "${PACKAGE_DIR}/Extractor Read Me.txt"
44sudo cp "/tmp/Extractor-build/Package/README - Mac OS X.txt" "${PACKAGE_DIR}/Extractor Read Me Mac OS X.txt"
45sudo cp "/tmp/GNUnet-build/Package/README.txt" "${PACKAGE_DIR}/GNUnet Read Me.txt"
46sudo cp "/tmp/GNUnet-build/Package/README - Mac OS X.txt" "${PACKAGE_DIR}/GNUnet Read Me Mac OS X.txt"
47
48# create disk image
49if [ -e "$DMG_NAME" ] ; then
50 sudo rm -f "$DMG_NAME"
51fi
52sudo hdiutil create -srcfolder "${PACKAGE_DIR}" -format UDBZ -volname "GNUnet ${PACKAGE_VERSION} Install" -mode 444 "$DMG_NAME"
53
diff --git a/GNUnet Setup Assistant/COPYING b/GNUnet Setup Assistant/COPYING
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/GNUnet Setup Assistant/COPYING
@@ -0,0 +1,339 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991
3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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
12freedom to share and change it. By contrast, the GNU General Public
13License is intended to guarantee your freedom to share and change free
14software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by
18the GNU Lesser General Public License instead.) You can apply it to
19your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22price. Our General Public Licenses are designed to make sure that you
23have the freedom to distribute copies of free software (and charge for
24this service if you wish), that you receive source code or can get it
25if you want it, that you can change the software or use pieces of it
26in 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
29anyone to deny you these rights or to ask you to surrender the rights.
30These restrictions translate to certain responsibilities for you if you
31distribute copies of the software, or if you modify it.
32
33 For example, if you distribute copies of such a program, whether
34gratis or for a fee, you must give the recipients all the rights that
35you have. You must make sure that they, too, receive or can get the
36source code. And you must show them these terms so they know their
37rights.
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,
41distribute and/or modify the software.
42
43 Also, for each author's protection and ours, we want to make certain
44that everyone understands that there is no warranty for this free
45software. If the software is modified by someone else and passed on, we
46want its recipients to know that what they have is not the original, so
47that any problems introduced by others will not reflect on the original
48authors' reputations.
49
50 Finally, any free program is threatened constantly by software
51patents. We wish to avoid the danger that redistributors of a free
52program will individually obtain patent licenses, in effect making the
53program proprietary. To prevent this, we have made it clear that any
54patent must be licensed for everyone's free use or not licensed at all.
55
56 The precise terms and conditions for copying, distribution and
57modification 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
63a notice placed by the copyright holder saying it may be distributed
64under the terms of this General Public License. The "Program", below,
65refers to any such program or work, and a "work based on the Program"
66means either the Program or any derivative work under copyright law:
67that is to say, a work containing the Program or a portion of it,
68either verbatim or with modifications and/or translated into another
69language. (Hereinafter, translation is included without limitation in
70the term "modification".) Each licensee is addressed as "you".
71
72Activities other than copying, distribution and modification are not
73covered by this License; they are outside its scope. The act of
74running the Program is not restricted, and the output from the Program
75is covered only if its contents constitute a work based on the
76Program (independent of having been made by running the Program).
77Whether that is true depends on what the Program does.
78
79 1. You may copy and distribute verbatim copies of the Program's
80source code as you receive it, in any medium, provided that you
81conspicuously and appropriately publish on each copy an appropriate
82copyright notice and disclaimer of warranty; keep intact all the
83notices that refer to this License and to the absence of any warranty;
84and give any other recipients of the Program a copy of this License
85along with the Program.
86
87You may charge a fee for the physical act of transferring a copy, and
88you 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
91of it, thus forming a work based on the Program, and copy and
92distribute such modifications or work under the terms of Section 1
93above, 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
114These requirements apply to the modified work as a whole. If
115identifiable sections of that work are not derived from the Program,
116and can be reasonably considered independent and separate works in
117themselves, then this License, and its terms, do not apply to those
118sections when you distribute them as separate works. But when you
119distribute the same sections as part of a whole which is a work based
120on the Program, the distribution of the whole must be on the terms of
121this License, whose permissions for other licensees extend to the
122entire whole, and thus to each and every part regardless of who wrote it.
123
124Thus, it is not the intent of this section to claim rights or contest
125your rights to work written entirely by you; rather, the intent is to
126exercise the right to control the distribution of derivative or
127collective works based on the Program.
128
129In addition, mere aggregation of another work not based on the Program
130with the Program (or with a work based on the Program) on a volume of
131a storage or distribution medium does not bring the other work under
132the scope of this License.
133
134 3. You may copy and distribute the Program (or a work based on it,
135under Section 2) in object code or executable form under the terms of
136Sections 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
155The source code for a work means the preferred form of the work for
156making modifications to it. For an executable work, complete source
157code means all the source code for all modules it contains, plus any
158associated interface definition files, plus the scripts used to
159control compilation and installation of the executable. However, as a
160special exception, the source code distributed need not include
161anything that is normally distributed (in either source or binary
162form) with the major components (compiler, kernel, and so on) of the
163operating system on which the executable runs, unless that component
164itself accompanies the executable.
165
166If distribution of executable or object code is made by offering
167access to copy from a designated place, then offering equivalent
168access to copy the source code from the same place counts as
169distribution of the source code, even though third parties are not
170compelled to copy the source along with the object code.
171
172 4. You may not copy, modify, sublicense, or distribute the Program
173except as expressly provided under this License. Any attempt
174otherwise to copy, modify, sublicense or distribute the Program is
175void, and will automatically terminate your rights under this License.
176However, parties who have received copies, or rights, from you under
177this License will not have their licenses terminated so long as such
178parties remain in full compliance.
179
180 5. You are not required to accept this License, since you have not
181signed it. However, nothing else grants you permission to modify or
182distribute the Program or its derivative works. These actions are
183prohibited by law if you do not accept this License. Therefore, by
184modifying or distributing the Program (or any work based on the
185Program), you indicate your acceptance of this License to do so, and
186all its terms and conditions for copying, distributing or modifying
187the Program or works based on it.
188
189 6. Each time you redistribute the Program (or any work based on the
190Program), the recipient automatically receives a license from the
191original licensor to copy, distribute or modify the Program subject to
192these terms and conditions. You may not impose any further
193restrictions on the recipients' exercise of the rights granted herein.
194You are not responsible for enforcing compliance by third parties to
195this License.
196
197 7. If, as a consequence of a court judgment or allegation of patent
198infringement or for any other reason (not limited to patent issues),
199conditions are imposed on you (whether by court order, agreement or
200otherwise) that contradict the conditions of this License, they do not
201excuse you from the conditions of this License. If you cannot
202distribute so as to satisfy simultaneously your obligations under this
203License and any other pertinent obligations, then as a consequence you
204may not distribute the Program at all. For example, if a patent
205license would not permit royalty-free redistribution of the Program by
206all those who receive copies directly or indirectly through you, then
207the only way you could satisfy both it and this License would be to
208refrain entirely from distribution of the Program.
209
210If any portion of this section is held invalid or unenforceable under
211any particular circumstance, the balance of the section is intended to
212apply and the section as a whole is intended to apply in other
213circumstances.
214
215It is not the purpose of this section to induce you to infringe any
216patents or other property right claims or to contest validity of any
217such claims; this section has the sole purpose of protecting the
218integrity of the free software distribution system, which is
219implemented by public license practices. Many people have made
220generous contributions to the wide range of software distributed
221through that system in reliance on consistent application of that
222system; it is up to the author/donor to decide if he or she is willing
223to distribute software through any other system and a licensee cannot
224impose that choice.
225
226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License.
228
229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License
232may add an explicit geographical distribution limitation excluding
233those countries, so that distribution is permitted only in or among
234countries not thus excluded. In such case, this License incorporates
235the limitation as if written in the body of this License.
236
237 9. The Free Software Foundation may publish revised and/or new versions
238of the General Public License from time to time. Such new versions will
239be similar in spirit to the present version, but may differ in detail to
240address new problems or concerns.
241
242Each version is given a distinguishing version number. If the Program
243specifies a version number of this License which applies to it and "any
244later version", you have the option of following the terms and conditions
245either of that version or of any later version published by the Free
246Software Foundation. If the Program does not specify a version number of
247this License, you may choose any version ever published by the Free Software
248Foundation.
249
250 10. If you wish to incorporate parts of the Program into other free
251programs whose distribution conditions are different, write to the author
252to ask for permission. For software which is copyrighted by the Free
253Software Foundation, write to the Free Software Foundation; we sometimes
254make exceptions for this. Our decision will be guided by the two goals
255of preserving the free status of all derivatives of our free software and
256of 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
261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268REPAIR OR CORRECTION.
269
270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278POSSIBILITY 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
285possible use to the public, the best way to achieve this is to make it
286free 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
289to attach them to the start of each source file to most effectively
290convey the exclusion of warranty; and each file should have at least
291the "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 along
307 with this program; if not, write to the Free Software Foundation, Inc.,
308 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
310Also add information on how to contact you by electronic and paper mail.
311
312If the program is interactive, make it output a short notice like this
313when it starts in an interactive mode:
314
315 Gnomovision version 69, Copyright (C) year name of author
316 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 This is free software, and you are welcome to redistribute it
318 under certain conditions; type `show c' for details.
319
320The hypothetical commands `show w' and `show c' should show the appropriate
321parts of the General Public License. Of course, the commands you use may
322be called something other than `show w' and `show c'; they could even be
323mouse-clicks or menu items--whatever suits your program.
324
325You should also get your employer (if you work as a programmer) or your
326school, if any, to sign a "copyright disclaimer" for the program, if
327necessary. Here is a sample; alter the names:
328
329 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
332 <signature of Ty Coon>, 1 April 1989
333 Ty Coon, President of Vice
334
335This General Public License does not permit incorporating your program into
336proprietary programs. If your program is a subroutine library, you may
337consider it more useful to permit linking proprietary applications with the
338library. If this is what you want to do, use the GNU Lesser General
339Public License instead of this License.
diff --git a/GNUnet Setup Assistant/English.lproj/InfoPlist.strings b/GNUnet Setup Assistant/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..cfc7af7
--- /dev/null
+++ b/GNUnet Setup Assistant/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/GNUnet Setup Assistant/English.lproj/MainMenu.nib/classes.nib b/GNUnet Setup Assistant/English.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 0000000..1d4a0f0
--- /dev/null
+++ b/GNUnet Setup Assistant/English.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,86 @@
1{
2 IBClasses = (
3 {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
4 {
5 ACTIONS = {backAction = id; continueAction = id; migrationButtonPressed = id; };
6 CLASS = GNDatastorePage;
7 LANGUAGE = ObjC;
8 OUTLETS = {
9 assistant = GNSetupAssistant;
10 datastoreQuotaField = NSTextField;
11 messageView = NSTextView;
12 migrationButton = NSButton;
13 };
14 SUPERCLASS = NSObject;
15 },
16 {
17 ACTIONS = {backAction = id; finishAction = id; };
18 CLASS = GNFinishPage;
19 LANGUAGE = ObjC;
20 OUTLETS = {
21 assistant = GNSetupAssistant;
22 autostartButton = NSButton;
23 messageView = NSTextView;
24 openEnhConfigButton = NSButton;
25 runUpdateButton = NSButton;
26 };
27 SUPERCLASS = NSObject;
28 },
29 {
30 ACTIONS = {backAction = id; continueAction = id; handleBandwidthSharingAction = id; };
31 CLASS = GNLoadLimitPage;
32 LANGUAGE = ObjC;
33 OUTLETS = {
34 assistant = GNSetupAssistant;
35 bandwidthShareMatrix = NSMatrix;
36 cpuUsageLimitField = NSTextField;
37 downloadLimitField = NSTextField;
38 messageView = NSTextView;
39 uploadLimitField = NSTextField;
40 };
41 SUPERCLASS = NSObject;
42 },
43 {
44 ACTIONS = {backAction = id; comboAction = id; continueAction = id; };
45 CLASS = GNNetworkConnectionPage;
46 LANGUAGE = ObjC;
47 OUTLETS = {
48 assistant = GNSetupAssistant;
49 ipAddressField = NSTextField;
50 messageView = NSTextView;
51 networkInterfaceComboBox = NSComboBox;
52 };
53 SUPERCLASS = NSObject;
54 },
55 {
56 ACTIONS = {backAction = id; continueAction = id; };
57 CLASS = GNServiceAccountPage;
58 LANGUAGE = ObjC;
59 OUTLETS = {
60 assistant = GNSetupAssistant;
61 groupField = NSTextField;
62 messageView = NSTextView;
63 userField = NSTextField;
64 };
65 SUPERCLASS = NSObject;
66 },
67 {
68 CLASS = GNSetupAssistant;
69 LANGUAGE = ObjC;
70 OUTLETS = {tabView = NSTabView; window = NSWindow; };
71 SUPERCLASS = NSObject;
72 },
73 {
74 ACTIONS = {backAction = id; continueAction = id; };
75 CLASS = GNWelcomePage;
76 LANGUAGE = ObjC;
77 OUTLETS = {
78 assistant = GNSetupAssistant;
79 backButton = NSButton;
80 messageView = NSTextView;
81 };
82 SUPERCLASS = NSObject;
83 }
84 );
85 IBVersion = 1;
86} \ No newline at end of file
diff --git a/GNUnet Setup Assistant/English.lproj/MainMenu.nib/info.nib b/GNUnet Setup Assistant/English.lproj/MainMenu.nib/info.nib
new file mode 100644
index 0000000..8cb3bef
--- /dev/null
+++ b/GNUnet Setup Assistant/English.lproj/MainMenu.nib/info.nib
@@ -0,0 +1,22 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>IBDocumentLocation</key>
6 <string>135 105 356 240 0 0 1680 1028 </string>
7 <key>IBEditorPositions</key>
8 <dict>
9 <key>29</key>
10 <string>132 352 311 44 0 0 1680 1028 </string>
11 </dict>
12 <key>IBFramework Version</key>
13 <string>489.0</string>
14 <key>IBOpenObjects</key>
15 <array>
16 <integer>29</integer>
17 <integer>21</integer>
18 </array>
19 <key>IBSystem Version</key>
20 <string>8S165</string>
21</dict>
22</plist>
diff --git a/GNUnet Setup Assistant/English.lproj/MainMenu.nib/keyedobjects.nib b/GNUnet Setup Assistant/English.lproj/MainMenu.nib/keyedobjects.nib
new file mode 100644
index 0000000..43a6251
--- /dev/null
+++ b/GNUnet Setup Assistant/English.lproj/MainMenu.nib/keyedobjects.nib
Binary files differ
diff --git a/GNUnet Setup Assistant/GNDatastorePage.h b/GNUnet Setup Assistant/GNDatastorePage.h
new file mode 100644
index 0000000..9dc01d3
--- /dev/null
+++ b/GNUnet Setup Assistant/GNDatastorePage.h
@@ -0,0 +1,26 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import <Cocoa/Cocoa.h>
12#import "GNSetupAssistant.h"
13
14@interface GNDatastorePage : NSObject {
15 IBOutlet GNSetupAssistant *assistant;
16 IBOutlet NSTextView *messageView;
17 IBOutlet NSTextField *datastoreQuotaField;
18 IBOutlet NSButton *migrationButton;
19}
20
21- (void)awakeFromNib;
22- (IBAction)backAction:(id)sender;
23- (IBAction)continueAction:(id)sender;
24- (IBAction)migrationButtonPressed:(id)sender;
25- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
26@end
diff --git a/GNUnet Setup Assistant/GNDatastorePage.m b/GNUnet Setup Assistant/GNDatastorePage.m
new file mode 100644
index 0000000..80d7c7a
--- /dev/null
+++ b/GNUnet Setup Assistant/GNDatastorePage.m
@@ -0,0 +1,82 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import "GNDatastorePage.h"
12
13@implementation GNDatastorePage
14- (void)awakeFromNib
15{
16 char *val;
17
18 [messageView setDrawsBackground:NO];
19 [[messageView enclosingScrollView] setDrawsBackground:NO];
20
21 GNUNET_GC_get_configuration_value_string(
22 [assistant gnunetGCConfiguration], "FS", "QUOTA", "1024", &val);
23 [datastoreQuotaField setStringValue:[[[NSString alloc]
24 initWithCString:val
25 encoding:NSUTF8StringEncoding] autorelease]];
26 GNUNET_free(val);
27
28 if (GNUNET_GC_get_configuration_value_yesno(
29 [assistant gnunetGCConfiguration], "FS",
30 "ACTIVEMIGRATION", GNUNET_YES) == GNUNET_YES)
31 [migrationButton setState:NSOnState];
32 else
33 [migrationButton setState:NSOffState];
34}
35
36- (IBAction)backAction:(id)sender
37{
38 NSControl *control = (NSControl *)sender;
39 if ([[control window] firstResponder] != nil &&
40 [[control window] firstResponder] != control &&
41 [[control window] makeFirstResponder:nil] == NO) {
42 return;
43 }
44 [assistant previousPage];
45}
46
47- (IBAction)continueAction:(id)sender
48{
49 NSControl *control = (NSControl *)sender;
50 if ([[control window] firstResponder] != nil &&
51 [[control window] firstResponder] != control &&
52 [[control window] makeFirstResponder:nil] == NO) {
53 return;
54 }
55 [assistant nextPage];
56}
57
58- (IBAction)migrationButtonPressed:(id)sender
59{
60 if ([migrationButton state] == NSOnState)
61 [assistant setConfigurationOption:"ACTIVEMIGRATION"
62 inSection:"FS"
63 toValue:"YES"
64 fromControl:migrationButton];
65 else
66 [assistant setConfigurationOption:"ACTIVEMIGRATION"
67 inSection:"FS"
68 toValue:"NO"
69 fromControl:migrationButton];
70}
71
72- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
73{
74 if (control == datastoreQuotaField)
75 return [assistant setConfigurationOption:"QUOTA"
76 inSection:"FS"
77 toValue:[[control stringValue] UTF8String]
78 fromControl:control];
79
80 return YES;
81}
82@end
diff --git a/GNUnet Setup Assistant/GNFinishPage.h b/GNUnet Setup Assistant/GNFinishPage.h
new file mode 100644
index 0000000..420ad13
--- /dev/null
+++ b/GNUnet Setup Assistant/GNFinishPage.h
@@ -0,0 +1,25 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import <Cocoa/Cocoa.h>
12#import "GNSetupAssistant.h"
13
14@interface GNFinishPage : NSObject {
15 IBOutlet GNSetupAssistant *assistant;
16 IBOutlet NSTextView *messageView;
17 IBOutlet NSButton *autostartButton;
18 IBOutlet NSButton *runUpdateButton;
19 IBOutlet NSButton *openEnhConfigButton;
20}
21
22- (void)awakeFromNib;
23- (IBAction)backAction:(id)sender;
24- (IBAction)finishAction:(id)sender;
25@end
diff --git a/GNUnet Setup Assistant/GNFinishPage.m b/GNUnet Setup Assistant/GNFinishPage.m
new file mode 100644
index 0000000..f75415c
--- /dev/null
+++ b/GNUnet Setup Assistant/GNFinishPage.m
@@ -0,0 +1,46 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import "GNFinishPage.h"
12
13@implementation GNFinishPage
14- (void)awakeFromNib
15{
16 [messageView setDrawsBackground:NO];
17 [[messageView enclosingScrollView] setDrawsBackground:NO];
18
19 if (GNUNET_configure_autostart(
20 [assistant gnunetGEContext], GNUNET_YES,
21 GNUNET_YES, NULL, NULL, NULL, NULL))
22 [autostartButton setEnabled:YES];
23 else
24 [autostartButton setEnabled:NO];
25
26 if (GNUNET_GC_get_configuration_value_yesno(
27 [assistant gnunetGCConfiguration], "GNUNETD",
28 "AUTOSTART", GNUNET_NO) == GNUNET_YES)
29 [autostartButton setState:NSOnState];
30 else
31 [autostartButton setState:NSOffState];
32
33 [runUpdateButton setState:NSOnState];
34 [openEnhConfigButton setState:NSOffState];
35}
36
37- (IBAction)backAction:(id)sender
38{
39 [assistant previousPage];
40}
41
42- (IBAction)finishAction:(id)sender
43{
44 [assistant finishSetup];
45}
46@end
diff --git a/GNUnet Setup Assistant/GNLoadLimitPage.h b/GNUnet Setup Assistant/GNLoadLimitPage.h
new file mode 100644
index 0000000..0e76652
--- /dev/null
+++ b/GNUnet Setup Assistant/GNLoadLimitPage.h
@@ -0,0 +1,28 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import <Cocoa/Cocoa.h>
12#import "GNSetupAssistant.h"
13
14@interface GNLoadLimitPage : NSObject {
15 IBOutlet GNSetupAssistant *assistant;
16 IBOutlet NSTextView *messageView;
17 IBOutlet NSTextField *uploadLimitField;
18 IBOutlet NSTextField *downloadLimitField;
19 IBOutlet NSTextField *cpuUsageLimitField;
20 IBOutlet NSMatrix *bandwidthShareMatrix;
21}
22
23- (void)awakeFromNib;
24- (IBAction)backAction:(id)sender;
25- (IBAction)continueAction:(id)sender;
26- (IBAction)handleBandwidthSharingAction:(id)sender;
27- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
28@end
diff --git a/GNUnet Setup Assistant/GNLoadLimitPage.m b/GNUnet Setup Assistant/GNLoadLimitPage.m
new file mode 100644
index 0000000..5e6a9fb
--- /dev/null
+++ b/GNUnet Setup Assistant/GNLoadLimitPage.m
@@ -0,0 +1,114 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import "GNLoadLimitPage.h"
12
13@implementation GNLoadLimitPage
14- (void)awakeFromNib
15{
16 char *val;
17
18 [messageView setDrawsBackground:NO];
19 [[messageView enclosingScrollView] setDrawsBackground:NO];
20
21 GNUNET_GC_get_configuration_value_string(
22 [assistant gnunetGCConfiguration], "LOAD",
23 "MAXNETUPBPSTOTAL", "50000", &val);
24 [uploadLimitField setStringValue:[[[NSString alloc]
25 initWithCString:val
26 encoding:NSUTF8StringEncoding] autorelease]];
27 GNUNET_free(val);
28
29 GNUNET_GC_get_configuration_value_string(
30 [assistant gnunetGCConfiguration], "LOAD",
31 "MAXNETDOWNBPSTOTAL", "50000", &val);
32 [downloadLimitField setStringValue:[[[NSString alloc]
33 initWithCString:val
34 encoding:NSUTF8StringEncoding] autorelease]];
35 GNUNET_free(val);
36
37 [[bandwidthShareMatrix cellAtRow:0 column:0]
38 setRepresentedObject:@"YES"];
39 [[bandwidthShareMatrix cellAtRow:1 column:0]
40 setRepresentedObject:@"NO"];
41 if (GNUNET_GC_get_configuration_value_yesno(
42 [assistant gnunetGCConfiguration], "LOAD",
43 "BASICLIMITING", GNUNET_NO) == GNUNET_YES) {
44 [bandwidthShareMatrix setState:1 atRow:0 column:0];
45 }
46 else {
47 [bandwidthShareMatrix setState:1 atRow:1 column:0];
48 }
49
50 GNUNET_GC_get_configuration_value_string(
51 [assistant gnunetGCConfiguration], "LOAD", "MAXCPULOAD",
52 "50", &val);
53 [cpuUsageLimitField setStringValue:[[[NSString alloc]
54 initWithCString:val
55 encoding:NSUTF8StringEncoding] autorelease]];
56 GNUNET_free(val);
57}
58
59- (IBAction)backAction:(id)sender
60{
61 NSControl *control = (NSControl *)sender;
62 if ([[control window] firstResponder] != nil &&
63 [[control window] firstResponder] != control &&
64 [[control window] makeFirstResponder:nil] == NO) {
65 return;
66 }
67 [assistant previousPage];
68}
69
70- (IBAction)continueAction:(id)sender
71{
72 NSControl *control = (NSControl *)sender;
73 if ([[control window] firstResponder] != nil &&
74 [[control window] firstResponder] != control &&
75 [[control window] makeFirstResponder:nil] == NO) {
76 return;
77 }
78 [assistant nextPage];
79}
80
81- (IBAction)handleBandwidthSharingAction:(id)sender
82{
83 NSString *obj;
84
85 obj = [[(NSMatrix *)sender selectedCell] representedObject];
86 [assistant setConfigurationOption:"BASICLIMITING"
87 inSection:"LOAD"
88 toValue:[obj UTF8String]
89 fromControl:(NSControl *)sender];
90}
91
92- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
93{
94 if (control == uploadLimitField)
95 return [assistant setConfigurationOption:"MAXNETUPBPSTOTAL"
96 inSection:"LOAD"
97 toValue:[[control stringValue] UTF8String]
98 fromControl:control];
99 else if (control == downloadLimitField)
100 return [assistant setConfigurationOption:"MAXNETDOWNBPSTOTAL"
101 inSection:"LOAD"
102 toValue:[[control stringValue] UTF8String]
103 fromControl:control];
104 else if (control == cpuUsageLimitField) {
105 char s[16];
106 snprintf(s, 16, "%d", [control intValue]);
107 return [assistant setConfigurationOption:"MAXCPULOAD"
108 inSection:"LOAD"
109 toValue:s
110 fromControl:control];
111 }
112 return YES;
113}
114@end
diff --git a/GNUnet Setup Assistant/GNNetworkConnectionPage.h b/GNUnet Setup Assistant/GNNetworkConnectionPage.h
new file mode 100644
index 0000000..5e8f8f3
--- /dev/null
+++ b/GNUnet Setup Assistant/GNNetworkConnectionPage.h
@@ -0,0 +1,26 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import <Cocoa/Cocoa.h>
12#import "GNSetupAssistant.h"
13
14@interface GNNetworkConnectionPage : NSObject {
15 IBOutlet GNSetupAssistant *assistant;
16 IBOutlet NSTextView *messageView;
17 IBOutlet NSComboBox *networkInterfaceComboBox;
18 IBOutlet NSTextField *ipAddressField;
19}
20
21- (void)awakeFromNib;
22- (IBAction)backAction:(id)sender;
23- (IBAction)continueAction:(id)sender;
24- (IBAction)comboAction:(id)sender;
25- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
26@end
diff --git a/GNUnet Setup Assistant/GNNetworkConnectionPage.m b/GNUnet Setup Assistant/GNNetworkConnectionPage.m
new file mode 100644
index 0000000..f72b0f8
--- /dev/null
+++ b/GNUnet Setup Assistant/GNNetworkConnectionPage.m
@@ -0,0 +1,115 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import "GNNetworkConnectionPage.h"
12
13static int insert_nic(const char *name, int default_value, void *opaque)
14{
15 NSObject *o;
16 NSComboBox *control = (NSComboBox *)opaque;
17 o = [[[NSString alloc] initWithCString:name
18 encoding:NSUTF8StringEncoding] autorelease];
19 [control addItemWithObjectValue:o];
20 if (default_value)
21 [control selectItemWithObjectValue:o];
22 return GNUNET_OK;
23}
24
25@implementation GNNetworkConnectionPage
26- (void)awakeFromNib
27{
28 char *val;
29 [messageView setDrawsBackground:NO];
30 [[messageView enclosingScrollView] setDrawsBackground:NO];
31
32 [networkInterfaceComboBox removeAllItems];
33
34 GNUNET_list_network_interfaces([assistant gnunetGEContext],
35 &insert_nic, networkInterfaceComboBox);
36 if ([networkInterfaceComboBox numberOfItems] != 0) {
37 [networkInterfaceComboBox setNumberOfVisibleItems:
38 [networkInterfaceComboBox numberOfItems] < 6 ?
39 [networkInterfaceComboBox numberOfItems] : 6];
40 if ([networkInterfaceComboBox indexOfSelectedItem] == -1)
41 [networkInterfaceComboBox selectItemAtIndex:0];
42 [assistant setConfigurationOption:"INTERFACE"
43 inSection:"NETWORK"
44 toValue:[[networkInterfaceComboBox stringValue]
45 UTF8String]
46 fromControl:networkInterfaceComboBox];
47 [assistant setConfigurationOption:"INTERFACES"
48 inSection:"LOAD"
49 toValue:[[networkInterfaceComboBox stringValue]
50 UTF8String]
51 fromControl:networkInterfaceComboBox];
52 }
53
54 GNUNET_GC_get_configuration_value_string(
55 [assistant gnunetGCConfiguration], "NETWORK", "IP", "", &val);
56 [ipAddressField setStringValue:[[[NSString alloc]
57 initWithCString:val
58 encoding:NSUTF8StringEncoding] autorelease]];
59 GNUNET_free(val);
60}
61
62- (IBAction)backAction:(id)sender
63{
64 NSControl *control = (NSControl *)sender;
65 if ([[control window] firstResponder] != nil &&
66 [[control window] firstResponder] != control &&
67 [[control window] makeFirstResponder:nil] == NO) {
68 return;
69 }
70 [assistant previousPage];
71}
72
73- (IBAction)continueAction:(id)sender
74{
75 NSControl *control = (NSControl *)sender;
76 if ([[control window] firstResponder] != nil &&
77 [[control window] firstResponder] != control &&
78 [[control window] makeFirstResponder:nil] == NO) {
79 return;
80 }
81 [assistant nextPage];
82}
83
84- (IBAction)comboAction:(id)sender
85{
86 NSControl *control = (NSControl *)sender;
87 [assistant setConfigurationOption:"INTERFACE"
88 inSection:"NETWORK"
89 toValue:[[control stringValue] UTF8String]
90 fromControl:control];
91 [assistant setConfigurationOption:"INTERFACES"
92 inSection:"LOAD"
93 toValue:[[control stringValue] UTF8String]
94 fromControl:control];
95}
96
97- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
98{
99 if (control == ipAddressField)
100 return [assistant setConfigurationOption:"IP"
101 inSection:"NETWORK"
102 toValue:[[control stringValue] UTF8String]
103 fromControl:control];
104 else if (control == networkInterfaceComboBox)
105 return [assistant setConfigurationOption:"INTERFACE"
106 inSection:"NETWORK"
107 toValue:[[control stringValue] UTF8String]
108 fromControl:control] &&
109 [assistant setConfigurationOption:"INTERFACES"
110 inSection:"LOAD"
111 toValue:[[control stringValue] UTF8String]
112 fromControl:control];
113 return YES;
114}
115@end
diff --git a/GNUnet Setup Assistant/GNServiceAccountPage.h b/GNUnet Setup Assistant/GNServiceAccountPage.h
new file mode 100644
index 0000000..e13423a
--- /dev/null
+++ b/GNUnet Setup Assistant/GNServiceAccountPage.h
@@ -0,0 +1,26 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import <Cocoa/Cocoa.h>
12#import "GNSetupAssistant.h"
13
14@interface GNServiceAccountPage : NSObject {
15 IBOutlet GNSetupAssistant *assistant;
16 IBOutlet NSTextView *messageView;
17 IBOutlet NSTextField *userField;
18 IBOutlet NSTextField *groupField;
19}
20
21- (void)awakeFromNib;
22- (void)refresh;
23- (IBAction)backAction:(id)sender;
24- (IBAction)continueAction:(id)sender;
25- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
26@end
diff --git a/GNUnet Setup Assistant/GNServiceAccountPage.m b/GNUnet Setup Assistant/GNServiceAccountPage.m
new file mode 100644
index 0000000..c151b13
--- /dev/null
+++ b/GNUnet Setup Assistant/GNServiceAccountPage.m
@@ -0,0 +1,122 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11// TODO: username field formatter
12
13#include <sys/types.h>
14#include <pwd.h>
15#include <grp.h>
16
17#import "GNServiceAccountPage.h"
18
19@implementation GNServiceAccountPage
20- (void)awakeFromNib
21{
22 [messageView setDrawsBackground:NO];
23 [[messageView enclosingScrollView] setDrawsBackground:NO];
24
25 [self refresh];
26 [[NSNotificationCenter defaultCenter] addObserver:self
27 selector:@selector(refresh)
28 name:@"GNAuthorizationChanged" object:nil];
29}
30
31- (void)refresh
32{
33 char *user_name;
34 char *group_name;
35 struct passwd *pwd;
36 struct group *grp;
37
38 if (([assistant isAuthorized] == YES) || (NULL != getpwnam ("gnunet")))
39 user_name = GNUNET_strdup ("gnunet");
40 else {
41 pwd = getpwuid (geteuid ());
42 if (pwd != NULL)
43 user_name = GNUNET_strdup (pwd->pw_name);
44 else
45 user_name = NULL;
46 }
47
48
49 if (([assistant isAuthorized] == YES) || (NULL != getgrnam ("gnunet")))
50 group_name = GNUNET_strdup ("gnunet");
51 else {
52 grp = getgrgid (getegid ());
53 if ((grp != NULL) && (grp->gr_name != NULL))
54 group_name = GNUNET_strdup (grp->gr_name);
55 else
56 group_name = NULL;
57 }
58
59 if (user_name != NULL) {
60 [userField setStringValue:[[[NSString alloc]
61 initWithCString:user_name
62 encoding:NSUTF8StringEncoding] autorelease]];
63 [assistant setConfigurationOption:"USER"
64 inSection:"GNUNETD"
65 toValue:[[userField stringValue] UTF8String]
66 fromControl:userField];
67 }
68
69 if (group_name != NULL) {
70 [groupField setStringValue:[[[NSString alloc]
71 initWithCString:group_name
72 encoding:NSUTF8StringEncoding] autorelease]];
73 [assistant setConfigurationOption:"GROUP"
74 inSection:"GNUNETD"
75 toValue:[[groupField stringValue] UTF8String]
76 fromControl:groupField];
77 }
78
79 [userField setEditable:[assistant isAuthorized]];
80 [groupField setEditable:[assistant isAuthorized]];
81
82 GNUNET_free_non_null(user_name);
83 GNUNET_free_non_null(group_name);
84}
85
86- (IBAction)backAction:(id)sender
87{
88 NSControl *control = (NSControl *)sender;
89 if ([[control window] firstResponder] != nil &&
90 [[control window] firstResponder] != control &&
91 [[control window] makeFirstResponder:nil] == NO) {
92 return;
93 }
94 [assistant previousPage];
95}
96
97- (IBAction)continueAction:(id)sender
98{
99 NSControl *control = (NSControl *)sender;
100 if ([[control window] firstResponder] != nil &&
101 [[control window] firstResponder] != control &&
102 [[control window] makeFirstResponder:nil] == NO) {
103 return;
104 }
105 [assistant nextPage];
106}
107
108- (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor
109{
110 if (control == userField)
111 return [assistant setConfigurationOption:"USER"
112 inSection:"GNUNETD"
113 toValue:[[control stringValue] UTF8String]
114 fromControl:control];
115 else if (control == groupField)
116 return [assistant setConfigurationOption:"GROUP"
117 inSection:"GNUNETD"
118 toValue:[[control stringValue] UTF8String]
119 fromControl:control];
120 return YES;
121}
122@end
diff --git a/GNUnet Setup Assistant/GNSetupAssistant.h b/GNUnet Setup Assistant/GNSetupAssistant.h
new file mode 100644
index 0000000..6d4c985
--- /dev/null
+++ b/GNUnet Setup Assistant/GNSetupAssistant.h
@@ -0,0 +1,60 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import <Security/Security.h>
12#import <Cocoa/Cocoa.h>
13
14#include <GNUnet/gnunet_util.h>
15#include <GNUnet/gnunet_setup_lib.h>
16
17@interface GNSetupAssistant : NSObject {
18 struct GNUNET_GE_Context *errorContext;
19 struct GNUNET_GNS_Context *gnsContext;
20 struct GNUNET_GC_Configuration *config;
21 NSMutableArray *gnsOptionsArray;
22 char *configFilename;
23
24 AuthorizationRef authRef;
25 BOOL isPreauthorized;
26
27 IBOutlet NSWindow *window;
28 IBOutlet NSTabView *tabView;
29}
30
31- (id)init;
32- (void)awakeFromNib;
33
34- (struct GNUNET_GC_Configuration *)gnunetGCConfiguration;
35- (struct GNUNET_GE_Context *)gnunetGEContext;
36- (BOOL)setConfigurationOption:(const char *)option
37 inSection:(const char *)section
38 toValue:(const char *)value
39 fromControl:(NSControl *)control;
40
41- (BOOL)preauthorize;
42- (BOOL)isAuthorized;
43//- (AuthorizationRef)authorization;
44- (int)saveConfig;
45- (int)privilegedSaveConfig;
46- (int)createUserGroup;
47- (int)setupAutostart;
48
49- (void)nextPage;
50- (void)previousPage;
51- (void)finishSetup;
52
53- (void)displayErrorAlert:(NSString *)message;
54- (void)alertDidEnd:(NSAlert *)alert returnCode:(int)returnCode
55 contextInfo:(void *)contextInfo;
56- (void)applicationWillTerminate:(NSNotification *)notification;
57
58- (void)getDefaultsFrom:(struct GNUNET_GNS_TreeNode *)pos
59 optionsTo:(NSMutableArray *)optionsArray;
60@end
diff --git a/GNUnet Setup Assistant/GNSetupAssistant.m b/GNUnet Setup Assistant/GNSetupAssistant.m
new file mode 100644
index 0000000..cb1ea5d
--- /dev/null
+++ b/GNUnet Setup Assistant/GNSetupAssistant.m
@@ -0,0 +1,510 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import "GNSetupAssistant.h"
12
13#include <GNUnet/gnunet_directories.h>
14
15static char * input_string(FILE *f)
16{
17 char *buf;
18 int len;
19 int n;
20
21 n = fread(&len, sizeof(len), 1, f);
22 if (n < 1)
23 return NULL;
24
25 if (len <= 0)
26 return NULL;
27
28 buf = malloc(len);
29 n = fread(buf, 1, len, f);
30 if (n < len) {
31 free(buf);
32 return NULL;
33 }
34
35 return buf;
36}
37
38
39static void output_string(FILE *f, char *s)
40{
41 int len;
42
43 if (s == NULL) {
44 len = 0;
45 fwrite(&len, sizeof(len), 1, f);
46 return;
47 }
48
49 len = strlen(s)+1;
50 fwrite(&len, sizeof(len), 1, f);
51 fwrite(s, 1, len, f);
52}
53
54@implementation GNSetupAssistant
55- (id) init
56{
57 if (self = [super init]) {
58 char *dirname, *specname;
59
60 errorContext = GNUNET_GE_create_context_stderr(GNUNET_NO,
61 GNUNET_GE_WARNING | GNUNET_GE_ERROR | GNUNET_GE_FATAL |
62 GNUNET_GE_USER | GNUNET_GE_ADMIN | GNUNET_GE_DEVELOPER |
63 GNUNET_GE_IMMEDIATE | GNUNET_GE_BULK);
64 GNUNET_GE_setDefaultContext(errorContext);
65 GNUNET_os_init(errorContext);
66
67 config = GNUNET_GC_create();
68 if (config == NULL) {
69 GNUNET_GE_free_context(errorContext);
70 [self release];
71 return nil;
72 }
73
74 // load spec
75 dirname = GNUNET_get_installation_path(GNUNET_IPK_DATADIR);
76 specname = GNUNET_malloc(strlen (dirname) +
77 strlen ("config-daemon.scm") + 1);
78 strcpy (specname, dirname);
79 strcat (specname, "config-daemon.scm");
80
81 gnsContext = GNUNET_GNS_load_specification(errorContext, config,
82 specname);
83 if (gnsContext == NULL) {
84 GNUNET_GE_free_context(errorContext);
85 GNUNET_GC_free(config);
86 [self release];
87 return nil;
88 }
89 GNUNET_free(specname);
90 GNUNET_free(dirname);
91
92 gnsOptionsArray = [NSMutableArray new];
93 [self getDefaultsFrom:GNUNET_GNS_get_tree_root(gnsContext)
94 optionsTo:gnsOptionsArray];
95
96 isPreauthorized = NO;
97
98 [NSApp setDelegate:self];
99 }
100
101 return self;
102}
103
104- (void) awakeFromNib
105{
106 char *filename;
107
108// TODO: take config filename from command line if specified
109/* s = [[NSUserDefaults standardUserDefaults]
110 stringForKey:@"StartupConfigType"];
111 NSLog(@"MODE: [%@]", s);
112 if (s != nil && [s caseInsensitiveCompare:@"Daemon"] == NSOrderedSame) {
113 printf("starting up with daemon config\n");
114 isDaemonConfig = YES;
115 }
116*/
117 filename = GNUNET_DEFAULT_DAEMON_CONFIG_FILE;
118 configFilename = GNUNET_expand_file_name(errorContext, filename);
119
120 [tabView selectFirstTabViewItem:self];
121}
122
123- (struct GNUNET_GC_Configuration *)gnunetGCConfiguration
124{
125 return config;
126}
127
128- (struct GNUNET_GE_Context *)gnunetGEContext
129{
130 return errorContext;
131}
132
133- (BOOL)setConfigurationOption:(const char *)option
134 inSection:(const char *)section
135 toValue:(const char *)value
136 fromControl:(NSControl *)control
137{
138 struct GNUNET_GE_Context *ectx;
139 struct GNUNET_GE_Memory *ectxMemory;
140 int ret;
141
142 ectxMemory = GNUNET_GE_memory_create(2);
143 ectx = GNUNET_GE_create_context_memory(GNUNET_GE_ALL, ectxMemory);
144 GNUNET_GC_set_error_context(config, ectx);
145 ret = GNUNET_GC_set_configuration_value_string(config,
146 errorContext,
147 section,
148 option,
149 value);
150 GNUNET_GC_set_error_context(config, errorContext);
151 if (ret != 0) {
152 NSAlert *alert = [[[NSAlert alloc] init] autorelease];
153 [alert setMessageText:@"Error!"];
154 [alert addButtonWithTitle:@"OK"];
155 [alert setInformativeText:[[[NSString alloc]
156 initWithCString:GNUNET_GE_memory_get(ectxMemory, 0)
157 encoding:NSUTF8StringEncoding] autorelease]];
158 [alert setAlertStyle:NSWarningAlertStyle];
159 [alert beginSheetModalForWindow:[(NSControl *)control window]
160 modalDelegate:self
161 didEndSelector:@selector(alertDidEnd:returnCode:
162 contextInfo:)
163 contextInfo:control];
164 }
165 GNUNET_GE_memory_free(ectxMemory);
166
167 return (ret != 0 ? NO : YES);
168}
169
170- (BOOL)preauthorize
171{
172 AuthorizationFlags authFlags = kAuthorizationFlagDefaults;
173 OSStatus status;
174
175 if (isPreauthorized == YES)
176 return YES;
177
178 status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
179 authFlags, &authRef);
180 if (status != errAuthorizationSuccess)
181 return NO;
182
183 AuthorizationItem authItems = { kAuthorizationRightExecute, 0, NULL, 0};
184 AuthorizationRights authRights = {1, &authItems};
185
186 authFlags = kAuthorizationFlagDefaults |
187 kAuthorizationFlagInteractionAllowed |
188 kAuthorizationFlagPreAuthorize |
189 kAuthorizationFlagExtendRights;
190 status = AuthorizationCopyRights(authRef, &authRights, NULL,
191 authFlags, NULL);
192
193 if (status != errAuthorizationSuccess) {
194 AuthorizationFree(authRef, kAuthorizationFlagDefaults);
195 return NO;
196 }
197
198 isPreauthorized = YES;
199
200 [[NSNotificationCenter defaultCenter]
201 postNotificationName:@"GNAuthorizationChanged" object:self];
202
203 return YES;
204}
205
206- (BOOL)isAuthorized
207{
208 return isPreauthorized;
209}
210
211- (int)saveConfig
212{
213 BOOL didSave;
214
215 didSave = NO;
216 if (isPreauthorized) {
217 if ([self privilegedSaveConfig] == 0)
218 didSave = YES;
219 }
220 else {
221 if (GNUNET_GC_write_configuration (config, configFilename) == 0)
222 didSave = YES;
223 }
224
225 return didSave == YES ? 0 : 1;
226}
227
228- (int)privilegedSaveConfig
229{
230 OSStatus status;
231 AuthorizationFlags authFlags = kAuthorizationFlagDefaults;
232 NSString *toolPath;
233 char *toolArgs[] = { "writeConfig", configFilename, NULL };
234 FILE *ioPipe = NULL;
235 NSBundle *toolBundle;
236 int ret;
237
238 toolBundle = [NSBundle bundleWithIdentifier:@"org.gnunet.GNUnet"];
239 toolPath = [[toolBundle resourcePath]
240 stringByAppendingPathComponent:@"gnunet-macosx-tool"];
241 if (toolPath == nil)
242 return -1;
243
244 authFlags = kAuthorizationFlagDefaults;
245 status = AuthorizationExecuteWithPrivileges(authRef,
246 [toolPath UTF8String], authFlags, toolArgs, &ioPipe);
247 ret = -1;
248 if (status == errAuthorizationSuccess) {
249 NSEnumerator *e = [gnsOptionsArray objectEnumerator];
250 id o;
251
252 while (o = [e nextObject]) {
253 char *section, *option, *value;
254
255 section = strdup([(NSString *)o UTF8String]);
256 option = section;
257 while (*option != '\0' && *option != ':')
258 option++;
259 if (option == '\0') {
260 free(section);
261 continue;
262 }
263 option[0] = '\0';
264 option++;
265
266 ret = GNUNET_GC_get_configuration_value_string(config,
267 section, option, NULL, &value);
268 if (ret != GNUNET_SYSERR) {
269 output_string(ioPipe, section);
270 output_string(ioPipe, option);
271 output_string(ioPipe, value);
272 GNUNET_free(value);
273 }
274 free(section);
275 }
276 output_string(ioPipe, NULL);
277
278 do {
279 char *value;
280 value = input_string(ioPipe);
281 if (value != NULL && strcmp(value, "OK") == 0)
282 ret = 0;
283 } while (!feof(ioPipe));
284
285 fclose(ioPipe);
286 }
287
288 return ret;
289}
290
291- (int)createUserGroup
292{
293 OSStatus status;
294 AuthorizationFlags authFlags = kAuthorizationFlagDefaults;
295 NSString *toolPath;
296 char *toolArgs[4];
297 FILE *ioPipe = NULL;
298 NSBundle *toolBundle;
299 char *username, *groupname;
300 int ret;
301
302 toolBundle = [NSBundle bundleWithIdentifier:@"org.gnunet.GNUnet"];
303 toolPath = [[toolBundle resourcePath]
304 stringByAppendingPathComponent:@"gnunet-macosx-tool"];
305 if (toolPath == nil)
306 return -1;
307
308 username = groupname = NULL;
309 GNUNET_GC_get_configuration_value_string (config,
310 "GNUNETD", "USER", "gnunet", &username);
311 GNUNET_GC_get_configuration_value_string (config,
312 "GNUNETD", "GROUP", "gnunet", &groupname);
313
314 if (username == NULL || groupname == NULL)
315 return -1;
316 if (strlen(username) == 0)
317 return -1;
318
319 toolArgs[0] = "createUserGroup";
320 toolArgs[1] = username;
321 toolArgs[2] = groupname;
322 toolArgs[3] = NULL;
323 authFlags = kAuthorizationFlagDefaults;
324 status = AuthorizationExecuteWithPrivileges(authRef,
325 [toolPath UTF8String], authFlags, toolArgs, &ioPipe);
326 ret = -1;
327 if (status == errAuthorizationSuccess) {
328 do {
329 char *value;
330 value = input_string(ioPipe);
331 if (value != NULL && strcmp(value, "OK") == 0)
332 ret = 0;
333 } while (!feof(ioPipe));
334
335 fclose(ioPipe);
336 }
337
338 GNUNET_free(username);
339 GNUNET_free(groupname);
340
341 return ret;
342}
343
344- (int)setupAutostart
345{
346 OSStatus status;
347 AuthorizationFlags authFlags = kAuthorizationFlagDefaults;
348 NSString *toolPath;
349 char *toolArgs[5];
350 FILE *ioPipe = NULL;
351 NSBundle *toolBundle;
352 char *username, *groupname;
353 int doAutostart;
354 int ret;
355
356 toolBundle = [NSBundle bundleWithIdentifier:@"org.gnunet.GNUnet"];
357 toolPath = [[toolBundle resourcePath]
358 stringByAppendingPathComponent:@"gnunet-macosx-tool"];
359 if (toolPath == nil)
360 return -1;
361
362 username = groupname = NULL;
363 GNUNET_GC_get_configuration_value_string (config,
364 "GNUNETD", "USER", "gnunet", &username);
365 GNUNET_GC_get_configuration_value_string (config,
366 "GNUNETD", "GROUP", "gnunet", &groupname);
367 if (GNUNET_GC_get_configuration_value_yesno(config,
368 "GNUNETD", "AUTOSTART", GNUNET_NO) == GNUNET_YES)
369 doAutostart = 1;
370 else
371 doAutostart = 0;
372
373 if (username == NULL || groupname == NULL)
374 return -1;
375 if (strlen(username) == 0)
376 return -1;
377
378 toolArgs[0] = "setupAutostart";
379 toolArgs[1] = doAutostart == 1 ? "1" : "0";
380 toolArgs[2] = username;
381 toolArgs[3] = groupname;
382 toolArgs[4] = NULL;
383 authFlags = kAuthorizationFlagDefaults;
384 status = AuthorizationExecuteWithPrivileges(authRef,
385 [toolPath UTF8String], authFlags, toolArgs, &ioPipe);
386 ret = -1;
387 if (status == errAuthorizationSuccess) {
388 do {
389 char *value;
390 value = input_string(ioPipe);
391 if (value != NULL && strcmp(value, "OK") == 0)
392 ret = 0;
393 } while (!feof(ioPipe));
394
395 fclose(ioPipe);
396 }
397
398 GNUNET_free(username);
399 GNUNET_free(groupname);
400
401 return ret;
402}
403
404- (void) finishSetup
405{
406 if ([self saveConfig] != 0)
407 [self displayErrorAlert:@"Error saving configuration!"];
408 else if ([self createUserGroup] != 0)
409 [self displayErrorAlert:@"Error creating user/group account!"];
410 else if ([self setupAutostart] != 0)
411 [self displayErrorAlert:@"Error setting up launchd configuration!"];
412 else
413 [NSApp terminate:self];
414}
415
416- (void) nextPage
417{
418 [tabView selectNextTabViewItem:self];
419}
420
421- (void) previousPage
422{
423 [tabView selectPreviousTabViewItem:self];
424}
425
426- (void)displayErrorAlert:(NSString *)message
427{
428 NSAlert *alert = [[[NSAlert alloc] init] autorelease];
429 [alert setMessageText:message];
430 [alert addButtonWithTitle:@"OK"];
431 [alert setAlertStyle:NSCriticalAlertStyle];
432 [alert beginSheetModalForWindow:window
433 modalDelegate:self
434 didEndSelector:@selector(alertDidEnd:
435 returnCode:
436 contextInfo:)
437 contextInfo:nil];
438}
439
440- (void) alertDidEnd:(NSAlert *)alert returnCode:(int)returnCode contextInfo:(void *)contextInfo
441{
442 [NSApp terminate:self];
443}
444
445- (void)windowWillClose:(NSNotification *)notification
446{
447 [NSApp terminate:self];
448}
449
450- (void) applicationWillTerminate:(NSNotification *)notification
451{
452 if (gnsOptionsArray != nil)
453 [gnsOptionsArray release];
454 if (gnsContext)
455 GNUNET_GNS_free_specification(gnsContext);
456 GNUNET_GC_free(config);
457 GNUNET_GE_free_context(errorContext);
458}
459
460- (void)getDefaultsFrom:(struct GNUNET_GNS_TreeNode *)pos
461 optionsTo:(NSMutableArray *)optionsArray
462{
463 struct GNUNET_GNS_TreeNode *child;
464 char *val;
465 char *s;
466 int i;
467
468 if (pos == NULL)
469 return;
470
471 i = 0;
472 while ((child = pos->children[i]) != NULL) {
473 switch (child->type & GNUNET_GNS_KIND_MASK) {
474 case GNUNET_GNS_KIND_NODE:
475 [self getDefaultsFrom:child
476 optionsTo:optionsArray];
477 break;
478 case GNUNET_GNS_KIND_LEAF:
479 if ((child->section == NULL) ||
480 (child->option == NULL))
481 break;
482 s = GNUNET_malloc(strlen(child->section) + 1 +
483 strlen(child->option)+1);
484 strcpy(s, child->section);
485 strcat(s, ":");
486 strcat(s, child->option);
487 [optionsArray addObject:[[NSString alloc]
488 initWithUTF8String:s]];
489 GNUNET_free(s);
490
491 if (GNUNET_NO ==
492 GNUNET_GC_have_configuration_value
493 (config, child->section, child->option))
494 {
495 val = GNUNET_GNS_get_default_value_as_string(child->type, &child->value);
496 if (val != NULL) {
497 GNUNET_GC_set_configuration_value_string (config, errorContext, child->section, child->option, val);
498 GNUNET_free (val);
499 }
500 }
501 break;
502 default:
503 NSLog(@"unknown GNS tree node\n");
504 break;
505 }
506 i++;
507 }
508}
509
510@end
diff --git a/GNUnet Setup Assistant/GNUnet Setup Assistant.xcodeproj/project.pbxproj b/GNUnet Setup Assistant/GNUnet Setup Assistant.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..542f6c2
--- /dev/null
+++ b/GNUnet Setup Assistant/GNUnet Setup Assistant.xcodeproj/project.pbxproj
@@ -0,0 +1,326 @@
1// !$*UTF8*$!
2{
3 archiveVersion = 1;
4 classes = {
5 };
6 objectVersion = 42;
7 objects = {
8
9/* Begin PBXBuildFile section */
10 8923FE290F3D6947003D9A76 /* GNUnet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8923FE280F3D6946003D9A76 /* GNUnet.framework */; };
11 892A59830F70CABB00D216B1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 892A59820F70CABB00D216B1 /* Security.framework */; };
12 894430840F8DC39300DDBCBD /* GNUnetSetupAssistant-icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 894430830F8DC39300DDBCBD /* GNUnetSetupAssistant-icon.icns */; };
13 894B87FD0F4F093600D26F3B /* GNLoadLimitPage.m in Sources */ = {isa = PBXBuildFile; fileRef = 894B87FC0F4F093600D26F3B /* GNLoadLimitPage.m */; };
14 894B88DC0F50694F00D26F3B /* GNServiceAccountPage.m in Sources */ = {isa = PBXBuildFile; fileRef = 894B88DB0F50694F00D26F3B /* GNServiceAccountPage.m */; };
15 894B89240F50746500D26F3B /* GNDatastorePage.m in Sources */ = {isa = PBXBuildFile; fileRef = 894B89230F50746500D26F3B /* GNDatastorePage.m */; };
16 894B895F0F507C3E00D26F3B /* GNFinishPage.m in Sources */ = {isa = PBXBuildFile; fileRef = 894B895E0F507C3E00D26F3B /* GNFinishPage.m */; };
17 897412130F3F5EC700854AC2 /* GNWelcomePage.m in Sources */ = {isa = PBXBuildFile; fileRef = 897412120F3F5EC700854AC2 /* GNWelcomePage.m */; };
18 897412170F3F5F2400854AC2 /* GNNetworkConnectionPage.m in Sources */ = {isa = PBXBuildFile; fileRef = 897412160F3F5F2400854AC2 /* GNNetworkConnectionPage.m */; };
19 89ADE16F0F40A40A0060A4FB /* GNSetupAssistant.m in Sources */ = {isa = PBXBuildFile; fileRef = 89ADE16E0F40A40A0060A4FB /* GNSetupAssistant.m */; };
20 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
21 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
22 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
23 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
24/* End PBXBuildFile section */
25
26/* Begin PBXFileReference section */
27 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
28 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
29 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
30 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
31 29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
32 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
33 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
34 8923FE280F3D6946003D9A76 /* GNUnet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GNUnet.framework; path = /Library/Frameworks/GNUnet.framework; sourceTree = "<absolute>"; };
35 892A59820F70CABB00D216B1 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
36 894430830F8DC39300DDBCBD /* GNUnetSetupAssistant-icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "GNUnetSetupAssistant-icon.icns"; sourceTree = "<group>"; };
37 894B87FB0F4F093600D26F3B /* GNLoadLimitPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GNLoadLimitPage.h; sourceTree = "<group>"; };
38 894B87FC0F4F093600D26F3B /* GNLoadLimitPage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GNLoadLimitPage.m; sourceTree = "<group>"; };
39 894B88DA0F50694F00D26F3B /* GNServiceAccountPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GNServiceAccountPage.h; sourceTree = "<group>"; };
40 894B88DB0F50694F00D26F3B /* GNServiceAccountPage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GNServiceAccountPage.m; sourceTree = "<group>"; };
41 894B89220F50746500D26F3B /* GNDatastorePage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GNDatastorePage.h; sourceTree = "<group>"; };
42 894B89230F50746500D26F3B /* GNDatastorePage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GNDatastorePage.m; sourceTree = "<group>"; };
43 894B895D0F507C3E00D26F3B /* GNFinishPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GNFinishPage.h; sourceTree = "<group>"; };
44 894B895E0F507C3E00D26F3B /* GNFinishPage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GNFinishPage.m; sourceTree = "<group>"; };
45 897412110F3F5EC700854AC2 /* GNWelcomePage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GNWelcomePage.h; sourceTree = "<group>"; };
46 897412120F3F5EC700854AC2 /* GNWelcomePage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GNWelcomePage.m; sourceTree = "<group>"; };
47 897412150F3F5F2400854AC2 /* GNNetworkConnectionPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GNNetworkConnectionPage.h; sourceTree = "<group>"; };
48 897412160F3F5F2400854AC2 /* GNNetworkConnectionPage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GNNetworkConnectionPage.m; sourceTree = "<group>"; };
49 89ADE16D0F40A40A0060A4FB /* GNSetupAssistant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GNSetupAssistant.h; sourceTree = "<group>"; };
50 89ADE16E0F40A40A0060A4FB /* GNSetupAssistant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GNSetupAssistant.m; sourceTree = "<group>"; };
51 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
52 8D1107320486CEB800E47090 /* GNUnet Setup Assistant.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "GNUnet Setup Assistant.app"; sourceTree = BUILT_PRODUCTS_DIR; };
53/* End PBXFileReference section */
54
55/* Begin PBXFrameworksBuildPhase section */
56 8D11072E0486CEB800E47090 /* Frameworks */ = {
57 isa = PBXFrameworksBuildPhase;
58 buildActionMask = 2147483647;
59 files = (
60 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
61 8923FE290F3D6947003D9A76 /* GNUnet.framework in Frameworks */,
62 892A59830F70CABB00D216B1 /* Security.framework in Frameworks */,
63 );
64 runOnlyForDeploymentPostprocessing = 0;
65 };
66/* End PBXFrameworksBuildPhase section */
67
68/* Begin PBXGroup section */
69 080E96DDFE201D6D7F000001 /* Classes */ = {
70 isa = PBXGroup;
71 children = (
72 894B87FB0F4F093600D26F3B /* GNLoadLimitPage.h */,
73 894B87FC0F4F093600D26F3B /* GNLoadLimitPage.m */,
74 897412110F3F5EC700854AC2 /* GNWelcomePage.h */,
75 897412120F3F5EC700854AC2 /* GNWelcomePage.m */,
76 897412150F3F5F2400854AC2 /* GNNetworkConnectionPage.h */,
77 897412160F3F5F2400854AC2 /* GNNetworkConnectionPage.m */,
78 89ADE16D0F40A40A0060A4FB /* GNSetupAssistant.h */,
79 89ADE16E0F40A40A0060A4FB /* GNSetupAssistant.m */,
80 894B88DA0F50694F00D26F3B /* GNServiceAccountPage.h */,
81 894B88DB0F50694F00D26F3B /* GNServiceAccountPage.m */,
82 894B89220F50746500D26F3B /* GNDatastorePage.h */,
83 894B89230F50746500D26F3B /* GNDatastorePage.m */,
84 894B895D0F507C3E00D26F3B /* GNFinishPage.h */,
85 894B895E0F507C3E00D26F3B /* GNFinishPage.m */,
86 );
87 name = Classes;
88 sourceTree = "<group>";
89 };
90 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
91 isa = PBXGroup;
92 children = (
93 892A59820F70CABB00D216B1 /* Security.framework */,
94 8923FE280F3D6946003D9A76 /* GNUnet.framework */,
95 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
96 );
97 name = "Linked Frameworks";
98 sourceTree = "<group>";
99 };
100 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
101 isa = PBXGroup;
102 children = (
103 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
104 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
105 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
106 );
107 name = "Other Frameworks";
108 sourceTree = "<group>";
109 };
110 19C28FACFE9D520D11CA2CBB /* Products */ = {
111 isa = PBXGroup;
112 children = (
113 8D1107320486CEB800E47090 /* GNUnet Setup Assistant.app */,
114 );
115 name = Products;
116 sourceTree = "<group>";
117 };
118 29B97314FDCFA39411CA2CEA /* GNUnet Setup Assistant */ = {
119 isa = PBXGroup;
120 children = (
121 080E96DDFE201D6D7F000001 /* Classes */,
122 29B97315FDCFA39411CA2CEA /* Other Sources */,
123 29B97317FDCFA39411CA2CEA /* Resources */,
124 29B97323FDCFA39411CA2CEA /* Frameworks */,
125 19C28FACFE9D520D11CA2CBB /* Products */,
126 );
127 name = "GNUnet Setup Assistant";
128 sourceTree = "<group>";
129 };
130 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
131 isa = PBXGroup;
132 children = (
133 29B97316FDCFA39411CA2CEA /* main.m */,
134 );
135 name = "Other Sources";
136 sourceTree = "<group>";
137 };
138 29B97317FDCFA39411CA2CEA /* Resources */ = {
139 isa = PBXGroup;
140 children = (
141 894430830F8DC39300DDBCBD /* GNUnetSetupAssistant-icon.icns */,
142 8D1107310486CEB800E47090 /* Info.plist */,
143 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
144 29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
145 );
146 name = Resources;
147 sourceTree = "<group>";
148 };
149 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
150 isa = PBXGroup;
151 children = (
152 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
153 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
154 );
155 name = Frameworks;
156 sourceTree = "<group>";
157 };
158/* End PBXGroup section */
159
160/* Begin PBXNativeTarget section */
161 8D1107260486CEB800E47090 /* GNUnet Setup Assistant */ = {
162 isa = PBXNativeTarget;
163 buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "GNUnet Setup Assistant" */;
164 buildPhases = (
165 8D1107290486CEB800E47090 /* Resources */,
166 8D11072C0486CEB800E47090 /* Sources */,
167 8D11072E0486CEB800E47090 /* Frameworks */,
168 );
169 buildRules = (
170 );
171 dependencies = (
172 );
173 name = "GNUnet Setup Assistant";
174 productInstallPath = "$(HOME)/Applications";
175 productName = "GNUnet Setup Assistant";
176 productReference = 8D1107320486CEB800E47090 /* GNUnet Setup Assistant.app */;
177 productType = "com.apple.product-type.application";
178 };
179/* End PBXNativeTarget section */
180
181/* Begin PBXProject section */
182 29B97313FDCFA39411CA2CEA /* Project object */ = {
183 isa = PBXProject;
184 buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GNUnet Setup Assistant" */;
185 hasScannedForEncodings = 1;
186 mainGroup = 29B97314FDCFA39411CA2CEA /* GNUnet Setup Assistant */;
187 projectDirPath = "";
188 targets = (
189 8D1107260486CEB800E47090 /* GNUnet Setup Assistant */,
190 );
191 };
192/* End PBXProject section */
193
194/* Begin PBXResourcesBuildPhase section */
195 8D1107290486CEB800E47090 /* Resources */ = {
196 isa = PBXResourcesBuildPhase;
197 buildActionMask = 2147483647;
198 files = (
199 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
200 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
201 894430840F8DC39300DDBCBD /* GNUnetSetupAssistant-icon.icns in Resources */,
202 );
203 runOnlyForDeploymentPostprocessing = 0;
204 };
205/* End PBXResourcesBuildPhase section */
206
207/* Begin PBXSourcesBuildPhase section */
208 8D11072C0486CEB800E47090 /* Sources */ = {
209 isa = PBXSourcesBuildPhase;
210 buildActionMask = 2147483647;
211 files = (
212 8D11072D0486CEB800E47090 /* main.m in Sources */,
213 897412130F3F5EC700854AC2 /* GNWelcomePage.m in Sources */,
214 897412170F3F5F2400854AC2 /* GNNetworkConnectionPage.m in Sources */,
215 89ADE16F0F40A40A0060A4FB /* GNSetupAssistant.m in Sources */,
216 894B87FD0F4F093600D26F3B /* GNLoadLimitPage.m in Sources */,
217 894B88DC0F50694F00D26F3B /* GNServiceAccountPage.m in Sources */,
218 894B89240F50746500D26F3B /* GNDatastorePage.m in Sources */,
219 894B895F0F507C3E00D26F3B /* GNFinishPage.m in Sources */,
220 );
221 runOnlyForDeploymentPostprocessing = 0;
222 };
223/* End PBXSourcesBuildPhase section */
224
225/* Begin PBXVariantGroup section */
226 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
227 isa = PBXVariantGroup;
228 children = (
229 089C165DFE840E0CC02AAC07 /* English */,
230 );
231 name = InfoPlist.strings;
232 sourceTree = "<group>";
233 };
234 29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
235 isa = PBXVariantGroup;
236 children = (
237 29B97319FDCFA39411CA2CEA /* English */,
238 );
239 name = MainMenu.nib;
240 sourceTree = "<group>";
241 };
242/* End PBXVariantGroup section */
243
244/* Begin XCBuildConfiguration section */
245 C01FCF4B08A954540054247B /* Debug */ = {
246 isa = XCBuildConfiguration;
247 buildSettings = {
248 COPY_PHASE_STRIP = NO;
249 GCC_DYNAMIC_NO_PIC = NO;
250 GCC_ENABLE_FIX_AND_CONTINUE = YES;
251 GCC_MODEL_TUNING = G5;
252 GCC_OPTIMIZATION_LEVEL = 0;
253 INFOPLIST_FILE = Info.plist;
254 INSTALL_PATH = /Applications/GNUnet;
255 PRODUCT_NAME = "GNUnet Setup Assistant";
256 WRAPPER_EXTENSION = app;
257 ZERO_LINK = YES;
258 };
259 name = Debug;
260 };
261 C01FCF4C08A954540054247B /* Release */ = {
262 isa = XCBuildConfiguration;
263 buildSettings = {
264 ARCHS = (
265 ppc,
266 i386,
267 );
268 GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
269 GCC_MODEL_TUNING = G5;
270 INFOPLIST_FILE = Info.plist;
271 INSTALL_PATH = /Applications/GNUnet;
272 PRODUCT_NAME = "GNUnet Setup Assistant";
273 WRAPPER_EXTENSION = app;
274 };
275 name = Release;
276 };
277 C01FCF4F08A954540054247B /* Debug */ = {
278 isa = XCBuildConfiguration;
279 buildSettings = {
280 DEPLOYMENT_LOCATION = NO;
281 GCC_WARN_ABOUT_RETURN_TYPE = YES;
282 GCC_WARN_UNUSED_VARIABLE = YES;
283 INSTALL_MODE_FLAG = "ug+w,o-w,a+rX";
284 INSTALL_PATH = "";
285 PREBINDING = NO;
286 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
287 };
288 name = Debug;
289 };
290 C01FCF5008A954540054247B /* Release */ = {
291 isa = XCBuildConfiguration;
292 buildSettings = {
293 GCC_WARN_ABOUT_RETURN_TYPE = YES;
294 GCC_WARN_UNUSED_VARIABLE = YES;
295 INSTALL_MODE_FLAG = "ug+w,o-w,a+rX";
296 INSTALL_PATH = "";
297 PREBINDING = NO;
298 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
299 };
300 name = Release;
301 };
302/* End XCBuildConfiguration section */
303
304/* Begin XCConfigurationList section */
305 C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "GNUnet Setup Assistant" */ = {
306 isa = XCConfigurationList;
307 buildConfigurations = (
308 C01FCF4B08A954540054247B /* Debug */,
309 C01FCF4C08A954540054247B /* Release */,
310 );
311 defaultConfigurationIsVisible = 0;
312 defaultConfigurationName = Release;
313 };
314 C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GNUnet Setup Assistant" */ = {
315 isa = XCConfigurationList;
316 buildConfigurations = (
317 C01FCF4F08A954540054247B /* Debug */,
318 C01FCF5008A954540054247B /* Release */,
319 );
320 defaultConfigurationIsVisible = 0;
321 defaultConfigurationName = Release;
322 };
323/* End XCConfigurationList section */
324 };
325 rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
326}
diff --git a/GNUnet Setup Assistant/GNUnetSetupAssistant-icon.icns b/GNUnet Setup Assistant/GNUnetSetupAssistant-icon.icns
new file mode 100644
index 0000000..1190133
--- /dev/null
+++ b/GNUnet Setup Assistant/GNUnetSetupAssistant-icon.icns
Binary files differ
diff --git a/GNUnet Setup Assistant/GNWelcomePage.h b/GNUnet Setup Assistant/GNWelcomePage.h
new file mode 100644
index 0000000..3f10897
--- /dev/null
+++ b/GNUnet Setup Assistant/GNWelcomePage.h
@@ -0,0 +1,23 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import <Cocoa/Cocoa.h>
12#import "GNSetupAssistant.h"
13
14@interface GNWelcomePage : NSObject {
15 IBOutlet GNSetupAssistant *assistant;
16 IBOutlet NSTextView *messageView;
17 IBOutlet NSButton *backButton;
18}
19
20- (void) awakeFromNib;
21- (IBAction) backAction:(id)sender;
22- (IBAction) continueAction:(id)sender;
23@end
diff --git a/GNUnet Setup Assistant/GNWelcomePage.m b/GNUnet Setup Assistant/GNWelcomePage.m
new file mode 100644
index 0000000..3c6430d
--- /dev/null
+++ b/GNUnet Setup Assistant/GNWelcomePage.m
@@ -0,0 +1,30 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import "GNWelcomePage.h"
12
13@implementation GNWelcomePage
14- (void)awakeFromNib
15{
16 [messageView setDrawsBackground:NO];
17 [[messageView enclosingScrollView] setDrawsBackground:NO];
18 [backButton setEnabled:NO];
19}
20
21- (IBAction)backAction:(id)sender
22{
23}
24
25- (IBAction)continueAction:(id)sender
26{
27 [assistant preauthorize];
28 [assistant nextPage];
29}
30@end
diff --git a/GNUnet Setup Assistant/Info.plist b/GNUnet Setup Assistant/Info.plist
new file mode 100644
index 0000000..d144b56
--- /dev/null
+++ b/GNUnet Setup Assistant/Info.plist
@@ -0,0 +1,30 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>CFBundleDevelopmentRegion</key>
6 <string>English</string>
7 <key>CFBundleExecutable</key>
8 <string>${EXECUTABLE_NAME}</string>
9 <key>CFBundleIconFile</key>
10 <string>GNUnetSetupAssistant-icon</string>
11 <key>CFBundleIdentifier</key>
12 <string>org.gnunet.GNUnetSetupAssistant</string>
13 <key>CFBundleInfoDictionaryVersion</key>
14 <string>6.0</string>
15 <key>CFBundleName</key>
16 <string>${PRODUCT_NAME}</string>
17 <key>CFBundlePackageType</key>
18 <string>APPL</string>
19 <key>CFBundleSignature</key>
20 <string>????</string>
21 <key>CFBundleShortVersionString</key>
22 <string>0.8.0</string>
23 <key>CFBundleVersion</key>
24 <string>0.8.0c</string>
25 <key>NSMainNibFile</key>
26 <string>MainMenu</string>
27 <key>NSPrincipalClass</key>
28 <string>NSApplication</string>
29</dict>
30</plist>
diff --git a/GNUnet Setup Assistant/Package/Description.plist b/GNUnet Setup Assistant/Package/Description.plist
new file mode 100644
index 0000000..834bc98
--- /dev/null
+++ b/GNUnet Setup Assistant/Package/Description.plist
@@ -0,0 +1,10 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>IFPkgDescriptionDescription</key>
6 <string>GNUnet Setup Assistant is a graphical setup application for GNUnet.</string>
7 <key>IFPkgDescriptionTitle</key>
8 <string>GNUnet Setup Assistant</string>
9</dict>
10</plist>
diff --git a/GNUnet Setup Assistant/Package/IFRequirement.strings b/GNUnet Setup Assistant/Package/IFRequirement.strings
new file mode 100644
index 0000000..1e7e856
--- /dev/null
+++ b/GNUnet Setup Assistant/Package/IFRequirement.strings
Binary files differ
diff --git a/GNUnet Setup Assistant/Package/Info.plist b/GNUnet Setup Assistant/Package/Info.plist
new file mode 100644
index 0000000..7d5aee7
--- /dev/null
+++ b/GNUnet Setup Assistant/Package/Info.plist
@@ -0,0 +1,40 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>CFBundleGetInfoString</key>
6 <string>GNUnet Setup Assistant 0.1, Copyright 2009 Heikki Lindholm</string>
7 <key>CFBundleIdentifier</key>
8 <string>org.gnunet.GNUnetSetupAssistant.pkg</string>
9 <key>CFBundleShortVersionString</key>
10 <string>0.1</string>
11 <key>IFPkgFlagAllowBackRev</key>
12 <false/>
13 <key>IFPkgFlagAuthorizationAction</key>
14 <string>RootAuthorization</string>
15 <key>IFPkgFlagBackgroundAlignment</key>
16 <string>topleft</string>
17 <key>IFPkgFlagBackgroundScaling</key>
18 <string>none</string>
19 <key>IFPkgFlagDefaultLocation</key>
20 <string>/Applications</string>
21 <key>IFPkgFlagFollowLinks</key>
22 <true/>
23 <key>IFPkgFlagInstalledSize</key>
24 <integer>0</integer>
25 <key>IFPkgFlagIsRequired</key>
26 <false/>
27 <key>IFPkgFlagOverwritePermissions</key>
28 <false/>
29 <key>IFPkgFlagRelocatable</key>
30 <false/>
31 <key>IFPkgFlagRestartAction</key>
32 <string>NoRestart</string>
33 <key>IFPkgFlagRootVolumeOnly</key>
34 <true/>
35 <key>IFPkgFlagUpdateInstalledLanguages</key>
36 <false/>
37 <key>IFPkgFormatVersion</key>
38 <real>0.10000000149011612</real>
39</dict>
40</plist>
diff --git a/GNUnet Setup Assistant/build-package.sh b/GNUnet Setup Assistant/build-package.sh
new file mode 100755
index 0000000..8b8d54b
--- /dev/null
+++ b/GNUnet Setup Assistant/build-package.sh
@@ -0,0 +1,33 @@
1BUILD_DIR="/tmp/GNUnetSetupAssistant-build"
2RESOURCE_DIR="${BUILD_DIR}/Resources"
3COMPONENT_DIR="${BUILD_DIR}/Applications"
4PACKAGE_DIR="${BUILD_DIR}/Package"
5PACKAGE_NAME="${PACKAGE_DIR}/GNUnetSetupAssistant.pkg"
6
7PACKAGEMAKER="/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
8
9# destroot to package build dir
10sudo rm -rf "${BUILD_DIR}"
11xcodebuild -configuration "Release" DSTROOT="${BUILD_DIR}" install
12
13# copy package/installer resources
14if [ -e "${RESOURCE_DIR}" ] ; then
15 rm -rf "${RESOURCE_DIR}"
16fi
17mkdir -p "${RESOURCE_DIR}"
18cp COPYING "${RESOURCE_DIR}/License.txt"
19cp Package/IFRequirement.strings "${RESOURCE_DIR}/IFRequirement.strings"
20
21# final permissions
22sudo chmod 775 "${COMPONENT_DIR}"/*
23sudo chown -R root "${COMPONENT_DIR}"/*
24sudo chgrp -R admin "${COMPONENT_DIR}"/*
25
26# create package
27if [ -e "${PACKAGE_DIR}" ] ; then
28 rm -rf "${PACKAGE_DIR}"
29fi
30mkdir -p "${PACKAGE_DIR}"
31
32sudo $PACKAGEMAKER -build -v -p "${PACKAGE_NAME}" -f "${COMPONENT_DIR}" -r "${RESOURCE_DIR}" -i Package/Info.plist -d Package/Description.plist
33
diff --git a/GNUnet Setup Assistant/main.m b/GNUnet Setup Assistant/main.m
new file mode 100644
index 0000000..0240e26
--- /dev/null
+++ b/GNUnet Setup Assistant/main.m
@@ -0,0 +1,16 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import <Cocoa/Cocoa.h>
12
13int main(int argc, char *argv[])
14{
15 return NSApplicationMain(argc, (const char **) argv);
16}
diff --git a/GNUnet Setup/COPYING b/GNUnet Setup/COPYING
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/GNUnet Setup/COPYING
@@ -0,0 +1,339 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991
3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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
12freedom to share and change it. By contrast, the GNU General Public
13License is intended to guarantee your freedom to share and change free
14software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by
18the GNU Lesser General Public License instead.) You can apply it to
19your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22price. Our General Public Licenses are designed to make sure that you
23have the freedom to distribute copies of free software (and charge for
24this service if you wish), that you receive source code or can get it
25if you want it, that you can change the software or use pieces of it
26in 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
29anyone to deny you these rights or to ask you to surrender the rights.
30These restrictions translate to certain responsibilities for you if you
31distribute copies of the software, or if you modify it.
32
33 For example, if you distribute copies of such a program, whether
34gratis or for a fee, you must give the recipients all the rights that
35you have. You must make sure that they, too, receive or can get the
36source code. And you must show them these terms so they know their
37rights.
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,
41distribute and/or modify the software.
42
43 Also, for each author's protection and ours, we want to make certain
44that everyone understands that there is no warranty for this free
45software. If the software is modified by someone else and passed on, we
46want its recipients to know that what they have is not the original, so
47that any problems introduced by others will not reflect on the original
48authors' reputations.
49
50 Finally, any free program is threatened constantly by software
51patents. We wish to avoid the danger that redistributors of a free
52program will individually obtain patent licenses, in effect making the
53program proprietary. To prevent this, we have made it clear that any
54patent must be licensed for everyone's free use or not licensed at all.
55
56 The precise terms and conditions for copying, distribution and
57modification 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
63a notice placed by the copyright holder saying it may be distributed
64under the terms of this General Public License. The "Program", below,
65refers to any such program or work, and a "work based on the Program"
66means either the Program or any derivative work under copyright law:
67that is to say, a work containing the Program or a portion of it,
68either verbatim or with modifications and/or translated into another
69language. (Hereinafter, translation is included without limitation in
70the term "modification".) Each licensee is addressed as "you".
71
72Activities other than copying, distribution and modification are not
73covered by this License; they are outside its scope. The act of
74running the Program is not restricted, and the output from the Program
75is covered only if its contents constitute a work based on the
76Program (independent of having been made by running the Program).
77Whether that is true depends on what the Program does.
78
79 1. You may copy and distribute verbatim copies of the Program's
80source code as you receive it, in any medium, provided that you
81conspicuously and appropriately publish on each copy an appropriate
82copyright notice and disclaimer of warranty; keep intact all the
83notices that refer to this License and to the absence of any warranty;
84and give any other recipients of the Program a copy of this License
85along with the Program.
86
87You may charge a fee for the physical act of transferring a copy, and
88you 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
91of it, thus forming a work based on the Program, and copy and
92distribute such modifications or work under the terms of Section 1
93above, 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
114These requirements apply to the modified work as a whole. If
115identifiable sections of that work are not derived from the Program,
116and can be reasonably considered independent and separate works in
117themselves, then this License, and its terms, do not apply to those
118sections when you distribute them as separate works. But when you
119distribute the same sections as part of a whole which is a work based
120on the Program, the distribution of the whole must be on the terms of
121this License, whose permissions for other licensees extend to the
122entire whole, and thus to each and every part regardless of who wrote it.
123
124Thus, it is not the intent of this section to claim rights or contest
125your rights to work written entirely by you; rather, the intent is to
126exercise the right to control the distribution of derivative or
127collective works based on the Program.
128
129In addition, mere aggregation of another work not based on the Program
130with the Program (or with a work based on the Program) on a volume of
131a storage or distribution medium does not bring the other work under
132the scope of this License.
133
134 3. You may copy and distribute the Program (or a work based on it,
135under Section 2) in object code or executable form under the terms of
136Sections 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
155The source code for a work means the preferred form of the work for
156making modifications to it. For an executable work, complete source
157code means all the source code for all modules it contains, plus any
158associated interface definition files, plus the scripts used to
159control compilation and installation of the executable. However, as a
160special exception, the source code distributed need not include
161anything that is normally distributed (in either source or binary
162form) with the major components (compiler, kernel, and so on) of the
163operating system on which the executable runs, unless that component
164itself accompanies the executable.
165
166If distribution of executable or object code is made by offering
167access to copy from a designated place, then offering equivalent
168access to copy the source code from the same place counts as
169distribution of the source code, even though third parties are not
170compelled to copy the source along with the object code.
171
172 4. You may not copy, modify, sublicense, or distribute the Program
173except as expressly provided under this License. Any attempt
174otherwise to copy, modify, sublicense or distribute the Program is
175void, and will automatically terminate your rights under this License.
176However, parties who have received copies, or rights, from you under
177this License will not have their licenses terminated so long as such
178parties remain in full compliance.
179
180 5. You are not required to accept this License, since you have not
181signed it. However, nothing else grants you permission to modify or
182distribute the Program or its derivative works. These actions are
183prohibited by law if you do not accept this License. Therefore, by
184modifying or distributing the Program (or any work based on the
185Program), you indicate your acceptance of this License to do so, and
186all its terms and conditions for copying, distributing or modifying
187the Program or works based on it.
188
189 6. Each time you redistribute the Program (or any work based on the
190Program), the recipient automatically receives a license from the
191original licensor to copy, distribute or modify the Program subject to
192these terms and conditions. You may not impose any further
193restrictions on the recipients' exercise of the rights granted herein.
194You are not responsible for enforcing compliance by third parties to
195this License.
196
197 7. If, as a consequence of a court judgment or allegation of patent
198infringement or for any other reason (not limited to patent issues),
199conditions are imposed on you (whether by court order, agreement or
200otherwise) that contradict the conditions of this License, they do not
201excuse you from the conditions of this License. If you cannot
202distribute so as to satisfy simultaneously your obligations under this
203License and any other pertinent obligations, then as a consequence you
204may not distribute the Program at all. For example, if a patent
205license would not permit royalty-free redistribution of the Program by
206all those who receive copies directly or indirectly through you, then
207the only way you could satisfy both it and this License would be to
208refrain entirely from distribution of the Program.
209
210If any portion of this section is held invalid or unenforceable under
211any particular circumstance, the balance of the section is intended to
212apply and the section as a whole is intended to apply in other
213circumstances.
214
215It is not the purpose of this section to induce you to infringe any
216patents or other property right claims or to contest validity of any
217such claims; this section has the sole purpose of protecting the
218integrity of the free software distribution system, which is
219implemented by public license practices. Many people have made
220generous contributions to the wide range of software distributed
221through that system in reliance on consistent application of that
222system; it is up to the author/donor to decide if he or she is willing
223to distribute software through any other system and a licensee cannot
224impose that choice.
225
226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License.
228
229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License
232may add an explicit geographical distribution limitation excluding
233those countries, so that distribution is permitted only in or among
234countries not thus excluded. In such case, this License incorporates
235the limitation as if written in the body of this License.
236
237 9. The Free Software Foundation may publish revised and/or new versions
238of the General Public License from time to time. Such new versions will
239be similar in spirit to the present version, but may differ in detail to
240address new problems or concerns.
241
242Each version is given a distinguishing version number. If the Program
243specifies a version number of this License which applies to it and "any
244later version", you have the option of following the terms and conditions
245either of that version or of any later version published by the Free
246Software Foundation. If the Program does not specify a version number of
247this License, you may choose any version ever published by the Free Software
248Foundation.
249
250 10. If you wish to incorporate parts of the Program into other free
251programs whose distribution conditions are different, write to the author
252to ask for permission. For software which is copyrighted by the Free
253Software Foundation, write to the Free Software Foundation; we sometimes
254make exceptions for this. Our decision will be guided by the two goals
255of preserving the free status of all derivatives of our free software and
256of 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
261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268REPAIR OR CORRECTION.
269
270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278POSSIBILITY 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
285possible use to the public, the best way to achieve this is to make it
286free 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
289to attach them to the start of each source file to most effectively
290convey the exclusion of warranty; and each file should have at least
291the "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 along
307 with this program; if not, write to the Free Software Foundation, Inc.,
308 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
310Also add information on how to contact you by electronic and paper mail.
311
312If the program is interactive, make it output a short notice like this
313when it starts in an interactive mode:
314
315 Gnomovision version 69, Copyright (C) year name of author
316 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 This is free software, and you are welcome to redistribute it
318 under certain conditions; type `show c' for details.
319
320The hypothetical commands `show w' and `show c' should show the appropriate
321parts of the General Public License. Of course, the commands you use may
322be called something other than `show w' and `show c'; they could even be
323mouse-clicks or menu items--whatever suits your program.
324
325You should also get your employer (if you work as a programmer) or your
326school, if any, to sign a "copyright disclaimer" for the program, if
327necessary. Here is a sample; alter the names:
328
329 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
332 <signature of Ty Coon>, 1 April 1989
333 Ty Coon, President of Vice
334
335This General Public License does not permit incorporating your program into
336proprietary programs. If your program is a subroutine library, you may
337consider it more useful to permit linking proprietary applications with the
338library. If this is what you want to do, use the GNU Lesser General
339Public License instead of this License.
diff --git a/GNUnet Setup/English.lproj/InfoPlist.strings b/GNUnet Setup/English.lproj/InfoPlist.strings
new file mode 100644
index 0000000..cfc7af7
--- /dev/null
+++ b/GNUnet Setup/English.lproj/InfoPlist.strings
Binary files differ
diff --git a/GNUnet Setup/English.lproj/MainMenu.nib/classes.nib b/GNUnet Setup/English.lproj/MainMenu.nib/classes.nib
new file mode 100644
index 0000000..e606cc0
--- /dev/null
+++ b/GNUnet Setup/English.lproj/MainMenu.nib/classes.nib
@@ -0,0 +1,21 @@
1{
2 IBClasses = (
3 {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
4 {
5 ACTIONS = {
6 saveChangesAction = id;
7 selectedClientConfig = id;
8 selectedDaemonConfig = id;
9 };
10 CLASS = GNSetup;
11 LANGUAGE = ObjC;
12 OUTLETS = {
13 clientConfigMenuItem = NSMenuItem;
14 daemonConfigMenuItem = NSMenuItem;
15 window = NSWindow;
16 };
17 SUPERCLASS = NSObject;
18 }
19 );
20 IBVersion = 1;
21} \ No newline at end of file
diff --git a/GNUnet Setup/English.lproj/MainMenu.nib/info.nib b/GNUnet Setup/English.lproj/MainMenu.nib/info.nib
new file mode 100644
index 0000000..68b9582
--- /dev/null
+++ b/GNUnet Setup/English.lproj/MainMenu.nib/info.nib
@@ -0,0 +1,22 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>IBDocumentLocation</key>
6 <string>138 55 356 240 0 0 1680 1028 </string>
7 <key>IBEditorPositions</key>
8 <dict>
9 <key>29</key>
10 <string>169 506 395 44 0 0 1680 1028 </string>
11 </dict>
12 <key>IBFramework Version</key>
13 <string>489.0</string>
14 <key>IBOpenObjects</key>
15 <array>
16 <integer>21</integer>
17 <integer>29</integer>
18 </array>
19 <key>IBSystem Version</key>
20 <string>8S165</string>
21</dict>
22</plist>
diff --git a/GNUnet Setup/English.lproj/MainMenu.nib/keyedobjects.nib b/GNUnet Setup/English.lproj/MainMenu.nib/keyedobjects.nib
new file mode 100644
index 0000000..ce7eb22
--- /dev/null
+++ b/GNUnet Setup/English.lproj/MainMenu.nib/keyedobjects.nib
Binary files differ
diff --git a/GNUnet Setup/GNSetup.h b/GNUnet Setup/GNSetup.h
new file mode 100644
index 0000000..2f64244
--- /dev/null
+++ b/GNUnet Setup/GNSetup.h
@@ -0,0 +1,79 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import <Security/Security.h>
12#import <Cocoa/Cocoa.h>
13#import <GNUnet/GNUNETSetupView.h>
14
15typedef enum {
16 GNSetupUserActionNone = 0,
17 GNSetupUserActionDaemonConfig,
18 GNSetupUserActionClientConfig,
19 GNSetupUserActionQuit
20} GNSetupUserAction;
21
22@interface GNSetup : NSObject {
23 struct GNUNET_GE_Context *errorContext;
24 struct GNUNET_GNS_Context *gnsContext;
25 struct GNUNET_GC_Configuration *config;
26 NSMutableArray *gnsOptionsArray;
27 char *configFilename;
28 char *defaultDaemonConfigFilename;
29 char *defaultClientConfigFilename;
30 BOOL isDaemonConfig;
31 BOOL shouldQuit;
32
33 AuthorizationRef authRef; // authorization for daemon config
34 BOOL isPreauthorized;
35 GNSetupUserAction actionBeforeAlert;
36
37 struct GNUNET_PluginHandle *cocoaSetupPlugin;
38 Class GNUNETSetupView_class;
39
40 IBOutlet NSWindow *window;
41 IBOutlet NSMenuItem *daemonConfigMenuItem;
42 IBOutlet NSMenuItem *clientConfigMenuItem;
43 NSString *windowTitle;
44 NSView *rootView;
45 GNUNETSetupView *setupView;
46}
47- (id)init;
48- (void)awakeFromNib;
49- (BOOL)isReadyToTerminate;
50- (BOOL)windowShouldClose:(id)window;
51- (void)windowWillClose:(NSNotification *)notification;
52
53- (BOOL)initSetupView;
54- (void)updateWindowFrame;
55- (NSString *)getFilenameFromOpenPanel;
56- (void)displayErrorLoadingAlertWithInfo:(NSString *)info;
57- (void)displaySaveAlert;
58- (void)displayErrorSavingAlert;
59- (void)saveAlertDidEnd:(NSAlert *)alert returnCode:(int)returnCode
60 contextInfo:(void *)contextInfo;
61- (void)errorAlertDidEnd:(NSAlert *)alert returnCode:(int)returnCode
62 contextInfo:(void *)contextInfo;
63- (void)continueInterruptedAction;
64
65- (BOOL)preauthorize;
66- (void)loadAndDisplayConfigOfType:(BOOL)isDaemon;
67
68- (IBAction)selectedDaemonConfig:(id)sender;
69- (IBAction)selectedClientConfig:(id)sender;
70- (IBAction)saveChangesAction:(id)sender;
71
72- (void)getDefaultsFrom:(struct GNUNET_GNS_TreeNode *)pos;
73- (void)buildOptionList:(NSMutableArray *)optionsArray
74 from:(struct GNUNET_GNS_TreeNode *)pos;
75- (int)loadConfigOfType:(BOOL)isDaemon fromFile:(const char *)filename;
76- (int)privilegedLoadConfig;
77- (int)saveConfig;
78- (int)privilegedSaveConfig;
79@end
diff --git a/GNUnet Setup/GNSetup.m b/GNUnet Setup/GNSetup.m
new file mode 100644
index 0000000..8c141c2
--- /dev/null
+++ b/GNUnet Setup/GNSetup.m
@@ -0,0 +1,763 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11// launch advanced configurator:
12//NSTask *task = [NSTask ......];
13//> pid_t pid = [task processIdentifier];
14//> ProcessSerialNumber psn;
15//> if (noErr == GetProcessForPID(pid, &psn)) {
16//> SetFrontProcess(&psn);
17//> }
18
19#include <stdio.h>
20#include <string.h>
21#include <unistd.h>
22
23#include <Security/Authorization.h>
24#include <Security/AuthorizationTags.h>
25
26#include <GNUnet/gnunet_util.h>
27#include <GNUnet/gnunet_directories.h>
28
29#import "GNSetup.h"
30
31static char * input_string(FILE *f)
32{
33 char *buf;
34 int len;
35 int n;
36
37 n = fread(&len, sizeof(len), 1, f);
38 if (n < 1)
39 return NULL;
40
41 if (len <= 0)
42 return NULL;
43
44 buf = malloc(len);
45 n = fread(buf, 1, len, f);
46 if (n < len) {
47 free(buf);
48 return NULL;
49 }
50
51 return buf;
52}
53
54
55static void output_string(FILE *f, char *s)
56{
57 int len;
58
59 if (s == NULL) {
60 len = 0;
61 fwrite(&len, sizeof(len), 1, f);
62 return;
63 }
64
65 len = strlen(s)+1;
66 fwrite(&len, sizeof(len), 1, f);
67 fwrite(s, 1, len, f);
68}
69
70@implementation GNSetup
71- (id)init
72{
73 if (self = [super init]) {
74 errorContext = GNUNET_GE_create_context_stderr(GNUNET_NO,
75 GNUNET_GE_WARNING | GNUNET_GE_ERROR | GNUNET_GE_FATAL |
76 GNUNET_GE_USER | GNUNET_GE_ADMIN | GNUNET_GE_DEVELOPER |
77 GNUNET_GE_IMMEDIATE | GNUNET_GE_BULK);
78 GNUNET_GE_setDefaultContext(errorContext);
79 GNUNET_os_init(errorContext);
80
81 config = GNUNET_GC_create();
82 if (config == NULL) {
83 GNUNET_GE_free_context(errorContext);
84 [self release];
85 return nil;
86 }
87
88 gnsContext = NULL;
89 gnsOptionsArray = nil;
90
91 cocoaSetupPlugin = GNUNET_plugin_load(errorContext,
92 "libgnunet", "setup_cocoa");
93 if (!cocoaSetupPlugin) {
94 GNUNET_GE_free_context(errorContext);
95 GNUNET_GC_free(config);
96 [self release];
97 return nil;
98 }
99
100 GNUNETSetupView_class = objc_getClass("GNUNETSetupView");
101 if (!GNUNETSetupView_class) {
102 GNUNET_GE_free_context(errorContext);
103 GNUNET_GC_free(config);
104 GNUNET_plugin_unload(cocoaSetupPlugin);
105 [self release];
106 return nil;
107 }
108
109 windowTitle = nil;
110 setupView = nil;
111 actionBeforeAlert = GNSetupUserActionNone;
112 shouldQuit = NO;
113 configFilename = nil;
114 [NSApp setDelegate:self];
115 }
116
117 return self;
118}
119
120- (void)awakeFromNib
121{
122 NSString *s;
123
124 // handle command line args
125 isDaemonConfig = NO;
126 s = [[NSUserDefaults standardUserDefaults]
127 stringForKey:@"StartupConfigType"];
128 if (s != nil && [s caseInsensitiveCompare:@"Daemon"] == NSOrderedSame) {
129 isDaemonConfig = YES;
130 }
131
132 s = [[NSUserDefaults standardUserDefaults]
133 stringForKey:@"DefaultDaemonConfig"];
134 if (s != nil)
135 defaultDaemonConfigFilename = strdup([s UTF8String]);
136 else
137 defaultDaemonConfigFilename = NULL;
138
139 s = [[NSUserDefaults standardUserDefaults]
140 stringForKey:@"DefaultClientConfig"];
141 if (s != nil)
142 defaultClientConfigFilename = strdup([s UTF8String]);
143 else
144 defaultClientConfigFilename = NULL;
145
146 [self loadAndDisplayConfigOfType:isDaemonConfig];
147}
148
149- (int)loadConfigOfType:(BOOL)isDaemon fromFile:(const char *)filename
150{
151 char *dirname;
152 char *specname;
153 BOOL didParseConfig;
154
155 isPreauthorized = NO;
156
157 // authorize if needed
158 if (isDaemon && access(filename, F_OK | R_OK | W_OK) == -1) {
159 if ([self preauthorize] == NO) {
160 if (configFilename == nil)
161 actionBeforeAlert = GNSetupUserActionQuit;
162 else
163 actionBeforeAlert = GNSetupUserActionNone;
164 [self displayErrorLoadingAlertWithInfo:@"Authorization failed."];
165 return -1;
166 }
167 isPreauthorized = YES;
168 }
169
170 if (setupView != nil) {
171 [setupView removeFromSuperviewWithoutNeedingDisplay];
172 setupView = nil;
173 }
174
175 if (gnsContext != NULL)
176 GNUNET_GNS_free_specification(gnsContext);
177
178 if (config != NULL)
179 GNUNET_GC_free(config);
180
181 config = GNUNET_GC_create();
182 if (config == NULL) {
183 if (configFilename == nil)
184 actionBeforeAlert = GNSetupUserActionQuit;
185 else
186 actionBeforeAlert = GNSetupUserActionNone;
187 [self displayErrorLoadingAlertWithInfo:@"Cannot create configuration."];
188 return -1;
189 }
190
191 // load spec
192 dirname = GNUNET_get_installation_path(GNUNET_IPK_DATADIR);
193 specname = GNUNET_malloc(strlen (dirname) +
194 strlen ("config-daemon.scm") + 1);
195 strcpy (specname, dirname);
196 if (isDaemon)
197 strcat (specname, "config-daemon.scm");
198 else
199 strcat (specname, "config-client.scm");
200
201 gnsContext = GNUNET_GNS_load_specification(errorContext, config,
202 specname);
203 if (gnsContext == NULL) {
204 if (configFilename == nil)
205 actionBeforeAlert = GNSetupUserActionQuit;
206 else
207 actionBeforeAlert = GNSetupUserActionNone;
208 [self displayErrorLoadingAlertWithInfo:@"Cannot load configuration specification."];
209 return -1;
210 }
211 GNUNET_free(specname);
212 GNUNET_free(dirname);
213
214 if (gnsOptionsArray != nil)
215 [gnsOptionsArray release];
216 gnsOptionsArray = [NSMutableArray new];
217 [self buildOptionList:gnsOptionsArray
218 from:GNUNET_GNS_get_tree_root(gnsContext)];
219
220 // load config
221 configFilename = GNUNET_expand_file_name(errorContext, filename);
222 isDaemonConfig = isDaemon;
223
224 windowTitle = [[NSString alloc] initWithCString:configFilename
225 encoding:NSUTF8StringEncoding];
226 didParseConfig = NO;
227 if (access(configFilename, F_OK | R_OK | W_OK) == 0) {
228 GNUNET_GC_parse_configuration (config, configFilename);
229 didParseConfig = YES;
230 }
231 else if (isDaemonConfig) {
232 int n;
233 n = [self privilegedLoadConfig];
234 if (n > 0 || access(configFilename, F_OK) == 0)
235 didParseConfig = YES;
236 }
237
238 if (didParseConfig == NO) {
239 NSString *s;
240 s = [windowTitle stringByAppendingString:@" (new)"];
241 [windowTitle release];
242 windowTitle = s;
243 }
244
245 [self getDefaultsFrom:GNUNET_GNS_get_tree_root(gnsContext)];
246
247 return 0;
248}
249
250- (BOOL)preauthorize
251{
252 AuthorizationFlags authFlags = kAuthorizationFlagDefaults;
253 OSStatus status;
254
255 status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
256 authFlags, &authRef);
257 if (status != errAuthorizationSuccess)
258 return NO;
259
260 AuthorizationItem authItems = { kAuthorizationRightExecute, 0, NULL, 0};
261 AuthorizationRights authRights = {1, &authItems};
262
263 authFlags = kAuthorizationFlagDefaults |
264 kAuthorizationFlagInteractionAllowed |
265 kAuthorizationFlagPreAuthorize |
266 kAuthorizationFlagExtendRights;
267 status = AuthorizationCopyRights(authRef, &authRights, NULL,
268 authFlags, NULL);
269
270 if (status != errAuthorizationSuccess) {
271 AuthorizationFree(authRef, kAuthorizationFlagDefaults);
272 return NO;
273 }
274
275 return YES;
276}
277
278- (int)privilegedLoadConfig
279{
280 OSStatus status;
281 AuthorizationFlags authFlags = kAuthorizationFlagDefaults;
282 NSString *toolPath;
283 char **toolArgs;
284 FILE *ioPipe = NULL;
285 NSBundle *toolBundle;
286 int ret, i;
287
288 toolBundle = [NSBundle bundleWithIdentifier:@"org.gnunet.GNUnet"];
289 toolPath = [[toolBundle resourcePath]
290 stringByAppendingPathComponent:@"gnunet-macosx-tool"];
291 if (toolPath == nil)
292 return -1;
293
294 toolArgs = malloc((2 + [gnsOptionsArray count] + 1)*sizeof(char *)); /*readConfig + ... + filename + NULL */
295 if (toolArgs == NULL)
296 return -1;
297
298 NSEnumerator *e = [gnsOptionsArray objectEnumerator];
299 id o;
300 toolArgs[0] = "readConfig";
301 toolArgs[1] = configFilename;
302 i = 2;
303 while (o = [e nextObject]) {
304 toolArgs[i] = strdup([(NSString *)o UTF8String]);
305 if (toolArgs[i] == NULL) {
306 free(toolArgs);
307 return -1;
308 }
309 i++;
310 }
311 toolArgs[i] = NULL;
312
313 authFlags = kAuthorizationFlagDefaults;
314 status = AuthorizationExecuteWithPrivileges(authRef,
315 [toolPath UTF8String], authFlags, toolArgs, &ioPipe);
316 ret = -1;
317 if (status == errAuthorizationSuccess) {
318 ret = 0;
319 do {
320 char *section, *option, *value;
321 section = input_string(ioPipe);
322 option = input_string(ioPipe);
323 value = input_string(ioPipe);
324 if (section && option) {
325 ret++;
326 if (GNUNET_GC_set_configuration_value_string(
327 config, errorContext,
328 section, option, value) != 0)
329 NSLog(@"error setting (%s:%s) [%s]\n",
330 section, option, value);
331 }
332 if (section) free(section);
333 if (option) free(option);
334 if (value) free(value);
335 } while (!feof(ioPipe));
336 fclose(ioPipe);
337 }
338
339 for (i = 0; i < [gnsOptionsArray count]; i++)
340 free(toolArgs[2+i]);
341 free(toolArgs);
342
343 return ret;
344}
345
346- (int)saveConfig
347{
348 BOOL didSave;
349
350 didSave = NO;
351 if (isPreauthorized) {
352 if ([self privilegedSaveConfig] == 0)
353 didSave = YES;
354 }
355 else {
356 if (GNUNET_GC_write_configuration (config, configFilename) == 0)
357 didSave = YES;
358 }
359
360 return didSave == YES ? 0 : 1;
361}
362
363- (int)privilegedSaveConfig
364{
365 OSStatus status;
366 AuthorizationFlags authFlags = kAuthorizationFlagDefaults;
367 NSString *toolPath;
368 char *toolArgs[] = { "writeConfig", configFilename, NULL };
369 FILE *ioPipe = NULL;
370 NSBundle *toolBundle;
371 int ret;
372
373 toolBundle = [NSBundle bundleWithIdentifier:@"org.gnunet.GNUnet"];
374 toolPath = [[toolBundle resourcePath]
375 stringByAppendingPathComponent:@"gnunet-macosx-tool"];
376 if (toolPath == nil)
377 return -1;
378
379 authFlags = kAuthorizationFlagDefaults;
380 status = AuthorizationExecuteWithPrivileges(authRef,
381 [toolPath UTF8String], authFlags, toolArgs, &ioPipe);
382 ret = -1;
383 if (status == errAuthorizationSuccess) {
384 NSEnumerator *e = [gnsOptionsArray objectEnumerator];
385 id o;
386
387 while (o = [e nextObject]) {
388 char *section, *option, *value;
389
390 section = strdup([(NSString *)o UTF8String]);
391 option = section;
392 while (*option != '\0' && *option != ':')
393 option++;
394 if (option == '\0') {
395 free(section);
396 continue;
397 }
398 option[0] = '\0';
399 option++;
400
401 ret = GNUNET_GC_get_configuration_value_string(config,
402 section, option, NULL, &value);
403 if (ret != GNUNET_SYSERR) {
404 output_string(ioPipe, section);
405 output_string(ioPipe, option);
406 output_string(ioPipe, value);
407 GNUNET_free(value);
408 }
409 free(section);
410 }
411 output_string(ioPipe, NULL);
412
413 do {
414 char *value;
415 value = input_string(ioPipe);
416 if (value != NULL && strcmp(value, "OK") == 0)
417 ret = 0;
418 } while (!feof(ioPipe));
419
420 fclose(ioPipe);
421 }
422
423 return ret;
424}
425
426- (BOOL)initSetupView
427{
428 if (setupView != nil) {
429 [setupView removeFromSuperviewWithoutNeedingDisplay];
430 }
431
432 setupView = [[GNUNETSetupView_class alloc]
433 initWithConfig:config
434 setupContext:gnsContext
435 errorContext:errorContext
436 maxWidth:768];
437
438 [[window contentView] addSubview:setupView];
439
440 [self updateWindowFrame];
441
442 [window setTitle:windowTitle];
443 [window center];
444
445 return YES;
446}
447
448- (void)updateWindowFrame
449{
450 NSSize size;
451 NSPoint origin;
452 NSRect frame;
453
454 size = [setupView frame].size;
455 size.width += 2*16.0;
456 size.height += 2*16.0;
457 [[window contentView] setFrameSize:size];
458
459 origin.x = 16.0;
460 origin.y = 16.0;
461 [setupView setFrameOrigin:origin];
462
463 frame = [window frame];
464 frame.size = [window
465 frameRectForContentRect:[[window contentView] frame]].size;
466 frame.origin.y -= ((frame.size.height) - [window frame].size.height);
467 [window setFrame:frame display:YES];
468}
469
470- (NSString *)getFilenameFromOpenPanel
471{
472 NSOpenPanel *openPanel;
473 NSArray *filetypes = [NSArray arrayWithObjects:@"conf", nil];
474 int result;
475
476 openPanel = [NSOpenPanel openPanel];
477 [openPanel setCanChooseFiles:YES];
478 [openPanel setCanChooseDirectories:NO];
479 [openPanel setAllowsMultipleSelection:NO];
480 result = [openPanel runModalForDirectory:nil file:nil types:filetypes];
481
482 if (result == NSOKButton)
483 return [openPanel filename];
484 else
485 return nil;
486}
487
488- (IBAction)selectedDaemonConfig:(id)sender
489{
490 if (isDaemonConfig == YES)
491 return;
492
493 if (GNUNET_GC_test_dirty(config)) {
494 actionBeforeAlert = GNSetupUserActionDaemonConfig;
495 [self displaySaveAlert];
496 return;
497 }
498
499 [self loadAndDisplayConfigOfType:YES];
500}
501
502- (IBAction)selectedClientConfig:(id)sender
503{
504 if (isDaemonConfig == NO)
505 return;
506
507 if (GNUNET_GC_test_dirty(config)) {
508 actionBeforeAlert = GNSetupUserActionClientConfig;
509 [self displaySaveAlert];
510 return;
511 }
512
513 [self loadAndDisplayConfigOfType:NO];
514}
515
516- (IBAction)saveChangesAction:(id)sender
517{
518 if ([self saveConfig] != 0)
519 [self displayErrorSavingAlert];
520}
521
522- (void)loadAndDisplayConfigOfType:(BOOL)isDaemon
523{
524 int ret;
525
526 ret = [self loadConfigOfType:isDaemon fromFile:(isDaemon ?
527 (defaultDaemonConfigFilename != NULL ?
528 defaultDaemonConfigFilename :
529 GNUNET_DEFAULT_DAEMON_CONFIG_FILE) :
530 (defaultClientConfigFilename != NULL ?
531 defaultClientConfigFilename :
532 GNUNET_DEFAULT_CLIENT_CONFIG_FILE))];
533
534 if (ret != 0)
535 return;
536
537 [daemonConfigMenuItem setState:isDaemonConfig ? NSOnState : NSOffState];
538 [clientConfigMenuItem setState:isDaemonConfig ? NSOffState : NSOnState];
539 [self initSetupView];
540}
541
542- (void)getDefaultsFrom:(struct GNUNET_GNS_TreeNode *)pos
543{
544 struct GNUNET_GNS_TreeNode *child;
545 char *val;
546 int i;
547
548 if (pos == NULL)
549 return;
550
551 i = 0;
552 while ((child = pos->children[i]) != NULL) {
553 switch (child->type & GNUNET_GNS_KIND_MASK) {
554 case GNUNET_GNS_KIND_NODE:
555 [self getDefaultsFrom:child];
556 break;
557 case GNUNET_GNS_KIND_LEAF:
558 if ((child->section == NULL) ||
559 (child->option == NULL))
560 break;
561 if (GNUNET_NO ==
562 GNUNET_GC_have_configuration_value
563 (config, child->section, child->option))
564 {
565 val = GNUNET_GNS_get_default_value_as_string(child->type, &child->value);
566 if (val != NULL) {
567 GNUNET_GC_set_configuration_value_string (config, errorContext, child->section, child->option, val);
568 GNUNET_free (val);
569 }
570 }
571 break;
572 default:
573 NSLog(@"unknown GNS tree node\n");
574 break;
575 }
576 i++;
577 }
578}
579
580- (void)buildOptionList:(NSMutableArray *)optionsArray
581 from:(struct GNUNET_GNS_TreeNode *)pos
582{
583 struct GNUNET_GNS_TreeNode *child;
584 char *s;
585 int i;
586
587 if (pos == NULL)
588 return;
589
590 i = 0;
591 while ((child = pos->children[i]) != NULL) {
592 switch (child->type & GNUNET_GNS_KIND_MASK) {
593 case GNUNET_GNS_KIND_NODE:
594 [self buildOptionList:optionsArray from:child];
595 break;
596 case GNUNET_GNS_KIND_LEAF:
597 if ((child->section == NULL) ||
598 (child->option == NULL))
599 break;
600 s = GNUNET_malloc(strlen(child->section) + 1 +
601 strlen(child->option)+1);
602 strcpy(s, child->section);
603 strcat(s, ":");
604 strcat(s, child->option);
605 [optionsArray addObject:[[NSString alloc]
606 initWithUTF8String:s]];
607 GNUNET_free(s);
608 break;
609 default:
610 NSLog(@"unknown GNS tree node\n");
611 break;
612 }
613 i++;
614 }
615}
616
617- (void)displayErrorLoadingAlertWithInfo:(NSString *)info
618{
619 NSAlert *alert = [[[NSAlert alloc] init] autorelease];
620 [alert setMessageText:@"Error loading configuration!"];
621 if (info != nil)
622 [alert setInformativeText:info];
623 [alert addButtonWithTitle:@"OK"];
624 [alert setAlertStyle:NSWarningAlertStyle];
625 [alert beginSheetModalForWindow:window
626 modalDelegate:self
627 didEndSelector:@selector(errorAlertDidEnd:
628 returnCode:
629 contextInfo:)
630 contextInfo:nil];
631}
632
633- (void)displaySaveAlert
634{
635 NSAlert *alert = [[[NSAlert alloc] init] autorelease];
636 [alert setMessageText:@"Configuration changed. Save?"];
637 [alert addButtonWithTitle:@"Yes"];
638 [alert addButtonWithTitle:@"Cancel"];
639 [alert addButtonWithTitle:@"No"];
640 [alert setAlertStyle:NSWarningAlertStyle];
641 [alert beginSheetModalForWindow:window
642 modalDelegate:self
643 didEndSelector:@selector(saveAlertDidEnd:
644 returnCode:
645 contextInfo:)
646 contextInfo:nil];
647}
648
649- (void)displayErrorSavingAlert
650{
651 NSAlert *alert = [[[NSAlert alloc] init] autorelease];
652 [alert setMessageText:@"Error saving configuration!"];
653 [alert addButtonWithTitle:@"OK"];
654 [alert setAlertStyle:NSCriticalAlertStyle];
655 [alert beginSheetModalForWindow:window
656 modalDelegate:self
657 didEndSelector:@selector(errorAlertDidEnd:
658 returnCode:
659 contextInfo:)
660 contextInfo:nil];
661}
662
663- (void)saveAlertDidEnd:(NSAlert *)alert returnCode:(int)returnCode
664 contextInfo:(void *)contextInfo
665{
666 [[alert window] orderOut:self];
667 if (returnCode == NSAlertFirstButtonReturn) { // Yes
668 if ([self saveConfig] == 0)
669 [self continueInterruptedAction];
670 else {
671 actionBeforeAlert = GNSetupUserActionNone;
672 [self displayErrorSavingAlert];
673 }
674 }
675 else if (returnCode == NSAlertThirdButtonReturn) { // No
676 [self continueInterruptedAction];
677 }
678 else // Cancel
679 actionBeforeAlert = GNSetupUserActionNone;
680}
681
682- (void)errorAlertDidEnd:(NSAlert *)alert returnCode:(int)returnCode
683 contextInfo:(void *)contextInfo
684{
685 [self continueInterruptedAction];
686}
687
688- (void)continueInterruptedAction
689{
690 GNSetupUserAction action;
691 action = actionBeforeAlert;
692 actionBeforeAlert = GNSetupUserActionNone;
693 switch (action) {
694 case GNSetupUserActionDaemonConfig:
695 [self loadAndDisplayConfigOfType:YES];
696 break;
697 case GNSetupUserActionClientConfig:
698 [self loadAndDisplayConfigOfType:NO];
699 break;
700 case GNSetupUserActionQuit:
701 shouldQuit = YES;
702 [NSApp terminate:self];
703 break;
704 case GNSetupUserActionNone:
705 break;
706 default:
707 NSLog(@"tried to continue unknown user action\n");
708 break;
709 }
710}
711
712- (BOOL)isReadyToTerminate
713{
714 if ([window firstResponder] != nil &&
715 [window makeFirstResponder:nil] == NO)
716 return NO;
717
718 if (GNUNET_GC_test_dirty(config) && shouldQuit == NO) {
719 actionBeforeAlert = GNSetupUserActionQuit;
720 [self displaySaveAlert];
721 return NO;
722 }
723
724 return YES;
725}
726
727- (BOOL)windowShouldClose:(id)sender
728{
729 if ([self isReadyToTerminate] == NO)
730 return NO;
731
732 if (setupView != nil) {
733 [setupView removeFromSuperviewWithoutNeedingDisplay];
734 }
735 return YES;
736}
737
738- (void)windowWillClose:(NSNotification *)notification
739{
740 [NSApp terminate:self];
741}
742
743- (NSApplicationTerminateReply)
744 applicationShouldTerminate:(NSApplication *)sender
745{
746 return [self isReadyToTerminate];
747}
748
749- (void)applicationWillTerminate:(NSNotification *)notification
750{
751 if (defaultDaemonConfigFilename)
752 free(defaultDaemonConfigFilename);
753 if (defaultClientConfigFilename)
754 free(defaultClientConfigFilename);
755 GNUNET_plugin_unload(cocoaSetupPlugin);
756 if (gnsOptionsArray != nil)
757 [gnsOptionsArray release];
758 if (gnsContext)
759 GNUNET_GNS_free_specification(gnsContext);
760 GNUNET_GC_free(config);
761 GNUNET_GE_free_context(errorContext);
762}
763@end
diff --git a/GNUnet Setup/GNUnet Setup.xcodeproj/project.pbxproj b/GNUnet Setup/GNUnet Setup.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..4d37766
--- /dev/null
+++ b/GNUnet Setup/GNUnet Setup.xcodeproj/project.pbxproj
@@ -0,0 +1,287 @@
1// !$*UTF8*$!
2{
3 archiveVersion = 1;
4 classes = {
5 };
6 objectVersion = 42;
7 objects = {
8
9/* Begin PBXBuildFile section */
10 8932C1E00F701EF800115139 /* GNUnetSetup-icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8932C1DF0F701EF800115139 /* GNUnetSetup-icon.icns */; };
11 89345C8B0F62709400BE0838 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89345C8A0F62709400BE0838 /* Security.framework */; };
12 899859F80F5192CA00ED2EEF /* GNUnet.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 899859F70F5192CA00ED2EEF /* GNUnet.framework */; };
13 899859FF0F5192E700ED2EEF /* GNSetup.m in Sources */ = {isa = PBXBuildFile; fileRef = 899859FE0F5192E700ED2EEF /* GNSetup.m */; };
14 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
15 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
16 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
17 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
18/* End PBXBuildFile section */
19
20/* Begin PBXFileReference section */
21 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
22 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
23 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
24 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
25 29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
26 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
27 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
28 8932C1DF0F701EF800115139 /* GNUnetSetup-icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "GNUnetSetup-icon.icns"; sourceTree = "<group>"; };
29 89345C8A0F62709400BE0838 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
30 899859F70F5192CA00ED2EEF /* GNUnet.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GNUnet.framework; path = /Library/Frameworks/GNUnet.framework; sourceTree = "<absolute>"; };
31 899859FD0F5192E700ED2EEF /* GNSetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GNSetup.h; sourceTree = "<group>"; };
32 899859FE0F5192E700ED2EEF /* GNSetup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GNSetup.m; sourceTree = "<group>"; };
33 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
34 8D1107320486CEB800E47090 /* GNUnet Setup.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "GNUnet Setup.app"; sourceTree = BUILT_PRODUCTS_DIR; };
35/* End PBXFileReference section */
36
37/* Begin PBXFrameworksBuildPhase section */
38 8D11072E0486CEB800E47090 /* Frameworks */ = {
39 isa = PBXFrameworksBuildPhase;
40 buildActionMask = 2147483647;
41 files = (
42 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
43 899859F80F5192CA00ED2EEF /* GNUnet.framework in Frameworks */,
44 89345C8B0F62709400BE0838 /* Security.framework in Frameworks */,
45 );
46 runOnlyForDeploymentPostprocessing = 0;
47 };
48/* End PBXFrameworksBuildPhase section */
49
50/* Begin PBXGroup section */
51 080E96DDFE201D6D7F000001 /* Classes */ = {
52 isa = PBXGroup;
53 children = (
54 899859FD0F5192E700ED2EEF /* GNSetup.h */,
55 899859FE0F5192E700ED2EEF /* GNSetup.m */,
56 );
57 name = Classes;
58 sourceTree = "<group>";
59 };
60 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
61 isa = PBXGroup;
62 children = (
63 89345C8A0F62709400BE0838 /* Security.framework */,
64 899859F70F5192CA00ED2EEF /* GNUnet.framework */,
65 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
66 );
67 name = "Linked Frameworks";
68 sourceTree = "<group>";
69 };
70 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
71 isa = PBXGroup;
72 children = (
73 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
74 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
75 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
76 );
77 name = "Other Frameworks";
78 sourceTree = "<group>";
79 };
80 19C28FACFE9D520D11CA2CBB /* Products */ = {
81 isa = PBXGroup;
82 children = (
83 8D1107320486CEB800E47090 /* GNUnet Setup.app */,
84 );
85 name = Products;
86 sourceTree = "<group>";
87 };
88 29B97314FDCFA39411CA2CEA /* GNUnet Setup */ = {
89 isa = PBXGroup;
90 children = (
91 080E96DDFE201D6D7F000001 /* Classes */,
92 29B97315FDCFA39411CA2CEA /* Other Sources */,
93 29B97317FDCFA39411CA2CEA /* Resources */,
94 29B97323FDCFA39411CA2CEA /* Frameworks */,
95 19C28FACFE9D520D11CA2CBB /* Products */,
96 );
97 name = "GNUnet Setup";
98 sourceTree = "<group>";
99 };
100 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
101 isa = PBXGroup;
102 children = (
103 29B97316FDCFA39411CA2CEA /* main.m */,
104 );
105 name = "Other Sources";
106 sourceTree = "<group>";
107 };
108 29B97317FDCFA39411CA2CEA /* Resources */ = {
109 isa = PBXGroup;
110 children = (
111 8932C1DF0F701EF800115139 /* GNUnetSetup-icon.icns */,
112 8D1107310486CEB800E47090 /* Info.plist */,
113 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
114 29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
115 );
116 name = Resources;
117 sourceTree = "<group>";
118 };
119 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
120 isa = PBXGroup;
121 children = (
122 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
123 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
124 );
125 name = Frameworks;
126 sourceTree = "<group>";
127 };
128/* End PBXGroup section */
129
130/* Begin PBXNativeTarget section */
131 8D1107260486CEB800E47090 /* GNUnet Setup */ = {
132 isa = PBXNativeTarget;
133 buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "GNUnet Setup" */;
134 buildPhases = (
135 8D1107290486CEB800E47090 /* Resources */,
136 8D11072C0486CEB800E47090 /* Sources */,
137 8D11072E0486CEB800E47090 /* Frameworks */,
138 );
139 buildRules = (
140 );
141 dependencies = (
142 );
143 name = "GNUnet Setup";
144 productInstallPath = "$(HOME)/Applications";
145 productName = "GNUnet Setup";
146 productReference = 8D1107320486CEB800E47090 /* GNUnet Setup.app */;
147 productType = "com.apple.product-type.application";
148 };
149/* End PBXNativeTarget section */
150
151/* Begin PBXProject section */
152 29B97313FDCFA39411CA2CEA /* Project object */ = {
153 isa = PBXProject;
154 buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GNUnet Setup" */;
155 hasScannedForEncodings = 1;
156 mainGroup = 29B97314FDCFA39411CA2CEA /* GNUnet Setup */;
157 projectDirPath = "";
158 targets = (
159 8D1107260486CEB800E47090 /* GNUnet Setup */,
160 );
161 };
162/* End PBXProject section */
163
164/* Begin PBXResourcesBuildPhase section */
165 8D1107290486CEB800E47090 /* Resources */ = {
166 isa = PBXResourcesBuildPhase;
167 buildActionMask = 2147483647;
168 files = (
169 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
170 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
171 8932C1E00F701EF800115139 /* GNUnetSetup-icon.icns in Resources */,
172 );
173 runOnlyForDeploymentPostprocessing = 0;
174 };
175/* End PBXResourcesBuildPhase section */
176
177/* Begin PBXSourcesBuildPhase section */
178 8D11072C0486CEB800E47090 /* Sources */ = {
179 isa = PBXSourcesBuildPhase;
180 buildActionMask = 2147483647;
181 files = (
182 8D11072D0486CEB800E47090 /* main.m in Sources */,
183 899859FF0F5192E700ED2EEF /* GNSetup.m in Sources */,
184 );
185 runOnlyForDeploymentPostprocessing = 0;
186 };
187/* End PBXSourcesBuildPhase section */
188
189/* Begin PBXVariantGroup section */
190 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
191 isa = PBXVariantGroup;
192 children = (
193 089C165DFE840E0CC02AAC07 /* English */,
194 );
195 name = InfoPlist.strings;
196 sourceTree = "<group>";
197 };
198 29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
199 isa = PBXVariantGroup;
200 children = (
201 29B97319FDCFA39411CA2CEA /* English */,
202 );
203 name = MainMenu.nib;
204 sourceTree = "<group>";
205 };
206/* End PBXVariantGroup section */
207
208/* Begin XCBuildConfiguration section */
209 C01FCF4B08A954540054247B /* Debug */ = {
210 isa = XCBuildConfiguration;
211 buildSettings = {
212 COPY_PHASE_STRIP = NO;
213 GCC_DYNAMIC_NO_PIC = NO;
214 GCC_ENABLE_FIX_AND_CONTINUE = YES;
215 GCC_MODEL_TUNING = G5;
216 GCC_OPTIMIZATION_LEVEL = 0;
217 INFOPLIST_FILE = Info.plist;
218 INSTALL_PATH = /Applications/GNUnet;
219 PRODUCT_NAME = "GNUnet Setup";
220 WRAPPER_EXTENSION = app;
221 ZERO_LINK = YES;
222 };
223 name = Debug;
224 };
225 C01FCF4C08A954540054247B /* Release */ = {
226 isa = XCBuildConfiguration;
227 buildSettings = {
228 ARCHS = (
229 ppc,
230 i386,
231 );
232 GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
233 GCC_MODEL_TUNING = G5;
234 INFOPLIST_FILE = Info.plist;
235 INSTALL_PATH = /Applications/GNUnet;
236 PRODUCT_NAME = "GNUnet Setup";
237 WRAPPER_EXTENSION = app;
238 };
239 name = Release;
240 };
241 C01FCF4F08A954540054247B /* Debug */ = {
242 isa = XCBuildConfiguration;
243 buildSettings = {
244 GCC_WARN_ABOUT_RETURN_TYPE = YES;
245 GCC_WARN_UNUSED_VARIABLE = YES;
246 INSTALL_MODE_FLAG = "ug+w,o-w,a+rX";
247 PREBINDING = NO;
248 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
249 };
250 name = Debug;
251 };
252 C01FCF5008A954540054247B /* Release */ = {
253 isa = XCBuildConfiguration;
254 buildSettings = {
255 GCC_WARN_ABOUT_RETURN_TYPE = YES;
256 GCC_WARN_UNUSED_VARIABLE = YES;
257 INSTALL_MODE_FLAG = "ug+w,o-w,a+rX";
258 PREBINDING = NO;
259 SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
260 };
261 name = Release;
262 };
263/* End XCBuildConfiguration section */
264
265/* Begin XCConfigurationList section */
266 C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "GNUnet Setup" */ = {
267 isa = XCConfigurationList;
268 buildConfigurations = (
269 C01FCF4B08A954540054247B /* Debug */,
270 C01FCF4C08A954540054247B /* Release */,
271 );
272 defaultConfigurationIsVisible = 0;
273 defaultConfigurationName = Release;
274 };
275 C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GNUnet Setup" */ = {
276 isa = XCConfigurationList;
277 buildConfigurations = (
278 C01FCF4F08A954540054247B /* Debug */,
279 C01FCF5008A954540054247B /* Release */,
280 );
281 defaultConfigurationIsVisible = 0;
282 defaultConfigurationName = Release;
283 };
284/* End XCConfigurationList section */
285 };
286 rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
287}
diff --git a/GNUnet Setup/GNUnetSetup-icon.icns b/GNUnet Setup/GNUnetSetup-icon.icns
new file mode 100644
index 0000000..1190133
--- /dev/null
+++ b/GNUnet Setup/GNUnetSetup-icon.icns
Binary files differ
diff --git a/GNUnet Setup/Info.plist b/GNUnet Setup/Info.plist
new file mode 100644
index 0000000..32a364c
--- /dev/null
+++ b/GNUnet Setup/Info.plist
@@ -0,0 +1,30 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>CFBundleDevelopmentRegion</key>
6 <string>English</string>
7 <key>CFBundleExecutable</key>
8 <string>${EXECUTABLE_NAME}</string>
9 <key>CFBundleIconFile</key>
10 <string>GNUnetSetup-icon</string>
11 <key>CFBundleIdentifier</key>
12 <string>org.gnunet.GNUnetSetup</string>
13 <key>CFBundleInfoDictionaryVersion</key>
14 <string>6.0</string>
15 <key>CFBundleName</key>
16 <string>${PRODUCT_NAME}</string>
17 <key>CFBundlePackageType</key>
18 <string>APPL</string>
19 <key>CFBundleSignature</key>
20 <string>????</string>
21 <key>CFBundleShortVersionString</key>
22 <string>0.8.0c</string>
23 <key>CFBundleVersion</key>
24 <string>1</string>
25 <key>NSMainNibFile</key>
26 <string>MainMenu</string>
27 <key>NSPrincipalClass</key>
28 <string>NSApplication</string>
29</dict>
30</plist>
diff --git a/GNUnet Setup/Package/Description.plist b/GNUnet Setup/Package/Description.plist
new file mode 100644
index 0000000..f1ef02f
--- /dev/null
+++ b/GNUnet Setup/Package/Description.plist
@@ -0,0 +1,10 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>IFPkgDescriptionDescription</key>
6 <string>GNUnet Setup is a graphical setup application for GNUnet.</string>
7 <key>IFPkgDescriptionTitle</key>
8 <string>GNUnet Setup</string>
9</dict>
10</plist>
diff --git a/GNUnet Setup/Package/IFRequirement.strings b/GNUnet Setup/Package/IFRequirement.strings
new file mode 100644
index 0000000..1e7e856
--- /dev/null
+++ b/GNUnet Setup/Package/IFRequirement.strings
Binary files differ
diff --git a/GNUnet Setup/Package/Info.plist b/GNUnet Setup/Package/Info.plist
new file mode 100644
index 0000000..424f099
--- /dev/null
+++ b/GNUnet Setup/Package/Info.plist
@@ -0,0 +1,40 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>CFBundleGetInfoString</key>
6 <string>GNUnet Setup 0.1, Copyright 2009 Heikki Lindholm</string>
7 <key>CFBundleIdentifier</key>
8 <string>org.gnunet.GNUnetSetup.pkg</string>
9 <key>CFBundleShortVersionString</key>
10 <string>0.1</string>
11 <key>IFPkgFlagAllowBackRev</key>
12 <false/>
13 <key>IFPkgFlagAuthorizationAction</key>
14 <string>RootAuthorization</string>
15 <key>IFPkgFlagBackgroundAlignment</key>
16 <string>topleft</string>
17 <key>IFPkgFlagBackgroundScaling</key>
18 <string>none</string>
19 <key>IFPkgFlagDefaultLocation</key>
20 <string>/Applications</string>
21 <key>IFPkgFlagFollowLinks</key>
22 <true/>
23 <key>IFPkgFlagInstalledSize</key>
24 <integer>0</integer>
25 <key>IFPkgFlagIsRequired</key>
26 <false/>
27 <key>IFPkgFlagOverwritePermissions</key>
28 <false/>
29 <key>IFPkgFlagRelocatable</key>
30 <false/>
31 <key>IFPkgFlagRestartAction</key>
32 <string>NoRestart</string>
33 <key>IFPkgFlagRootVolumeOnly</key>
34 <true/>
35 <key>IFPkgFlagUpdateInstalledLanguages</key>
36 <false/>
37 <key>IFPkgFormatVersion</key>
38 <real>0.10000000149011612</real>
39</dict>
40</plist>
diff --git a/GNUnet Setup/build-package.sh b/GNUnet Setup/build-package.sh
new file mode 100755
index 0000000..a26404b
--- /dev/null
+++ b/GNUnet Setup/build-package.sh
@@ -0,0 +1,33 @@
1BUILD_DIR="/tmp/GNUnetSetup-build"
2RESOURCE_DIR="${BUILD_DIR}/Resources"
3COMPONENT_DIR="${BUILD_DIR}/Applications"
4PACKAGE_DIR="${BUILD_DIR}/Package"
5PACKAGE_NAME="${PACKAGE_DIR}/GNUnetSetup.pkg"
6
7PACKAGEMAKER="/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
8
9# destroot to package build dir
10sudo rm -rf "${BUILD_DIR}"
11xcodebuild -configuration "Release" DSTROOT="${BUILD_DIR}" install
12
13# copy package/installer resources
14if [ -e "${RESOURCE_DIR}" ] ; then
15 rm -rf "${RESOURCE_DIR}"
16fi
17mkdir -p "${RESOURCE_DIR}"
18cp COPYING "${RESOURCE_DIR}/License.txt"
19cp Package/IFRequirement.strings "${RESOURCE_DIR}/IFRequirement.strings"
20
21# final permissions
22sudo chmod 775 "${COMPONENT_DIR}"/*
23sudo chown -R root "${COMPONENT_DIR}"/*
24sudo chgrp -R admin "${COMPONENT_DIR}"/*
25
26# create package
27if [ -e "${PACKAGE_DIR}" ] ; then
28 rm -rf "${PACKAGE_DIR}"
29fi
30mkdir -p "${PACKAGE_DIR}"
31
32sudo $PACKAGEMAKER -build -v -p "${PACKAGE_NAME}" -f "${COMPONENT_DIR}" -r "${RESOURCE_DIR}" -i Package/Info.plist -d Package/Description.plist
33
diff --git a/GNUnet Setup/main.m b/GNUnet Setup/main.m
new file mode 100644
index 0000000..0240e26
--- /dev/null
+++ b/GNUnet Setup/main.m
@@ -0,0 +1,16 @@
1/*
2 * GNUnet Setup (Cocoa UI)
3 * Copyright (C) 2009 Heikki Lindholm <holin@iki.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#import <Cocoa/Cocoa.h>
12
13int main(int argc, char *argv[])
14{
15 return NSApplicationMain(argc, (const char **) argv);
16}