0

I need to have a script that will install a package from source in a Linux system and need to know how to take care of the errors that usually come up as a result of the first step ./configure maybe a package is missing his will just kill the process and will not completely configure the package from the given source.

I have a script that is a normal bash organized in that it will

  1. unpack the sources tar
  2. cd into the directory
  3. Run ./configure

I need help to make sure that for example If the package was GNUCASH and running ./configure returns

     Package libxml-2.0 was not found in the pkg-config search path. 
     Perhaps you should add the directory containing `libxml-2.0.pc' to the
     PKG_CONFIG_PATH environment variable No package 'libxml-2.0' found
     configure: error: Library requirements (libxml-2.0 >= 2.5.10) not met;consider     

     adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a  
     nonstandard prefix so pkg-config can find them.

My script will take care of the missing libxml package or at least help the end user to troubleshoot the process automatically in order to make sure all the steps of the BUILD process are taken and each error that may occur will be taken care of.

Gideon Maina
  • 111
  • 4
  • This has been resolved multiple times by multiple packaging systems already. The approach taken by both RPM and Debian is to create a build wrapper which reads the dependencies from a simple spec file. This needs to be maintained by hand for every package, but there are so many other things you need to tweak anyway that this is a minor nuisance. – tripleee Mar 06 '15 at 13:04

1 Answers1

1

I think you should install dependencies first because you know what package is needed, not the Users.

Summer Nguyen
  • 214
  • 3
  • 10
  • Hi Summer you have an application that is in source it's very hard to know what the ./configure command will not find on your system. It may be libxml libgoffice or any other package not on your system that you are building from. – Gideon Maina Mar 01 '15 at 15:43
  • Hi, I think that you have better skills than end users. So, if you think "it's very hard to know" , how can end users know ?. Have you ever built .rpm or .deb packages ? You have to define dependencies for the package you buid. Ahh, build a rpm or deb packages may be a good solution. In this case, end users will install the package very quicky instead of waiting for compiling from source. P.S: You can check out this:[https://github.com/jordansissel/fpm] for build the .deb or rpm package. P.S 2:You can use VirtualBox to create Minimum installation of the OS, compile from it, find dependencies. – Summer Nguyen Mar 01 '15 at 15:57
  • Good I will follow that and use Debian tools to make and build the source to a Debian package. Thanks – Gideon Maina Mar 01 '15 at 17:27