2

I'm currently building a large package which is handled with automake. Package is composed by C,C++ and Python. So far i have good results with C/C++ but i'm blocked when it comes to python dependencies.

I personnaly run a script when i'm installing, and i'd like to run it whenever make install is called. For now it's called by configure.ac but it's run at unecessary times.

The script is doing 3 things :

  • Placing some python files in /usr/local/lib/python2.7/(dist|site)-packages
  • Installing a homemade python module
  • Checking for python & program dependencies such as geckodriver and install those if necessary

I know that makefiles generated by automake are "creating commands" that are triggered when install or uninstall by example, and i'd like to know how to tell makefile.am to call somescript.sh when install is called and to call someOtherscript.sh when uninstall is called to remove what my program installed.

A bit like preinst script in debian packages.

0

I eventually found a way to handle python with autotools. Makefile.am allow you to override install and uninstall like this :

install-exec-local:
    cd src/ && python setup.py install --record $(pythondir)/installed_files.txt

uninstall-local:
    cat $(pythondir)/installed_files.txt | xargs rm -rf \
    rm -r $(sysconfdir)/nina

special thanks to Kevin Brown for his amazing tutorial.

https://blog.kevin-brown.com/programming/2014/09/24/combining-autotools-and-setuptools.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.