1 |
ennael |
37571 |
package tmp::compssUsers; |
2 |
|
|
|
3 |
|
|
use common; |
4 |
tv |
388363 |
use install::pkgs; |
5 |
ennael |
37571 |
|
6 |
|
|
my $low_resources = detect_devices::has_low_resources(); |
7 |
|
|
my $netbook_desktop = detect_devices::is_netbook_nettop(); |
8 |
|
|
my $light_desktop = detect_devices::need_light_desktop(); |
9 |
|
|
my $meta_class = $::o->{meta_class}; |
10 |
|
|
my $powerpack = $meta_class eq 'powerpack'; |
11 |
|
|
my $server = $meta_class eq 'server'; |
12 |
|
|
|
13 |
|
|
my $h = { |
14 |
|
|
N_("Workstation") => |
15 |
|
|
[ |
16 |
|
|
{ label => N_("Office Workstation"), |
17 |
|
|
descr => |
18 |
tv |
99702 |
N_("Office programs: wordprocessors (LibreOffice Writer, Kword), spreadsheets (LibreOffice Calc, Kspread), PDF viewers, etc"), |
19 |
ennael |
37571 |
flags => [ qw(OFFICE SPELLCHECK PIM ARCHIVING ), if_(!$light_desktop, qw(PUBLISHING)) ], |
20 |
|
|
default_selected => 1, |
21 |
tv |
388363 |
required => [ qw(libreoffice-writer abiword) ], |
22 |
ennael |
37571 |
}, |
23 |
|
|
if_(!$server, |
24 |
|
|
{ label => N_("Game station"), |
25 |
|
|
descr => N_("Amusement programs: arcade, boards, strategy, etc"), |
26 |
|
|
flags => [ qw(GAMES) ], |
27 |
|
|
}, |
28 |
|
|
{ label => N_("Multimedia station"), |
29 |
|
|
descr => N_("Sound and video playing/editing programs"), |
30 |
|
|
flags => [ qw(AUDIO VIDEO GRAPHICS VIDEO_EDITING) ], |
31 |
|
|
default_selected => 1, |
32 |
|
|
}, |
33 |
|
|
), |
34 |
|
|
{ label => N_("Internet station"), |
35 |
|
|
descr => N_("Set of tools to read and send mail and news (mutt, tin..) and to browse the Web"), |
36 |
|
|
flags => [ qw(NETWORKING_WWW NETWORKING_MAIL NETWORKING_NEWS COMMUNICATIONS NETWORKING_CHAT NETWORKING_FILE_TRANSFER NETWORKING_IRC NETWORKING_INSTANT_MESSAGING NETWORKING_DNS) ], |
37 |
|
|
default_selected => 1, |
38 |
|
|
}, |
39 |
|
|
if_(!$server, |
40 |
|
|
{ label => N_("Network Computer (client)"), |
41 |
|
|
descr => N_("Clients for different protocols including ssh"), |
42 |
|
|
flags => [ qw(NETWORKING_REMOTE_ACCESS NETWORKING_FILE) ], |
43 |
|
|
default_selected => $powerpack, |
44 |
tv |
388363 |
required => [ qw(openssh-clients samba-client) ], |
45 |
ennael |
37571 |
}, |
46 |
|
|
{ label => N_("Configuration"), |
47 |
|
|
descr => N_("Tools to ease the configuration of your computer"), |
48 |
|
|
flags => [ qw(CONFIG) ], |
49 |
|
|
default_selected => 1, |
50 |
|
|
}, |
51 |
|
|
{ label => N_("Console Tools"), |
52 |
|
|
descr => N_("Editors, shells, file tools, terminals"), |
53 |
|
|
flags => [ qw(EDITORS TERMINALS TEXT_TOOLS SHELLS FILE_TOOLS) ], |
54 |
|
|
default_selected => 1, |
55 |
|
|
}, |
56 |
|
|
{ label => N_("Development"), |
57 |
|
|
descr => N_("C and C++ development libraries, programs and include files"), |
58 |
|
|
flags => [ qw(DEVELOPMENT EDITORS) ], |
59 |
tv |
388363 |
required => [ 'make' ], |
60 |
ennael |
37571 |
}, |
61 |
|
|
{ label => N_("Documentation"), |
62 |
|
|
descr => N_("Books and Howto's on Linux and Free Software"), |
63 |
|
|
flags => [ qw(BOOKS) ], |
64 |
|
|
default_selected => !$light_desktop, |
65 |
|
|
}, |
66 |
|
|
{ label => N_("LSB"), |
67 |
|
|
descr => N_("Linux Standard Base. Third party applications support"), |
68 |
|
|
flags => [ qw(LSB) ], |
69 |
tv |
388363 |
required => [ 'lsb-core' ], |
70 |
ennael |
37571 |
}, |
71 |
|
|
), |
72 |
|
|
], |
73 |
|
|
|
74 |
|
|
N_("Server") => |
75 |
|
|
[ |
76 |
|
|
$server ? ( |
77 |
|
|
{ label => N_("Web Server"), |
78 |
|
|
descr => N_("Apache"), |
79 |
|
|
flags => [ qw(NETWORKING_WWW_SERVER) ], |
80 |
tv |
388363 |
required => [ qw(apache lftp mirrordir rsync) ], |
81 |
ennael |
37571 |
}, |
82 |
|
|
{ label => N_("Groupware"), |
83 |
|
|
descr => N_("Kolab Server"), |
84 |
|
|
flags => [ qw(NETWORKING_GROUPWARE_SERVER) ], |
85 |
|
|
}, |
86 |
|
|
{ label => N_("Firewall/Router"), |
87 |
|
|
descr => N_("Internet gateway"), |
88 |
|
|
flags => [ qw(NETWORKING_FIREWALLING_SERVER) ], |
89 |
|
|
}, |
90 |
|
|
{ label => N_("Mail/News"), |
91 |
|
|
descr => N_("Postfix mail server, Inn news server"), |
92 |
|
|
flags => [ qw(NETWORKING_MAIL_SERVER NETWORKING_NEWS_SERVER) ], |
93 |
tv |
388363 |
required => [ 'postfix' ], |
94 |
ennael |
37571 |
}, |
95 |
|
|
{ label => N_("Directory Server"), |
96 |
|
|
descr => N_("LDAP Server"), |
97 |
|
|
flags => [ qw(NETWORKING_LDAP_SERVER) ], |
98 |
tv |
388363 |
required => [ 'openldap-servers' ], |
99 |
ennael |
37571 |
}, |
100 |
|
|
{ label => N_("FTP Server"), |
101 |
|
|
descr => N_("ProFTPd"), |
102 |
|
|
flags => [ qw(NETWORKING_FILE_TRANSFER_SERVER) ], |
103 |
tv |
388363 |
required => [ 'proftpd' ], |
104 |
ennael |
37571 |
}, |
105 |
|
|
{ label => N_("DNS/NIS"), |
106 |
|
|
descr => N_("Domain Name and Network Information Server"), |
107 |
|
|
flags => [ qw(NIS_SERVER NETWORKING_DNS_SERVER) ], |
108 |
tv |
388363 |
required => [ 'bind' ], |
109 |
ennael |
37571 |
}, |
110 |
|
|
{ label => N_("File and Printer Sharing Server"), |
111 |
|
|
descr => N_("NFS Server, Samba server"), |
112 |
|
|
flags => [ qw(NETWORKING_FILE_SERVER PRINTER) ], |
113 |
tv |
388363 |
required => [ qw(nfs-utils cups samba-server) ], |
114 |
ennael |
37571 |
}, |
115 |
|
|
{ label => N_("Database"), |
116 |
ennael |
235001 |
descr => N_("PostgreSQL and MariaDB Database Server"), |
117 |
ennael |
37571 |
flags => [ qw(DATABASES DATABASES_SERVER) ], |
118 |
tv |
388363 |
required => [ qw(postgresql9.1 postgresql9.2 mariadb) ], |
119 |
ennael |
37571 |
}, |
120 |
|
|
) : ( |
121 |
|
|
{ label => N_("Web/FTP"), |
122 |
|
|
descr => N_("Apache, Pro-ftpd"), |
123 |
|
|
flags => [ qw(NETWORKING_WWW_SERVER NETWORKING_FILE_TRANSFER_SERVER) ], |
124 |
tv |
388363 |
required => [ qw(apache proftpd rsync) ], |
125 |
ennael |
37571 |
}, |
126 |
|
|
{ label => N_("Mail"), |
127 |
|
|
descr => N_("Postfix mail server"), |
128 |
|
|
flags => [ qw(NETWORKING_MAIL_SERVER) ], |
129 |
tv |
388363 |
required => [ 'postfix' ], |
130 |
ennael |
37571 |
}, |
131 |
|
|
{ label => N_("Database"), |
132 |
ennael |
235001 |
descr => N_("PostgreSQL or MariaDB database server"), |
133 |
ennael |
37571 |
flags => [ qw(DATABASES DATABASES_SERVER) ], |
134 |
tv |
388363 |
required => [ qw(postgresql9.1 postgresql9.2 mariadb) ], |
135 |
ennael |
37571 |
}, |
136 |
|
|
{ label => N_("Firewall/Router"), |
137 |
|
|
descr => N_("Internet gateway"), |
138 |
|
|
flags => [ qw(NETWORKING_FIREWALLING_SERVER) ], |
139 |
|
|
}, |
140 |
|
|
{ label => N_("Network Computer server"), |
141 |
|
|
descr => N_("NFS server, SMB server, Proxy server, ssh server"), |
142 |
|
|
flags => [ qw(NETWORKING_FILE_SERVER NETWORKING_REMOTE_ACCESS_SERVER) ], |
143 |
tv |
388363 |
required => [ qw(nfs-utils cups samba-server openssh-server) ], |
144 |
ennael |
37571 |
}, |
145 |
|
|
), |
146 |
|
|
], |
147 |
|
|
|
148 |
|
|
N_("Graphical Environment") => |
149 |
|
|
[ |
150 |
|
|
{ label => N_("KDE Workstation"), |
151 |
|
|
descr => N_("The K Desktop Environment, the basic graphical environment with a collection of accompanying tools"), |
152 |
|
|
flags => [ qw(KDE X ACCESSIBILITY THEMES) ], |
153 |
|
|
default_selected => !$light_desktop, |
154 |
tv |
388363 |
required => [ 'task-kde4-minimal' ], |
155 |
ennael |
37571 |
}, |
156 |
|
|
{ label => N_("GNOME Workstation"), |
157 |
|
|
descr => N_("A graphical environment with user-friendly set of applications and desktop tools"), |
158 |
|
|
flags => [ qw(GNOME X THEMES), if_(!$light_desktop, qw(ACCESSIBILITY)) ], |
159 |
|
|
default_selected => $netbook_desktop, |
160 |
tv |
388363 |
required => [ 'task-gnome-minimal' ], |
161 |
ennael |
37571 |
}, |
162 |
|
|
{ label => N_("LXDE Desktop"), |
163 |
|
|
flags => [ qw(LXDE X ACCESSIBILITY) ], |
164 |
|
|
descr => N_("A lightweight & fast graphical environment with user-friendly set of applications and desktop tools"), |
165 |
|
|
default_selected => $low_resources, |
166 |
|
|
}, |
167 |
|
|
{ label => N_("Other Graphical Desktops"), |
168 |
|
|
descr => N_("Window Maker, Enlightenment, Fvwm, etc"), |
169 |
tmb |
338771 |
flags => [ qw(GRAPHICAL_DESKTOP X ACCESSIBILITY E17 XFCE) ], |
170 |
ennael |
37571 |
}, |
171 |
|
|
], |
172 |
|
|
|
173 |
|
|
if_($server, |
174 |
|
|
N_("Development") => |
175 |
|
|
[ |
176 |
|
|
{ label => N_("Development"), |
177 |
|
|
descr => N_("C and C++ development libraries, programs and include files"), |
178 |
|
|
flags => [ qw(DEVELOPMENT EDITORS) ], |
179 |
|
|
default_selected => 1, |
180 |
|
|
}, |
181 |
|
|
{ label => N_("Documentation"), |
182 |
|
|
descr => N_("Books and Howto's on Linux and Free Software"), |
183 |
|
|
flags => [ qw(BOOKS) ], |
184 |
|
|
}, |
185 |
|
|
{ label => N_("LSB"), |
186 |
|
|
descr => N_("Linux Standard Base. Third party applications support"), |
187 |
|
|
flags => [ qw(LSB) ], |
188 |
|
|
}, |
189 |
|
|
], |
190 |
|
|
|
191 |
|
|
N_("Utilities") => |
192 |
|
|
[ |
193 |
|
|
{ label => N_("SSH Server"), |
194 |
|
|
descr => N_("SSH Server"), |
195 |
|
|
flags => [ qw(NETWORKING_REMOTE_ACCESS_SERVER) ], |
196 |
|
|
default_selected => 1, |
197 |
|
|
}, |
198 |
|
|
{ label => N_("Webmin"), |
199 |
|
|
descr => N_("Webmin Remote Configuration Server"), |
200 |
|
|
flags => [ qw(WEBMIN) ], |
201 |
|
|
default_selected => 1, |
202 |
|
|
}, |
203 |
|
|
{ label => N_("Network Utilities/Monitoring"), |
204 |
|
|
descr => N_("Monitoring tools, processes accounting, tcpdump, nmap, ..."), |
205 |
|
|
flags => [ qw(MONITORING NETWORKING_FILE) ], |
206 |
|
|
default_selected => 1, |
207 |
|
|
}, |
208 |
ennael |
38828 |
{ label => N_("Mageia Wizards"), |
209 |
ennael |
37571 |
descr => N_("Wizards to configure server"), |
210 |
|
|
flags => [ qw(WIZARDS) ], |
211 |
|
|
default_selected => 1, |
212 |
|
|
}, |
213 |
|
|
], |
214 |
|
|
), |
215 |
|
|
}; |
216 |
|
|
|
217 |
|
|
foreach my $path (keys %$h) { |
218 |
|
|
foreach (@{$h->{$path}}) { |
219 |
|
|
$_->{path} = $path; |
220 |
|
|
$_->{uid} = join('|', $path, $_->{label}); |
221 |
|
|
} |
222 |
|
|
} |
223 |
|
|
|
224 |
tv |
388363 |
sub _filter { |
225 |
tv |
389212 |
grep { $_->{required} ? (any { install::pkgs::packageByName($::o->{packages}, $_ ) } @{$_->{required}}) : 1 } map { @$_ } @_; |
226 |
tv |
388363 |
} |
227 |
ennael |
37571 |
|
228 |
tv |
388363 |
my $compssUsers = [ _filter(values %$h) ]; |
229 |
|
|
|
230 |
ennael |
37571 |
my $gtk_display_compssUsers = sub { |
231 |
|
|
my ($entry) = @_; |
232 |
|
|
|
233 |
|
|
require ugtk2; |
234 |
|
|
ugtk2->import(qw(:helpers :wrappers :create)); |
235 |
|
|
require mygtk2; |
236 |
|
|
mygtk2->import(qw(gtknew)); |
237 |
|
|
|
238 |
|
|
my $entries_in_path = sub { |
239 |
|
|
my ($path) = @_; |
240 |
tv |
389193 |
my @items = map { $entry->($_) } _filter($h->{$path}); |
241 |
ennael |
37571 |
|
242 |
|
|
# ensure we have an even number of items: |
243 |
|
|
if (@items % 2) { |
244 |
|
|
my @last_items = (pop @items, gtknew('Label')); |
245 |
|
|
# RTL support: |
246 |
|
|
@last_items = reverse @last_items if lang::text_direction_rtl(); |
247 |
|
|
push @items, @last_items; |
248 |
|
|
} |
249 |
|
|
|
250 |
|
|
gtknew('Title2', label => mygtk2::asteriskize(translate($path))), |
251 |
|
|
gtknew('Table', children => [ group_by2(@items) ], homogeneous => 1), |
252 |
|
|
Gtk2::HSeparator->new; |
253 |
|
|
}; |
254 |
|
|
|
255 |
|
|
gtkpack__(Gtk2::VBox->new, |
256 |
|
|
$entries_in_path->('Workstation'), |
257 |
|
|
$server ? $entries_in_path->('Server') : (), |
258 |
|
|
$server ? ( |
259 |
|
|
$entries_in_path->('Graphical Environment'), |
260 |
|
|
$entries_in_path->('Development'), |
261 |
|
|
$entries_in_path->('Utilities'), |
262 |
|
|
) : ( |
263 |
|
|
$entries_in_path->('Server'), |
264 |
|
|
$entries_in_path->('Graphical Environment'), |
265 |
|
|
), |
266 |
|
|
); |
267 |
|
|
}; |
268 |
|
|
|
269 |
|
|
$compssUsers, $gtk_display_compssUsers; |