Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ebuild questions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
intord
n00b
n00b


Joined: 12 Aug 2017
Posts: 33

PostPosted: Sat Feb 17, 2018 5:36 pm    Post subject: ebuild questions Reply with quote

Hi all,

i am currently doing an ebuild for the vpn application use for years, so got a couple of questions. This is a .deb archive which should be installed as a bin app.

1) unlike others ${S} is not created by portage during install. Is it designed way to do so? After archive is copied to /vat/tmp/portage i see all other dirs created, but not this one so if i will not put a statement

Code:
pkg_setup() {
   # portage requires ${S} to exist
   mkdir -p ${S}
   chmod 777 ${S}
}


install process will fail with the error "${S} directory does not exist". also i must set 777 otherwize will not be able to even to copy the .deb.file there if needed. just checked firefox-bin ebuild for example and could not find anywhere same statement to create ${S}

2) this application has a .so file which should be placed into /usr/lib/app-name/. i tried multiple ways dolib.so or newlib.so but it seems always install it into /usr/lib64/, is there a way to override this path? the solution which works is to do
Code:
insinto /usr/lib/app-name
doins file


3) getting a message about same .so file that "QA Notice: The following files contain writable and executable sections and might not work well" however will it affect the execution of a program in this case?

4) probably most important: during installation browser plugin config should be installed into ${HOME}/.config/ for a current user (not root), so all commands from orig script such as

Code:
sudo -u "${USER}" bash -c 'mkdir -p "${HOME}/.config/google-chrome/NativeMessagingHosts"'


will not work. i understood that since its executed inside of a portage environment there is no access to global variables as ${USER} etc. however what to do if you need to install a file for a current user (or all users)?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Sat Feb 17, 2018 6:38 pm    Post subject: Reply with quote

1) you can override S variable, usually is ${WORKDIR}/${P} but in your case seems to be only ${WORKDIR}. In your ebuild add S=${WORKDIR} (se for example app-emulation/genymotion-bin ebuild).
2) lib dir is a symlink to lib64, then is correct install in lib64
Code:
# ls -l /
lrwxrwxrwx   1 root root     5 Feb 10 12:33 lib -> lib64
drwxr-xr-x   2 root root  4096 Feb 10 12:33 lib32
drwxr-xr-x  16 root root 12288 Feb 12 17:23 lib64

3) is a pre-compiled program? If yes you should use QA_PREBUILT variable (see app-emulation/genymotion-bin ebuild)
4) I don't know very well this part, but you can try to install plugin in /usr/lib64/nsbrowser like www-plugins/adobe-flash?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
intord
n00b
n00b


Joined: 12 Aug 2017
Posts: 33

PostPosted: Sat Feb 17, 2018 8:25 pm    Post subject: Reply with quote

fedeliallalinea, thanks.

2) no, the data folder of the .deb file has this structure:

Code:
./usr/lib/application/xvclient.so


so it must be installed into /usr/lib/application, when i tried to use dolib.so or newlib.so it was installed into /usr/lib64, however vpn service did not start because exe file expects this library to be at /usr/lib/application/

4) so far i see only 1 way: to do

Code:
find /home/ -maxdepth 1 -mindepth 1 -type d | cut -d'/' -f3


so get all user names in the system (another way is to grep /etc/passwd), this is a config file for the browser plugin for this vpn service. so orig file is located at

Code:
/usr/lib/application/google-chrome/some-config.json


and during installation must be copied into

Code:
/home/user/.config/google-chrome/


under user's ownership. this will give ability for a user to install an extension inside a browser
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Sat Feb 17, 2018 8:51 pm    Post subject: Reply with quote

intord wrote:
so it must be installed into /usr/lib/application, when i tried to use dolib.so or newlib.so it was installed into /usr/lib64, however vpn service did not start because exe file expects this library to be at /usr/lib/application/

Strange copy this file in /usr/lib or /usr/lib64 in a profile <=17.0 is same things. What program is?

intord wrote:
4) so far i see only 1 way: to do

Code:
find /home/ -maxdepth 1 -mindepth 1 -type d | cut -d'/' -f3


so get all user names in the system (another way is to grep /etc/passwd), this is a config file for the browser plugin for this vpn service. so orig file is located at

Code:
/usr/lib/application/google-chrome/some-config.json


and during installation must be copied into

Code:
/home/user/.config/google-chrome/


under user's ownership. this will give ability for a user to install an extension inside a browser

Or better you can print a message in pkg_postinst() that inform to copy this file in ~/.config.
I never see a ebuild that copy file in user home
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
intord
n00b
n00b


Joined: 12 Aug 2017
Posts: 33

PostPosted: Sun Feb 18, 2018 6:48 pm    Post subject: Reply with quote

ok implemented.

one last thing came up: when calling rc-service status getting a message

Code:
/etc/init.d/expressvpn: line 186: status_of_proc: command not found


which leads me to the file where it says:

Code:
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
[ -f /lib/lsb/init-functions ] && . /lib/lsb/init-functions


i understand that gentoo does not have lsb-base by default so what is the appropriate way to fix this?
just checked a couple of files in /etc/init.d and none of them have status function so i assume rc-service has its own implementation and calls pid or something like that? so can i simply delete status case from the script then?

after os restart daemon is not running (after i called 'rc-update add' before restart) is this might be related?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Sun Feb 18, 2018 7:35 pm    Post subject: Reply with quote

I think you should rewrite init script with start-stop-daemon and correct function (howto here).
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
intord
n00b
n00b


Joined: 12 Aug 2017
Posts: 33

PostPosted: Sat Mar 03, 2018 8:11 pm    Post subject: Reply with quote

ok did it and now get these results:

Code:
gentoo /home/gentoo # rc-service expressvpn start
 * Caching service dependencies ...
/lib64/rc/sh/rc-functions.sh: line 153: shell_var: command not found                                            [ ok ]
/etc/init.d/expressvpn: line 54: ebegin: command not found
nohup: appending output to 'nohup.out'
/etc/init.d/expressvpn: line 67: eend: command not found
 * ERROR: expressvpn failed to start
gentoo /home/gentoo # rc-service expressvpn status
/lib64/rc/sh/openrc-run.sh: line 127: service_stopping: command not found
/lib64/rc/sh/openrc-run.sh: line 130: service_starting: command not found
/lib64/rc/sh/openrc-run.sh: line 133: service_inactive: command not found
/lib64/rc/sh/openrc-run.sh: line 136: service_started: command not found
/lib64/rc/sh/openrc-run.sh: line 144: einfo: command not found


btw if i will try to stat openvpn, see same thing:

Code:
gentoo /home/gentoo # rc-service openvpn start
 * Caching service dependencies ...
/lib64/rc/sh/rc-functions.sh: line 153: shell_var: command not found                             [ ok ]
 * Starting openvpn ...


looked this thread with similar problem - https://forums.gentoo.org/viewtopic-t-1075762.html?sid=a1536dc1b0362d8d9fba4b3969f7ef18 - however i am on

Code:
gentoo /home/gentoo # ls -sl /lib/rc/bin/service_*
20 -rwxr-xr-x 1 root root 18880 Dec  8 21:15 /lib/rc/bin/service_crashed
20 -rwxr-xr-x 1 root root 19504 Dec  8 21:15 /lib/rc/bin/service_get_value
20 -rwxr-xr-x 1 root root 18880 Dec  8 21:15 /lib/rc/bin/service_hotplugged
20 -rwxr-xr-x 1 root root 18880 Dec  8 21:15 /lib/rc/bin/service_inactive
20 -rwxr-xr-x 1 root root 19504 Dec  8 21:15 /lib/rc/bin/service_set_value
20 -rwxr-xr-x 1 root root 18880 Dec  8 21:15 /lib/rc/bin/service_started
20 -rwxr-xr-x 1 root root 18880 Dec  8 21:15 /lib/rc/bin/service_started_daemon
20 -rwxr-xr-x 1 root root 18880 Dec  8 21:15 /lib/rc/bin/service_starting
20 -rwxr-xr-x 1 root root 18880 Dec  8 21:15 /lib/rc/bin/service_stopped
20 -rwxr-xr-x 1 root root 18880 Dec  8 21:15 /lib/rc/bin/service_stopping
20 -rwxr-xr-x 1 root root 18880 Dec  8 21:15 /lib/rc/bin/service_wasinactive
gentoo /home/gentoo # eselect profile show
Current /etc/portage/make.profile symlink:
  default/linux/amd64/17.0/desktop/plasma


profile so do i still need to fix something?
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30915
Location: here

PostPosted: Sun Mar 04, 2018 7:00 am    Post subject: Reply with quote

This isn't the same problem as reported in link because is related to 17.1 profile.
If you run rc-service with another existing service return same error?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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