You are not logged in.

#1 2020-10-07 10:35:24

rupert
Member
Registered: 2020-10-07
Posts: 3

PKGBUILD review request

Ok, so I need one specific software for my college called UMLFRI2 and I want to put it in aur. I've tried creating a PKGBUILD but feel like it's missing something

# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# Maintainer: rupert <kubostehlik1@gmail.com>
pkgname=umlfri2-git
pkgver=2.2.1
pkgrel=1
epoch=1
pkgdesc="A tool to create UML files"
url="https://umlfri.org/"
license=('GPL')
arch=('x86_64')
groups=()
provides=('umlfri2')
conflicts=('umlfri2')
depends=()
makedepends=('git')
optdepends=('python-qtconsole' 'python-sentry_sdk' 'python-pyqt5' 'ipython' 'python-jinja-time' 'python-lxml' 'python-pyparsing')
changelog=
source=("$pkgname::git+https://github.com/umlfri/umlfri2.git")
md5sums=('SKIP')


prepare() {
#   download and install icons
	cd "$pkgname-$pkgver"/tools/icons/
	./download_icons.py
}

Last edited by rupert (2020-10-07 12:58:23)

Offline

#2 2020-10-07 12:47:33

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 3,401

Re: PKGBUILD review request

Welcome to the forum. Please edit your post and use [ code ] tags (not quote tags) when posting output.

https://wiki.archlinux.org/index.php/Co … s_and_code
https://bbs.archlinux.org/help.php#bbcode

Offline

#3 2020-10-07 12:59:22

rupert
Member
Registered: 2020-10-07
Posts: 3

Re: PKGBUILD review request

sorry. edited it to have code

Offline

#4 2020-10-07 13:08:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 24,454
Website

Re: PKGBUILD review request

1. Get rid of empty variables like groups and changelog
2. I'd get rid of provides / conflicts as there is no umlfri2 package, though these are harmless
3. The license should be GPL3
4. Ditch the prepare function and don't use upstreams icon downloader.  It looks like all it does is download and extract a copy of the tango icon theme.  Just list tango-icon-theme as a dependency.  As written your code will also fail as you 'cd' to a non-existent directory in the prepare function.
5. List other dependencies from "doc/dependencies.pip"
6. You definitely need a package function.  Without a package function, your PKGBUILD does not BUILD a PKG.
7. You may also need build function, though if it's just the python script, perhaps not
8. Unfortunately, this doesn't come with any common python setup tools input, so installation will be "manual" and likely messy.  They don't even provide any documentation for installation, but just suggest using the main.py script from where it is.  If I were you I'd open an upstream request to use setup tools and provide a setup.py to make this an actual installable python package.

EDIT: "manual" installation might be as simple as copying the umlfri2 subdirectory to /usr/lib/python3.8/site-packages/ and then copying main.py to /usr/bin/ with an appropriate name change (e.g., /usr/bin/umlfri).  This is, however, completely untested - I don't know if the script requires the content under the data, addons, and tools directories - if it does, a bit of patching would likely be required.  E.g., the following (completely untested) package function is what I'm thinking / brainstorming:

package() {
   cd umlfri2
   mkdir -p "$pkgdir/usr/lib/python3.8/site-packages/"
   cp -a umfri2 "$pkgdir/usr/lib/python3.8/site-packages/"
   install -Dm755 main.py "$pkgdir/usr/bin/umlfri"
}

EDIT 2: See Progandy's post below on why this will not work.  I'd personally favor patching "paths.py" over installing to /opt/, but either way this should really be sent upstream for them to fix this up appropriately so it can be installed in a standard way. (minor edit, accidentally cited the wrong name for the post below, sorry about that).

Last edited by Trilby (2020-10-07 17:09:58)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2020-10-07 16:11:09

rupert
Member
Registered: 2020-10-07
Posts: 3

Re: PKGBUILD review request

Thanks! I will look into it

EDIT: guys im at loss, i feel like i'll just download it from github for myself and forget about trying to add it to the AUR

Last edited by rupert (2020-10-07 17:44:11)

Offline

#6 2020-10-07 16:16:29

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,987

Re: PKGBUILD review request

Also don't rename the source dir and add descriptions to the optional deps so people know if they need them.

Offline

#7 2020-10-07 16:59:22

progandy
Member
Registered: 2012-05-17
Posts: 3,903

Re: PKGBUILD review request

EDIT: "manual" installation might be as simple as copying the umlfri2 subdirectory to /usr/lib/python3.8/site-packages/ and then copying main.py to /usr/bin/ with an appropriate name change (e.g., /usr/bin/umlfri).  This is, however, completely untested - I don't know if the script requires the content under the data, addons, and tools directories - if it does, a bit of patching would likely be required.

As-is you can only package the program into /opt and add a symlink in /usr/bin. All paths to assets it uses are relative to the location of main.py, so without modifications you cannot put anything into the proper linux FHS locations. At least the paths are centrally defined.

https://github.com/umlfri/umlfri2/blob/ … s/paths.py

Last edited by progandy (2020-10-07 17:03:45)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB