Specify script to run with install command automake

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
1












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.










share|improve this question



























    up vote
    2
    down vote

    favorite
    1












    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.










    share|improve this question

























      up vote
      2
      down vote

      favorite
      1









      up vote
      2
      down vote

      favorite
      1






      1





      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.










      share|improve this question















      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.







      bash make automake autotools






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 21 at 12:42









      Rui F Ribeiro

      36.7k1271116




      36.7k1271116










      asked Mar 1 '17 at 14:25









      Neah-Ko

      285




      285




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          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






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f348398%2fspecify-script-to-run-with-install-command-automake%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote



            accepted










            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






            share|improve this answer
























              up vote
              0
              down vote



              accepted










              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






              share|improve this answer






















                up vote
                0
                down vote



                accepted







                up vote
                0
                down vote



                accepted






                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






                share|improve this answer












                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







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 8 '17 at 10:11









                Neah-Ko

                285




                285



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f348398%2fspecify-script-to-run-with-install-command-automake%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?