|
@@ -9,9 +9,13 @@ Group: Applications/File
|
|
URL: http://code.google.com/p/lsyncd/
|
|
URL: http://code.google.com/p/lsyncd/
|
|
|
|
|
|
Source: lsyncd-%{version}.tar.gz
|
|
Source: lsyncd-%{version}.tar.gz
|
|
|
|
+Source1: lsyncd.init
|
|
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
|
Requires: rsync
|
|
Requires: rsync
|
|
|
|
+Requires(post): /sbin/chkconfig
|
|
|
|
+Requires(preun): /sbin/chkconfig
|
|
|
|
+Requires(preun): /sbin/service
|
|
|
|
|
|
Vendor: Project Vine
|
|
Vendor: Project Vine
|
|
Distribution: Vine Linux
|
|
Distribution: Vine Linux
|
|
@@ -36,9 +40,26 @@ for detailed command line options.
|
|
%{__rm} -rf %{buildroot}
|
|
%{__rm} -rf %{buildroot}
|
|
%{__make} install DESTDIR=%{buildroot}
|
|
%{__make} install DESTDIR=%{buildroot}
|
|
|
|
|
|
|
|
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
|
|
|
|
+%{__install} -m755 %{SOURCE1} /etc/rc.d/init.d/lsyncd
|
|
|
|
+
|
|
%clean
|
|
%clean
|
|
%{__rm} -rf %{buildroot}
|
|
%{__rm} -rf %{buildroot}
|
|
|
|
|
|
|
|
+%post
|
|
|
|
+/sbin/chkconfig --add lsyncd
|
|
|
|
+
|
|
|
|
+%preun
|
|
|
|
+if [ "$1" = "0" ]; then
|
|
|
|
+ /sbin/service lsyncd stop >/dev/null 2>&1
|
|
|
|
+ /sbin/chkconfig --del lsyncd
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+%postun
|
|
|
|
+if [ "$1" -ge "1" ]; then
|
|
|
|
+ /sbin/service lsyncd condrestart >/dev/null 2>&1
|
|
|
|
+fi
|
|
|
|
+
|
|
%files
|
|
%files
|
|
%defattr(-, root, root, 0755)
|
|
%defattr(-, root, root, 0755)
|
|
%doc AUTHORS COPYING ChangeLog NEWS TODO lsyncd.conf.xml
|
|
%doc AUTHORS COPYING ChangeLog NEWS TODO lsyncd.conf.xml
|