wok-tiny view rsync/receipt @ rev 176

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