Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MoPi: Mobile Power for the Raspberry Pi
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
paul_chany
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2010
Posts: 82
Location: Europe, Serbia

PostPosted: Mon Aug 01, 2016 6:09 pm    Post subject: MoPi: Mobile Power for the Raspberry Pi Reply with quote

Hi,

I just want to ask a question about installing simbamond software on Gentoo Linux system.

I have a Raspberry Pi 2 Model. On it Gentoo Linux, and a Moodle system are running.
I wish to get this MoPi to serve as UPS for my RPi.

Only do not know how can one install the simbamond debian package here, on Gentoo Linux?

I ask the question:
"Can I expect a simbamond daemon which is running on a Gentoo linux too?"
the developers, but get an answer:
"There's nothing very debian-specific in the package -- I'd just google "installing .deb on gentoo" and see where that gets you?
best"

So, what can I do to achieve my goal with simbamond?
_________________
Best, Pali
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54831
Location: 56N 3W

PostPosted: Mon Aug 01, 2016 8:31 pm    Post subject: Reply with quote

paul_chany,

Fetch the source from git then build and install by hand.
When you do that, software should really install to /usr/local.
This package won't do that, which is a bad thing. You might want to modify the makefile.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
paul_chany
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2010
Posts: 82
Location: Europe, Serbia

PostPosted: Sun Nov 06, 2016 2:54 pm    Post subject: Reply with quote

NeddySeagoon wrote:
paul_chany,

Fetch the source from git then build and install by hand.
When you do that, software should really install to /usr/local.
This package won't do that, which is a bad thing. You might want to modify the makefile.

I have now the MoPi hardware at my hands. :D
I am willing to install this on to my Gentoo system now.
Here are few lines in makefile in simbamon directory:
Code:
VERSION=4.1
NEXT_SNAP=1
P=simbamond
D=simbamon
MOPI=mopi
MOPICLI=mopicli
MOPIAPI=mopiapi.py
PD=package/$(VERSION)
INSTALLED_FILES=\
  $(DESTDIR)/usr/sbin/$(D) \
  $(DESTDIR)/usr/sbin/$(MOPI) \
  $(DESTDIR)/usr/sbin/$(MOPICLI) \
  $(DESTDIR)/usr/sbin/$(MOPIAPI) \
  $(DESTDIR)/etc/init.d/$(P) \
  $(DESTDIR)/etc/default/$(P) \
  $(DESTDIR)/usr/share/man/man8/$(D).8.gz \
  $(DESTDIR)/usr/share/man/man8/$(P).8.gz \
  $(DESTDIR)/usr/share/man/man8/$(MOPI).8.gz \
  $(DESTDIR)/usr/share/man/man8/$(MOPICLI).8.gz \
  $(DESTDIR)/usr/share/man/man8/$(MOPIAPI).8.gz

How can I modify $(DESTDIR) variable?
_________________
Best, Pali
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54831
Location: 56N 3W

PostPosted: Sun Nov 06, 2016 4:52 pm    Post subject: Reply with quote

paul_chany,

DESTDIR looks like an environment variable. Its normally empty, so its default value is "" (the empty string)

Random example from your post.
Code:
 $(DESTDIR)/usr/sbin/$(MOPI)
and we see that
Code:
MOPI=mopi

Taken together that expands to /usr/sbin/mopi, which is what you might expect.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23091

PostPosted: Sun Nov 06, 2016 6:13 pm    Post subject: Reply with quote

Since the package does respect DESTDIR, but does not provide an easy way to install to /usr/local, you could instead write an ebuild for it so that Portage can manage it when it is installed to /usr.
Back to top
View user's profile Send private message
paul_chany
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2010
Posts: 82
Location: Europe, Serbia

PostPosted: Sun Nov 06, 2016 6:45 pm    Post subject: Reply with quote

Hu wrote:
Since the package does respect DESTDIR, but does not provide an easy way to install to /usr/local, you could instead write an ebuild for it so that Portage can manage it when it is installed to /usr.

I wish to write an ebuild for this, but have not enough spare time ( because I am a teacher and teaching they lost me a lot of my time ).
However I do not write any ebuild so far.. but if somehow find time for this then I will try to write it.
_________________
Best, Pali
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23091

PostPosted: Sun Nov 06, 2016 6:57 pm    Post subject: Reply with quote

If you need help writing an ebuild, we can try to guide you. If the installation is simple enough, someone might write the ebuild for you.
Back to top
View user's profile Send private message
paul_chany
Tux's lil' helper
Tux's lil' helper


Joined: 01 Aug 2010
Posts: 82
Location: Europe, Serbia

PostPosted: Sun Nov 06, 2016 8:07 pm    Post subject: Reply with quote

Hu wrote:
If you need help writing an ebuild, we can try to guide you. If the installation is simple enough, someone might write the ebuild for you.

OK
I'm reading now followings:
https://wiki.gentoo.org/wiki/Ebuild
https://wiki.gentoo.org/wiki/Basic_guide_to_write_Gentoo_Ebuilds
Please tell me how to start writing ebuild for simbamon, a Simple Battery Monitor daemon?
Eg. should it hase name like: app-misc/simbamon or sys-power/simbamon ?
So I am following the Gentoo Wiki Ebuild.
So far did followings:
Code:
mkdir -p /usr/local/portage/sys-power/simbamon
cd $_
cp /usr/portage/header.txt ./simbamon-1.0.ebuild
nano simbamon-1.0.ebuild

Code:
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

DESCRIPTION="a Simple Battery Monitor daemon for projects like Mobile Pi ( MoPi ) -- http://pi.gate.ac.uk/mopi"
SLOT="0"

HOMEPAGE="https://github.com/hamishcunningham/pi-tronics/tree/master/simbamon"

SRC_URI=""

Code:
ebuild simbamon-1.0.ebuild manifest clean merge
As you can see I do not know what to put in SRC_URI?
Because the simbamon code is a part of the pi-tronics and only pi-tronics is packaged into a ZIP archive:
https://github.com/hamishcunningham/pi-tronics/archive/master.zip

OK I get help on #gentoo channel and the ebuild looks like this:
/usr/local/portage/sys-power/simbamon/simbamon-1.0.ebuild
Code:
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

DESCRIPTION="a Simple Battery Monitor daemon for projects like Mobile Pi ( MoPi ) -- http://pi.gate.ac.uk/mopi"
SLOT="0"

SRC_URI=""

HOMEPAGE="https://github.com/hamishcunningham/pi-tronics/tree/master/simbamon"

EGIT_REPO_URI="https://github.com/hamishcunningham/pi-tronics/tree/master/simbamon"

LICENSE="GPL 3 or any later version ( unless otherwise stated ) ."

KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"


I can install this ebuild with command:
Code:
ebuild simbamon-1.0.ebuild manifest clean merge

But, when I run it on a shell, I get this message:
Quote:
/usr/local/usr/sbin/simbamon: line 22: /lib/lsb/init-functions: No such file or directory

So I get again help on #gentoo channel, but only that, that where to find about the /lib/lsb/init-funtions script.
Look here: http://www.linuxfromscratch.org/lfs/view/stable/scripts/apds02.html
From here I do not know how to proceed further?
_________________
Best, Pali
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum