diff --git a/.abf.yml b/.abf.yml new file mode 100644 index 0000000..5c423eb --- /dev/null +++ b/.abf.yml @@ -0,0 +1,2 @@ +sources: + syncthing-source-v1.3.0.tar.gz: 3034b64191fc6fca6ad407551ca5ce6c1a50d579 diff --git a/syncthing b/syncthing deleted file mode 100755 index c2762d5..0000000 --- a/syncthing +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -# -# /etc/rc.d/init.d/syncthing -## -# chkconfig: 345 89 14 -# description: Starts and stops the syncthing server daemon -# processname: syncthing -# config: /etc/syncthing.conf -# pidfile: /var/run/syncthing/syncthing.pid -# - -# Source function library. -. /etc/init.d/functions - -PROG_NAME=syncthing -PID_FILE=${PID_FILE-/var/run/syncthing/syncthing.pid} -FS_USER=${FS_USER-root} -FS_FILE=${FS_FILE-/usr/bin/syncthing} -FS_HOME=${FS_HOME-/var/run/syncthing} -LOCK_FILE=/var/lock/subsys/syncthing -RETVAL=0 - -# Source usr/localions file -if [ -f /etc/sysconfig/syncthing ]; then - . /etc/sysconfig/syncthing -fi - -syncthing_ARGS="-gui-address='$GUI_ADDRESS'" - -# - -start() { - echo -n "Starting $PROG_NAME: " - if [ -e $LOCK_FILE ]; then - if [ -e $PID_FILE ] && [ -e /proc/`cat $PID_FILE` ]; then - echo - echo -n $"$PROG_NAME is already running."; - failure $"$PROG_NAME is already running."; - echo - return 1 - fi - fi - cd $FS_HOME - daemon --user $FS_USER --pidfile $PID_FILE "$FS_FILE $syncthing_ARGS $syncthing_PARAMS >/dev/null 2>&1" & - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch $LOCK_FILE; - echo - return $RETVAL -} - -stop() { - echo -n "Shutting down $PROG_NAME: " - if [ ! -e $LOCK_FILE ]; then - echo - echo -n $"cannot stop $PROG_NAME: $PROG_NAME is not running." - failure $"cannot stop $PROG_NAME: $PROG_NAME is not running." - echo - return 1; - fi - cd $FS_HOME - $FS_FILE -stop > /dev/null 2>&1 - killproc $PROG_NAME - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE; - return $RETVAL -} - -rhstatus() { - status $PROG_NAME; -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status $PROG_NAME - RETVAL=$? - ;; - restart) - stop - start - ;; - reload) -# - ;; - condrestart) - [ -f $PID_FILE ] && restart || : - ;; - *) - echo "Usage: $PROG_NAME {start|stop|status|reload|restart}" - exit 1 - ;; -esac -exit $RETVAL diff --git a/syncthing.spec b/syncthing.spec index 24105f6..c0fc791 100644 --- a/syncthing.spec +++ b/syncthing.spec @@ -11,17 +11,15 @@ %endif Name: syncthing -Version: 1.1.3 +Version: 1.3.0 Release: 1 Summary: Syncthing License: MIT URL: http://syncthing.net/ -#Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-source-v%{version}.tar.gz +Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-source-v%{version}.tar.gz Source1: syncthing@.service Source10: %{name} -#Source2: %{name}-linux-386-v%{version}.tar.gz Group: Networking/Other -#ExclusiveArch: x86_64 %{ix86} BuildRequires: systemd BuildRequires: procps BuildRequires: go >= 1.7 @@ -41,36 +39,20 @@ transmitted over the Internet. Using syncthing, that control is returned to you. %prep -#setup -q -n %{name} +%setup -q -n %{name} %build -rm -rf $RPM_BUILD_DIR/%{name} - -install -d $RPM_BUILD_DIR/%{name}/src/github.com/%{name} - -pushd $RPM_BUILD_DIR/%{name}/src/github.com/%{name}/ -git clone --single-branch -b "v%{version}" https://github.com/syncthing/syncthing.git -pushd %{name} -#go run build.go -goos linux -goarch %{altarch} -version v%{version} -no-upgrade ./build.sh -popd -popd +upx bin/%{name} %install rm -rf %{buildroot} -install -d %{buildroot}%{_bindir} -install -d %{buildroot}%{_unitdir} -install -d %{buildroot}%{_sbindir} -install -d %{buildroot}%{_initddir} -install -d %{buildroot}%{_datadir}/doc/%{name} +install -d %{buildroot}{%{_bindir},%{_unitdir},%{_sbindir},%{_mandir}/man1/%{name}} -pushd $RPM_BUILD_DIR/%{name}/src/github.com/%{name}/%{name}/ install -pm 0755 bin/syncthing %{buildroot}%{_bindir} install -pm 0644 etc/linux-systemd/system/%{name}@.service %{buildroot}%{_unitdir} -install -sm 755 bin/syncthing %{buildroot}%{_sbindir} -install -pm 0644 LICENSE README.md %{buildroot}%{_datadir}/doc/%{name} -popd +install -Dm0644 man/* %{buildroot}%{_mandir}/man1/%{name} %post %systemd_post %{name}@.service @@ -82,9 +64,9 @@ popd %systemd_postun_with_restart %{name}@.service %files +%doc LICENSE README.md %{_bindir}/%{name} -%{_sbindir}/%{name} -%{_datadir}/doc/%{name}/* %{_unitdir}/%{name}@.service +%{_mandir}/man1/%{name} %changelog diff --git a/syncthing@.service b/syncthing@.service deleted file mode 100644 index d0405fe..0000000 --- a/syncthing@.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Syncthing - -[Service] -Type=simple -User=%I -Environment=STNORESTART=yes -ExecStart=/usr/bin/syncthing -Restart=on-failure - -[Install] -WantedBy=multi-user.target