Skip to content

Commit

Permalink
Makefile: add a missing dir. use symlinks
Browse files Browse the repository at this point in the history
moni-install: $MAIN option added
  • Loading branch information
wkpark committed Apr 18, 2009
1 parent d2607fe commit 9e89c2c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ install: moni-install
mkdir -p $(DESTDIR)$(prefix)/share/moniwiki/data
cp data/*.* $(DESTDIR)$(prefix)/share/moniwiki/data
cp -ar wikiseed imgs css $(DESTDIR)$(prefix)/share/moniwiki
cp -ar lib plugin $(DESTDIR)$(prefix)/share/moniwiki
cp -ar lib plugin local $(DESTDIR)$(prefix)/share/moniwiki
cp -ar locale tools $(DESTDIR)$(prefix)/share/moniwiki
cp -ar local config $(DESTDIR)$(prefix)/share/moniwiki
cp -ar theme $(DESTDIR)$(prefix)/share/moniwiki
cp -ar applets $(DESTDIR)$(prefix)/share/moniwiki
cp wiki.php wikilib.php $(DESTDIR)$(prefix)/share/moniwiki
cp wikismiley.php $(DESTDIR)$(prefix)/share/moniwiki
cp config.php.default monisetup.php $(DESTDIR)$(prefix)/share/moniwiki
cp config.php.* monisetup.php $(DESTDIR)$(prefix)/share/moniwiki
cp monisetup.sh secure.sh $(DESTDIR)$(prefix)/share/moniwiki
cp moni-install $(DESTDIR)$(prefix)/share/moniwiki/bin

Expand Down
32 changes: 23 additions & 9 deletions moni-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,32 @@ echo "| MoniWiki installation script |"
echo "+------------------------------------+"
echo

INSTDIR=@@INSTDIR@@
if [ -z $INSTDIR ]; then
INSTDIR=@@INSTDIR@@
fi

if [ -z $MAIN ]; then
MAIN=wiki.php
fi

[ ! -d data ] && cp -a $INSTDIR/data .
[ ! -d imgs ] && cp -a $INSTDIR/imgs .
[ ! -d theme ] && cp -a $INSTDIR/theme .
[ ! -d css ] && cp -a $INSTDIR/css .
[ ! -d local ] && cp -a $INSTDIR/local .
[ ! -d config ] && cp -a $INSTDIR/config .
[ ! -d applets ] && cp -a $INSTDIR/applets .
cp $INSTDIR/{monisetup.*,secure.sh,config.php.default} .
[ ! -d imgs ] && ln -s $INSTDIR/imgs .
[ ! -d images ] && ln -s $INSTDIR/imgs .
[ ! -d theme ] && ln -s $INSTDIR/theme .
[ ! -d css ] && ln -s $INSTDIR/css .
[ ! -d local ] && ln -s $INSTDIR/local .
[ ! -d locale ] && ln -s $INSTDIR/locale .
[ ! -d config ] && ln -s $INSTDIR/config .
[ ! -d applets ] && ln -s $INSTDIR/applets .
[ ! -d plugin ] && ln -s $INSTDIR/plugin .
[ ! -f config.php.default ] && ln -s $INSTDIR/config.php.default .
[ ! -f monisetup.php ] && ln -s $INSTDIR/monisetup.php .
conf=`ls $INSTDIR/config.php.*|grep -v config.php.default`
cp -a $INSTDIR/{monisetup.sh,secure.sh} .
cp -a $conf .

cat <<PHP >index.php
<?php
include("$INSTDIR/wiki.php");
include("$INSTDIR/$MAIN");
?>
PHP
2 changes: 1 addition & 1 deletion monisetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function _getHostConfig() {
}

if (!file_exists('wikilib.php')) {
$checkfile = array('index.php','plugin');
$checkfile = array('plugin','locale');
$dir='';
foreach ($checkfile as $f) {
if (is_link($f)) {
Expand Down

0 comments on commit 9e89c2c

Please sign in to comment.