droidian / oFono2MM

Python daemom implementing ModemManager D-Bus API and using oFono to manage the modems.
BSD 3-Clause "New" or "Revised" License
8 stars 8 forks source link

Add some kind of buildsystem #9

Closed JamiKettunen closed 10 months ago

JamiKettunen commented 1 year ago

Currently there's only the debian packaging .links, .dirs and .install files as reference for where files should be put which isn't too great for non-Debian distros wanting to use this software.

For Waydroid I ended up contributing a Makefile which has since been extended and has provided a consistent experience on all distributions packaging it.

As a part of this e.g. /etc/polkit-1/localauthority/10-vendor.d/ofono2mm-radio.pkla should be moved under /var/lib/polkit-1/... since that's where 3rd party packages are supposed to put files as opposed to local user configuration (see Directory Structure of https://linux.die.net/man/8/pklocalauthority)

JamiKettunen commented 1 year ago

For my Void Linux packaging I ended up with the following which remains to be tested on my end for now:

do_install() {
    vmkdir usr/bin
    vmkdir usr/lib/ofono2mm
    vmkdir var/lib/polkit-1/localauthority/10-vendor.d
    vcopy main.py usr/lib/ofono2mm
    vcopy ofono2mm usr/lib/ofono2mm
    vcopy 'ofono*.xml' usr/lib/ofono2mm
    vcopy extra/ofono2mm-radio.pkla var/lib/polkit-1/localauthority/10-vendor.d
    ln -sr ${DESTDIR}/usr/lib/ofono2mm/main.py ${DESTDIR}/usr/bin/ofono2mm
}
erikinkinen commented 1 year ago

You are welcome to open a pull request with an improved more universal build system, if you so wish.

FakeShell commented 10 months ago

i decided to finally added a makefile as its much more convenient for testing. i guess we can finally close it? https://github.com/droidian/oFono2MM/commit/c9f6aa4d6bec649d831aa8e2e21d634942170392

erikinkinen commented 10 months ago

@FakeShell , the Makefile could do with some improvements.

  1. Overriding LIBDIR and BINDIR separately from PREFIX should be possible.
  2. Opting-out from systemd and polkit configuration should be possible. (Especially because previously mentioned Void Linux uses runit not systemd.)
FakeShell commented 10 months ago

@erikinkinen should be good now

erikinkinen commented 10 months ago

Fixed