diff --git a/Makefile b/Makefile index bb44552..92cf05f 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,32 @@ -# This makefile must be compatible with both gmake and bmake. Keep it like that. - PREFIX?= /iocage/jails/moinmoin/root/var/moinmoin UID?= 165 GID?= 165 NAME:= acaro -IMGDIR:= img -IMG!= ls $(IMGDIR)/*.png +IMGDIR:= $(PREFIX)/static/$(NAME)/img +IMG!= ls img/*.png +CSSDIR:= $(PREFIX)/static/$(NAME)/css +CSS!= ls css/*.css -CSSDIR:= css -CSS!= ls $(CSSDIR)/*.css +.ifdef TEST +IMGDIR:= $(PREFIX)/../env/lib/python2.7/site-packages/MoinMoin/web/static/htdocs/$(NAME)/img +CSSDIR:= $(PREFIX)/../env/lib/python2.7/site-packages/MoinMoin/web/static/htdocs/$(NAME)/css +UID!= id -u +GID!= id -g +.endif .PHONY: install install: install -o $(UID) -g $(GID) -m 644 $(NAME).py $(PREFIX)/data/plugin/theme/ - install -o $(UID) -g $(GID) -m 664 -d $(PREFIX)/static/$(NAME)/$(IMGDIR) - install -o $(UID) -g $(GID) -m 664 $(IMG) $(PREFIX)/static/$(NAME)/$(IMGDIR) - install -o $(UID) -g $(GID) -m 664 -d $(PREFIX)/static/$(NAME)/$(CSSDIR) - install -o $(UID) -g $(GID) -m 664 $(CSS) $(PREFIX)/static/$(NAME)/$(CSSDIR) + install -o $(UID) -g $(GID) -m 755 -d $(IMGDIR) + install -o $(UID) -g $(GID) -m 664 $(IMG) $(IMGDIR) + install -o $(UID) -g $(GID) -m 755 -d $(CSSDIR) + install -o $(UID) -g $(GID) -m 664 $(CSS) $(CSSDIR) .PHONY: deinstall deinstall: - rm -rf $(PREFIX)/static/$(NAME) + rm -rf $(IMGDIR) + rm -rf $(CSSDIR) rm -f $(PREFIX)/data/plugin/theme/$(NAME).py diff --git a/README.md b/README.md index 0dab3e4..f0d43e7 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ Once you're connected to the server via SSH run the following commands as root. ## How to develop and test +If you're running linux make sure you're using BSD Make (bmake). + ### Installing MoinMoin locally All you need is Python 2 (Python 3 is not supported and will likely never be) @@ -31,9 +33,26 @@ Replace `/tmp/moin` with the path you want to install MoinMoin in. cp -pr env/share/moin/config/wikiconfig.py wiki/ moin --config-dir=wiki account create --name=admin --email=admin@localhost --password=admin - sed -i '/FrontPage/s/#//g' wiki/wikiconfig.py - sed -i '/superuser.*YourName/s/#//g' wiki/wikiconfig.py - sed -i '/superuser.*YourName/s/YourName/admin/g' wiki/wikiconfig.py + sed -i "/FrontPage/s/#//g" wiki/wikiconfig.py + sed -i "/superuser.*YourName/s/#//g" wiki/wikiconfig.py + sed -i "/superuser.*YourName/s/YourName/admin/g" wiki/wikiconfig.py + sed -i "/wikiconfig_dir = /s/os\.path\.abspath.*/'\/tmp\/moin\/wiki\/'/g" wiki/wikiconfig.py + +### Installing Acaro in the test environment + +Replace `/tmp/moin` with the path you have installed MoinMoin in. + + git clone --depth 1 https://git.unit.macaomilano.org/unit/moinmoin-acaro.git + cd moinmoin-acaro + +Eventually run the following command as command as root. + + PREFIX=/tmp/moin/wiki TEST=yes bmake install + +To enable the theme in the settings run the followin command. + + cd /tmp/moin + sed -i "/theme_default/s/modernized/acaro/" wiki/wikiconfig.py ### Running MoinMoin @@ -48,20 +67,4 @@ Something like this will show up. Follow the link to be greeted by MoinMoin. 2017-08-26 12:32:14,027 INFO werkzeug:87 * Running on http://localhost:8080/ (Press CTRL+C to quit) -### Installing Acaro in the test environment - -Replace `/tmp/moin` with the path you have installed MoinMoin in. - - git clone --depth 1 https://git.unit.macaomilano.org/unit/moinmoin-acaro.git - cd moinmoin-acaro - -Eventually run the following command as command as root. - - PREFIX=/tmp/moin/wiki UID=$(id -u) GID=$(id -g) make install - -To enable the theme in the settings run the followin command. - - cd /tmp/moin - sed -i "/theme_default/s/^\w+.*/theme_default = 'acaro'/" wiki/wikiconfig.py - You're ready to go!