Parcourir la source

Tweak makefile and readme

Andy Baugh il y a 7 ans
Parent
commit
05600b93be
2 fichiers modifiés avec 47 ajouts et 5 suppressions
  1. 38 4
      Makefile
  2. 9 1
      README.md

+ 38 - 4
Makefile

@@ -1,13 +1,47 @@
 all: install
 
-install: depend
+install: depend-all
 	[ -d /var/cpanel/perl/Cpanel/iContact/Provider/Schema ] || mkdir -p /var/cpanel/perl/Cpanel/iContact/Provider/Schema/
 	cp -f lib/Cpanel/iContact/Provider/Schema/*.pm /var/cpanel/perl/Cpanel/iContact/Provider/Schema/
 	cp -f lib/Cpanel/iContact/Provider/*.pm /var/cpanel/perl/Cpanel/iContact/Provider/
 
-test: depend
+install-slack:
+	cp -f lib/Cpanel/iContact/Provider/Schema/Slack.pm /var/cpanel/perl/Cpanel/iContact/Provider/Schema/Slack.pm
+	cp -f lib/Cpanel/iContact/Provider/Slack.pm /var/cpanel/perl/Cpanel/iContact/Provider/Slack.pm
+
+install-xmpp: depend-xmpp
+	cp -f lib/Cpanel/iContact/Provider/Schema/XMPP.pm /var/cpanel/perl/Cpanel/iContact/Provider/Schema/XMPP.pm
+	cp -f lib/Cpanel/iContact/Provider/XMPP.pm /var/cpanel/perl/Cpanel/iContact/Provider/XMPP.pm
+
+install-irc: depend-irc
+	cp -f lib/Cpanel/iContact/Provider/Schema/IRC.pm /var/cpanel/perl/Cpanel/iContact/Provider/Schema/IRC.pm
+	cp -f lib/Cpanel/iContact/Provider/IRC.pm /var/cpanel/perl/Cpanel/iContact/Provider/IRC.pm
+
+install-discord:
+	cp -f lib/Cpanel/iContact/Provider/Schema/Discord.pm /var/cpanel/perl/Cpanel/iContact/Provider/Schema/Discord.pm
+	cp -f lib/Cpanel/iContact/Provider/Discord.pm /var/cpanel/perl/Cpanel/iContact/Provider/Discord.pm
+
+uninstall:
+	rm /var/cpanel/perl/Cpanel/iContact/Provider/Slack.pm
+	rm /var/cpanel/perl/Cpanel/iContact/Provider/Schema/Slack.pm
+	rm /var/cpanel/perl/Cpanel/iContact/Provider/IRC.pm
+	rm /var/cpanel/perl/Cpanel/iContact/Provider/Schema/IRC.pm
+	rm /var/cpanel/perl/Cpanel/iContact/Provider/XMPP.pm
+	rm /var/cpanel/perl/Cpanel/iContact/Provider/Schema/XMPP.pm
+	rm /var/cpanel/perl/Cpanel/iContact/Provider/Discord.pm
+	rm /var/cpanel/perl/Cpanel/iContact/Provider/Schema/Discord.pm
+
+test: depend-all depend-test
 	[ ! -x /usr/local/cpanel/3rdparty/bin/prove ] || /usr/local/cpanel/3rdparty/bin/prove t/*.t
 	[ -x /usr/local/cpanel/3rdparty/bin/prove ] || prove t/*.t
 
-depend:
-	perl -MNet::XMPP -MMozilla::CA -MTest::More -MTest::Fatal -MTest::MockModule -MConfig::Simple -MIO::Socket::INET -MIO::Socket::SSL -MHTTP::Tiny::UA -MHTTP::Tiny::UA::Response -e 'exit 0;' || sudo cpan -i Net::XMPP Mozilla::CA Test::More Test::Fatal Test::MockModule Config::Simple IO::Socket::INET IO::Socket::SSL HTTP::Tiny::UA HTTP::Tiny::UA::Response
+depend-irc:
+	perl -MIO::Socket::INET -MIO::Socket::SSL -e 'exit 0;' || sudo cpan -i IO::Socket::INET IO::Socket::SSL
+
+depend-xmpp:
+	perl -MNet::XMPP -MMozilla::CA -e 'exit 0;' || sudo cpan -i Net::XMPP Mozilla::CA
+
+depend-all: depend-xmpp depend-irc
+
+depend-test:
+	perl -MTest::More -MTest::Fatal -MTest::MockModule -MConfig::Simple -MHTTP::Tiny::UA -MHTTP::Tiny::UA::Response -e 'exit 0;' || sudo cpan -i Test::More Test::Fatal Test::MockModule Config::Simple HTTP::Tiny::UA HTTP::Tiny::UA::Response

+ 9 - 1
README.md

@@ -10,11 +10,15 @@ Current plugins:
 
 Installation and Use:
 ---------------------
-* Clone this repo with git onto a cPanel host of at least 11.64+, then run `make` after changing the current working directory of your terminal session into the repo's directory.
+* Clone this repo with git onto a cPanel host of at least 11.64+.
+* After changing the current working directory of your terminal session into the repo's directory, run `make` if you want to install all the providers.
+OR
+* If you want to only install one specific provider, run 'make install-$provider' -- example: `make install-slack` would install Slack's provider.
 * (Optionally) Run the Tests with `make test`
 * Go to WHM >> Basic Setup and configure the provider options
 * Go to WHM >> Contact Manager and make sure it is set up to spam you mercilessly (and for the notifications you care about!).
 * Do something to trigger a notification that should fire notifications from cPanel & WHM per your preference in /etc/clevels.conf
+* If you tire of the modules and want to get rid of them, run `make uninstall`.
 
 KNOWN BUGS
 ----------
@@ -23,6 +27,10 @@ Currently, the DIGEST-MD5 method (used by default in Net::XMPP when authenticati
 causes failures to send notifications. Add `disable_sasl_mechanisms: "DIGEST-MD5"` to your `ejabberd.yml` config file
 to avoid this problem. See issue #2 on the tracker.
 
+Also, I've seen a report about gtalk.t failing on install for certain users when attempting to install Net::XMPP as a dependency.
+If this occurs, you'll likely have to manually run CPAN and tell it to ignore the failing tests:
+`cpan -i -f Net::XMPP`. After it installs you can then rerun make install and it should be OK. (the '-f' flag stands for 'force')
+
 TESTING NOTES
 -------------
 If you want to run a functional test for any of these (to debug problems), please run the following script: