need to split deluge package for Arch Linux

Suggestions and discussion of future versions
graysky
Member
Member
Posts: 44
Joined: Sun Oct 05, 2008 11:28 am

need to split deluge package for Arch Linux

Postby graysky » Tue Jan 03, 2012 8:23 pm

Is there an officially supported way to break up deluge for packaging purposes? I would like to have two packages for Arch Linux:

1) deluge (contains the daemon, deluge-console, and deluge-web)
2) deluge-gtk (contains the deluge-gtk)

Here is how the current all-in-one package for Arch linux is created. Note that Arch linux uses a "PKGBUILD" which is a template for it's package manager. It is very simple. In a nutshell, this package is a two step process 1) build and 2) package. $srcdir is the source and $pkgdir is the dirtree where the files will go installed by Arch's package manager.

The complete PKGBUILD is here but here are the important parts:

1) Build:

Code: Select all

cd "$srcdir/$pkgname-$pkgver"
  python2 setup.py build


2) Package:

Code: Select all

cd "$srcdir/$pkgname-$pkgver"
  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
  install -Dm644 deluge/data/pixmaps/deluge.svg "$pkgdir/usr/share/pixmaps/deluge.svg"

  _dir="$pkgdir/usr/lib/python2.7/site-packages/deluge/ui"
  sed -e '1s/python$/&2/' -i "$_dir/Win32IconImagePlugin.py" -i "$_dir/web/gen_gettext.py"


Thanks!

Cas
Top Bloke
Top Bloke
Posts: 3463
Joined: Mon Dec 07, 2009 6:04 am
OS or Distro: Ubuntu 16.04
Location: Scotland

Re: need to split deluge package for Arch Linux

Postby Cas » Tue Jan 03, 2012 9:23 pm

For a reference point it is already split for debian/ubuntu: http://anonscm.debian.org/gitweb/?p=col ... deluge.git

I do not know the details for Arch so you should really contact the package maintainer about best practice: http://www.archlinux.org/packages/extra/any/deluge/

graysky
Member
Member
Posts: 44
Joined: Sun Oct 05, 2008 11:28 am

Re: need to split deluge package for Arch Linux

Postby graysky » Wed Jan 04, 2012 12:01 am

THanks for the reply, Cas. As you can see here, a bugreport/feature request was filed 2-3 years ago asking for this split package. Thing is, since there isn't a native compile method to do it, the package maintainer is unsure which files to include in the gtk package and which in the standard package. I looked at the git link you posted, but don't understand how you split the compiled files.

Cas
Top Bloke
Top Bloke
Posts: 3463
Joined: Mon Dec 07, 2009 6:04 am
OS or Distro: Ubuntu 16.04
Location: Scotland

Re: need to split deluge package for Arch Linux

Postby Cas » Wed Jan 04, 2012 12:29 am

From debian/control you have the following (i have snipped out irrelevant code):

Code: Select all

Package: deluge-common
Depends: python (>= 2.6) | python-simplejson,
         python-twisted-web,
         python-openssl,
         python-pkg-resources,
         python-chardet,
         python-xdg,
         geoip-database


Code: Select all

Package: deluged
Depends: deluge-common (= ${source:Version}),
         python-libtorrent (>= 0.14.9),


Code: Select all

Package: deluge-console
Depends: deluge-common (= ${source:Version})


Code: Select all

Package: deluge-web
Depends: deluge-common (= ${source:Version}),
         python-mako


Code: Select all

Package: deluge-gtk
Depends: deluge-common (= ${source:Version}),
         python-glade2,
         python-notify,
         notification-daemon,
         librsvg2-common,
         xdg-utils


Code: Select all

Package: deluge
Depends: python-libtorrent (>= 0.14.9),
         deluge-gtk (= ${source:Version})

graysky
Member
Member
Posts: 44
Joined: Sun Oct 05, 2008 11:28 am

Re: need to split deluge package for Arch Linux

Postby graysky » Wed Jan 04, 2012 1:58 am

OK... so you're showing me a package name and its respective dependencies? What I don't understand is which files from the source are required for each package you listed.

Cas
Top Bloke
Top Bloke
Posts: 3463
Joined: Mon Dec 07, 2009 6:04 am
OS or Distro: Ubuntu 16.04
Location: Scotland

Re: need to split deluge package for Arch Linux

Postby Cas » Wed Jan 04, 2012 2:12 am

look at debian/*.install for each of those packages

graysky
Member
Member
Posts: 44
Joined: Sun Oct 05, 2008 11:28 am

Re: need to split deluge package for Arch Linux

Postby graysky » Wed Jan 04, 2012 2:12 pm

There we go, thanks, Cas.

tsachev

Re: need to split deluge package for Arch Linux

Postby tsachev » Tue Oct 09, 2012 11:04 am

Hi graysky,
were you able to get a PKGBUILD for splitted deluge?

graysky
Member
Member
Posts: 44
Joined: Sun Oct 05, 2008 11:28 am

Re: need to split deluge package for Arch Linux

Postby graysky » Sun Nov 27, 2016 8:06 pm

I totally forgot about this but now I would like to rekindle it. I think in order to have the Arch Linux package straightforward to maintain as a split package, the install options would need to be native rather than one-by-one as it appears the Debian package is doing. For the Arch build setup, it's a literal:

Code: Select all

python2 setup.py build


And for the Arch install step, it's a literal:

Code: Select all

python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1


Is there the capacity to have multiple install targets provided by upstream to allow for the split packages? For example, something like:

Code: Select all

python2 setup.py install-TARGET--prefix=/usr --root="$pkgdir" --optimize=1


Here TARGET would be one of the following:
install-common = all common files need by all other packages
install-daemon = files needed for deluged
install-gtk = files needed for gtk client
install-console = files needed for console client
install-webui = files needed for webui

There could be an alias to install-all which would be everything (currently, what `setup.py install` does. This would allow for split packages directed by upstream not by distro packagers.

Cas
Top Bloke
Top Bloke
Posts: 3463
Joined: Mon Dec 07, 2009 6:04 am
OS or Distro: Ubuntu 16.04
Location: Scotland

Re: need to split deluge package for Arch Linux

Postby Cas » Mon Nov 28, 2016 7:32 pm

Sure, it's no trivial task though. Recently I have been working towards supporting something like what you describe.

It will actually have a much more beneficial outcome, in that we can place some/all parts of deluge on pypi. The only real barriers are GTK and libtorrent, the latter should be possible with wheels if someone can help out with that but this is a bit off-topic ;)


Return to “Development”

Who is online

Users browsing this forum: No registered users and 5 guests