wok-tiny view rsync/receipt @ rev 86
Add lpd-config
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Aug 21 19:04:10 2012 +0200 (2012-08-21) |
parents | 998910ee725e |
children | c952624a764f |
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 [ "$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 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 }