wok-tiny view rsync/receipt @ rev 94

Refresh, remove kernel*, add linux
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Oct 02 21:45:05 2015 +0200 (2015-10-02)
parents a592b36892ba
children 10cf1a5f187d
line source
1 # SliTaz package receipt.
3 PACKAGE="rsync"
4 VERSION="3.1.1"
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 # Rules to configure and make the package.
18 compile_rules()
19 {
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=$DESTDIR install
33 }
35 # Rules to gen a SliTaz package suitable for Tazpkg.
36 genpkg_rules()
37 {
38 mkdir -p $fs/usr
39 cp -a $install/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 [ "$START" == "on" ] && START="ckecked=ckecked " || START=
52 [ -n "$RSYNCD_CONF" ] || RSYNCD_CONF="$(cat $1/etc/rsyncd.conf)"
53 [ -n "$RSYNCD_SECRETS" ] || RSYNCD_SECRETS="$(cat $1/etc/rsyncd.secrets)"
54 cat <<EOT
55 <p>
56 <input type="checkbox" name="START" $START> start rsync daemon during boot
57 </p>
58 <fieldset>
59 <legend><i>/etc/rsyncd.conf</i></legend>
60 <textarea name="RSYNCD_CONF" rows="15" cols="60" wrap="off">
61 $RSYNCD_CONF
62 </textarea>
63 </fieldset>
64 <fieldset>
65 <legend><i>/etc/rsyncd.secrets</i></legend>
66 <textarea name="RSYNCD_SECRETS" cols="60" wrap="off">
67 $RSYNCD_SECRETS
68 </textarea>
69 </fieldset>
70 <fieldset>
71 <legend><i>/etc/rsyncd.motd</i></legend>
72 <textarea name="RSYNCD_MOTD" rows="10" cols="60" wrap="off">
73 $RSYNCD_MOTD
74 </textarea>
75 </fieldset>
76 EOT
77 }
79 config_note()
80 {
81 cat <<EOT
82 <script type="text/javascript">
83 function update_form()
84 {
85 var hide = true
86 for (var i = 0; i < document.forms.length; i++) {
87 for (var j = 0; j < document.forms[i].elements.length; j++) {
88 var obj = document.forms[i].elements[j]
89 if (obj.name == "START" && obj.checked == true)
90 hide = false
91 }
92 }
93 for (var i = 0; i < document.forms.length; i++) {
94 for (var j = 0; j < document.forms[i].elements.length; j++) {
95 var obj = document.forms[i].elements[j]
96 switch (obj.name) {
97 case "RSYNCD_CONF" :
98 case "RSYNCD_SECRETS" :
99 case "RSYNCD_MOTD" :
100 obj.disabled = hide; break;
101 }
102 }
103 }
104 }
105 update_form()
106 window.onchange = update_form
107 //-->
108 </script>
109 EOT
110 }
112 post_install()
113 {
114 if [ -n "$START" ]; then
115 cat > $1/etc/rsyncd.conf <<EOT
116 $RSYNCD_CONF
117 EOT
118 cat > $1/etc/rsyncd.secrets <<EOT
119 $RSYNCD_SECRETS
120 EOT
121 cat > $1/etc/rsyncd.motd <<EOT
122 $RSYNCD_MOTD
123 EOT
124 grep -q inetd $1/etc/rcS.conf ||
125 sed -i 's/^RUN_DAEMONS="/&inetd /' $1/etc/rcS.conf
126 grep -q rsync $1/etc/inetd.conf || cat >> $1/etc/inetd.conf <<EOT
127 rsync stream tcp nowait root /usr/bin/rsync /usr/bin/rsync --daemon
128 EOT
129 else
130 rm -f $1/etc/rsyncd.conf $1/etc/rsyncd.secrets \
131 $1/etc/init.d/rsyncd
132 fi
133 }