diff options
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | common/Wizcommon.pm | 2 | ||||
-rwxr-xr-x | drakwizard.pl | 2 | ||||
-rwxr-xr-x | postfix_wizard/Postfix.pm | 114 | ||||
-rwxr-xr-x | samba_wizard/Samba.pm | 2 |
5 files changed, 70 insertions, 67 deletions
@@ -3,7 +3,7 @@ NAME = drakwizard TAR = $(NAME).tar.bz2 # TODO: get WIZ_HOME take care of usr prefix -WIZ_HOME=/usr/share/wizards +WIZ_HOME=/usr/share/wizards/ PERL_VENDORLIB=$(shell eval "`perl -V:installvendorlib`"; installvendorlib=$${installvendorlib\#/usr}; echo $$installvendorlib) @@ -29,21 +29,26 @@ all: install: mkdir -p ${prefix}/sbin - mkdir -p --mode=u=rwx,g=rx,o=rx ${prefix}/share/wizards/client_wizard/images mkdir -p ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard/ install -p drakwizard.pl ${prefix}/sbin/drakwizard - perl -i -pe "s|__WIZ_HOME__|$(WIZ_HOME)/|g; s|$$ENV{__WIZ_HOME__}|$(WIZ_HOME)/|g" ${prefix}/sbin/drakwizard + perl -i -pe "s,(__WIZ_HOME__|\i\\$$ENV{__WIZ_HOME__}),$(WIZ_HOME),g" ${prefix}/sbin/drakwizard perl -i -pe "s|new IFCFG|new MDK::Wizard::IFCFG|g" common/Wizcommon.pm for l in $(OTHER); do \ $(MAKE) -C $$l $@; \ done install --mode=u=rw,g=r,o=r -p common/*.pm ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard/; \ for l in $(WIZ); do \ + install --mode=u=rwx,g=rx,o=rx -d ${prefix}/share/wizards/$$l/images/; \ install --mode=u=rw,g=r,o=r -p $$l/*.pm ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard/; \ - install --mode=a=r -p $$l/images/*.png ${prefix}/share/wizards/client_wizard/images; \ + install --mode=a=r -p $$l/images/*.png ${prefix}/share/wizards/$$l/images; \ done - find ${prefix}/share/wizards -type f -regex ".*\.wiz$$\|.*.pm$$\|.*\.sh$$" -exec \ - perl -i -pe "s|__WIZ_HOME__|$(WIZ_HOME)|g; s|$$ENV{__WIZ_HOME__}|$(WIZ_HOME)/|g" \{\} \; + find ${prefix}/$(PERL_VENDORLIB)/MDK/Wizard -type f -regex ".*.pm$$" \ + -exec perl -i -pe "s,(\\\$$ENV{__WIZ_HOME__}|__WIZ_HOME__),$(WIZ_HOME),g" \{\} \; + +pitest: + cp samba_wizard/Samba.pm . + perl -i -pe "s,\\\$$ENV{__WIZ_HOME__},$(WIZ_HOME),g" Samba.pm + grep defaultimage Samba.pm clean: $(MAKE) -C po $@ diff --git a/common/Wizcommon.pm b/common/Wizcommon.pm index 36f9c53b..6b7c172d 100644 --- a/common/Wizcommon.pm +++ b/common/Wizcommon.pm @@ -30,7 +30,7 @@ sub check_dhcp { sub new { my ($class, $_conf) = @_; - $net = new MDK::Wizard::IFCFG; + $net = new IFCFG; bless { net => $net, }, $class; diff --git a/drakwizard.pl b/drakwizard.pl index 41481610..c17525e0 100755 --- a/drakwizard.pl +++ b/drakwizard.pl @@ -41,7 +41,7 @@ my %wiz = ( bind => ['Bind', "Dns (configuration)"], bind_client => ['Bind_client', "Dns (add client)"], inn => ['Inn', "News server"], - nfs => ['Nfs', "NFS server"], + nfs => ['NFS', "NFS server"], postfix => ['Postfix', "Mail server"], proftpd => ['Proftpd', "Ftp server"], samba => ['Samba', "Samba server"], diff --git a/postfix_wizard/Postfix.pm b/postfix_wizard/Postfix.pm index 20fd9af7..12567d8d 100755 --- a/postfix_wizard/Postfix.pm +++ b/postfix_wizard/Postfix.pm @@ -41,61 +41,61 @@ my $o = { }; $o->{pages} = { - welcome => { - name => N("Internet Mail Configuration Wizard") . "\n\n" . N("This wizard will help you configuring the Internet Mail services for your network."), - no_back => 1, - next => 'config' - }, - config => { - name => N("Outgoing Mail Address") . "\n\n" . N("You can select the kind of address that outgoing mail will show in the \qFrom:\q and \qReply-to\q field.") . "\n\n" . N("This should be chosen consistently with the address you use for incoming mail."), - pre => sub { - $o->{var}{wiz_mail_masquerade} ||= get_mail_masquerade(); - }, - post => \&check_masquerade, - data => [ - { label => N("Mail Address:"), val => \$o->{var}{wiz_mail_masquerade} }, - ], - next => 'isp' - }, - warning => { - name => N("Warning:"), - data => [ - { label => N("You entered an empty address for the mail gateway.") }, - { label => N("Your choice can be accepted, but this will not allow you to send mail outside your local network. Press next to continue, or back to enter a value.") } - ], - next => 'summary' - }, - masquerade_not_good => { - name => N("Error."), - data => [ { label => N("Masquerade not good!") } ], - next => 'config' - }, - isp => { - name => N("Internet Mail Gateway") . "\n\n" . N("Your server will send the outgoing through a mail gateway, that will take care of the final delivery.") . "\n\n" . N("Internet host names must be in the form \qhost.domain.domaintype\q; for example, if your provider is \qprovider.com\q, the internet mail server is usually \qsmtp.provider.com\q."), - pre => sub { - $o->{var}{wiz_ext_mail_relay} ||= get_mail_relay(); - }, - post => \&check_relay, - data => [ - { label => N("Mail Server Name:"), val => \$o->{var}{wiz_ext_mail_relay} }, - ], - next => 'summary' - }, - summary => { - name => N("Configuring the Internet Mail") . "\n\n" . N("The wizard collected the following parameters needed to configure your Internet Mail Service:") . "\n\n" . N("To accept these values, and configure your server, click the Next button or use the Back button to correct them."), - data => [ - { label => N("Internet Mail Gateway"), fixed_val => \$o->{var}{wiz_ext_mail_relay} }, - { label => N("Form of the Address"), fixed_val => \$o->{var}{wiz_mail_masquerade} }, - ], - post => \&do_it, - next => 'end' - }, - end => { - name => N("Congratulations"), - data => [ { label => N("The wizard successfully configured your Internet Mail service of your server.") } ], - end => 1, - next => 0 + welcome => { + name => N("Internet Mail Configuration Wizard") . "\n\n" . N("This wizard will help you configuring the Internet Mail services for your network."), + no_back => 1, + next => 'config' + }, + config => { + name => N("Outgoing Mail Address") . "\n\n" . N("You can select the kind of address that outgoing mail will show in the \qFrom:\q and \qReply-to\q field.") . "\n\n" . N("This should be chosen consistently with the address you use for incoming mail."), + pre => sub { + $o->{var}{wiz_mail_masquerade} ||= get_mail_masquerade(); }, + post => \&check_masquerade, + data => [ + { label => N("Masquerade domain name:"), val => \$o->{var}{wiz_mail_masquerade} }, + ], + next => 'isp' + }, + warning => { + name => N("Warning:"), + data => [ + { label => N("You entered an empty address for the mail gateway.") }, + { label => N("Your choice can be accepted, but this will not allow you to send mail outside your local network. Press next to continue, or back to enter a value.") } + ], + next => 'summary' + }, + masquerade_not_good => { + name => N("Error."), + data => [ { label => N("Masquerade not good!") } ], + next => 'config' + }, + isp => { + name => N("Internet Mail Gateway") . "\n\n" . N("Your server will send the outgoing through a mail gateway, that will take care of the final delivery.") . "\n\n" . N("Internet host names must be in the form \qhost.domain.domaintype\q; for example, if your provider is \qprovider.com\q, the internet mail server is usually \qsmtp.provider.com\q."), + pre => sub { + $o->{var}{wiz_ext_mail_relay} ||= get_mail_relay(); + }, + post => \&check_relay, + data => [ + { label => N("Mail Server Name:"), val => \$o->{var}{wiz_ext_mail_relay} }, + ], + next => 'summary' + }, + summary => { + name => N("Configuring the Internet Mail") . "\n\n" . N("The wizard collected the following parameters needed to configure your Internet Mail Service:") . "\n\n" . N("To accept these values, and configure your server, click the Next button or use the Back button to correct them."), + data => [ + { label => N("Internet Mail Gateway"), fixed_val => \$o->{var}{wiz_ext_mail_relay} }, + { label => N("Form of the Address"), fixed_val => \$o->{var}{wiz_mail_masquerade} }, + ], + post => \&do_it, + next => 'end' + }, + end => { + name => N("Congratulations"), + data => [ { label => N("The wizard successfully configured your Internet Mail service of your server.") } ], + end => 1, + next => 0 + }, }; sub new { @@ -107,7 +107,7 @@ sub new { sub check_masquerade { $o->{var}{wiz_mail_masquerade} or return 'masquerade_not_good'; - $o->{var}{wiz_mail_masquerade} =~ /@(\S+)$/ or return 'masquerade_not_good'; + $o->{var}{wiz_mail_masquerade} =~ /\w+\.\w+$/ or return 'masquerade_not_good'; } sub check_relay { @@ -116,13 +116,11 @@ sub check_relay { } sub get_mail_masquerade { - my $login = `logname`; my $relayhost = `/usr/sbin/postconf -h relayhost`; chomp($relayhost); ($relayhost) = $relayhost =~ /.*\.(.*\..*)/; !length $relayhost and $relayhost = $wiz_domain_name; - chomp($login); - "$login\@$relayhost"; + $relayhost } sub get_mail_relay { diff --git a/samba_wizard/Samba.pm b/samba_wizard/Samba.pm index f310fcb2..d40a51a5 100755 --- a/samba_wizard/Samba.pm +++ b/samba_wizard/Samba.pm @@ -236,7 +236,7 @@ sub new { sub check { $> and return 1; - $o->is_dhcp() and return 2; + $wiz->{net}->is_dhcp() and return 2; 0; } |