cookutils rev 422
Add libcook.sh and start sharing code between cook, cooker and cookiso
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat May 19 05:17:29 2012 +0200 (2012-05-19) |
parents | 71450d322f7b |
children | b2edbfaef132 |
files | Makefile cook lib/libcook.sh |
line diff
1.1 --- a/Makefile Sat May 19 04:47:53 2012 +0200 1.2 +++ b/Makefile Sat May 19 05:17:29 2012 +0200 1.3 @@ -6,7 +6,12 @@ 1.4 1.5 all: 1.6 1.7 -install: 1.8 +install: install-cook install-libcook install-cross 1.9 +uninstall: uninstall-cook uninstall-libcook uninstall-cross 1.10 + 1.11 +# Cook 1.12 + 1.13 +install-cook: 1.14 install -m 0755 -d $(DESTDIR)/etc/slitaz 1.15 install -m 0755 -d $(DESTDIR)/etc/init.d 1.16 install -m 0755 -d $(DESTDIR)$(PREFIX)/bin 1.17 @@ -29,13 +34,22 @@ 1.18 install -m 0755 init.d/cooker $(DESTDIR)/etc/init.d 1.19 chmod 0755 $(DESTDIR)/var/www/cgi-bin/cooker/*.cgi 1.20 1.21 -uninstall: 1.22 +uninstall-cook: 1.23 rm -rf \ 1.24 $(DESTDIR)$(PREFIX)/bin/cook \ 1.25 $(DESTDIR)$(PREFIX)/bin/cooker \ 1.26 $(DESTDIR)/etc/slitaz/cook.* \ 1.27 $(DESTDIR)/var/www/cooker 1.28 1.29 +# Libcook 1.30 + 1.31 +install-libcook: 1.32 + install -m 0755 -d $(DESTDIR)$(PREFIX)/lib/slitaz 1.33 + install -m 0755 lib/libcook.sh $(DESTDIR)$(PREFIX)/lib/slitaz 1.34 + 1.35 +uninstall-libcook: 1.36 + rm -f $(DESTDIR)$(PREFIX)/lib/slitaz/libcook.sh 1.37 + 1.38 # Cross 1.39 1.40 install-cross:
2.1 --- a/cook Sat May 19 04:47:53 2012 +0200 2.2 +++ b/cook Sat May 19 05:17:29 2012 +0200 2.3 @@ -6,10 +6,7 @@ 2.4 # Copyright (C) SliTaz GNU/Linux - GNU gpl v3 2.5 # Author: Christophe Lincoln <pankso@slitaz.org> 2.6 # 2.7 -. /lib/libtaz.sh 2.8 - 2.9 -[ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf 2.10 -[ -f "cook.conf" ] && . ./cook.conf 2.11 +. /usr/lib/slitaz/libcook.sh 2.12 2.13 # Share DB and status with the Cooker. 2.14 activity="$CACHE/activity"
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/lib/libcook.sh Sat May 19 05:17:29 2012 +0200 3.3 @@ -0,0 +1,15 @@ 3.4 +#!/bin/sh 3.5 +# 3.6 +# Cook library - Shared configs and functions between cook, the cooker and 3.7 +# cookiso. Read the README before adding or modifing any code in libcook.sh! 3.8 +# 3.9 +# Copyright (C) SliTaz GNU/Linux - GNU gpl v3 3.10 +# Author: Christophe Lincoln <pankso@slitaz.org> 3.11 +# 3.12 +. /lib/libtaz.sh 3.13 +. /usr/lib/slitaz/libpkg.sh 3.14 +. /etc/slitaz/slitaz.conf 3.15 + 3.16 +# System wide config can be overwriten by a cook.conf in current path. 3.17 +[ -f "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf 3.18 +[ -f "cook.conf" ] && . ./cook.conf