wok-tiny rev 80

Add rsync
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jul 19 23:03:09 2012 +0200 (2012-07-19)
parents d55b82d5919c
children dc79b649a4b9
files p910nd/receipt rsync/receipt rsync/stuff/etc/init.d/rsyncd rsync/stuff/etc/rsyncd.conf rsync/stuff/etc/rsyncd.secrets
line diff
     1.1 --- a/p910nd/receipt	Tue Jun 12 11:57:26 2012 +0200
     1.2 +++ b/p910nd/receipt	Thu Jul 19 23:03:09 2012 +0200
     1.3 @@ -26,7 +26,6 @@
     1.4  {
     1.5  	mkdir -p $fs/usr $fs/etc/init.d $fs/dev
     1.6  	cp -a $_pkg/usr/sbin $fs/usr
     1.7 -	mknod -m 660 $fs/dev/lp0 c 6 0
     1.8  	ln -s daemon $fs/etc/init.d/p910nd
     1.9  }
    1.10  
    1.11 @@ -41,6 +40,9 @@
    1.12  	echo "$DEVICES" | dos2unix | awk '{ if ($1 != "") printf \
    1.13  "%d	stream	tcp	nowait	root	%s %s -b -f %s\n", 9100 + n++, \
    1.14  "/usr/sbin/p910nd", "/usr/sbin/p910nd", $1 }' >> $1/etc/inetd.conf
    1.15 +	for dev in $DEVICES; do
    1.16 +		mknod -m 660 $fs$dev c 6 ${dev#*lp}
    1.17 +	done
    1.18  }
    1.19  
    1.20  config_form()
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/rsync/receipt	Thu Jul 19 23:03:09 2012 +0200
     2.3 @@ -0,0 +1,124 @@
     2.4 +# SliTaz package receipt.
     2.5 +
     2.6 +PACKAGE="rsync"
     2.7 +VERSION="3.0.9"
     2.8 +CATEGORY="network"
     2.9 +SHORT_DESC="Utility that provides fast incremental."
    2.10 +MAINTAINER="pankso@slitaz.org"
    2.11 +[ -n "$TARGET" ] || TARGET="i486"
    2.12 +BUILD_DEPENDS="uclibc-cross-compiler-$TARGET"
    2.13 +DEPENDS=""
    2.14 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    2.15 +WEB_SITE="http://rsync.samba.org/"
    2.16 +WGET_URL="${WEB_SITE}ftp/$PACKAGE/$TARBALL"
    2.17 +CONFIG_FILES="/etc/rsyncd.conf /etc/rsyncd.secrets"
    2.18 +
    2.19 +# Rules to configure and make the package.
    2.20 +compile_rules()
    2.21 +{
    2.22 +	cd $src
    2.23 +sed -i 's/cross_compiling=no/cross_compiling=yes/' configure.sh
    2.24 +	./configure CC=uclibc-$TARGET-cc --host=i486-pc-linux-gnu \
    2.25 +		--prefix=/usr \
    2.26 +		--mandir=/usr/share/man \
    2.27 +		--disable-iconv --disable-iconv-open \
    2.28 +		--disable-acl-support --disable-xattr-support \
    2.29 +		--with-included-popt --disable-debug \
    2.30 +		$CONFIGURE_ARGS
    2.31 +	sed -i  -e 's/HAVE_ICONV_H ./HAVE_ICONV_H 0/' \
    2.32 +		-e 's/HAVE_ICONV_OPEN ./HAVE_ICONV_OPEN 0/' config.h
    2.33 +	sed -i 's/-liconv//' Makefile
    2.34 +	make &&
    2.35 +	make DESTDIR=$PWD/_pkg install
    2.36 +}
    2.37 +
    2.38 +# Rules to gen a SliTaz package suitable for Tazpkg.
    2.39 +genpkg_rules()
    2.40 +{
    2.41 +	mkdir -p $fs/usr
    2.42 +	cp -a $_pkg/usr/bin $fs/usr
    2.43 +	# Config file is /etc/rsyncd.conf.
    2.44 +	# User and passwd in /etc/rsyncd.secrets, syntax : user:passwd
    2.45 +	#
    2.46 +	cp -a stuff/etc $fs
    2.47 +	chown root.root $fs/etc/init.d/*
    2.48 +	chmod 0644 $fs/etc/rsyncd.conf
    2.49 +
    2.50 +}
    2.51 +
    2.52 +config_form()
    2.53 +{
    2.54 +	cat <<EOT
    2.55 +<p>
    2.56 +<input type="checkbox" name="START" > start rsync daemon during boot
    2.57 +</p>
    2.58 +<fieldset>
    2.59 +<legend><i>/etc/rsyncd.conf</i></legend>
    2.60 +<textarea name="RSYNCD_CONF" rows="15" cols="60" wrap="off">
    2.61 +$(cat $1/etc/rsyncd.conf)
    2.62 +</textarea>
    2.63 +</fieldset>
    2.64 +<fieldset>
    2.65 +<legend><i>/etc/rsyncd.secrets</i></legend>
    2.66 +<textarea name="RSYNCD_SECRETS" cols="60" wrap="off">
    2.67 +$(cat $1/etc/rsyncd.secrets)
    2.68 +</textarea>
    2.69 +</fieldset>
    2.70 +<fieldset>
    2.71 +<legend><i>/etc/rsyncd.motd</i></legend>
    2.72 +<textarea name="RSYNCD_MOTD" rows="10" cols="60" wrap="off">
    2.73 +</textarea>
    2.74 +</fieldset>
    2.75 +EOT
    2.76 +}
    2.77 +
    2.78 +config_note()
    2.79 +{
    2.80 +	cat <<EOT
    2.81 +<script type="text/javascript">
    2.82 +function update_form()
    2.83 +{
    2.84 +	var hide = true
    2.85 +	for (var i = 0; i < document.forms.length; i++) {
    2.86 +		for (var j = 0; j < document.forms[i].elements.length; j++) {
    2.87 +			var obj = document.forms[i].elements[j]
    2.88 +			if (obj.name == "START" && obj.checked == true)
    2.89 +				hide = false
    2.90 +		}
    2.91 +	}	
    2.92 +	for (var i = 0; i < document.forms.length; i++) {
    2.93 +		for (var j = 0; j < document.forms[i].elements.length; j++) {
    2.94 +			var obj = document.forms[i].elements[j]
    2.95 +			switch (obj.name) {
    2.96 +			case "RSYNCD_CONF" :
    2.97 +			case "RSYNCD_SECRETS" :
    2.98 +			case "RSYNCD_MOTD" :
    2.99 +				obj.disabled = hide; break;
   2.100 +			}
   2.101 +		}
   2.102 +	}	
   2.103 +}
   2.104 +update_form()
   2.105 +window.onchange = update_form
   2.106 +//-->
   2.107 +</script>
   2.108 +EOT
   2.109 +}
   2.110 +
   2.111 +post_install()
   2.112 +{
   2.113 +	if [ -n "$START" ]; then
   2.114 +		cat > $1/etc/rsyncd.conf <<EOT
   2.115 +$RSYNCD_CONF
   2.116 +EOT
   2.117 +		cat > $1/etc/rsyncd.secrets <<EOT
   2.118 +$RSYNCD_SECRETS
   2.119 +EOT
   2.120 +		cat > $1/etc/rsyncd.motd <<EOT
   2.121 +$RSYNCD_MOTD
   2.122 +EOT
   2.123 +	else
   2.124 +		rm -f $1/etc/rsyncd.conf $1/etc/rsyncd.secrets \
   2.125 +			$1/etc/init.d/rsyncd
   2.126 +	fi
   2.127 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/rsync/stuff/etc/init.d/rsyncd	Thu Jul 19 23:03:09 2012 +0200
     3.3 @@ -0,0 +1,57 @@
     3.4 +#!/bin/sh
     3.5 +# /etc/init.d/rsyncd: Start, stop and restart Rsync deamon on SliTaz, at boot
     3.6 +# time or with the command line.
     3.7 +#
     3.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS
     3.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
    3.10 +#
    3.11 +. /etc/init.d/rc.functions
    3.12 +. /etc/daemons.conf
    3.13 +
    3.14 +NAME=Rsyncd
    3.15 +DESC="rsync deamon"
    3.16 +DAEMON=/usr/bin/rsync
    3.17 +OPTIONS=$RSYNCD_OPTIONS
    3.18 +PIDFILE=/var/run/rsyncd.pid
    3.19 +
    3.20 +case "$1" in
    3.21 +  start)
    3.22 +    if active_pidfile $PIDFILE rsync ; then
    3.23 +      echo "$NAME already running."
    3.24 +      exit 1
    3.25 +    fi
    3.26 +    echo -n "Starting $DESC: $NAME... "
    3.27 +    $DAEMON $OPTIONS 
    3.28 +    status
    3.29 +    ;;
    3.30 +  stop)
    3.31 +    if ! active_pidfile $PIDFILE rsync ; then
    3.32 +      echo "$NAME is not running."
    3.33 +      exit 1
    3.34 +    fi
    3.35 +    echo -n "Stopping $DESC: $NAME... "
    3.36 +    kill `cat $PIDFILE`
    3.37 +    rm $PIDFILE
    3.38 +    status
    3.39 +    ;;
    3.40 +  restart)
    3.41 +    if ! active_pidfile $PIDFILE rsync ; then
    3.42 +      echo "$NAME is not running."
    3.43 +      exit 1
    3.44 +    fi
    3.45 +    echo -n "Restarting $DESC: $NAME... "
    3.46 +    kill `cat $PIDFILE`
    3.47 +    rm $PIDFILE
    3.48 +    sleep 2
    3.49 +    $DAEMON $OPTIONS
    3.50 +    status
    3.51 +    ;;
    3.52 +  *)
    3.53 +    echo ""
    3.54 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    3.55 +    echo ""
    3.56 +    exit 1
    3.57 +    ;;
    3.58 +esac
    3.59 +
    3.60 +exit 0
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/rsync/stuff/etc/rsyncd.conf	Thu Jul 19 23:03:09 2012 +0200
     4.3 @@ -0,0 +1,19 @@
     4.4 +# /etc/rsyncd.conf: Rsync deamon configuration file.
     4.5 +#
     4.6 +
     4.7 +max connections = 2
     4.8 +use chroot = yes
     4.9 +#motd file = /etc/rsyncd.motd
    4.10 +pid file = /var/run/rsyncd.pid
    4.11 +
    4.12 +# Deny/allow hosts by IP.
    4.13 +#
    4.14 +#hosts allow = 192.168.1.100/255.255.0.0
    4.15 +#hosts deny = *
    4.16 +
    4.17 +[web-server]
    4.18 +        path = /var/www
    4.19 +        comment = WWW rsync module
    4.20 +        exclude = cgi-bin/
    4.21 +#	secrets file = /etc/rsyncd.secrets
    4.22 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/rsync/stuff/etc/rsyncd.secrets	Thu Jul 19 23:03:09 2012 +0200
     5.3 @@ -0,0 +1,1 @@
     5.4 +hacker:topsecret