Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
pkg management - handling non-repo dependencies
« previous
next »
Print
Pages: [
1
]
Author
Topic: pkg management - handling non-repo dependencies (Read 4046 times)
mihak
Jr. Member
Posts: 70
Karma: 5
pkg management - handling non-repo dependencies
«
on:
March 22, 2021, 12:52:37 am »
I am tidying-up the speedtest plugin that I cobbled together in the last few weeks (
https://github.com/mihakralj/opnsense-speedtest
)
During the development, I included the copy of binary for speedtest directly in the .txz - but now it is time to remove it from the package and declare an external dependency. The problem is that Ookla's speedtest is not part of any repo (that I know), so
their installation guideline
is asking for a direct
pkg add
installation command.
Having a PLUGIN_DEPENDS statement in the Makefile will stop the installation of the plugin if speedtest is not installed prior, but it would prefer a more streamlined method where some +PRE_INSTALL (if it exists) would run the required
pkg add
command for a 3rd-party package that is not found in any of linked repos.
Logged
mimugmail
Hero Member
Posts: 6766
Karma: 494
Re: pkg management - handling non-repo dependencies
«
Reply #1 on:
March 22, 2021, 11:16:54 am »
Why don't you use +PRE_INSTALL? Just don't forget about +POST_DEINSTALL.
If you add your copyrights to the plugin I can add it to the repo, also the binary itself.
Maybe also think about moving Speedtest to Report section instead of Dashboard.
Logged
WWW:
www.routerperformance.net
Support plans:
https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German):
https://opnsense.max-it.de/
mihak
Jr. Member
Posts: 70
Karma: 5
Re: pkg management - handling non-repo dependencies
«
Reply #2 on:
March 22, 2021, 09:03:53 pm »
like this?
if [ ! -f /usr/local/bin/speedtest ];
then sudo pkg add "
https://bintray.com/ookla/download/download_file?file_path=ookla-speedtest-1.0.0-freebsd>
fi
pkg info libidn2 > nul
if [ $? != 0 ]; then sudo pkg install -y libidn2; fi
Logged
mihak
Jr. Member
Posts: 70
Karma: 5
Re: pkg management - handling non-repo dependencies
«
Reply #3 on:
March 22, 2021, 11:06:03 pm »
Ummm - this chaining of pkg statements is not working. When running the script above either as a +PRE_INSTALL or +POST_INSTALL, I get:
pkg: Cannot get an exclusive lock on a database, it is locked by another process
Any other ideas? :-)
Logged
mimugmail
Hero Member
Posts: 6766
Karma: 494
Re: pkg management - handling non-repo dependencies
«
Reply #4 on:
March 23, 2021, 03:08:18 pm »
Maybe we were crosstalking, I wasn't talking about adding it to the official repo, I have no write access there and adding a binary inside the pkg is also prohibited. But for building a trustworthy plugin (sorry, no offense!) I need the source ad my repo (also for adding the binary).
Is this ok for you?
Logged
WWW:
www.routerperformance.net
Support plans:
https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German):
https://opnsense.max-it.de/
franco
Administrator
Hero Member
Posts: 17665
Karma: 1611
Re: pkg management - handling non-repo dependencies
«
Reply #5 on:
March 23, 2021, 07:57:18 pm »
Everything that needs compile or extended dependencies needs to go to FreeBSD ports tree or our extended tree worst case. We would like to be able to vet the sources, check for updates and adjust when issues arise. This is also important because the build produces compatible binaries and getting something from somewhere is going to break eventually.
From the plugin the install afterwards is as easy as adding
PLUGIN_DEPENDS= my-dependency-package-name
Cheers,
Franco
Logged
Patrick M. Hausen
Hero Member
Posts: 6836
Karma: 574
Re: pkg management - handling non-repo dependencies
«
Reply #6 on:
March 23, 2021, 08:12:09 pm »
@mihak Can't you use py37-speedtest-cli?
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Development and Code Review
(Moderator:
fabian
) »
pkg management - handling non-repo dependencies