wok-tiny view rsync/receipt @ rev 80

Add rsync
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jul 19 23:03:09 2012 +0200 (2012-07-19)
parents
children 998910ee725e
line source
1 # SliTaz package receipt.
3 PACKAGE="rsync"
4 VERSION="3.0.9"
5 CATEGORY="network"
6 SHORT_DESC="Utility that provides fast incremental."
7 MAINTAINER="pankso@slitaz.org"
8 [ -n "$TARGET" ] || TARGET="i486"
9 BUILD_DEPENDS="uclibc-cross-compiler-$TARGET"
10 DEPENDS=""
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WEB_SITE="http://rsync.samba.org/"
13 WGET_URL="${WEB_SITE}ftp/$PACKAGE/$TARBALL"
14 CONFIG_FILES="/etc/rsyncd.conf /etc/rsyncd.secrets"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 cd $src
20 sed -i 's/cross_compiling=no/cross_compiling=yes/' configure.sh
21 ./configure CC=uclibc-$TARGET-cc --host=i486-pc-linux-gnu \
22 --prefix=/usr \
23 --mandir=/usr/share/man \
24 --disable-iconv --disable-iconv-open \
25 --disable-acl-support --disable-xattr-support \
26 --with-included-popt --disable-debug \
27 $CONFIGURE_ARGS
28 sed -i -e 's/HAVE_ICONV_H ./HAVE_ICONV_H 0/' \
29 -e 's/HAVE_ICONV_OPEN ./HAVE_ICONV_OPEN 0/' config.h
30 sed -i 's/-liconv//' Makefile
31 make &&
32 make DESTDIR=$PWD/_pkg install
33 }
35 # Rules to gen a SliTaz package suitable for Tazpkg.
36 genpkg_rules()
37 {
38 mkdir -p $fs/usr
39 cp -a $_pkg/usr/bin $fs/usr
40 # Config file is /etc/rsyncd.conf.
41 # User and passwd in /etc/rsyncd.secrets, syntax : user:passwd
42 #
43 cp -a stuff/etc $fs
44 chown root.root $fs/etc/init.d/*
45 chmod 0644 $fs/etc/rsyncd.conf
47 }
49 config_form()
50 {
51 cat <<EOT
52 <p>
53 <input type="checkbox" name="START" > start rsync daemon during boot
54 </p>
55 <fieldset>
56 <legend><i>/etc/rsyncd.conf</i></legend>
57 <textarea name="RSYNCD_CONF" rows="15" cols="60" wrap="off">
58 $(cat $1/etc/rsyncd.conf)
59 </textarea>
60 </fieldset>
61 <fieldset>
62 <legend><i>/etc/rsyncd.secrets</i></legend>
63 <textarea name="RSYNCD_SECRETS" cols="60" wrap="off">
64 $(cat $1/etc/rsyncd.secrets)
65 </textarea>
66 </fieldset>
67 <fieldset>
68 <legend><i>/etc/rsyncd.motd</i></legend>
69 <textarea name="RSYNCD_MOTD" rows="10" cols="60" wrap="off">
70 </textarea>
71 </fieldset>
72 EOT
73 }
75 config_note()
76 {
77 cat <<EOT
78 <script type="text/javascript">
79 function update_form()
80 {
81 var hide = true
82 for (var i = 0; i < document.forms.length; i++) {
83 for (var j = 0; j < document.forms[i].elements.length; j++) {
84 var obj = document.forms[i].elements[j]
85 if (obj.name == "START" && obj.checked == true)
86 hide = false
87 }
88 }
89 for (var i = 0; i < document.forms.length; i++) {
90 for (var j = 0; j < document.forms[i].elements.length; j++) {
91 var obj = document.forms[i].elements[j]
92 switch (obj.name) {
93 case "RSYNCD_CONF" :
94 case "RSYNCD_SECRETS" :
95 case "RSYNCD_MOTD" :
96 obj.disabled = hide; break;
97 }
98 }
99 }
100 }
101 update_form()
102 window.onchange = update_form
103 //-->
104 </script>
105 EOT
106 }
108 post_install()
109 {
110 if [ -n "$START" ]; then
111 cat > $1/etc/rsyncd.conf <<EOT
112 $RSYNCD_CONF
113 EOT
114 cat > $1/etc/rsyncd.secrets <<EOT
115 $RSYNCD_SECRETS
116 EOT
117 cat > $1/etc/rsyncd.motd <<EOT
118 $RSYNCD_MOTD
119 EOT
120 else
121 rm -f $1/etc/rsyncd.conf $1/etc/rsyncd.secrets \
122 $1/etc/init.d/rsyncd
123 fi
124 }