Bookmark and Share

Ubuntu Linux

sudo apt-get install git-mediawiki mediawiki

sudo apt-get install mediawiki-extensions-math memcached clamav mysql-server postgresql-contrib

macOS

Install Perl modules

Update cpan:

brew doctor
brew update
brew install cpanminus

Intall Perl modules:

sudo cpan install MediaWiki::API
sudo cpan install DateTime::Format::ISO8601

Optionally, in particular, if the above cpan installing commands fail, try to re-initliaze cpan configuration:

mv ~/.cpan ~/.cpan.bak
cpan config

Installing git-media executables

Download the git.git/tree/contrib/mw-to-git subdirectory of the git.git Git repository from kernel.org:

http://git.kernel.org/cgit/git/git.git/tree/contrib/mw-to-git

Or clone the git.git repository from http://git.kernel.org/cgit/git/

git clone git://git.kernel.org/pub/scm/git/git.git

Copy the git-remote-mediawiki.perl executable to git execution path:

sudo cp git/contrib/mw-to-git/git-remote-mediawiki.perl "$(git --exec-path)/git-remote-mediawiki"
sudo chmod a+x "$(git --exec-path)/git-remote-mediawiki"
sudo cp git/contrib/mw-to-git/git-mw.perl "$(git --exec-path)/git-mw"
sudo chmod a+x "$(git --exec-path)/git-mw"

PERL5LIB environment variable

Define PERL5LIB environment variable in $HOME/.bashrc:

#######################################################################
#+ PERL5LIB environment variable
#+
#+ ## References
#+ * https://github.com/moy/Git-Mediawiki/wiki/User-manual
#+ * 
##

GIT="$HOME/path/to/repo/git"
export PERL5LIB=$GIT/perl:$GIT/contrib/mw-to-git

Set up local mediawiki repository

cd XmydirX
git init XmymediawikirepoX
chmod 600 .git/config # you're going to put a password there
                      # so don't keep it world-readable!
cd XmymediawikirepoX
git remote add origin mediawiki::http://XexampleX.XcomX/XwikiX/
# edit .git/config and set the right variables in the [remote "origin"] section 
# such as
# mwLogin = XXX
# shallow = true
git fetch origin

References

blog comments powered by Disqus