Where should I put my source code? [duplicate]

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











up vote
0
down vote

favorite













This question already has an answer here:



  • Standard location for holding software source files

    4 answers



I am using multiple tools developed by the suckless people which are not configured via a config file but via their source code (in this case C) and then simply installed through make install. So I am maintaining my own repos (need continuous changes) of these programs. The question is where should i put these repos? Directorys like /usr or /usr/local/share are for reference purpose. Is it /opt, /srv or should i just collect them somewhere in my home directory?










share|improve this question













marked as duplicate by thrig, Kusalananda, Stephen Kitt, Christopher, Isaac Aug 23 at 17:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Also: unix.stackexchange.com/questions/56394/…
    – Kusalananda
    Aug 23 at 14:15










  • Also: unix.stackexchange.com/questions/30/…
    – Kusalananda
    Aug 23 at 14:15










  • apparently i didn't make it clear enough that these projects need need constant editing/recompiling. i read these answers before posting and they more or less suggest to use /usr/src. the FHS however says "only for reference purposes."
    – protolyse
    Aug 23 at 14:28











  • you should put it wherever makes you happy or most practical, there is no requirement, keeping thing simple and explicit is usually best. If it wasn't for how you worded your question i would not have commented; may i suggest /usr/local/bendover/ haha
    – ron
    Aug 23 at 15:52















up vote
0
down vote

favorite













This question already has an answer here:



  • Standard location for holding software source files

    4 answers



I am using multiple tools developed by the suckless people which are not configured via a config file but via their source code (in this case C) and then simply installed through make install. So I am maintaining my own repos (need continuous changes) of these programs. The question is where should i put these repos? Directorys like /usr or /usr/local/share are for reference purpose. Is it /opt, /srv or should i just collect them somewhere in my home directory?










share|improve this question













marked as duplicate by thrig, Kusalananda, Stephen Kitt, Christopher, Isaac Aug 23 at 17:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • Also: unix.stackexchange.com/questions/56394/…
    – Kusalananda
    Aug 23 at 14:15










  • Also: unix.stackexchange.com/questions/30/…
    – Kusalananda
    Aug 23 at 14:15










  • apparently i didn't make it clear enough that these projects need need constant editing/recompiling. i read these answers before posting and they more or less suggest to use /usr/src. the FHS however says "only for reference purposes."
    – protolyse
    Aug 23 at 14:28











  • you should put it wherever makes you happy or most practical, there is no requirement, keeping thing simple and explicit is usually best. If it wasn't for how you worded your question i would not have commented; may i suggest /usr/local/bendover/ haha
    – ron
    Aug 23 at 15:52













up vote
0
down vote

favorite









up vote
0
down vote

favorite












This question already has an answer here:



  • Standard location for holding software source files

    4 answers



I am using multiple tools developed by the suckless people which are not configured via a config file but via their source code (in this case C) and then simply installed through make install. So I am maintaining my own repos (need continuous changes) of these programs. The question is where should i put these repos? Directorys like /usr or /usr/local/share are for reference purpose. Is it /opt, /srv or should i just collect them somewhere in my home directory?










share|improve this question














This question already has an answer here:



  • Standard location for holding software source files

    4 answers



I am using multiple tools developed by the suckless people which are not configured via a config file but via their source code (in this case C) and then simply installed through make install. So I am maintaining my own repos (need continuous changes) of these programs. The question is where should i put these repos? Directorys like /usr or /usr/local/share are for reference purpose. Is it /opt, /srv or should i just collect them somewhere in my home directory?





This question already has an answer here:



  • Standard location for holding software source files

    4 answers







filesystems source root-filesystem






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 23 at 13:55









protolyse

82




82




marked as duplicate by thrig, Kusalananda, Stephen Kitt, Christopher, Isaac Aug 23 at 17:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by thrig, Kusalananda, Stephen Kitt, Christopher, Isaac Aug 23 at 17:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • Also: unix.stackexchange.com/questions/56394/…
    – Kusalananda
    Aug 23 at 14:15










  • Also: unix.stackexchange.com/questions/30/…
    – Kusalananda
    Aug 23 at 14:15










  • apparently i didn't make it clear enough that these projects need need constant editing/recompiling. i read these answers before posting and they more or less suggest to use /usr/src. the FHS however says "only for reference purposes."
    – protolyse
    Aug 23 at 14:28











  • you should put it wherever makes you happy or most practical, there is no requirement, keeping thing simple and explicit is usually best. If it wasn't for how you worded your question i would not have commented; may i suggest /usr/local/bendover/ haha
    – ron
    Aug 23 at 15:52

















  • Also: unix.stackexchange.com/questions/56394/…
    – Kusalananda
    Aug 23 at 14:15










  • Also: unix.stackexchange.com/questions/30/…
    – Kusalananda
    Aug 23 at 14:15










  • apparently i didn't make it clear enough that these projects need need constant editing/recompiling. i read these answers before posting and they more or less suggest to use /usr/src. the FHS however says "only for reference purposes."
    – protolyse
    Aug 23 at 14:28











  • you should put it wherever makes you happy or most practical, there is no requirement, keeping thing simple and explicit is usually best. If it wasn't for how you worded your question i would not have commented; may i suggest /usr/local/bendover/ haha
    – ron
    Aug 23 at 15:52
















Also: unix.stackexchange.com/questions/56394/…
– Kusalananda
Aug 23 at 14:15




Also: unix.stackexchange.com/questions/56394/…
– Kusalananda
Aug 23 at 14:15












Also: unix.stackexchange.com/questions/30/…
– Kusalananda
Aug 23 at 14:15




Also: unix.stackexchange.com/questions/30/…
– Kusalananda
Aug 23 at 14:15












apparently i didn't make it clear enough that these projects need need constant editing/recompiling. i read these answers before posting and they more or less suggest to use /usr/src. the FHS however says "only for reference purposes."
– protolyse
Aug 23 at 14:28





apparently i didn't make it clear enough that these projects need need constant editing/recompiling. i read these answers before posting and they more or less suggest to use /usr/src. the FHS however says "only for reference purposes."
– protolyse
Aug 23 at 14:28













you should put it wherever makes you happy or most practical, there is no requirement, keeping thing simple and explicit is usually best. If it wasn't for how you worded your question i would not have commented; may i suggest /usr/local/bendover/ haha
– ron
Aug 23 at 15:52





you should put it wherever makes you happy or most practical, there is no requirement, keeping thing simple and explicit is usually best. If it wasn't for how you worded your question i would not have commented; may i suggest /usr/local/bendover/ haha
– ron
Aug 23 at 15:52











2 Answers
2






active

oldest

votes

















up vote
2
down vote



accepted










If you’re installing the software in /usr/local, I would use /usr/local/src — that’s the local variant of /usr/src, of which the FHS says




Source code may be placed in this subdirectory, only for reference purposes.




with a footnote adding that




Generally, source should not be built within this hierarchy.




It’s your system though so in my opinion /usr/local/src is fair game.



What is the "/usr/local/src" folder meant for? has more on the topic; read this answer in particular.



The general idea is to do your work in your home directory, but ensure that the source code to anything installed in /usr/local be at least copied for reference in /usr/local/src, so that local binaries can be rebuilt without needing a specific user’s home directory.






share|improve this answer




















  • So you're saying, since it is my system i can ignore the " ... source should not be built within this hierarchy" ?
    – protolyse
    Aug 23 at 14:23











  • Right, /usr/local is really your domain; it’s helpful to use it in a way which matches the equivalents in /usr, but you don’t have to. Where things get a bit complicated if you try to work inside /usr/local/src is that you shouldn’t build software as root, only become root to install it; one way to deal with that is to make /usr/local/src owned by a src group, setgid, and add yourself to that group (Debian used to configure systems in that way).
    – Stephen Kitt
    Aug 23 at 14:31










  • Ok thanks I think this solves my problem. I guess the question should've been "what is a proper workflow/setup"
    – protolyse
    Aug 23 at 14:47










  • @protolyse It's up to you. If several people are working against the same repository, it makes most sense for them to have private clones of it in their home directories somewhere.
    – Kusalananda
    Aug 23 at 15:41


















up vote
0
down vote













I consulted the Linux manual, specifically the page about filesystem hierarchy (man hier)



/usr/local/src
Source code for locally installed software.
[...]

/usr/src
Source files for different parts of the system, included with
some packages for reference purposes. Don't work here with
your own projects, as files below /usr should be read-only
except when installing software (optional).

/usr/src/linux
This was the traditional place for the kernel source. Some
distributions put here the source for the default kernel they
ship. You should probably use another directory when building
your own kernel.





share|improve this answer



























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote



    accepted










    If you’re installing the software in /usr/local, I would use /usr/local/src — that’s the local variant of /usr/src, of which the FHS says




    Source code may be placed in this subdirectory, only for reference purposes.




    with a footnote adding that




    Generally, source should not be built within this hierarchy.




    It’s your system though so in my opinion /usr/local/src is fair game.



    What is the "/usr/local/src" folder meant for? has more on the topic; read this answer in particular.



    The general idea is to do your work in your home directory, but ensure that the source code to anything installed in /usr/local be at least copied for reference in /usr/local/src, so that local binaries can be rebuilt without needing a specific user’s home directory.






    share|improve this answer




















    • So you're saying, since it is my system i can ignore the " ... source should not be built within this hierarchy" ?
      – protolyse
      Aug 23 at 14:23











    • Right, /usr/local is really your domain; it’s helpful to use it in a way which matches the equivalents in /usr, but you don’t have to. Where things get a bit complicated if you try to work inside /usr/local/src is that you shouldn’t build software as root, only become root to install it; one way to deal with that is to make /usr/local/src owned by a src group, setgid, and add yourself to that group (Debian used to configure systems in that way).
      – Stephen Kitt
      Aug 23 at 14:31










    • Ok thanks I think this solves my problem. I guess the question should've been "what is a proper workflow/setup"
      – protolyse
      Aug 23 at 14:47










    • @protolyse It's up to you. If several people are working against the same repository, it makes most sense for them to have private clones of it in their home directories somewhere.
      – Kusalananda
      Aug 23 at 15:41















    up vote
    2
    down vote



    accepted










    If you’re installing the software in /usr/local, I would use /usr/local/src — that’s the local variant of /usr/src, of which the FHS says




    Source code may be placed in this subdirectory, only for reference purposes.




    with a footnote adding that




    Generally, source should not be built within this hierarchy.




    It’s your system though so in my opinion /usr/local/src is fair game.



    What is the "/usr/local/src" folder meant for? has more on the topic; read this answer in particular.



    The general idea is to do your work in your home directory, but ensure that the source code to anything installed in /usr/local be at least copied for reference in /usr/local/src, so that local binaries can be rebuilt without needing a specific user’s home directory.






    share|improve this answer




















    • So you're saying, since it is my system i can ignore the " ... source should not be built within this hierarchy" ?
      – protolyse
      Aug 23 at 14:23











    • Right, /usr/local is really your domain; it’s helpful to use it in a way which matches the equivalents in /usr, but you don’t have to. Where things get a bit complicated if you try to work inside /usr/local/src is that you shouldn’t build software as root, only become root to install it; one way to deal with that is to make /usr/local/src owned by a src group, setgid, and add yourself to that group (Debian used to configure systems in that way).
      – Stephen Kitt
      Aug 23 at 14:31










    • Ok thanks I think this solves my problem. I guess the question should've been "what is a proper workflow/setup"
      – protolyse
      Aug 23 at 14:47










    • @protolyse It's up to you. If several people are working against the same repository, it makes most sense for them to have private clones of it in their home directories somewhere.
      – Kusalananda
      Aug 23 at 15:41













    up vote
    2
    down vote



    accepted







    up vote
    2
    down vote



    accepted






    If you’re installing the software in /usr/local, I would use /usr/local/src — that’s the local variant of /usr/src, of which the FHS says




    Source code may be placed in this subdirectory, only for reference purposes.




    with a footnote adding that




    Generally, source should not be built within this hierarchy.




    It’s your system though so in my opinion /usr/local/src is fair game.



    What is the "/usr/local/src" folder meant for? has more on the topic; read this answer in particular.



    The general idea is to do your work in your home directory, but ensure that the source code to anything installed in /usr/local be at least copied for reference in /usr/local/src, so that local binaries can be rebuilt without needing a specific user’s home directory.






    share|improve this answer












    If you’re installing the software in /usr/local, I would use /usr/local/src — that’s the local variant of /usr/src, of which the FHS says




    Source code may be placed in this subdirectory, only for reference purposes.




    with a footnote adding that




    Generally, source should not be built within this hierarchy.




    It’s your system though so in my opinion /usr/local/src is fair game.



    What is the "/usr/local/src" folder meant for? has more on the topic; read this answer in particular.



    The general idea is to do your work in your home directory, but ensure that the source code to anything installed in /usr/local be at least copied for reference in /usr/local/src, so that local binaries can be rebuilt without needing a specific user’s home directory.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Aug 23 at 14:16









    Stephen Kitt

    146k22320386




    146k22320386











    • So you're saying, since it is my system i can ignore the " ... source should not be built within this hierarchy" ?
      – protolyse
      Aug 23 at 14:23











    • Right, /usr/local is really your domain; it’s helpful to use it in a way which matches the equivalents in /usr, but you don’t have to. Where things get a bit complicated if you try to work inside /usr/local/src is that you shouldn’t build software as root, only become root to install it; one way to deal with that is to make /usr/local/src owned by a src group, setgid, and add yourself to that group (Debian used to configure systems in that way).
      – Stephen Kitt
      Aug 23 at 14:31










    • Ok thanks I think this solves my problem. I guess the question should've been "what is a proper workflow/setup"
      – protolyse
      Aug 23 at 14:47










    • @protolyse It's up to you. If several people are working against the same repository, it makes most sense for them to have private clones of it in their home directories somewhere.
      – Kusalananda
      Aug 23 at 15:41

















    • So you're saying, since it is my system i can ignore the " ... source should not be built within this hierarchy" ?
      – protolyse
      Aug 23 at 14:23











    • Right, /usr/local is really your domain; it’s helpful to use it in a way which matches the equivalents in /usr, but you don’t have to. Where things get a bit complicated if you try to work inside /usr/local/src is that you shouldn’t build software as root, only become root to install it; one way to deal with that is to make /usr/local/src owned by a src group, setgid, and add yourself to that group (Debian used to configure systems in that way).
      – Stephen Kitt
      Aug 23 at 14:31










    • Ok thanks I think this solves my problem. I guess the question should've been "what is a proper workflow/setup"
      – protolyse
      Aug 23 at 14:47










    • @protolyse It's up to you. If several people are working against the same repository, it makes most sense for them to have private clones of it in their home directories somewhere.
      – Kusalananda
      Aug 23 at 15:41
















    So you're saying, since it is my system i can ignore the " ... source should not be built within this hierarchy" ?
    – protolyse
    Aug 23 at 14:23





    So you're saying, since it is my system i can ignore the " ... source should not be built within this hierarchy" ?
    – protolyse
    Aug 23 at 14:23













    Right, /usr/local is really your domain; it’s helpful to use it in a way which matches the equivalents in /usr, but you don’t have to. Where things get a bit complicated if you try to work inside /usr/local/src is that you shouldn’t build software as root, only become root to install it; one way to deal with that is to make /usr/local/src owned by a src group, setgid, and add yourself to that group (Debian used to configure systems in that way).
    – Stephen Kitt
    Aug 23 at 14:31




    Right, /usr/local is really your domain; it’s helpful to use it in a way which matches the equivalents in /usr, but you don’t have to. Where things get a bit complicated if you try to work inside /usr/local/src is that you shouldn’t build software as root, only become root to install it; one way to deal with that is to make /usr/local/src owned by a src group, setgid, and add yourself to that group (Debian used to configure systems in that way).
    – Stephen Kitt
    Aug 23 at 14:31












    Ok thanks I think this solves my problem. I guess the question should've been "what is a proper workflow/setup"
    – protolyse
    Aug 23 at 14:47




    Ok thanks I think this solves my problem. I guess the question should've been "what is a proper workflow/setup"
    – protolyse
    Aug 23 at 14:47












    @protolyse It's up to you. If several people are working against the same repository, it makes most sense for them to have private clones of it in their home directories somewhere.
    – Kusalananda
    Aug 23 at 15:41





    @protolyse It's up to you. If several people are working against the same repository, it makes most sense for them to have private clones of it in their home directories somewhere.
    – Kusalananda
    Aug 23 at 15:41













    up vote
    0
    down vote













    I consulted the Linux manual, specifically the page about filesystem hierarchy (man hier)



    /usr/local/src
    Source code for locally installed software.
    [...]

    /usr/src
    Source files for different parts of the system, included with
    some packages for reference purposes. Don't work here with
    your own projects, as files below /usr should be read-only
    except when installing software (optional).

    /usr/src/linux
    This was the traditional place for the kernel source. Some
    distributions put here the source for the default kernel they
    ship. You should probably use another directory when building
    your own kernel.





    share|improve this answer
























      up vote
      0
      down vote













      I consulted the Linux manual, specifically the page about filesystem hierarchy (man hier)



      /usr/local/src
      Source code for locally installed software.
      [...]

      /usr/src
      Source files for different parts of the system, included with
      some packages for reference purposes. Don't work here with
      your own projects, as files below /usr should be read-only
      except when installing software (optional).

      /usr/src/linux
      This was the traditional place for the kernel source. Some
      distributions put here the source for the default kernel they
      ship. You should probably use another directory when building
      your own kernel.





      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        I consulted the Linux manual, specifically the page about filesystem hierarchy (man hier)



        /usr/local/src
        Source code for locally installed software.
        [...]

        /usr/src
        Source files for different parts of the system, included with
        some packages for reference purposes. Don't work here with
        your own projects, as files below /usr should be read-only
        except when installing software (optional).

        /usr/src/linux
        This was the traditional place for the kernel source. Some
        distributions put here the source for the default kernel they
        ship. You should probably use another directory when building
        your own kernel.





        share|improve this answer












        I consulted the Linux manual, specifically the page about filesystem hierarchy (man hier)



        /usr/local/src
        Source code for locally installed software.
        [...]

        /usr/src
        Source files for different parts of the system, included with
        some packages for reference purposes. Don't work here with
        your own projects, as files below /usr should be read-only
        except when installing software (optional).

        /usr/src/linux
        This was the traditional place for the kernel source. Some
        distributions put here the source for the default kernel they
        ship. You should probably use another directory when building
        your own kernel.






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 23 at 16:38









        loa_in_

        22717




        22717












            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?