Bug 187360 - new port: net-p2p/btsync
Summary: new port: net-p2p/btsync
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Li-Wen Hsu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-08 01:20 UTC by joshruehlig
Modified: 2014-06-30 07:24 UTC (History)
1 user (show)

See Also:


Attachments
file.shar (5.06 KB, text/plain)
2014-03-08 01:20 UTC, joshruehlig
no flags Details
btsync.shar (5.35 KB, application/x-shar)
2014-03-26 05:49 UTC, joshruehlig
no flags Details
btsync.shar (5.30 KB, application/x-shar)
2014-04-04 07:51 UTC, joshruehlig
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description joshruehlig 2014-03-08 01:20:01 UTC
This is a copy of the below change-request with a few updates to the 'shar' file.
http://www.freebsd.org/cgi/query-pr.cgi?pr=179724
####

Please find attached my port of the Bittorrent Sync program, provided by Bittorrent Labs, http://labs.bittorrent.com/experiments/sync.html

This program allows the user to sync multiple files/directories between machines using the bittorrent peer-to-peer protocol.

Fix: Patch attached with submission follows:
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2014-03-08 07:51:41 UTC
Responsible Changed
From-To: freebsd-ports-bugs->lwhsu

I'll take it.
Comment 2 Li-Wen Hsu freebsd_committer freebsd_triage 2014-03-16 19:05:33 UTC
State Changed
From-To: open->feedback

Ask for submitter approval.
Comment 3 Li-Wen Hsu freebsd_committer freebsd_triage 2014-03-17 03:23:48 UTC
Oh, it seem that gnats did not append the follow-up, please check this:

http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2014-March/274155.html

Thanks,

On Mon, Mar 17, 2014 at 6:48 AM, Joshua Ruehlig <joshruehlig@gmail.com> wrote:
> Sorry, I'm not sure if I'm the 'submitter'.  Did you need me to do anything
> anything else or are we waiting for someone else to approve something?
>
> Thanks,
>
>
> On Sun, Mar 16, 2014 at 12:05 PM, <lwhsu@freebsd.org> wrote:
>>
>> Synopsis: new port: net-p2p/btsync
>>
>> State-Changed-From-To: open->feedback
>> State-Changed-By: lwhsu
>> State-Changed-When: Sun Mar 16 19:05:33 UTC 2014
>> State-Changed-Why:
>> Ask for submitter approval.
>>
>> http://www.freebsd.org/cgi/query-pr.cgi?pr=187360
>
>



-- 
Li-Wen Hsu
http://lwhsu.org
Comment 4 Li-Wen Hsu freebsd_committer freebsd_triage 2014-03-17 07:54:27 UTC
On Sun, Mar 16, 2014 at 22:22:20 -0700, Joshua Ruehlig wrote:
> Hey Li-Wen,
> 
> Here's my comments on the changes made.
> 
> ####
> 
>     - Add checksum for i386
>     - Wrap long lines in pkg-descr
>     - Fix portlint warnings
> 
> > Awesome, didn't even know about portlint till now.

Cool, you will want to use that next time when submitting ports PR.

>     - Pick UID/GID for btsync as 819/819
> 
> > I'd prefer 817 because that's what my current FreeNAS PBI uses.  If this
> isn't possible I'll just need to inform users that if they update they may
> need to change user UIDs on their ZFS datasets.  Not a big issue.

That's fine, I just randomly pick one empty slot, 817 is also not registered so we can use taht.

>     - set btsync's home to /usr/local/btsync
>     - Move data storage to btsync's home
>     - Rename /usr/local/etc/btsync as btsync_config_dir in rc script,
> 
> > Is there a reason using /usr/local/btsync is preferred to
> /usr/local/etc/btsync.  Just incase you haven't used BTSync before, the
> 'storage' directory doesn't (and shouldn't) actually store files, just the
> metadata about the files and other things BTSync needs.  The other issue
> this creates is you're hardcoding in /usr/local which isn't true for PBI
> installations.

/usr/local/etc is for configuration files, I am not sure it's a good
parctice to put data there.   If they are only metadata, isn't it probably
more suitable to go to /var/db?

> If the 'storage' directory is moved to /usr/local/btsync I don't see a need
> for an entire config directory, there's only one config file so
> /usr/local/etc/btsync.ini would be fine.

I wanted to change this, but it would take some more time to modity
other parts of this port, so I want to discuss with you first.

> ####
> 
> Thanks!  Do you want me to correspond using email or on the mailing list
> (I've never used one, I assume I need to subscribe somehow)?

Both works for me, please also CC bug-followup@FreeBSD.org so the
discussion will be recorded.  The mailing list is somehow only useful
for people really want to receive *every* ports PR updating.  Of course
you're welcomed to subscribe that :)

> 
> On Sun, Mar 16, 2014 at 8:23 PM, Li-Wen Hsu <lwhsu@freebsd.org> wrote:
> 
> > Oh, it seem that gnats did not append the follow-up, please check this:
> >
> >
> > http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2014-March/274155.html
> >
> > Thanks,
> >
> > On Mon, Mar 17, 2014 at 6:48 AM, Joshua Ruehlig <joshruehlig@gmail.com>
> > wrote:
> > > Sorry, I'm not sure if I'm the 'submitter'.  Did you need me to do
> > anything
> > > anything else or are we waiting for someone else to approve something?
> > >
> > > Thanks,
> > >
> > >
> > > On Sun, Mar 16, 2014 at 12:05 PM, <lwhsu@freebsd.org> wrote:
> > >>
> > >> Synopsis: new port: net-p2p/btsync
> > >>
> > >> State-Changed-From-To: open->feedback
> > >> State-Changed-By: lwhsu
> > >> State-Changed-When: Sun Mar 16 19:05:33 UTC 2014
> > >> State-Changed-Why:
> > >> Ask for submitter approval.
> > >>
> > >> http://www.freebsd.org/cgi/query-pr.cgi?pr=187360
> > >
> > >
> >
> >
> >
> > --
> > Li-Wen Hsu
> > http://lwhsu.org
> >

-- 
Li-Wen Hsu <lwhsu@FreeBSD.org>
http://lwhsu.org
Comment 5 joshruehlig 2014-03-18 03:57:04 UTC
Thanks for the quick response.  Here's what I'll do..

1) Apply your diff
2) change the UID/GID to 817
3) drop the home directory and instead create a directory /var/db/btsync
owned by btsync
4) change the config file to /usr/local/etc/btsync.conf
5) Figure out and use portlint
6) submit a new shar to you (I hope this includes the needed changes to UID
and GID)


On Mon, Mar 17, 2014 at 12:54 AM, Li-Wen Hsu <lwhsu@freebsd.org> wrote:

> On Sun, Mar 16, 2014 at 22:22:20 -0700, Joshua Ruehlig wrote:
> > Hey Li-Wen,
> >
> > Here's my comments on the changes made.
> >
> > ####
> >
> >     - Add checksum for i386
> >     - Wrap long lines in pkg-descr
> >     - Fix portlint warnings
> >
> > > Awesome, didn't even know about portlint till now.
>
> Cool, you will want to use that next time when submitting ports PR.
>
> >     - Pick UID/GID for btsync as 819/819
> >
> > > I'd prefer 817 because that's what my current FreeNAS PBI uses.  If
> this
> > isn't possible I'll just need to inform users that if they update they
> may
> > need to change user UIDs on their ZFS datasets.  Not a big issue.
>
> That's fine, I just randomly pick one empty slot, 817 is also not
> registered so we can use taht.
>
> >     - set btsync's home to /usr/local/btsync
> >     - Move data storage to btsync's home
> >     - Rename /usr/local/etc/btsync as btsync_config_dir in rc script,
> >
> > > Is there a reason using /usr/local/btsync is preferred to
> > /usr/local/etc/btsync.  Just incase you haven't used BTSync before, the
> > 'storage' directory doesn't (and shouldn't) actually store files, just
> the
> > metadata about the files and other things BTSync needs.  The other issue
> > this creates is you're hardcoding in /usr/local which isn't true for PBI
> > installations.
>
> /usr/local/etc is for configuration files, I am not sure it's a good
> parctice to put data there.   If they are only metadata, isn't it probably
> more suitable to go to /var/db?
>
> > If the 'storage' directory is moved to /usr/local/btsync I don't see a
> need
> > for an entire config directory, there's only one config file so
> > /usr/local/etc/btsync.ini would be fine.
>
> I wanted to change this, but it would take some more time to modity
> other parts of this port, so I want to discuss with you first.
>
> > ####
> >
> > Thanks!  Do you want me to correspond using email or on the mailing list
> > (I've never used one, I assume I need to subscribe somehow)?
>
> Both works for me, please also CC bug-followup@FreeBSD.org so the
> discussion will be recorded.  The mailing list is somehow only useful
> for people really want to receive *every* ports PR updating.  Of course
> you're welcomed to subscribe that :)
>
> >
> > On Sun, Mar 16, 2014 at 8:23 PM, Li-Wen Hsu <lwhsu@freebsd.org> wrote:
> >
> > > Oh, it seem that gnats did not append the follow-up, please check this:
> > >
> > >
> > >
> http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2014-March/274155.html
> > >
> > > Thanks,
> > >
> > > On Mon, Mar 17, 2014 at 6:48 AM, Joshua Ruehlig <joshruehlig@gmail.com
> >
> > > wrote:
> > > > Sorry, I'm not sure if I'm the 'submitter'.  Did you need me to do
> > > anything
> > > > anything else or are we waiting for someone else to approve
> something?
> > > >
> > > > Thanks,
> > > >
> > > >
> > > > On Sun, Mar 16, 2014 at 12:05 PM, <lwhsu@freebsd.org> wrote:
> > > >>
> > > >> Synopsis: new port: net-p2p/btsync
> > > >>
> > > >> State-Changed-From-To: open->feedback
> > > >> State-Changed-By: lwhsu
> > > >> State-Changed-When: Sun Mar 16 19:05:33 UTC 2014
> > > >> State-Changed-Why:
> > > >> Ask for submitter approval.
> > > >>
> > > >> http://www.freebsd.org/cgi/query-pr.cgi?pr=187360
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > Li-Wen Hsu
> > > http://lwhsu.org
> > >
>
> --
> Li-Wen Hsu <lwhsu@FreeBSD.org>
> http://lwhsu.org
>
Comment 6 Li-Wen Hsu freebsd_committer freebsd_triage 2014-06-27 03:51:28 UTC
Hi,

Sorry for the delay, I was busy and it took me some time for fixing stage support.  I've updated this port to the latest btsync release, new shar is here:

    https://people.freebsd.org/~lwhsu/shar/btsync.shar

Please check and approve this, I'll commit it ASAP.

Thanks,
Li-Wen
Comment 7 joshruehlig 2014-06-27 04:22:04 UTC
Hi,
Thanks for following up on this.

I reviewed the shar and had a few changes I'd like to make. I can make a new shar based on what you think and resubmit it.


Makefile

* Set LICENSE_PERMS to auto-accept. The user is presented with the license upon first run of the program so showing it upon compilation is redundant.

* Set user to "syncer". I also will submit a port for syncthing and believe these should use the same user, UID/GID=817.

* Remove "post-install". This is redundant with pkg-plist and doesn't do anything because it lives below PREFIX.

pkg-plist
* Replace last two lines of pkg-plist with below. Setting permissions isn't necessary, ownership is enough. I'm not sure if you would rather do this in two lines?
@exec install -d -o %%USER%% -g %%GROUP%% /var/db/%%PORTNAME%%
Comment 8 Li-Wen Hsu freebsd_committer freebsd_triage 2014-06-27 15:27:31 UTC
(In reply to joshruehlig from comment #7)
> Hi,
> Thanks for following up on this.

Thanks for still interesting in this :)

> I reviewed the shar and had a few changes I'd like to make. I can make a new
> shar based on what you think and resubmit it.
> 
> 
> Makefile
> 
> * Set LICENSE_PERMS to auto-accept. The user is presented with the license
> upon first run of the program so showing it upon compilation is redundant.

Sounds good, changed.

> * Set user to "syncer". I also will submit a port for syncthing and believe
> these should use the same user, UID/GID=817.

I don't think this is necessary, unless these two ports are usually work together.  "syncer" to me sounds more like a program sync buffers to disk.  It's no need to save one line in UIDs/GIDs file, and end users can still overwrite the user/group to what they want.  This is just my preference, I want to make privileges of different two programs explicitly separated.  

> * Remove "post-install". This is redundant with pkg-plist and doesn't do
> anything because it lives below PREFIX.

That's need for stage support.  Please see:

    https://wiki.freebsd.org/ports/StageDir

bullet 4 and 5 in "Makefile {pre,do,post}-install: targets"

> pkg-plist
> * Replace last two lines of pkg-plist with below. Setting permissions isn't
> necessary, ownership is enough. I'm not sure if you would rather do this in
> two lines?
> @exec install -d -o %%USER%% -g %%GROUP%% /var/db/%%PORTNAME%%

Yeah when there is only one file, it's fine.

I also created a new shar file at the same place:

    https://people.freebsd.org/~lwhsu/shar/btsync.shar
Comment 9 joshruehlig 2014-06-29 07:05:18 UTC
> > * Set user to "syncer". I also will submit a port for syncthing and believe
> > these should use the same user, UID/GID=817.
> 
> I don't think this is necessary, unless these two ports are usually work
> together.  "syncer" to me sounds more like a program sync buffers to disk. 
> It's no need to save one line in UIDs/GIDs file, and end users can still
> overwrite the user/group to what they want.  This is just my preference, I
> want to make privileges of different two programs explicitly separated.  

Good point. these are two similar competing programs but they wouldn't likely work together. I'll just submit 'syncthing' with its own user with a different UID/GID.


> > * Remove "post-install". This is redundant with pkg-plist and doesn't do
> > anything because it lives below PREFIX.
> 
> That's need for stage support.  Please see:
> 
>     https://wiki.freebsd.org/ports/StageDir
> 
> bullet 4 and 5 in "Makefile {pre,do,post}-install: targets"

OK, very well explained in the wiki. Should we use install instead to set permissions or is mkdir enough for stage support?


> > pkg-plist
> > * Replace last two lines of pkg-plist with below. Setting permissions isn't
> > necessary, ownership is enough. I'm not sure if you would rather do this in
> > two lines?
> > @exec install -d -o %%USER%% -g %%GROUP%% /var/db/%%PORTNAME%%
> 
> Yeah when there is only one file, it's fine.

We don't need the "-m 755", but it will work either way.


> I also created a new shar file at the same place:
> 
>     https://people.freebsd.org/~lwhsu/shar/btsync.shar
Awesome, I think everything great with this shar. Also, as a reminder we need the user & group added to UID & GID files.

Thanks!
Comment 10 commit-hook freebsd_committer freebsd_triage 2014-06-29 10:56:53 UTC
A commit references this bug:

Author: lwhsu
Date: Sun Jun 29 10:55:54 UTC 2014
New revision: 359755
URL: http://svnweb.freebsd.org/changeset/ports/359755

Log:
  Add btsync, distributed peer-to-peer file syncing application.

  PR:		187360
  Submitted by:	Joshua Ruehlig <joshruehlig@gmail.com>

Changes:
  head/GIDs
  head/UIDs
  head/net-p2p/Makefile
  head/net-p2p/btsync/
  head/net-p2p/btsync/Makefile
  head/net-p2p/btsync/distinfo
  head/net-p2p/btsync/files/
  head/net-p2p/btsync/files/btsync.in
  head/net-p2p/btsync/files/pkg-message.in
  head/net-p2p/btsync/pkg-descr
  head/net-p2p/btsync/pkg-plist
Comment 11 joshruehlig 2014-06-30 07:24:12 UTC
(In reply to commit-hook from comment #10)
> A commit references this bug:
> 
> Author: lwhsu
> Date: Sun Jun 29 10:55:54 UTC 2014
> New revision: 359755
> URL: http://svnweb.freebsd.org/changeset/ports/359755
> 
> Log:
>   Add btsync, distributed peer-to-peer file syncing application.
> 
>   PR:		187360
>   Submitted by:	Joshua Ruehlig <joshruehlig@gmail.com>
> 
> Changes:
>   head/GIDs
>   head/UIDs
>   head/net-p2p/Makefile
>   head/net-p2p/btsync/
>   head/net-p2p/btsync/Makefile
>   head/net-p2p/btsync/distinfo
>   head/net-p2p/btsync/files/
>   head/net-p2p/btsync/files/btsync.in
>   head/net-p2p/btsync/files/pkg-message.in
>   head/net-p2p/btsync/pkg-descr
>   head/net-p2p/btsync/pkg-plist

Awesome thanks! I'll work on submitting a new bug report for the other port 'syncthing' with fairly similar files.