2
0
mirror of https://github.com/deajan/osync synced 2024-11-17 09:25:42 +00:00
osync/packaging/RHEL/osync.spec

79 lines
2.5 KiB
RPMSpec
Raw Normal View History

2016-12-18 12:12:47 +00:00
%define name osync
2017-04-26 13:40:19 +00:00
%define version 1.2
2017-02-15 16:08:53 +00:00
%define gitsource https://github.com/deajan/%{name}/archive/v%{version}.zip
2016-12-18 12:12:47 +00:00
%define use_systemd 1
%{?el5:%define use_systemd 0}
%{?el6:%define use_systemd 0}
Name: %{name}
2017-02-15 16:08:53 +00:00
Version: %{version}
2016-12-18 12:12:47 +00:00
Release: 1%{?dist}
Summary: robust file synchronization tool
Group: Applications/File
License: BSD
URL: https://www.netpower.fr/osync
2016-12-18 12:12:47 +00:00
Source0: %{gitsource}
2016-12-18 12:12:47 +00:00
BuildRequires: wget
2017-02-15 16:08:53 +00:00
Requires: rsync openssh-server bash wget inotify-tools
BuildArch: noarch
%description
2016-12-18 12:12:47 +00:00
A robust two way (bidirectional) file sync script based on rsync with fault tolerance, time control and ACL synchronization.
2016-12-18 12:12:47 +00:00
#%prep
#%setup -q
#%build
#%configure
%install
2017-02-15 16:08:53 +00:00
wget --no-check-certificate --timeout=5 -O %{_sourcedir}/%{name}-%{version}.zip %{gitsource}
2017-03-14 21:09:53 +00:00
( cd %{_sourcedir} && unzip -o %{_sourcedir}/%{name}-%{version}.zip )
rm -rf ${RPM_BUILD_ROOT}
2016-12-18 12:12:47 +00:00
mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
mkdir -p ${RPM_BUILD_ROOT}%{_unitdir}
2017-02-15 16:08:53 +00:00
install -m 755 %{_sourcedir}/%{name}-%{version}/osync.sh ${RPM_BUILD_ROOT}%{_bindir}
install -m 755 %{_sourcedir}/%{name}-%{version}/osync-batch.sh ${RPM_BUILD_ROOT}%{_bindir}
2016-12-18 12:12:47 +00:00
install -m 0755 -d ${RPM_BUILD_ROOT}/etc/osync
2017-02-15 16:08:53 +00:00
install -m 0644 %{_sourcedir}/%{name}-%{version}/sync.conf.example ${RPM_BUILD_ROOT}/etc/osync
2016-12-18 12:12:47 +00:00
%if %use_systemd
2017-03-14 21:09:53 +00:00
sed -i 's#/usr/local/bin#%{_bindir}#' %{_sourcedir}/%{name}-%{version}/osync-srv@.service
2017-02-15 16:08:53 +00:00
install -m 0755 %{_sourcedir}/%{name}-%{version}/osync-srv@.service ${RPM_BUILD_ROOT}%{_unitdir}
2016-12-18 12:12:47 +00:00
%else
2017-03-14 21:09:53 +00:00
sed -i 's#/usr/local/bin#%{_bindir}#' %{_sourcedir}/%{name}-%{version}/osync-srv
2017-02-15 16:08:53 +00:00
install -m 0755 %{_sourcedir}/%{name}-%{version}/osync-srv ${RPM_BUILD_ROOT}/etc/init.d
2016-12-18 12:12:47 +00:00
%endif
%files
%defattr(-,root,root)
%attr(755,root,root) %{_bindir}/osync.sh
2016-12-18 12:12:47 +00:00
%attr(755,root,root) %{_bindir}/osync-batch.sh
%attr(644,root,root) /etc/osync/sync.conf.example
%if %use_systemd
%attr(755,root,root) %{_unitdir}/osync-srv@.service
%else
%attr(755,root,root) /etc/init.d/osync-srv
%endif
2016-12-18 12:12:47 +00:00
%doc
%changelog
2017-03-14 21:09:53 +00:00
* Tue Mar 14 2017 Orsiris de Jong <ozy@netpower.fr>
- On the fly update binary path from /usr/local/bin to %{_bindir} in source service files for RPM usage
- Allow unzip to overwrite existing source files
2017-02-15 16:08:53 +00:00
* Wed Feb 15 2017 Richard Grainger <grainger@gmail.com>
- Update version
- Download source archive based on version
- Add inotify-tools as dependency
2016-12-18 12:12:47 +00:00
* Sun Dec 18 2016 Orsiris de Jong <ozy@netpower.fr>
- Add systemd / initV differentiation
- Make source autodownload work
- Disable all macros except install
* Tue Aug 30 2016 Orsiris de Jong <ozy@netpower.fr>
- Initial spec file