Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to know if the install is a binary install ?
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
jorge.ventura
n00b
n00b


Joined: 08 Mar 2016
Posts: 8

PostPosted: Fri Mar 22, 2024 10:52 pm    Post subject: How to know if the install is a binary install ? Reply with quote

I created a custom apache-3.eclass based on apache-2.eclass to link with openssl-compat-1.1.1u. This require to download openssl-1.1.1u tarball in a separated directory, compile and use in apache-3.eclass to build and install such custom apache.

However, when I install from my local repository where I have the binary package ready to install, the binary package reprocess the openssl-1,1,1u from source; something not required.

Is there a way to know inside ebuild if the install will be from binary package or from source ???


Ventura
Back to top
View user's profile Send private message
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1539

PostPosted: Sat Mar 23, 2024 12:57 pm    Post subject: Reply with quote

The ebuild does not need and should not know if a binary package is installed. I'm not sure, but if the ebuild plays here it would be preinst, postinst, prerm and and postrm and perhaps config but the last one you should run manually.

My guess is you're trying to do something in the wrong way or at best - at the wrong place.

Post the modification you're done here plus explanation of what you've doen and what you want to achieve. I'm more than sure there's easier way.

Best Regards,
Georgi
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3138

PostPosted: Sun Mar 24, 2024 2:02 am    Post subject: Reply with quote

Quote:
This require to download openssl-1.1.1u tarball in a separated directory,
So ,basically you just want your apache ebuild to "depend" on openssl-compat, right?
Ebuilds already have a mechanism for defining packages they depend on. There's not need to write a whole new class, just add it to the list.
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
jorge.ventura
n00b
n00b


Joined: 08 Mar 2016
Posts: 8

PostPosted: Mon Mar 25, 2024 12:55 pm    Post subject: Reply with quote

logrusx wrote:
The ebuild does not need and should not know if a binary package is installed. I'm not sure, but if the ebuild plays here it would be preinst, postinst, prerm and and postrm and perhaps config but the last one you should run manually.

My guess is you're trying to do something in the wrong way or at best - at the wrong place.

Post the modification you're done here plus explanation of what you've doen and what you want to achieve. I'm more than sure there's easier way.

Best Regards,
Georgi


I definitely believe there is a better way to do that.

My package has dev-libs/openssl-compat:1,1,1 that has no include files installed, just the binaries, reason why I have to compile mod_ssl with the openssl-1.1.1u downloaded from openssl.org archive.

I did a copy of apache-2.eclass and created another one to use in my private repository.

Here the changes that I did:

if use ssl ; then
# Install openssl version 1 under opt
if [[ -n "${OPENSSL_VERSION}" ]];then
pushd .
cd /tmp
[[ -e "/tmp/openssl" ]] && rm -rf /tmp/openssl
[[ -e "/tmp/openssl-${OPENSSL_VERSION}.tar.gz" ]] && rm -f /tmp/openssl-${OPENSSL_VERSION}.tar.gz
[[ -e "/tmp/openssl-${OPENSSL_VERSION}" ]] && rm -rf /tmp/openssl-${OPENSSL_VERSION}
VRS=`echo ${OPENSSL_VERSION} | awk '{print substr($1, 1, length($1)-1)}'`
wget https://www.openssl.org/source/old/${VRS}/openssl-${OPENSSL_VERSION}.tar.gz
tar -xvzf openssl-${OPENSSL_VERSION}.tar.gz
cd openssl-${OPENSSL_VERSION}
./config --prefix=/tmp/openssl --openssldir=/tmp/openssl/ssl
make -j64
make install
popd
MY_CONF+=( --with-ssl=/tmp/openssl --enable-ssl=${mod_type} )
else
MY_CONF+=( --with-ssl --enable-ssl=${mod_type} )
fi
MY_MODS+=( ssl )
else
MY_CONF+=( --without-ssl --disable-ssl )
fi

I have a variable OPENSSL_VERSION to control the logic so that I can match the version from openssl-compat package. If the variable is empty the logic is the same from original apache-2.eclass.

Thank you,
Ventura
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1660

PostPosted: Mon Mar 25, 2024 1:09 pm    Post subject: Reply with quote

This is dangerous and insane plus it breaks the sandbox so not likely to work.

The real unanswered question is why keep 1.1.1? If it is missing ciphers for ancient SSL stacks, then there is the weak-ssl-ciphers USE on 3.0 to bring in many of them from 1.1
Back to top
View user's profile Send private message
jorge.ventura
n00b
n00b


Joined: 08 Mar 2016
Posts: 8

PostPosted: Mon Mar 25, 2024 8:59 pm    Post subject: Reply with quote

grknight wrote:
This is dangerous and insane plus it breaks the sandbox so not likely to work.

The real unanswered question is why keep 1.1.1? If it is missing ciphers for ancient SSL stacks, then there is the weak-ssl-ciphers USE on 3.0 to bring in many of them from 1.1



I have to support legacy systems with no firmware update.

By the way it's already working.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1660

PostPosted: Mon Mar 25, 2024 10:05 pm    Post subject: Reply with quote

Quote:
I have to support legacy systems with no firmware update.

Fine, but you still haven't explained anything. Still sounds like an XY Problem without context and what does not work.

jorge.ventura wrote:
By the way it's already working.

Hopefully no one accesses your system and does 'ln -s /usr /tmp/openssl' since tmp is usually writable by everyone. Portage provides ${T} to avoid crazy ideas like using /tmp in a build.
Back to top
View user's profile Send private message
jorge.ventura
n00b
n00b


Joined: 08 Mar 2016
Posts: 8

PostPosted: Mon Mar 25, 2024 11:11 pm    Post subject: [SOLVED] How to know if the install is a binary install ? Reply with quote

grknight wrote:
This is dangerous and insane plus it breaks the sandbox so not likely to work.

The real unanswered question is why keep 1.1.1? If it is missing ciphers for ancient SSL stacks, then there is the weak-ssl-ciphers USE on 3.0 to bring in many of them from 1.1


Your comment did help me to do what I was trying to do. Here is the new code:

Quote:
# Install openssl version 1 under ${T}
if [[ -n "${OPENSSL_VERSION}" ]];then
pushd .
if [ "${MERGE_TYPE}" == "buildonly" ]; then
cd ${T}
VRS=`echo ${OPENSSL_VERSION} | awk '{print substr($1, 1, length($1)-1)}'`
wget https://www.openssl.org/source/old/${VRS}/openssl-${OPENSSL_VERSION}.tar.gz
tar -xvf openssl-${OPENSSL_VERSION}.tar.gz
cd openssl-${OPENSSL_VERSION}
./config --prefix=${T}/openssl-${OPENSSL_VERSION}/instdir --openssldir=${T}/openssl-${OPENSSL_VERSION}/instdir/ssl
make -j64
make install
elog
elog "openssl-${OPENSSL_VERSION} was compiled"
elog "MERGE_TYPE: ${MERGE_TYPE}"
elog
fi
popd
MY_CONF+=( --with-ssl=${T}/openssl-${OPENSSL_VERSION}/instdir --enable-ssl=${mod_type} )
else
MY_CONF+=( --with-ssl --enable-ssl=${mod_type} )
fi


1. Using ${T}, I moved the openssl-1.1.1u to be compiled inside sandbox.

2. The variable ${MERGE_TYPE} is the answer of my question. Using in the logic help to avoid recompile openssl if it was before.

Thank you so much.
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