Hey !
so I created 2 spec files to build my rpm, one with syncthing's files and one with syncthing configuration :
Syncthing's files :
Name: syncthing
Version: 0.11.8
Release:%{?dist}
Summary: Syncthing
License: GPL
URL: http://syncthing.net/
Source0: /root/rpmbuild/SOURCES/syncthing-linux-386-v0.11.8.tar.gz
BuildRoot: %{_tmppath}/%{name}-test
BuildRequires: golang
%description
Syncthing replaces Dropbox and BitTorrent Sync with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet.
%prep
%setup -c -n syncthing-%{version}
%build
rm -rf /home/syncthing
userdel syncthing
useradd syncthing
mkdir /home/syncthing/log
mkdir /home/syncthing/bin
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_bindir}
install -p -m 0755 %{name}-linux-386-v%{version}/syncthing %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_unitdir}
install -p -m 0644 %{S:0} %{buildroot}%{_unitdir}
%clean
%files
/usr/bin/syncthing
%defattr(-,root,root)
%doc
%changelog
Syncthing's configuration :
Name: syncthing_server
Version: 0.11.8
Release:%{?dist}
Summary: Syncthing
License: GPL
URL: http://syncthing.net/
Source0: /root/rpmbuild/SOURCES/syncthing_server.tar.gz #Contains config.xml + syncthing's script
BuildRoot: %{_tmppath}/%{name}-test
BuildRequires: syncthing
%description
Syncthing replaces Dropbox and BitTorrent Sync with something open, trustworthy and decentralized. Your data is your data alone and you deserve to choose where it is stored, if it is shared with some third party and how it's transmitted over the Internet.
%prep
%setup -c -n %{name}
%build
%install
cd /root/rpmbuild/BUILD/syncthing_server/syncthing_server
cp syncthing /etc/rc.d/init.d/
cp config.xml /home/syncthing/.config/syncthing/
%post
chown syncthing:syncthing -Rf /home/syncthing
chmod u+x /etc/rc.d/init.d/syncthing
chkconfig syncthing --override
ln -f -s /etc/rc.d/init.d/e-smith-service /etc/rc7.d/S99syncthing
config set syncthing service status enabled
config setprop syncthing access public
config setprop syncthing TCPPort 8080
config setprop syncthing TCPPorts 8080,22000
config setprop syncthing UDPPort 21025
signal-event remoteaccess-update
%files
So, are there some mistakes or some things missing in theses files ?
And is there something missing to create my rpm ?
Thanks !