Bug 193676 - Update net-p2p/btSync to 1.4.75
Summary: Update net-p2p/btSync to 1.4.75
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: i386 Any
: --- Affects Many People
Assignee: Pawel Pekala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-16 03:29 UTC by joshruehlig
Modified: 2014-09-20 19:05 UTC (History)
2 users (show)

See Also:


Attachments
Diff of changes (3.22 KB, patch)
2014-09-16 03:30 UTC, joshruehlig
joshruehlig: maintainer-approval+
Details | Diff
diff of changes, edited 8/16/14 (3.75 KB, patch)
2014-09-16 19:45 UTC, joshruehlig
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description joshruehlig 2014-09-16 03:29:35 UTC
The attached diff
* updates btsync to 1.4.75
* moves the pidfile to /var/run/btsync/btsync.pid
* adds %%PORTNAME%% in places I missed it

I tested it on i386 and amd64
Comment 1 joshruehlig 2014-09-16 03:30:28 UTC
Created attachment 147369 [details]
Diff of changes
Comment 2 joshruehlig 2014-09-16 18:58:14 UTC
I noticed I can also remove another no longer needed option from the init file. I'll create a new diff and sumbit tonight.
Comment 3 joshruehlig 2014-09-16 19:42:05 UTC
Comment on attachment 147369 [details]
Diff of changes

diff -ruN /usr/ports/net-p2p/btsync/Makefile ./btsync/Makefile
--- /usr/ports/net-p2p/btsync/Makefile	2014-08-27 03:42:05.000000000 -0700
+++ ./btsync/Makefile	2014-09-13 09:19:09.711915761 -0700
@@ -1,7 +1,7 @@
 # $FreeBSD: head/net-p2p/btsync/Makefile 366304 2014-08-27 10:42:05Z robak $
 
 PORTNAME=	btsync
-PORTVERSION=	1.3.109
+PORTVERSION=	1.4.75
 CATEGORIES=	net-p2p
 MASTER_SITES=	http://syncapp.bittorrent.com/${PORTVERSION}/
 DISTNAME=	${PORTNAME}_freebsd_${CONFIG_ARCH}-${PORTVERSION}
@@ -42,9 +42,10 @@
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/temp/btsync ${STAGEDIR}${PREFIX}/bin
 	${WRKSRC}/temp/btsync --dump-sample-config > ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample
-	${REINPLACE_CMD} -e 's;\(^ *"storage_path" *: *\)"/.*",;\1"/var/db/${PORTNAME}",;' ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample
+	${REINPLACE_CMD} -e 's;^//\( *"storage_path" *: *\)"/.*",;\1"/var/db/${PORTNAME}",;' ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample
+	${REINPLACE_CMD} -e 's;^//\( *"pid_file" *: *"/var/run/${PORTNAME}/${PORTNAME}.pid",\);\1;' ${STAGEDIR}${PREFIX}/etc/${PORTNAME}.conf.sample
 
 post-install:
-	${MKDIR} ${STAGEDIR}/var/db/btsync
+	${MKDIR} ${STAGEDIR}/var/db/${PORTNAME}
 
 .include <bsd.port.post.mk>
diff -ruN /usr/ports/net-p2p/btsync/distinfo ./btsync/distinfo
--- /usr/ports/net-p2p/btsync/distinfo	2014-08-27 03:42:05.000000000 -0700
+++ ./btsync/distinfo	2014-09-13 09:26:14.636916352 -0700
@@ -1,4 +1,4 @@
-SHA256 (btsync_freebsd_i386-1.3.109.tar.gz) = b451949b677d3aa006199164a7d7f9f799eb5b7758f96b0f2a5bbbb84a9a4aad
-SIZE (btsync_freebsd_i386-1.3.109.tar.gz) = 3279348
-SHA256 (btsync_freebsd_x64-1.3.109.tar.gz) = 31599871449dca3fbc464422fd31440d730cfb0ad11f05321e482ae7ed7f47df
-SIZE (btsync_freebsd_x64-1.3.109.tar.gz) = 3374894
+SHA256 (btsync_freebsd_i386-1.4.75.tar.gz) = 88262978b0c68406be93d0e98e9ffaff6fe73840195c63e43a846810eaa05e48
+SIZE (btsync_freebsd_i386-1.4.75.tar.gz) = 3543603
+SHA256 (btsync_freebsd_x64-1.4.75.tar.gz) = 3772d82c865a462ab47a8fad56e924a47eb0d0983aa23705d4a59ae3ad33c99b
+SIZE (btsync_freebsd_x64-1.4.75.tar.gz) = 3688773
diff -ruN /usr/ports/net-p2p/btsync/files/btsync.in ./btsync/files/btsync.in
--- /usr/ports/net-p2p/btsync/files/btsync.in	2014-06-29 03:55:52.000000000 -0700
+++ ./btsync/files/btsync.in	2014-09-16 12:29:12.761915666 -0700
@@ -18,9 +18,6 @@
 #                               what you want it to be. It uses '%%GROUP%%'
 #                               group by default. Do not sets it as empty or it
 #                               will run as wheel.
-# %%PORTNAME%%_data_dir:        Directory where %%PORTNAME%% configuration
-#                               data is stored.
-#                               Default: /var/db/%%PORTNAME%%
 
 . /etc/rc.subr
 name="%%PORTNAME%%"
@@ -30,10 +27,16 @@
 : ${%%PORTNAME%%_enable:="NO"}
 : ${%%PORTNAME%%_user:="%%USER%%"}
 : ${%%PORTNAME%%_group:="%%GROUP%%"}
-: ${%%PORTNAME%%_data_dir:="/var/db/%%PORTNAME%%"}
 
-pidfile="$btsync_data_dir/sync.pid"
+pidfile="/var/run/%%PORTNAME%%/%%PORTNAME%%.pid"
 command="%%PREFIX%%/bin/btsync"
 command_args="--config %%PREFIX%%/etc/%%PORTNAME%%.conf"
 
+start_precmd=%%PORTNAME%%_prestart
+%%PORTNAME%%_prestart(){
+	if [ ! -d ${pidfile%/*} ]; then
+		install -d -o $%%PORTNAME%%_user -g $%%PORTNAME%%_group ${pidfile%/*}
+	fi
+}
+
 run_rc_command "$1"
diff -ruN /usr/ports/net-p2p/btsync/pkg-plist ./btsync/pkg-plist
--- /usr/ports/net-p2p/btsync/pkg-plist	2014-06-29 03:55:52.000000000 -0700
+++ ./btsync/pkg-plist	2014-09-13 07:53:06.238915443 -0700
@@ -1,5 +1,5 @@
 @unexec %D/etc/rc.d/%%PORTNAME%% forcestop 2>/dev/null || true
 bin/btsync
 @sample etc/%%PORTNAME%%.conf.sample
-@unexec rmdir /var/db/btsync 2>/dev/null || true
+@unexec rmdir /var/db/%%PORTNAME%% 2>/dev/null || true
 @exec install -d -o %%USER%% -g %%GROUP%% /var/db/%%PORTNAME%%
Comment 4 joshruehlig 2014-09-16 19:45:55 UTC
Created attachment 147386 [details]
diff of changes, edited 8/16/14
Comment 5 joshruehlig 2014-09-16 19:50:09 UTC
OK, still trying to figure out how to use this PR system. sorry for the extra posts I can't seem to delete. diff attached (#147386) is good to go, I am the maintainer so I'm not sure what happens next.
Thanks,
Comment 6 Marcus von Appen freebsd_committer freebsd_triage 2014-09-17 16:56:52 UTC
The patch looks good, over to Patch Ready for a committer to pick up.
Comment 7 commit-hook freebsd_committer freebsd_triage 2014-09-20 19:02:52 UTC
A commit references this bug:

Author: pawel
Date: Sat Sep 20 19:02:31 UTC 2014
New revision: 368676
URL: http://svnweb.freebsd.org/changeset/ports/368676

Log:
  - Update to version 1.4.75
  - Move pidfile to /var/run/btsync dir
  - Use %%PORTNAME%% subs in rc file

  PR:		ports/193676
  Submitted by:	maintainer

Changes:
  head/net-p2p/btsync/Makefile
  head/net-p2p/btsync/distinfo
  head/net-p2p/btsync/files/btsync.in
  head/net-p2p/btsync/pkg-plist
Comment 8 joshruehlig 2014-09-20 19:05:51 UTC
thanks!

btsync issued another two minor updates, so I'll submit those soon.