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.

1 Answer 1


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

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

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

special thanks to Kevin Brown for his amazing tutorial.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .