Mail-SpamCannibal

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

MY_POD2TEXT = |. $post_constants .q|
|;
  } else {
    $post_constants = q|
MY_POD2TEXT = echo "perl distro missing 'pod2text' to convert "
|;
  }
  $post_constants .= q|
|. $configtxt .q|
SPAMUID= |. $uid .q|
SPAMGID= |. $gid .q|

|;
  if ($workaround) {
    $post_constants .= pf_handy_list(\%makeparms);
  }
  $post_constants;
}

### replaced in MY::postamble - install_permissions
### 
#	chmod 0644 $(SPAMCANNIBAL_HOME)/config/sc_web.conf.sample
#	if [ -f $(SPAMCANNIBAL_HOME)/config/sc_web.conf ]; then \
#	    chmod 0644 $(SPAMCANNIBAL_HOME)/config/sc_web.conf; \
#	fi
### replaced with ...  below
#	chmod 0644 $(SPAMCANNIBAL_HOME)/config/sc_web*

sub MY::postamble {
  my $postamble;
  $postamble = q|
.PHONY = install_daemon install_spamcannibal clean_CTest pods/INSTALL.pod install_sc_permissions

INSTALL : pods/INSTALL.pod
	@$(MY_POD2TEXT) pods/INSTALL.pod > INSTALL

pods/INSTALL.pod :
	@$(NOOP)

SiteConfig.pm : config.db
	$(PERL) inst/make_Config.pl

install_spamcannibal	: scripts/sc_sesswrap
	@$(MKPATH) $(SPMCNBL_CONFIG_DIR)
	@$(MKPATH) $(SPMCNBL_SCRIPT_DIR)
	$(RM_F) $(SPMCNBL_SCRIPT_DIR)/sc_remotewrap
	$(CP) -p rc.sc_lbdaemon.sample $(SPMCNBL_SCRIPT_DIR)
	$(CP) -p rc.sc_dbwatch	$(SPMCNBL_SCRIPT_DIR)
	$(CP) -p scripts/*.pl $(SPMCNBL_SCRIPT_DIR)
	$(CP) -p scripts/sc_sesswrap $(SPMCNBL_SCRIPT_DIR)
	@ln -s $(SPMCNBL_SCRIPT_DIR)/sc_sesswrap $(SPMCNBL_SCRIPT_DIR)/sc_remotewrap
	$(CP) -p config/*.sample $(SPMCNBL_CONFIG_DIR)
	$(CP) -rp public_html $(SPAMCANNIBAL_HOME)
	$(RM_F) $(SPAMCANNIBAL_HOME)/public_html/admin.cgi
	@ln -s $(SPAMCANNIBAL_HOME)/public_html/cannibal.cgi $(SPAMCANNIBAL_HOME)/public_html/admin.cgi
	@$(MKPATH) $(SPAMCANNIBAL_HOME)/sess
	@$(MKPATH) $(SPAMCANNIBAL_HOME)/private
	$(CP) -p private/* $(SPAMCANNIBAL_HOME)/private

install_sc_permissions	:
	chown -R $(SPAMUID) $(SPAMCANNIBAL_HOME)
	chgrp -R $(SPAMGID) $(SPAMCANNIBAL_HOME)
	chmod 0700 $(SPAMCANNIBAL_HOME)/sess
	chmod 0700 $(SPAMCANNIBAL_HOME)/private
	chmod 0600 $(SPAMCANNIBAL_HOME)/private/*
	chmod 0640 $(SPAMCANNIBAL_HOME)/config/*
	chmod 0644 $(SPAMCANNIBAL_HOME)/config/sc_web*
	chmod 0644 $(SPAMCANNIBAL_HOME)/config/sc_Black*
	chmod 04755 $(SPMCNBL_SCRIPT_DIR)/sc_sesswrap
	chmod 01700 $(SPMCNBL_SCRIPT_DIR)/sc_session.pl
	chmod 0700 $(SPMCNBL_SCRIPT_DIR)/sc_remote.pl
	if [ -d $(SPAMCANNIBAL_HOME)/public_html/tmp ]; then \
	    $(RM_F) $(SPAMCANNIBAL_HOME)/public_html/tmp/*; \
	else \
	    $(MKPATH) $(SPAMCANNIBAL_HOME)/public_html/tmp; \
	    chown -R $(SPAMUID) $(SPAMCANNIBAL_HOME)/public_html/tmp; \
	    chgrp -R $(SPAMGID) $(SPAMCANNIBAL_HOME)/public_html/tmp; \
	    chmod 0777 $(SPAMCANNIBAL_HOME)/public_html/tmp; \
	fi
	if [ -d $(SPAMCANNIBAL_HOME)/public_html/flags ]; then \
	    echo "$(SPAMCANNIBAL_HOME)/public_html/flags exists, skipping..."; \
	else \
	    $(MKPATH) $(SPAMCANNIBAL_HOME)/public_html/flags; \
	    chown -R $(SPAMUID) $(SPAMCANNIBAL_HOME)/public_html/flags; \
	    chgrp -R $(SPAMGID) $(SPAMCANNIBAL_HOME)/public_html/flags; \
	    chmod 0777 $(SPAMCANNIBAL_HOME)/public_html/flags; \
	fi

install_daemon	:
	@cd BDBaccess && $(MAKE) install_daemon $(PASTHRU)
	@cd DNSBLserver && $(MAKE) install_daemon $(PASTHRU)

clean_CTest	:
	@cd BDBaccess && $(MAKE) clean_CTest $(PASTHRU)
	@cd DNSBLserver && $(MAKE) clean_CTest $(PASTHRU)

|;
  if ($workaround) {
    $postamble .= pf_htmlifypods(\%makeparms,\%Config);
  }
  $postamble;
}

sub MY::top_targets {
  my $inherited;
  {
    package MY;   # add dependencies for .pm and xs files
    $inherited = shift->SUPER::top_targets(@_);
  }
  $inherited =~ s|(\npure_all\s+::.+)config(.+)|${1}SiteConfig.pm scripts/sc_sesswrap INSTALL config$2|;
  if ($workaround) {
    $inherited =~ s/(manifypods)/pf_htmlifypods $1/g;
  }
  $inherited .= q|

scripts/sc_sesswrap	: cdata/sc_sesswrap.c
	@$(CC) cdata/sc_sesswrap.c -o scripts/sc_sesswrap

|;
}

sub MY::makefile {
  package MY;
  my $inherited = shift->SUPER::makefile(@_);
  $inherited =~ s/(Makefile\s+:.+)/$1 config.db/;
  $inherited .= q|
config.db :
	@$(NOOP);

|;
}

sub MY::install {
  my $inherited;
  {
    package MY;
    $inherited = shift->SUPER::install(@_);
  }
  $inherited =~ s/(\ninstall\s+::)(.+doc.+install)/$1 install_daemon install_spamcannibal${2} install_sc_permissions/;
  $inherited =~ s/(\ninstall_perl\s+::(.+doc.+install))/$1 install_daemon install_spamcannibal${2} install_sc_permissions/;
  $inherited =~ s/(\ninstall_site\s+::)(.+doc.+install)/$1 install_daemon install_spamcannibal${2} install_sc_permissions/;   
  $inherited =~ s/(\s+)all(\s+)/${1}all clean_CTest${2}/g;
#  $inherited =~ s|(pure_site_install\s+::.*)|$1\n\t\@\$\(MKPATH\) \$\(INSTALLHTMLSITELIBDIR\)|;
  if ($workaround) {



( run in 0.843 second using v1.01-cache-2.11-cpan-71847e10f99 )