# HG changeset patch # User Christophe Lincoln # Date 1337397449 -7200 # Node ID 50cd87593dae41e0db1e1d8bb62d0ebd4c1b3b61 # Parent 71450d322f7bb044e68449c75d6240534e062e9f Add libcook.sh and start sharing code between cook, cooker and cookiso diff -r 71450d322f7b -r 50cd87593dae Makefile --- a/Makefile Sat May 19 04:47:53 2012 +0200 +++ b/Makefile Sat May 19 05:17:29 2012 +0200 @@ -6,7 +6,12 @@ all: -install: +install: install-cook install-libcook install-cross +uninstall: uninstall-cook uninstall-libcook uninstall-cross + +# Cook + +install-cook: install -m 0755 -d $(DESTDIR)/etc/slitaz install -m 0755 -d $(DESTDIR)/etc/init.d install -m 0755 -d $(DESTDIR)$(PREFIX)/bin @@ -29,13 +34,22 @@ install -m 0755 init.d/cooker $(DESTDIR)/etc/init.d chmod 0755 $(DESTDIR)/var/www/cgi-bin/cooker/*.cgi -uninstall: +uninstall-cook: rm -rf \ $(DESTDIR)$(PREFIX)/bin/cook \ $(DESTDIR)$(PREFIX)/bin/cooker \ $(DESTDIR)/etc/slitaz/cook.* \ $(DESTDIR)/var/www/cooker +# Libcook + +install-libcook: + install -m 0755 -d $(DESTDIR)$(PREFIX)/lib/slitaz + install -m 0755 lib/libcook.sh $(DESTDIR)$(PREFIX)/lib/slitaz + +uninstall-libcook: + rm -f $(DESTDIR)$(PREFIX)/lib/slitaz/libcook.sh + # Cross install-cross: diff -r 71450d322f7b -r 50cd87593dae cook --- a/cook Sat May 19 04:47:53 2012 +0200 +++ b/cook Sat May 19 05:17:29 2012 +0200 @@ -6,10 +6,7 @@ # Copyright (C) SliTaz GNU/Linux - GNU gpl v3 # Author: Christophe Lincoln # -. /lib/libtaz.sh - -[ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf -[ -f "cook.conf" ] && . ./cook.conf +. /usr/lib/slitaz/libcook.sh # Share DB and status with the Cooker. activity="$CACHE/activity" diff -r 71450d322f7b -r 50cd87593dae lib/libcook.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/libcook.sh Sat May 19 05:17:29 2012 +0200 @@ -0,0 +1,15 @@ +#!/bin/sh +# +# Cook library - Shared configs and functions between cook, the cooker and +# cookiso. Read the README before adding or modifing any code in libcook.sh! +# +# Copyright (C) SliTaz GNU/Linux - GNU gpl v3 +# Author: Christophe Lincoln +# +. /lib/libtaz.sh +. /usr/lib/slitaz/libpkg.sh +. /etc/slitaz/slitaz.conf + +# System wide config can be overwriten by a cook.conf in current path. +[ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf +[ -f "cook.conf" ] && . ./cook.conf