Browse Source

lsyncd: update to 2.0.4

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@3888 ec354946-7b23-47d6-9f5a-488ba84defc7
daisuke 14 years ago
parent
commit
8f674760af
2 changed files with 40 additions and 17 deletions
  1. 23 7
      l/lsyncd/lsyncd-vl.spec
  2. 17 10
      l/lsyncd/lsyncd.init

+ 23 - 7
l/lsyncd/lsyncd-vl.spec

@@ -1,7 +1,7 @@
 Summary: Live syncing (mirroring) daemon
 Summary(ja): リアルタイム同期(ミラーリング)デーモン
 Name: lsyncd
-Version: 1.39
+Version: 2.0.4
 Release: 1%{?_dist_release}
 
 License: GPL
@@ -12,7 +12,7 @@ Source: lsyncd-%{version}.tar.gz
 Source1: lsyncd.init
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildRequires: libxml2-devel
+BuildRequires: lua-devel
 Requires: rsync
 Requires(post): chkconfig
 Requires(preun): chkconfig
@@ -23,12 +23,19 @@ Distribution: Vine Linux
 Packager: daisuke
 
 %description
+Lsyncd provides a light-weight live mirror solution.
 Lsyncd uses rsync to synchronize local directories with a remote machine running rsyncd. 
 Lsyncd watches multiple directories trees through inotify. The first step after adding
 the watches is to rsync all directories with the remote host, and then sync single file 
-by collecting the inotify events. So lsyncd is a light-weight live mirror solution that
-should be easy to install and use while blending well with your system. See lsyncd --help 
-for detailed command line options.
+by collecting the inotify events.  
+
+
+%description
+Lsyncd は軽量なリアルタイムミラーを構築することができます。
+Lsyncd は rsync を用いて rsyncd が動いているリモートのマシンとローカル
+のディレクトリを同期させることができます。Lsyncd は複数のディレクトリツ
+リーを inotify を通じて監視し、inotefy イベントを収集することでここの
+ファイルを同期します。
 
 %prep
 %setup
@@ -44,6 +51,12 @@ for detailed command line options.
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
 %{__install} -m755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/lsyncd
 
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/lsyncd
+
+# remove examples
+%{__rm} -rf %{buildroot}%{_datadir}/doc/lsyncd
+
+
 %clean
 %{__rm} -rf %{buildroot}
 
@@ -63,13 +76,16 @@ fi
 
 %files
 %defattr(-, root, root, 0755)
-%doc AUTHORS COPYING ChangeLog NEWS TODO lsyncd.conf.xml
+%doc COPYING ChangeLog examples/
 %{_sysconfdir}/rc.d/init.d/lsyncd
+%{_sysconfdir}/lsyncd/
 %{_bindir}/lsyncd
 %{_mandir}/man1/lsyncd.1*
-%{_mandir}/man5/lsyncd.conf.xml.5*
       
 %changelog
+* Mon May 16 2011 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.4-1
+- update to 2.0.4
+
 * Sun Oct 31 2010 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 1.39-1
 - new upstream release
 

+ 17 - 10
l/lsyncd/lsyncd.init

@@ -19,16 +19,23 @@
 #
 DAEMON=/usr/bin/lsyncd
 prog=`basename $DAEMON`
-CONFIG=/etc/lsyncd.conf.xml
-PIDFILE=/var/lock/subsys/lsyncd
+CONFIG=/etc/lsyncd/lsyncd.conf.lua
+DAEMON_ARGS="${CONFIG}"
+PIDFILE=/var/run/${prog}.pid
+LOCKFILE=/var/lock/subsys/${prog}
 
-test -e $DAEMON || exit 0
-test -f $CONFIG || exit 0
+[ -x "$DAEMON" ] || exit 0
+[ -r "$CONFIG" ] || exit 0
 
 if [ -r /etc/init.d/functions ]; then
 	. /etc/init.d/functions
 fi
 
+if [ -r /etc/sysconfig/${prog} ]; then
+	. /etc/sysconfig/${prog}
+fi
+
+
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 export PATH
 
@@ -37,20 +44,20 @@ RETVAL=0
 start() {
 	# Check if it is already running
 	if [ ! -f $PIDFILE ]; then
-		echo -n $"Starting lsyncd daemon: "	
-	    daemon /usr/bin/lsyncd --pidfile $PIDFILE --conf $CONFIG
+		echo -n $"Starting $prog: "	
+	    daemon --pidfile=$PIDFILE $DAEMON $CONFIG
 	    RETVAL=$?
-	    [ $RETVAL -eq 0 ] && touch $PIDFILE
+	    [ $RETVAL -eq 0 ] && touch $LOCKFILE
 	    echo
 	fi
 	return $RETVAL
 }
 
 stop() {
-	echo -n $"Stopping lsyncd daemon: "
-	killproc /usr/bin/lsyncd
+	echo -n $"Stopping $prog: "
+	killproc -p "${PIDFILE}" $DAEMON
 	RETVAL=$?
-	[ $RETVAL -eq 0 ] && rm -f $PIDFILE
+	[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
 	echo
         return $RETVAL
 }