Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log | RSS feed

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