diff options
Diffstat (limited to 'www/resin2/files/install.sh')
-rw-r--r-- | www/resin2/files/install.sh | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/www/resin2/files/install.sh b/www/resin2/files/install.sh new file mode 100644 index 000000000000..36e53c1e9bac --- /dev/null +++ b/www/resin2/files/install.sh @@ -0,0 +1,48 @@ +#! /bin/sh + +set -e + +warning() { + echo "Kept %%PREFIX%%/etc/%%APP_NAME%%.xml intact from previous installation, please diff" + echo "against %%APP_NAME%%.xml-dist" +} + +# Install config file only if none is already there +if test -e %%PREFIX%%/etc/%%APP_NAME%%.xml && \ + ! cmp -s %%WRKDIR%%/resin.conf %%PREFIX%%/etc/%%APP_NAME%%.xml ; then + echo + echo "********************************************************************************" + warning | fmt -w 80 + echo "********************************************************************************" + echo +else + install %%WRKDIR%%/resin.conf %%PREFIX%%/etc/%%APP_NAME%%.xml + echo Installed %%PREFIX%%/etc/%%APP_NAME%%.xml +fi + +# Install new config file with '-dist' appended +install %%WRKDIR%%/resin.conf %%PREFIX%%/etc/%%APP_NAME%%.xml-dist +echo Installed %%PREFIX%%/etc/%%APP_NAME%%.xml-dist + +install %%WRKDIR%%/resin.sh.in %%PREFIX%%/etc/rc.d/%%APP_NAME%%.sh +chmod 755 %%PREFIX%%/etc/rc.d/%%APP_NAME%%.sh +echo Installed %%PREFIX%%/etc/rc.d/%%APP_NAME%%.sh + +install %%WRKSRC%%/bin/wrapper.pl %%PREFIX%%/sbin/%%APP_NAME%%ctl +echo Installed %%PREFIX%%/sbin/%%APP_NAME%%ctl + +test -d %%APP_HOME%% || mkdir %%APP_HOME%% +echo Created installation directory %%APP_HOME%% + +list() +{ + for dir in doc lib xsl ; do + ( cd %%WRKSRC%% ; find $dir ) + done +} + +# Remove all empty dirs +( cd %%WRKSRC%% ; find doc -type d -empty -delete ) + +echo Installing in %%APP_HOME%% +list | xargs tar -C %%WRKSRC%% -cf- | tar -C %%APP_HOME%% -xpf- |