Bug 199093 - [MAINTAINER] multimedia/mediabrowser: Move to multimedia/emby-server and update to 3.0.5572.0
Summary: [MAINTAINER] multimedia/mediabrowser: Move to multimedia/emby-server and upda...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Adam Weinberger
URL: https://github.com/MediaBrowser/Media...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-01 16:27 UTC by Ben Woods
Modified: 2015-04-08 22:22 UTC (History)
3 users (show)

See Also:


Attachments
Patch to move multimedia/mediabrowser to multimedia/emby and update to 3.0.5569.0 (162.82 KB, patch)
2015-04-01 16:27 UTC, Ben Woods
no flags Details | Diff
Patch to move multimedia/mediabrowser to multimedia/emby and update to 3.0.5569.0 (162.83 KB, patch)
2015-04-01 16:33 UTC, Ben Woods
no flags Details | Diff
Patch to move multimedia/mediabrowser to multimedia/emby and update to 3.0.5569.0 (162.60 KB, patch)
2015-04-03 01:30 UTC, Ben Woods
no flags Details | Diff
Patch to move multimedia/mediabrowser to multimedia/emby-server and update to 3.0.5572.0 (163.15 KB, patch)
2015-04-06 14:43 UTC, Ben Woods
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Woods freebsd_committer 2015-04-01 16:27:35 UTC
Created attachment 155095 [details]
Patch to move multimedia/mediabrowser to multimedia/emby and update to 3.0.5569.0

Move the multimedia/mediabrowser port to multimedia/emby-server to reflect the change of the upstream project name.
http://emby.media/community/index.php?/blog/1/entry-179-introducing-emby/

Also update to version 3.0.5569.0 which includes these new features:
- Add cloud & folder sync features
- Migrate from GDI to ImageMagick
Comment 1 Ben Woods freebsd_committer 2015-04-01 16:33:38 UTC
Created attachment 155097 [details]
Patch to move multimedia/mediabrowser to multimedia/emby and update to 3.0.5569.0

Correct pkg-message and files/emby-server.in to ensure it is clear that /etc/rc.conf should contain emby_server_enable="YES" and the service should be started with "service emby-server start" (note the hyphen rather than an underscore).
Comment 2 Ben Woods freebsd_committer 2015-04-03 01:30:13 UTC
Created attachment 155142 [details]
Patch to move multimedia/mediabrowser to multimedia/emby and update to 3.0.5569.0

Remove unnecessary post-patch step (fix incorporated upstream)
Comment 3 Adam Weinberger freebsd_committer 2015-04-03 17:04:26 UTC
Ben I'm not sure that reusing 989 is the best idea. I see the "pw groupmod" line that you've added, but is there any benefit to just creating a new emby group/user? Or is your patch more likely to be transparent to end-users?
Comment 4 joshruehlig 2015-04-03 17:59:50 UTC
I think the user rename makes things easier for users. this way they can delete the old package, install the new package, and their data-directory is still writable and will be used.
Comment 5 Ben Woods freebsd_committer 2015-04-04 03:57:09 UTC
We made UID/GID 989 as a dedicated user/group for this program. Therefore I think it makes sense for the UID/GID 989 to continue to be used for this program, even if it has changed names.

Also, I think the database at /var/db/mediabrowser owned by UID/GID 989 which has been created by users for this program should not be left behind simply because of a project name change. That historical data should come along with the new project name, and the easiest way to do that for users is to automatically rename the directory to /var/db/emby-server and automatically change the user/group name for 989 to emby.

If the UID/GID 989 was used for some other purpose other than running this program and owning the database, I would agree we should use another UID/GID. But the scripts I have included with the patch ensure that UID 989 exists and has the username mediabrowser, confirming that UID 989 does not exist for some other purpose.
Comment 6 Adam Weinberger freebsd_committer 2015-04-04 06:20:10 UTC
(Cc'ing bapt@ for advice)

Hi Bapt,

I haven't addressed this problem before, and I was wondering if you could review the plan here?


This PR is to rename mediabrowser to emby. Part of the move will require migrating ${USERS} and ${GROUPS}, and renaming directories in /var/db.

What Ben (maintainer) is proposing is:
  - Rename group 989/user 989 from mediabrowser -> emby
    - @exec line in pkg-plist

  - Rename /var/db/mediabrowser -> /var/db/emby
    - In rc(8) script


It seems like a good proposal to me, because it avoids having to manually chown files in /var/db/.


Is there collateral damage that I'm not anticipating? Are there periodic daily/security scripts that are going to complain? The /var/db files/dirs do not appear in the plist.
Comment 7 joshruehlig 2015-04-05 14:27:15 UTC
Hi Ben,
There is now a newer version of this.

Also, I recommend you don't move the /var/db/mediabrowser directory in the rc.d script.
* this doesn't work in practice. emby-server will not start because some directories are still expected in the old location. I suspect a config file or sqlite database somewhere in the data-directory also needs to be updated
* This adds additional complexity while not successfully achieving the intended purpose.

what users could do if they want to migrate from mediabrowser to emby is either..
* set emby_server_data_dir=/var/db/mediabrowser
* move the directory as you do, but also edit the locations that still point to the mediabrowser location. (I don't know where these are exactly though)
Comment 8 Ben Woods freebsd_committer 2015-04-06 14:43:37 UTC
Created attachment 155230 [details]
Patch to move multimedia/mediabrowser to multimedia/emby-server and update to 3.0.5572.0

Changed patch to update to latest upstream release 3.0.5572.0 Stable.

Other changes (since previous PR199093 attachment):
- do not move an existing database (it is not supported as the full path is used in some database entries). If a database exists at the old location /var/db/mediabrowser, use it. Otherwise, a new database will be created upon start at a new location /var/db/emby-server.

- do not rename an existing user/group. If a user/group exists with name mediabrowser, use it by default. Otherwise, a new user/group will be created with name emby.

- add a note to pkg-message explaining the above to the user.
Comment 9 Adam Weinberger freebsd_committer 2015-04-08 15:57:44 UTC
Really good job on this, Ben. Sorry about the long delay before committing.

The only thing you forgot to do was update multimedia/Makefile but I took care of that :-)
Comment 10 commit-hook freebsd_committer 2015-04-08 15:57:51 UTC
A commit references this bug:

Author: adamw
Date: Wed Apr  8 15:56:56 UTC 2015
New revision: 383577
URL: https://svnweb.freebsd.org/changeset/ports/383577

Log:
  Rename multimedia/mediabrowser to multimedia/emby-server, and update
  to 3.0.5572.0.

  The user and group names have change, but the uid/gid remain the same.
  The port will continue to use the old database and user/group names if
  they exist, but will default to the new names for new installs.

  Instructions are in pkg-message for how to manually migrate things
  yourself.

  PR:		199093
  Submitted by:	maintainer (Ben Woods)

Changes:
  head/GIDs
  head/MOVED
  head/UIDs
  head/multimedia/Makefile
  head/multimedia/emby-server/
  head/multimedia/emby-server/Makefile
  head/multimedia/emby-server/distinfo
  head/multimedia/emby-server/files/emby-server.in
  head/multimedia/emby-server/files/mediabrowser.in
  head/multimedia/emby-server/pkg-deinstall
  head/multimedia/emby-server/pkg-descr
  head/multimedia/emby-server/pkg-message
  head/multimedia/emby-server/pkg-plist
  head/multimedia/mediabrowser/
Comment 11 Ben Woods freebsd_committer 2015-04-08 22:22:20 UTC
Doh - multimedia/Makefile... Thanks for that!