[aur-general] AUR Best Practice for New Package Upload
Hi, I am fairly new to Arch in general--switched to it a few months ago--and a newbie at PKGBUILD and maintaining packages on AUR. So please bear with me. I am looking to write my first PKGBUILD to upload to AUR, for a small program written in Python (hashing tools). The program has 3 components: 1) the main script which is CLI (available for python2 and/or python3) 2) a GTK+ GUI (optional) for python2 3) the GTK+ GUI (optional) for python3 I use the GTK+GUI for python3 on my box but perhaps some users might want (or have to) use python2. Question 1): The program is small (approx 250kb only) and my tendency would be to just do the one package with all 3 components which users will then use as they see fit, CLI only or GUI, etc. This would allow me to maintain only one package for this program. Is only one package OK with the AUR community? Question 2) The program does not have an install file but comes as a dir structure as such: Top Level dir: program/ -rw-r--r-- 1 stef_204 users 39 Jun 8 2012 AUTHORS -rw-r--r-- 1 stef_204 users 35147 Jun 8 2012 COPYING drwxr-xr-x 2 stef_204 users 4096 Jul 15 2012 data drwxr-xr-x 2 stef_204 users 4096 Aug 15 00:15 python2 drwxr-xr-x 2 stef_204 users 4096 Aug 15 12:00 python3 -rw-r--r-- 1 stef_204 users 2421 Jul 17 2012 README python2/ and python3/ each contain 2 files, the script and the GUI launcher for their respective version. I just basically downloaded the source tarball, extracted it to /opt and am running it from there. My idea is to achieve the same with PKGBUILD, following proper protocol, etc. Is "installing" (extracting dir structure) to /opt a problem? Once I finish writing script, I will check it with Namcap and post it here for review. Thanks for your comments on Questions 1) and 2) above.
On 06 Sep 2014, at 12:06, stef <stef_204@yahoo.com> wrote:
1) the main script which is CLI (available for python2 and/or python3) 2) a GTK+ GUI (optional) for python2 3) the GTK+ GUI (optional) for python3
I use the GTK+GUI for python3 on my box but perhaps some users might want (or have to) use python2.
Question 1):
The program is small (approx 250kb only) and my tendency would be to just do the one package with all 3 components which users will then use as they see fit, CLI only or GUI, etc. This would allow me to maintain only one package for this program.
Is only one package OK with the AUR community?
You shouldn’t mix python2 and 3. Make it a split package.
Question 2) I just basically downloaded the source tarball, extracted it to /opt and am running it from there.
My idea is to achieve the same with PKGBUILD, following proper protocol, etc.
Is “installing” (extracting dir structure) to /opt a problem?
Don’t do that, it’s very ewwy. Read up on how and where python packages are normally packaged. Or actually, read up on setuptools and write a setup.py that you can use in the PKGBUILD.
On sam, 2014-09-06 at 13:03 +0200, Johannes Löthberg wrote:
On 06 Sep 2014, at 12:06, stef <stef_204@yahoo.com> wrote:
1) the main script which is CLI (available for python2 and/or python3) 2) a GTK+ GUI (optional) for python2 3) the GTK+ GUI (optional) for python3
I use the GTK+GUI for python3 on my box but perhaps some users might want (or have to) use python2.
Question 1):
The program is small (approx 250kb only) and my tendency would be to just do the one package with all 3 components which users will then use as they see fit, CLI only or GUI, etc. This would allow me to maintain only one package for this program.
Is only one package OK with the AUR community?
You shouldn’t mix python2 and 3. Make it a split package.
Do you really need to build both the python2 and python3 versions? If it is just an application (and not a library), I would recommend to build just the python3 version. -- Nuno Araujo <nuno.araujo@russo79.com> http://www.russo79.com
-------------------------------------------- On Sat, 9/6/14, Johannes Löthberg <johannes@kyriasis.com> wrote: Subject: Re: [aur-general] AUR Best Practice for New Package Upload To: "Discussion about the Arch User Repository (AUR)" <aur-general@archlinux.org> Date: Saturday, September 6, 2014, 1:03 PM On 06 Sep 2014, at 12:06, stef <stef_204@yahoo.com> wrote:
1) the main script which is CLI (available for python2 and/or python3)
2) a GTK+ GUI (optional) for python2
3) the GTK+ GUI (optional) for python3
I use the GTK+GUI for
use python2.
Question 1):
The program is small (approx 250kb only) and my tendency would be to just do the one package with all 3 components which users will then use as they see fit, CLI only or GUI, etc. This would allow me to
python3 on my box but perhaps some users might want (or have to) maintain only one package for this program.
Is only one package OK
Question 2) I just basically downloaded the source tarball, extracted it to /opt and am running it from there.
My idea is to achieve
with the AUR community? You shouldn’t mix python2 and 3. Make it a split package. the same with PKGBUILD, following proper protocol, etc.
Is “installing”
(extracting dir structure) to /opt a problem? Don’t do that, it’s very ewwy. Read up on how and where python packages are normally packaged. Or actually, read up on setuptools and write a setup.py that you can use in the PKGBUILD. -------------------- I will consider only using the python3 package. If want to offer python2 as well, will make it a split package. As far as the location of the install, whether to optify it or not, I will look at this further: <https://wiki.archlinux.org/index.php/Python_Package_Guidelines> I guess I can ask the developer to write a setup.py file that can/will be used to install the package; I'm not sure I want to do this myself. Lastly, what about splitting CLI only package from GUI? Can I make only one package or is it advisable to dp one package for each? This would result in the actual program (CLI) in one package and the GUI on top of it in a different package. It's more work to maintain 2 packages so is it necessary or advisable or can I stick to a single package? Thanks.
On mer, 2014-09-10 at 04:17 -0700, stef wrote:
Lastly, what about splitting CLI only package from GUI? Can I make only one package or is it advisable to dp one package for each? This would result in the actual program (CLI) in one package and the GUI on top of it in a different package. It's more work to maintain 2 packages so is it necessary or advisable or can I stick to a single package?
Well, you can make a split package. This way you only have a PKGBUILD to maintain. AUR now supports them by default so I see no major issues here. The rule of thumb that I tend to apply now is: Write a single PKGBUILD per downloaded file. Make it a split package if necessary. -- Nuno Araujo <nuno.araujo@russo79.com> http://www.russo79.com
-------------------------------------------- On Wed, 9/10/14, Nuno Araujo <nuno.araujo@russo79.com> wrote: Subject: Re: [aur-general] AUR Best Practice for New Package Upload To: aur-general@archlinux.org Date: Wednesday, September 10, 2014, 1:23 PM Well, you can make a split package. This way you only have a PKGBUILD to maintain. AUR now supports them by default so I see no major issues here. The rule of thumb that I tend to apply now is: Write a single PKGBUILD per downloaded file. Make it a split package if necessary. -- Nuno Araujo <nuno.araujo@russo79.com> http://www.russo79.com Nuno, sorry but I'm lost here. To me a "split package" is 2 separate packages, one for the CLI and another one for the GUI. The GUI will only include the GUI itself (GTK+) obviously and not the actual program which will be listed as a dependency. So, does that not imply 2 separate PKGBUILD's and 2 separate packages? One for CLI and one for GUI? Sorry but I'm obviously missing something. I looked at wiki AUR packaging standard but not finding what you are referring to. You are referring to a single PKGBUILD. Can you please explain or refer me to proper wiki section? Thanks.
On mer, 2014-09-10 at 08:58 -0700, stef wrote:
Nuno, sorry but I'm lost here. To me a "split package" is 2 separate packages, one for the CLI and another one for the GUI. The GUI will only include the GUI itself (GTK+) obviously and not the actual program which will be listed as a dependency.
So, does that not imply 2 separate PKGBUILD's and 2 separate packages? One for CLI and one for GUI?
No, for quite some time now now create multiple packages from a single PKGBUILD. Take a look at [1] for an example of a single PKGBUILD that creates a package both for python2 and python3 for instance. Another a bit more complex example can be found at [2].
Sorry but I'm obviously missing something. I looked at wiki AUR packaging standard but not finding what you are referring to. You are referring to a single PKGBUILD.
Can you please explain or refer me to proper wiki section?
As for documenting split packages, just take a look at the PKGBUILD man page [3]. :) [1] https://aur.archlinux.org/packages/py/python-pyside/PKGBUILD [2] https://aur.archlinux.org/packages/ap/apparmor/PKGBUILD [3] https://www.archlinux.org/pacman/PKGBUILD.5.html#_package_splitting -- Nuno Araujo <nuno.araujo@russo79.com> http://www.russo79.com
-------------------------------------------- On Wed, 9/10/14, Nuno Araujo <nuno.araujo@russo79.com> wrote: Subject: Re: [aur-general] AUR Best Practice for New Package Upload To: aur-general@archlinux.org Date: Wednesday, September 10, 2014, 6:46 PM
So, does that not imply 2 separate PKGBUILD's and 2 separate packages? One for CLI and one for GUI?
No, for quite some time now now create multiple packages from a single PKGBUILD. Take a look at [1] for an example of a single PKGBUILD that creates a package both for python2 and python3 for instance. Another a bit more complex example can be found at [2].
Sorry but I'm obviously missing something. I looked at wiki AUR packaging standard but not finding what you are referring to. You are referring to a single PKGBUILD.
As for documenting split packages, just take a look at the PKGBUILD man page [3]. :) [1] https://aur.archlinux.org/packages/py/python-pyside/PKGBUILD [2] https://aur.archlinux.org/packages/ap/apparmor/PKGBUILD [3] https://www.archlinux.org/pacman/PKGBUILD.5.html#_package_splitting -- Nuno Araujo <nuno.araujo@russo79.com> http://www.russo79.com ================================ OK, will look at the links you have provided and try to find the best solution. Thanks for feedback.
participants (3)
-
Johannes Löthberg
-
Nuno Araujo
-
stef