1

I am trying to build nano package in focal fossa:

sudo apt-get build-dep nano
export CFLAGS=-static
export LDFLAGS=-static
export CPPFLAGS=-static
export CFLAGS_APPEND=-static
export LDFLAGS_APPEND=-static
export CPPFLAGS_APPEND=-static
export PREFIX=/Opt/nano
apt-get source --build nano

Basically i'm trying to build an package static with a custom installation directory, but not working, the generated .deb file does not have "/Opt/" as root, the root is still as "/".

I have done build other programs like nginx from tar sources from github, using a command like this:

./configure --prefix=/Opt/nginx --with-cc-opt='-static --static-libgcc' --with-ld-opt='-static'

But I don't know how to apply it to the build procedure with apt-get, for example1:

sudo apt-get build-dep nano
export CFLAGS=-static
export LDFLAGS=-static
export CPPFLAGS=-static
export CFLAGS_APPEND=-static
export LDFLAGS_APPEND=-static
export CPPFLAGS_APPEND=-static
apt-get source --build --prefix=/Opt/nano nano

not works, Or for example2:

sudo apt-get build-dep nano
export CFLAGS=-static
export LDFLAGS=-static
export CPPFLAGS=-static
export CFLAGS_APPEND=-static
export LDFLAGS_APPEND=-static
export CPPFLAGS_APPEND=-static
cd nano-4.8
./configure --prefix=/Opt/nano --with-cc-opt='-static --static-libgcc' --with-ld-opt='-static'
cd ..
apt-get source --build nano

Example2, Give me an error:

bash: ./configure: No such file or directory

Even if it doesn't generate a .deb but lets me run "make install" so it's properly installed to "/Opt/nano" it would be useful. Do you know any solution?

0 Answers0