Commit 86fa6017 authored by david.verdin's avatar david.verdin
Browse files

[-feature] Reintegrating the latest changes in sympa-autotools-cleanup branch.



git-svn-id: https://subversion.renater.fr/sympa/trunk@5958 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent c1032968
......@@ -19,7 +19,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
SUBDIRS = src wwsympa soap web_tt2 mail_tt2 doc po po-wwsympa
SUBDIRS = src wwsympa soap web_tt2 mail_tt2 doc po po-wwsympa t
EXTRA_DIST = important_changes.pl \
sympa.spec.in \
......
......@@ -453,6 +453,7 @@ AC_CONFIG_FILES([
mail_tt2/Makefile
po/Makefile.in
po-wwsympa/Makefile.in
t/Makefile
sympa.spec
])
AC_OUTPUT
man8_MANS = archived.8 bounced.8 alias_manager.8 sympa.8
EXTRA_DIST = archived.pod bounced.pod alias_manager.pod sympa.pod
EXTRA_DIST = archived.pod.in bounced.pod.in alias_manager.pod.in sympa.pod
CLEANFILES = $(man8_MANS)
CLEANFILES = $(man8_MANS) archived.pod bounced.pod alias_manager.pod
.pod.8:
rm -f $@
pod2man --section=8 --center="sympa $(VERSION)" --lax --release="$(VERSION)" $< $@
install-data-hook:
archived.pod bounced.pod alias_manager.pod: Makefile
rm -f $@
sed \
-e 's|--piddir--|$(piddir)|' \
-e 's|--libexecdir--|$(libexecdir)|' \
-e 's|--sysconfdir--|$(sysconfdir)|' \
-e 's|--defaultdir--|$(defaultdir)|' \
-e 's|--expldir--|$(expldir)|' \
-e 's|--spooldir--|$(spooldir)|' \
-e 's|--docdir--|$(docdir)|' \
$(addprefix $(DESTDIR)$(man8dir)/, $(man8_MANS))
-e 's|--WWSCONFIG--|$(WWSCONFIG)|' \
-e 's|--SENDMAIL_ALIASES--|$(SENDMAIL_ALIASES)|' \
< $(srcdir)/$@.in > $@
archived.pod: $(srcdir)/archived.pod.in
bounced.pod: $(srcdir)/bounced.pod.in
alias_manager.pod: $(srcdir)/alias_manager.pod.in
......@@ -13,7 +13,7 @@ created lists and deleting aliases for closed lists.
Is is called by
I<wwsympa.fcgi> via the I<aliaswrapper>. Alias management is performed
by I<wwsympa.fcgi> only if it was setup in I<--CONFDIR--/wwsympa.conf>
by I<wwsympa.fcgi> only if it was setup in I<--WWSCONFIG-->
(I<sendmail_aliases> configuration parameter).
Administrators using MTA functionalities to manage aliases (ie
......
......@@ -42,7 +42,7 @@ F<--spooldir--/outgoing/> outgoing Sympa directory.
F<--defaultdir--/mhonarc-ressources> mhonarc ressource file
F<--confdir--/wwsympa.conf> WWSympa configuration file.
F<--sysconfdir--/wwsympa.conf> WWSympa configuration file.
F<--piddir--/archived.pid> this file contains the process ID
of F<archived.pl>.
......
......@@ -35,7 +35,7 @@ Run the program in a debug mode.
=head1 FILES
F<--confdir--/wwsympa.conf> WWSympa configuration file.
F<--sysconfdir--/wwsympa.conf> WWSympa configuration file.
F<--libexecdir--/bouncequeue> bounce spooler, referenced from sendmail alias file
......
......@@ -35,9 +35,15 @@ nobase_default_DATA = list_task_models/expire.yearly.task \
global_task_models/purge_tables.daily.task \
global_task_models/purge_user_table.monthly.task \
charset.conf topics.conf nrcpt_by_domain.conf \
ldap_alias_entry.tt2 ldap_alias_manager.conf edit_list.conf \
create_list.conf crawlers_detection.conf auth.conf \
ca-bundle.crt mhonarc-ressources.tt2 list_aliases.tt2 \
ldap_alias_entry.tt2 \
ldap_alias_manager.conf \
edit_list.conf \
create_list.conf \
crawlers_detection.conf \
auth.conf \
ca-bundle.crt \
mhonarc-ressources.tt2 \
list_aliases.tt2 \
create_list_templates/discussion_list/comment.tt2 \
create_list_templates/discussion_list/config.tt2 \
create_list_templates/hotline/comment.tt2 \
......@@ -144,7 +150,9 @@ nobase_default_DATA = list_task_models/expire.yearly.task \
scenari/visibility.noconceal \
scenari/visibility.secret
EXTRA_DIST = $(nobase_default_DATA)
EXTRA_DIST = $(nobase_default_DATA) list_aliases.tt2.in
CLEANFILES = list_aliases.tt2
DEFAULT_SCENARIOS = add.owner \
d_edit.owner \
......@@ -160,9 +168,13 @@ DEFAULT_SCENARIOS = add.owner \
unsubscribe.open \
visibility.conceal
list_aliases.tt2: Makefile list_aliases.tt2.in
rm -f $@
sed \
-e 's|--libexecdir--|$(libexecdir)|' \
< $(srcdir)/$@.in > $@
install-data-hook:
sed -e 's|--libexecdir--|$(libexecdir)|' \
$(DESTDIR)$(defaultdir)/list_aliases.tt2
cd $(DESTDIR)$(defaultdir)/scenari; \
for file in $(DEFAULT_SCENARIOS); do \
ln -sf $$file `echo $$file | sed -e 's/\.[^.]\+$$/.default/'`; \
......
......@@ -19,28 +19,53 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
dbscripts = create_db.Pg create_db.mysql create_db.Oracle \
create_db.Sybase create_db.SQLite
script_SCRIPTS = create_db.Pg create_db.mysql create_db.Oracle \
create_db.Sybase create_db.SQLite \
arc2webarc.pl testldap.pl p12topem.pl init_comment.pl \
crypt_passwd.pl testlogs.pl mod2html.pl tpl2tt2.pl \
ldap_alias_manager.pl mysql_alias_manager.pl
perlscripts = arc2webarc.pl testldap.pl p12topem.pl init_comment.pl \
crypt_passwd.pl testlogs.pl mod2html.pl tpl2tt2.pl \
ldap_alias_manager.pl mysql_alias_manager.pl
script_SCRIPTS = $(dbscripts) $(perlscripts)
init_SCRIPTS = sympa
EXTRA_DIST = $(script_SCRIPTS) $(init_SCRIPTS)
EXTRA_DIST = $(dbscripts) \
arc2webarc.pl.in crypt_passwd.pl.in init_comment.pl.in \
ldap_alias_manager.pl.in mod2html.pl.in mysql_alias_manager.pl.in \
p12topem.pl.in testldap.pl.in testlogs.pl.in tpl2tt2.pl.in \
sympa.in
CLEANFILES = $(perlscripts) $(init_SCRIPTS)
install-data-hook:
arc2webarc.pl crypt_passwd.pl init_comment.pl ldap_alias_manager.pl mod2html.pl mysql_alias_manager.pl p12topem.pl testldap.pl testlogs.pl tpl2tt2.pl: Makefile
rm -f $@
sed \
-e 's|--PERL--|$(PERL)|' \
-e 's|--USER--|$(USER)|' \
-e 's|--GROUP--|$(GROUP)|' \
-e 's|--modulesdir--|$(modulesdir)|' \
< $(srcdir)/$@.in > $@
chmod +x $@
sympa: Makefile
rm -f $@
sed \
-e 's|--CONFIG--|$(CONFIG)|' \
-e 's|--WWSCONFIG--|$(WWSCONFIG)|' \
-e 's|--prefix--|$(prefix)|' \
-e 's|--sbindir--|$(sbindir)|' \
-e 's|--initdir--|$(initdir)|' \
-e 's|--piddir--|$(piddir)|' \
-e 's|--lockdir--|$(lockdir)|' \
-e 's|--initdir--|$(initdir)|' \
-e 's|--sbindir--|$(sbindir)|' \
-e 's|--pkgdatadir--|$(pkgdatadir)|' \
$(addprefix $(DESTDIR)$(scriptdir)/, $(script_SCRIPTS)) \
$(addprefix $(DESTDIR)$(initdir)/, $(init_SCRIPTS))
< $(srcdir)/$@.in > $@
chmod +x $@
arc2webarc.pl: arc2webarc.pl.in
crypt_passwd.pl: crypt_passwd.pl.in
init_comment.pl: init_comment.pl.in
ldap_alias_manager.pl: ldap_alias_manager.pl.in
mod2html.pl: mod2html.pl.in
mysql_alias_manager.pl: mysql_alias_manager.pl.in
p12topem.pl: p12topem.pl.in
testldap.pl: testldap.pl.in
testlogs.pl: testlogs.pl.in
tpl2tt2.pl: tpl2tt2.pl.in
sympa: sympa.in
......@@ -24,8 +24,10 @@
use lib '--modulesdir--';
use wwslib;
$wwsympa_conf_file = '--WWSCONFIG--';
$sympa_conf_file = '--CONFIG--';
use Sympa::Constants;
$wwsympa_conf_file = Sympa::Constants::WWSCONFIG;
$sympa_conf_file = Sympa::Constants::CONFIG;
use List;
use Log;
......@@ -71,8 +73,10 @@ my $listname = $ARGV[0];
my $robot = $ARGV[1];
## Check UID
unless ([getpwuid $<]->[0] eq '--USER--') {
print "You should run this script as user \"--USER--\", ignore ? (y/CR)";
unless ([getpwuid $<]->[0] eq Sympa::Constants::USER) {
printf
"You should run this script as user \"%s\", ignore ? (y/CR)",
Sympa::Constants::USER;
my $s = <STDIN>;
die unless ($s =~ /^y$/i);
}
......
......@@ -23,6 +23,7 @@
use lib '--modulesdir--';
use wwslib;
use Sympa::Constants;
unless (require Crypt::CipherSaber) {
die "Crypt::CipherSaber not installed ; cannot crypt passwords";
......@@ -34,7 +35,7 @@ use List;
use Log;
## Load sympa config
&Conf::load('--CONFIG--') || die 'config_error';
&Conf::load(Sympa::Constants::CONFIG) || die 'config_error';
chdir $Conf::Conf{'home'};
......
......@@ -21,14 +21,15 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
use lib '--modulesdir--/lib';
use lib '--modulesdir--';
use wwslib;
use Sympa::Constants;
use List;
use Log;
## Load sympa config
&Conf::load('--CONFIG--') || die 'config_error';
&Conf::load(Sympa::Constants::CONFIG) || die 'config_error';
chdir $Conf::Conf{'home'};
......
......@@ -17,8 +17,6 @@
$ENV{'PATH'} = '';
my $SYMPA_CONF = '--CONFIG--';
## Load Sympa.conf
use strict;
use lib '--modulesdir';
......@@ -26,12 +24,13 @@ use Conf;
use POSIX;
require tools;
require tt2;
use Sympa::Constants;
use Net::LDAP;
use Net::LDAPS;
unless (Conf::load($SYMPA_CONF)) {
print gettext("The configuration file $SYMPA_CONF contains errors.\n");
unless (Conf::load(Sympa::Constants::CONFIG)) {
print gettext("The configuration file contains errors.\n");
exit(1);
}
......@@ -82,7 +81,7 @@ my @aliases ;
my $tt2_include_path = [$Conf{'etc'}.'/'.$domain,
$Conf{'etc'},
'--ETCBINDIR--'];
Sympa::Constants::DEFAULTDIR];
my $aliases_dump;
&tt2::parse_tt2(\%data, 'list_aliases.tt2',\$aliases_dump, $tt2_include_path);
......
......@@ -8,8 +8,9 @@ use lib '--modulesdir--';
use Conf; # to load Sympa conf which is needed by List.pm
use List;
use Log; # if you want to get logs of List.pm
use Sympa::Constants;
unless (Conf::load('--CONFIG--')) {
unless (Conf::load(Sympa::Constants::CONFIG)) {
die "Can't load Sympa configuration file";
}
&do_openlog($Conf{'syslog'}, $Conf{'log_socket_type'}, 'sympa');
......@@ -22,8 +23,8 @@ if ($Conf{'db_name'} and $Conf{'db_type'}) {
&List::_apply_defaults(); # else reading of a List configuration won't work
# Set the UserID & GroupID for the process
$( = $) = (getgrnam('--GROUP--'))[2];
$< = $> = (getpwnam('--USER--'))[2];
$( = $) = (getgrnam(Sympa::Constants::GROUP))[2];
$< = $> = (getpwnam(Sympa::Constants::USER))[2];
# Sets the UMASK
umask(oct($Conf{'umask'}));
......
......@@ -14,11 +14,12 @@ use Conf;
use POSIX;
require tools;
require tt2;
use Sympa::Constants;
use DBI;
unless (Conf::load('--CONFIG--')) {
print gettext("The configuration file --CONFIG-- contains errors.\n");
unless (Conf::load(Sympa::Constants::CONFIG)) {
print gettext("The configuration file contains errors.\n");
exit(1);
}
......
......@@ -28,8 +28,9 @@ use strict;
use lib '--modulesdir--';
use Getopt::Long;
use Sympa::Constants;
my $sympa_conf_file = '--CONFIG--';
my $sympa_conf_file = Sympa::Constants::CONFIG;
use Conf;
use List;
......
......@@ -26,9 +26,10 @@ use wwslib;
use Conf;
use Language;
require "tt2.pl";
use Sympa::Constants;
$wwsympa_conf_file = '--WWSCONFIG--';
$sympa_conf_file = '--CONFIG--';
$wwsympa_conf_file = Sympa::Constants::WWSCONFIG;
$sympa_conf_file = Sympa::Constants::CONFIG;
use List;
use Log;
......@@ -38,7 +39,7 @@ my %options;
$| = 1;
## Check UID
#unless (getlogin() eq '--USER--') {
#unless (getlogin() eq Sympa::Constants::USER) {
# print "You should run this script as user \"sympa\", ignore ? (y/CR)";
# my $s = <STDIN>;
# die unless ($s =~ /^y$/i);
......@@ -220,8 +221,8 @@ foreach my $tpl (@templates) {
next;
}
unless (&tools::set_file_rights(file => $dest_path,
user => '--USER--',
group => '--GROUP--',
user => Sympa::Constants::USER,
group => Sympa::Constants::GROUP,
mode => 0755,
))
{
......@@ -273,8 +274,8 @@ sub convert {
printf "Template file $in_file has been converted to $out_file\n";
unless (&tools::set_file_rights(file => $out_file,
user => '--USER--',
group => '--GROUP--',
user => Sympa::Constants::USER,
group => Sympa::Constants::GROUP
))
{
&do_log('err','Unable to set rights on %s',$Conf{'db_name'});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment