Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ebuild - Local by Flywheel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
vi2nano
n00b
n00b


Joined: 24 Dec 2019
Posts: 4
Location: Iowa, USA

PostPosted: Thu Feb 06, 2020 4:15 am    Post subject: ebuild - Local by Flywheel Reply with quote

This is my first ever ebuild.
Please correct any mistakes as I'm sure there are enough to go around. It does install/run on my system. Fairly certain I have all of the dependencies at least.

Code:
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

MY_PN="local"
MY_PV=$(ver_rs 1- -)
MY_P="${MY_PN}-${MY_PV}"

inherit rpm xdg-utils

DESCRIPTION="A program to create a local WordPress development environment."
HOMEPAGE="https://localbyflywheel.com/"
SRC_URI="https://local-by-flywheel-flywheel.netdna-ssl.com/releases/${MY_PV}/${MY_P}-linux.rpm"

LICENSE="freedist"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

DEPEND="
    sys-process/numactl
    dev-libs/libaio
    =sys-libs/ncurses-compat-5.9"

RDEPEND="${DEPEND}"
BDEPEND=""

S=${WORKDIR}

src_unpack() {
    rpm_src_unpack ${A}
    cd "${S}"
}

src_install() {
    insinto /
    doins -r "${S}"/usr
    doins -r "${S}"/opt
    fowners root:root /opt/Local/chrome-sandbox
    fperms 4755 /opt/Local/chrome-sandbox
    fperms 755 /opt/Local/local
}

pkg_postinst() {
    xdg_desktop_database_update
    xdg_mimeinfo_database_update
    xdg_icon_cache_update
}

pkg_postrm() {
    xdg_desktop_database_update
    xdg_icon_cache_update
}

_________________
Do or do not, there is no try
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Thu Feb 06, 2020 7:20 am    Post subject: Reply with quote

Use "inherit xdg" instead of xdg-utils, it calls the xdg_* functions automatically so you don't have to.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31255
Location: here

PostPosted: Thu Feb 06, 2020 7:34 am    Post subject: Re: ebuild - Local by Flywheel Reply with quote

Code:
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

MY_PN="local"
MY_PV=$(ver_rs 1- -)
MY_P="${MY_PN}-${MY_PV}"

inherit rpm xdg-utils

DESCRIPTION="A program to create a local WordPress development environment."
HOMEPAGE="https://localbyflywheel.com/"
SRC_URI="https://local-by-flywheel-flywheel.netdna-ssl.com/releases/${MY_PV}/${MY_P}-linux.rpm"

LICENSE="freedist"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

DEPEND="
    sys-process/numactl
    dev-libs/libaio
    =sys-libs/ncurses-compat-5.9"

I'm not sure if is better use <sys-libs/ncurses-compat-6.0 but in this case if ncurses-compat get a revision you can update it.

Code:
RDEPEND="${DEPEND}"
BDEPEND=""

If you don't need BDEPEND remmove it

Code:
S=${WORKDIR}

src_unpack() {
    rpm_src_unpack ${A}
    cd "${S}"
}

src_install() {
    insinto /
    doins -r "${S}"/usr
    doins -r "${S}"/opt
    fowners root:root /opt/Local/chrome-sandbox
    fperms 4755 /opt/Local/chrome-sandbox
    fperms 755 /opt/Local/local
}

You don't need use ${S} because you are already in this and I think same for ${A}.
In src_install you use fowners for root but I think is not needed because is already installed with this owner.
Set setuid (fperms 4755) isn't a good option.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
vi2nano
n00b
n00b


Joined: 24 Dec 2019
Posts: 4
Location: Iowa, USA

PostPosted: Fri Feb 07, 2020 12:24 am    Post subject: Reply with quote

Thank you Ant P. I changed that and it's much more simple.

fedeliallalinea, I did change the ncurses depend just in case it gets a rev bump. I did also remove BDEPEND.
If I don't define ${S} portage complains that S' doesn't exist. I think it's because inside the binary are just the /opt and /usr folders, Instead of a folder with the app name.

If I only define ${S} but don't specify it in
Code:
doins -r ${S}/usr

It basically tries to reinstall everything in /usr to /usr and /opt to /opt, resetting permissions on everything. Yep, probably broke my system but that's fine. 8O
I was able to do away with ${A} without any issue.


I added
Code:
fowners root:root /opt/Local/chrome-sandbox
fperms 4755 /opt/Local/chrome-sandbox

specifically because if I didn't have it when I try to launch the installed application it complains
Code:
FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /opt/Local/chrome-sandbox is owned by root and has mode 4755.
Trace/breakpoint trap


Also was unable to launch from user session as the executable is not executable... so I added
Code:
fperms 755 /opt/Local/local


Thank you for the feedback. :D :D
_________________
Do or do not, there is no try
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31255
Location: here

PostPosted: Fri Feb 07, 2020 6:48 am    Post subject: Reply with quote

vi2nano wrote:
If I don't define ${S} portage complains that S' doesn't exist. I think it's because inside the binary are just the /opt and /usr folders, Instead of a folder with the app name.

S="${WORKDIR}" is ok, but doins -r ${S}/usr you can write simple doins -r usr because for doins ${S} is implied
_________________
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 Unsupported Software 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