Browse Source

n/mediawiki: Removed.

slackware-14.2
Damien Goutte-Gattat 8 years ago
parent
commit
bf02a7f76d
  1. 17
      n/mediawiki/UPGRADE
  2. 25
      n/mediawiki/create-mwiki.sh
  3. 7
      n/mediawiki/extensions
  4. 57
      n/mediawiki/makearticle/Style.css
  5. 162
      n/mediawiki/makearticle/makearticle.php
  6. 1
      n/mediawiki/mediawiki-1.18.1.tar.gz.sha1
  7. 128
      n/mediawiki/mediawiki.SlackBuild
  8. 12
      n/mediawiki/slack-desc
  9. 22
      n/mediawiki/texvc-fix-paths-i486.patch
  10. 22
      n/mediawiki/texvc-fix-paths-x86_64.patch

17
n/mediawiki/UPGRADE

@ -1,17 +0,0 @@
UPGRADE FROM A PREVIOUS MEDIAWIKI INSTALLATION
* For each MediaWiki instance, backup the database and the whole
instance directory.
* Upgrade the package.
* To upgrade an instance installed in /var/www/htdocs/wiki:
# cd /var/www/htdocs
# mv wiki wiki.bak
# create-mwiki wiki
# cp -r wiki.bak/LocalSettings.php wiki.bak/images wiki/
# cd wiki
# chown root:apache LocalSettings.php images
# chmod 775 images
# php maintenance/update.php --conf LocalSettings.php

25
n/mediawiki/create-mwiki.sh

@ -1,25 +0,0 @@
#!/bin/bash
die()
{
echo "${0##*/}: $@" >&2
exit
}
MWIKI_SHARED_DIR=/usr/share/mediawiki
set -e
[ -n "$1" ] || die "target directory not specified"
[ ! -e "$1" ] || die "a file '$1' already exists"
mkdir -p "$1"
cd "$1"
cp $MWIKI_SHARED_DIR/*.php .
mkdir cache images
chgrp apache cache images
chmod 775 cache images
for d in bin extensions includes languages maintenance mw-config resources skins ; do
ln -s $MWIKI_SHARED_DIR/$d $d
done

7
n/mediawiki/extensions

@ -1,7 +0,0 @@
Cite 98759
Collection 100383
Configure 92462
Math 103240
OggHandler 100383
ParserFunctions 98766
SyntaxHighlight_GeSHi 90546

57
n/mediawiki/makearticle/Style.css

@ -1,57 +0,0 @@
.mpForm
{
margin: 0;
padding: 0;
width: 400px;
}
.mpForm h2
{
text-align: center;
font-size: 16pt;
font-weight: bold;
}
.mpR
{
color: red;
}
.mpTable
{
border-collapse: collapse;
text-align: left;
width: 100%;
}
.mpForm textarea
{
margin-left: 2px;
margin-right: 2px;
vertical-align: middle;
width: 99%;
height: 10em;
}
.mpForm textarea.mpSingle
{
height: 1.5em;
}
.mpHeader
{
width: 10em;
}
.mpForm td
{
background-color: #f2f2f2;
border: 1px black solid;
}
.mpButton
{
background-color: #ffe0e0;
position: absolute;
right: 10px;
}

162
n/mediawiki/makearticle/makearticle.php

@ -1,162 +0,0 @@
<?php
/**
* A parser hook to generate a form from a Template: so the user can populate the parameters of the
* template and then hit a button to create a page with the name they have chosen consisting of
* the template filled out with those parameters.
*
* @addtogroup Extensions
*
* Draws on the following extensions:
*
* - createarticle by Lisa Ridley
* - PageCSS by Ævar Arnfjörð Bjarmason
*
* @author Julian Porter <julian.porter@porternet.org>
* @copyright Copyright © 2010, Julian Porter
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
*/
$wgHooks['ParserFirstCallInit'][]='wfMakeArticleInit';
$wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
'name' => 'MakeArticle (version 0.1 beta)',
'author' => 'Julian Porter',
'url' => 'http://www.mediawiki.org/User:julianporter',
'description' => 'Makes an article based on a specified Template: with the <tt>&lt;makearticle&gt;</tt> tag'
);
$wgHooks['UnknownAction'][] = 'wfActionMakeArticle';
$wgMakeArticleCSS="$IP/extensions/makearticle/Style.css";
function wfMakeArticleInit(&$parser)
{
$parser->setHook('makearticle','wfMakeArticle');
return true;
}
function wfMakeArticle($input)
{
$pageMaker=new MakeArticle($input);
return $pageMaker->render();
}
class MakeArticle
{
private $template,$css,$templateText,$parameters;
function __construct($input)
{
global $wgMakeArticleCSS;
$this->parameters=array();
$this->template=trim($input);
$this->css=file_get_contents($wgMakeArticleCSS);
if($this->css==false) MakeArticle::errorHandler("File Missing","Cannot find $wgMakeArticleCSS");
}
public function render()
{
$this->makeStyleSheet();
$this->getTemplate();
$this->getParameters();
return $this->makeForm($template,$parameters);
}
private function makeStyleSheet()
{
global $wgParser;
$css = htmlspecialchars( trim( Sanitizer::checkCss( $this->css ) ) );
$data= '<style type="text/css"> <![CDATA[*/'.$css.'/*]]>*/ </style>';
$wgParser->mOutput->addHeadItem($data);
}
private function getTemplate()
{
$title=Title::newFromText($this->template);
$id=0;
if(isset($title)) $id=$title->getArticleID();
if(!$id) MakeArticle::errorHandler("Template Missing","Cannot find template $template");
$article=Article::newFromID($id);
$this->templateText=$article->fetchContent();
}
private function getParameters()
{
preg_match_all("#\{{3}\s*(.*?)\s*\}{3}#",$this->templateText,$matches,PREG_SET_ORDER);
foreach($matches as $value) if(!in_array($value[1],$this->parameters)) $this->parameters[]=$value[1];
}
private function makeForm()
{
global $wgScript;
$action=htmlspecialchars($wgScript);
$html="";
$html.='<div class="mpForm"><h2>Populating template <span class="mpR">'.$this->template.'</span></h2><form name="makepage" action="'.$action.'" method="get">';
$html.='<input type="hidden" name="action" value="___makePage" />';
$html.='<table class="mpTable"><tr><td class="head">Title</td><td><textarea class="mpSingle" name="___title" ncols="40" nrows="2"></textarea></td></tr>';
foreach($this->parameters as $param)
{
$html.='<tr><td class="mpHeader">'.$param.'</td><td><textarea name="cp_'.$param.'" ncols="40" nrows="10"></textarea></td></tr>';
}
$html.='</table><input type="hidden" name="___template" value="'.$this->template.'"><input type="submit" name="createarticle" class="mpButton" value="Create" /></form></div>';
return $html;
}
static function errorHandler($name,$message)
{
global $wgOut, $wTitle;
$wgTitle=Title::newFromText(wfMsgForContent($name));
$wgOut->errorPage($name,$message);
}
}
function wfActionMakeArticle($action,$article)
{
global $wgRequest;
if($action!='___makePage') return true;
$title=trim($wgRequest->getVal('___title'));
if($title=='') MakeArticle::errorHandler('Bad Page Title','Title is Null');
else
{
$pageTitle=Title::newFromText($title);
if(isset($pageTitle)&&$pageTitle->getArticleID()==0)
{
$values=$wgRequest->getValues();
$html='{{'.$wgRequest->getVal('___template');
foreach($values as $key => $value)
{
$prefix=substr($key,0,3);
$keyName=substr($key,3);
if($prefix=='cp_') $html.='|'.$keyName.'='.$value;
}
$html.='}}';
//$preload=wfMakePageContents();
$article=new Article($pageTitle);
$status=$article->doEdit($html,"$title",EDIT_NEW);
if($status->isOK()) $article->doRedirect();
else MakeArticle::errorHandler('Error Creating Page',$status->getWikiText());
}
else MakeArticle::errorHandler('Bad Page Title',"Page $title already exists");
}
return false;
}
?>

1
n/mediawiki/mediawiki-1.18.1.tar.gz.sha1

@ -1 +0,0 @@
1c433523a5ae2835e97462053e08ad7c01e178d2 mediawiki-1.18.1.tar.gz

128
n/mediawiki/mediawiki.SlackBuild

@ -1,128 +0,0 @@
#!/bin/bash
# Build script for Slackware
# Copyright (C) 2011,2012 Damien Goutte-Gattat
#
# Redistribution and use of this script, with or without modifications,
# is permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Contact: Damien Goutte-Gattat <dgouttegattat@incenp.org>
#
# Latest mediawiki sourcecode is available at:
# <http://www.mediawiki.org/>.
#
# Depends: d/ocaml
# Source package infos
NAMESRC=${NAMESRC:-mediawiki}
VERSION=${VERSION:-1.18.1}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.gz}
WGET=${WGET:-http://download.wikimedia.org/mediawiki/${VERSION%.*}/$ARCHIVE}
SVN=${SVN:-http://svn.wikimedia.org/svnroot}
# Build infos
NAMEPKG=${NAMEPKG:-mediawiki}
BUILD=${BUILD:-1GGD}
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
EXT=${EXT:-txz}
# Directories
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
PKG=${PKG:-$OUT/$NAMEPKG}
CWD=$(pwd)
set -e # Quit if a command returns non-zero
# Sanity checks
if [ $UID -eq 0 ]; then
echo "You should NOT run this script as ROOT!"
exit 1
fi
if [ ! -d $TMP ]; then
echo "$TMP does not exists or is not a directory!"
exit 1
fi
# Get and verify the source archive
if [ ! -r $ARCHIVE ]; then
wget -c -O $ARCHIVE.part "$WGET"
mv $ARCHIVE.part $ARCHIVE
fi
sha1sum -c $ARCHIVE.sha1
NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1)
# Download extensions
cat $CWD/extensions | while read extension revision ; do
if [ ! -r $extension-$revision.tar.gz ]; then
svn export -r $revision $SVN/mediawiki/trunk/extensions/$extension $extension
tar czf $extension-$revision.tar.gz $extension
rm -rf $extension
fi
done
# Install shared files
mkdir -p $PKG/usr/share
cd $PKG/usr/share
tar xf $CWD/$ARCHIVE
mv $NAME mediawiki
cd mediawiki
# Install extensions
cat $CWD/extensions | while read extension revision ; do
tar xf $CWD/$extension-$revision.tar.gz -C extensions
done
# Build and install texcv from the Math extension
(
cd extensions/Math/math
patch < $CWD/texvc-fix-paths-$ARCH.patch
make
install -s -D -m 755 texvc $PKG/usr/bin/texvc
)
# Install unversioned extension makearticle
cp -r $CWD/makearticle extensions/makearticle
# Install documentation
mkdir -p $PKG/usr/doc/$NAME
mv COPYING CREDITS FAQ HISTORY INSTALL README RELEASE-NOTES-1.18 UPGRADE docs \
$PKG/usr/doc/$NAME/
# Remove useless files and directories
rm -rf *.php5 cache images math
# Install helper script
install -m 755 $CWD/create-mwiki.sh $PKG/usr/bin/create-mwiki
# Copy slack-desc file
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
# Package the tree
cd $PKG
mkdir -p $OUT
PACKAGING="
chown root:root . -R
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT
rm -rf $PKG
rm -rf $TMP/$NAME
"
if type -p fakeroot ; then
echo "$PACKAGING" | fakeroot
else
su -c "$PACKAGING"
fi

12
n/mediawiki/slack-desc

@ -1,12 +0,0 @@
|-----handy-ruler----------------------------------------------------|
mediawiki: mediawiki (Wiki engine for PHP)
mediawiki:
mediawiki: MediaWiki is the software used for Wikipedia and the other
mediawiki: Wikimedia foundation websites. Compared to other wikis, it has an
mediawiki: excellent range of features and support for high-traffic websites
mediawiki: using multiple servers.
mediawiki:
mediawiki:
mediawiki:
mediawiki:
mediawiki:

22
n/mediawiki/texvc-fix-paths-i486.patch

@ -1,22 +0,0 @@
--- render.ml.orig 2012-01-17 13:02:13.600433449 +0100
+++ render.ml 2012-01-17 13:04:18.447041745 +0100
@@ -1,15 +1,15 @@
(* vim: set sw=8 ts=8 et: *)
-let cmd_dvips tmpprefix = "dvips -q -R -E " ^ tmpprefix ^ ".dvi -f >" ^ tmpprefix ^ ".ps"
-let cmd_latex tmpprefix = "latex " ^ tmpprefix ^ ".tex >/dev/null"
+let cmd_dvips tmpprefix = "/opt/texlive/2011/bin/i486/dvips -q -R -E " ^ tmpprefix ^ ".dvi -f >" ^ tmpprefix ^ ".ps"
+let cmd_latex tmpprefix = "/opt/texlive/2011/bin/i486/latex " ^ tmpprefix ^ ".tex >/dev/null"
(* Putting -transparent white in converts arguments will sort-of give you transperancy *)
-let cmd_convert tmpprefix finalpath = "convert -quality 100 -density 120 " ^ tmpprefix ^ ".ps " ^ finalpath ^ " >/dev/null 2>/dev/null"
+let cmd_convert tmpprefix finalpath = "/usr/bin/convert -quality 100 -density 120 " ^ tmpprefix ^ ".ps " ^ finalpath ^ " >/dev/null 2>/dev/null"
(* Putting -bg Transparent in dvipng's arguments will give full-alpha transparency *)
(* Note that IE have problems with such PNGs and need an additional javascript snippet *)
(* Putting -bg transparent in dvipng's arguments will give binary transparency *)
-let cmd_dvipng tmpprefix finalpath backcolor = "dvipng -bg \'" ^ backcolor ^ "\' -gamma 1.5 -D 120 -T tight --strict " ^ tmpprefix ^ ".dvi -o " ^ finalpath ^ " >/dev/null 2>/dev/null"
+let cmd_dvipng tmpprefix finalpath backcolor = "/opt/texlive/2011/bin/i486/dvipng -bg \'" ^ backcolor ^ "\' -gamma 1.5 -D 120 -T tight --strict " ^ tmpprefix ^ ".dvi -o " ^ finalpath ^ " >/dev/null 2>/dev/null"
exception ExternalCommandFailure of string

22
n/mediawiki/texvc-fix-paths-x86_64.patch

@ -1,22 +0,0 @@
--- render.ml.orig 2012-01-17 13:02:13.600433449 +0100
+++ render.ml 2012-01-17 13:03:21.513676322 +0100
@@ -1,15 +1,15 @@
(* vim: set sw=8 ts=8 et: *)
-let cmd_dvips tmpprefix = "dvips -q -R -E " ^ tmpprefix ^ ".dvi -f >" ^ tmpprefix ^ ".ps"
-let cmd_latex tmpprefix = "latex " ^ tmpprefix ^ ".tex >/dev/null"
+let cmd_dvips tmpprefix = "/opt/texlive/2011/bin/x86_64-linux/dvips -q -R -E " ^ tmpprefix ^ ".dvi -f >" ^ tmpprefix ^ ".ps"
+let cmd_latex tmpprefix = "/opt/texlive/2011/bin/x86_64-linux/latex " ^ tmpprefix ^ ".tex >/dev/null"
(* Putting -transparent white in converts arguments will sort-of give you transperancy *)
-let cmd_convert tmpprefix finalpath = "convert -quality 100 -density 120 " ^ tmpprefix ^ ".ps " ^ finalpath ^ " >/dev/null 2>/dev/null"
+let cmd_convert tmpprefix finalpath = "/usr/bin/convert -quality 100 -density 120 " ^ tmpprefix ^ ".ps " ^ finalpath ^ " >/dev/null 2>/dev/null"
(* Putting -bg Transparent in dvipng's arguments will give full-alpha transparency *)
(* Note that IE have problems with such PNGs and need an additional javascript snippet *)
(* Putting -bg transparent in dvipng's arguments will give binary transparency *)
-let cmd_dvipng tmpprefix finalpath backcolor = "dvipng -bg \'" ^ backcolor ^ "\' -gamma 1.5 -D 120 -T tight --strict " ^ tmpprefix ^ ".dvi -o " ^ finalpath ^ " >/dev/null 2>/dev/null"
+let cmd_dvipng tmpprefix finalpath backcolor = "/opt/texlive/2011/bin/x86_64-linux/dvipng -bg \'" ^ backcolor ^ "\' -gamma 1.5 -D 120 -T tight --strict " ^ tmpprefix ^ ".dvi -o " ^ finalpath ^ " >/dev/null 2>/dev/null"
exception ExternalCommandFailure of string
Loading…
Cancel
Save