http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99796

Revision: 99796
Author:   wikinaut
Date:     2011-10-14 19:34:39 +0000 (Fri, 14 Oct 2011)
Log Message:
-----------
Makefile changed: now using 'hash' instead of 'which' for testing presence of 
'patch' program as suggested in stackoverflow.com. Added lots of explaining 
echo text lines guiding the interested user

Modified Paths:
--------------
    trunk/extensions/OpenID/Makefile

Modified: trunk/extensions/OpenID/Makefile
===================================================================
--- trunk/extensions/OpenID/Makefile    2011-10-14 19:25:48 UTC (rev 99795)
+++ trunk/extensions/OpenID/Makefile    2011-10-14 19:34:39 UTC (rev 99796)
@@ -1,4 +1,4 @@
-VER=2.2.2
+OPENID_PHP_VERSION=2.2.2
 SUBDIR=openid-php-openid-782224d
 SHELL = /bin/sh
 
@@ -40,6 +40,13 @@
 #    cd $IP/extensions/OpenID
 #    make
 #
+# If you want to clean-up (delete $IP/extensions/OpenID/Auth subdirectory and
+# to delete a previously downloaded tgz file) to try a fresh "make", then use
+#
+#    cd $IP/extensions/OpenID
+#    make clean
+#    make
+#
 # initially written by Brion Vibber
 # 20110203 T. Gries 
 # 20111014 added a test whether "patch" (program) exists before starting it 
blindly
@@ -48,29 +55,41 @@
 
 # test if "patch" program is installed 
 # some distributions don't have it installed by default
-# alternative rule: patch-exists: ; patch --version >/dev/null
-# http://www.gnu.org/s/hello/manual/make/Standard-Targets.html
+# 
+# as suggested in 
+# 
http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script
+# we use "hash" to test existence of "patch"
 
 check-if-patch-exists:
-       @if $(SHELL) -c 'which patch' >/dev/null 2>&1; then \
-               # echo "...The 'patch' program exists." ; \
+       @if $(SHELL) -c 'hash patch' >/dev/null 2>&1; then \
+               # echo "... The 'patch' program exists." ; \
                true; \
        else \
-               echo "...The 'patch' program does not exist on your system. 
Please install it before running make."; \
+               echo "... The 'patch' program does not exist on your system. 
Please install it before running make."; \
                false; \
        fi
 
-Auth:  php-openid-$(VER).tar.gz
-       tar -xzf php-openid-$(VER).tar.gz $(SUBDIR)/Auth
-       rm -f php-openid-$(VER).tar.gz
+Auth:  php-openid-$(OPENID_PHP_VERSION).tar.gz
+       @echo "... Extracting php-openid-$(OPENID_PHP_VERSION).tar.gz:"
+       tar -xzf php-openid-$(OPENID_PHP_VERSION).tar.gz $(SUBDIR)/Auth
+       rm -f php-openid-$(OPENID_PHP_VERSION).tar.gz
        mv $(SUBDIR)/Auth ./
-       patch -p1 -d Auth < patches/php-openid-$(VER).patch
+       @echo "... Patching php-openid-$(OPENID_PHP_VERSION) files in the Auth 
subdirectory:"
+       patch -p1 -d Auth < patches/php-openid-$(OPENID_PHP_VERSION).patch
        rmdir $(SUBDIR)
+       @echo -e "\n\
+... Now almost everything is ready for making your MediaWiki OpenID-aware.\n\
+... Don't forget to add\n\
+    require_once( \"\$$IP/extensions/OpenID/OpenID.php\" );\n\
+... to your \$$IP/LocalSettings.php, if not yet done. Then start your wiki."
 
-php-openid-$(VER).tar.gz:
-       wget --no-check-certificate 
https://github.com/openid/php-openid/tarball/$(VER) -O php-openid-$(VER).tar.gz
+php-openid-$(OPENID_PHP_VERSION).tar.gz:
+       @echo "... Downloading the PHP library for OpenID:"
+       wget --no-check-certificate 
https://github.com/openid/php-openid/tarball/$(OPENID_PHP_VERSION) -O 
php-openid-$(OPENID_PHP_VERSION).tar.gz
 
 # before starting a fresh installation or update,
 # you could use "make clean" to clean up, then "make" again
 clean:
-       rm -rf Auth php-openid-$(VER).tar.gz
+       @echo "... Deleting the Auth subdirectory and the 
php-openid-$(OPENID_PHP_VERSION).tar.gz file:"
+       rm -rf Auth php-openid-$(OPENID_PHP_VERSION).tar.gz
+       @echo "... A new installation can be started now by typing 'make'."


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to