开发者

How are open source projects commonly organized and deployed? [closed]

开发者 https://www.devze.com 2022-12-15 18:22 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 7 years ago.

Improve this question

I am looking for documentation on how to commonly do the technical part of publishing the source of first open source projects, in particular with library-intensive stuff in C/C++, Java, Python.

To give an example, if I built a C++ project with an IDE like Netbeans and various libraries like Xerces开发者_如何转开发-C and Boost, I would like to find out about these questions:

  • which are the most common tools to organize the build process for such a process outside of my own environment, and more importantly

  • how do I learn them in the way that it is 'generally being done' ? I use many open source projects and can certainly read the build code (makefiles and config options and so on), but that doesn't tell me how to get there, what are the important details and what is generally expected.

  • is there for specific languages (like the ones mentioned) something like a 'coding style' guidance on deployment ? Are there open source projects that have guidelines on that ?

  • when deploying source code (rather than packages with apt/port/etc, where you can resolve dependencies), what is the typical way to deploy library dependencies ?

I know that I can read all the manpages and all the documentation, but I would like to read about the 'conventions' and how they are implemented and expected rather than all the possible technical options.

I found this one on another stackoverflow post, it's nice, but not very specific: http://producingoss.com/en/producingoss.html


Let's look at one of open-source features. If you want to learn how it's deployed, download a couple of similar open-source projects and learn from them. So, find one that's done like yours and study its sources.

Why should it help? The thing is that open-source projects have to be able to build on users' machines easily. Otherwise noone will be able to contribute to them. Therefore all necessary information about how they should be deployed is usually included in INSTALL or README files witihn the sources you downloaded. They usually consist of several simple steps. For the same purpose, checking availability and versions of prerequisites is automated (in configure scripts), and sometimes such scripts even aid in installing them.

What is generally expected is something like

# Download sources (this line is read from your website)
wget http://myapp.org/myapp-source-2.15.tgz
tar -xzf myapp-source-2.15.tgz
cd myapp-2.15
less INSTALL
# read INSTALL file, where instructions about installing prerequisites are
./configure --help
# Read help, learn about possible options
./configure --prefix=/install/here --without-sound
make
make install

Nowadays some applications use cmake instead of autotools (the stufff with configure script).

I doubt that Linux projects actually requires NetBeans as a build system--that would be an overkill. But this IDE seems to generate makefiles, so ship them. You may also commit IDE-specific porject files into repository, for convenience, but it shouldn't be the primary way of building your soft.

There're some more things users expect to find in your package:

  • Licensing information (usually in LICENSE file and at the beginning of every source file as well)
  • Link to project homepage (where to report bugs)
  • Coding guidelines (as a text flie)
  • Information for maintainers (how to bump version, how to add module, etc)


You could start with http://llvm.org/docs/DeveloperPolicy.html and http://llvm.org/docs/CodingStandards.html. The LLVM project is a very well organized opensource project.


As you seem to be writing Linux apps, you might want to take a look at the GNU autotools such as autoconf. There is actually a good book on them, and they will handle most dependency problems for you.


I recommend this: http://producingoss.com/

This book explains most of the commonly used procedures, as well as lots of social things, f.e. how to cope with contributors.


What is you are looking for is build-system++

If you develop for POSIX (linux) platforms or you work only with MingW under Win32 that I would suggest to learn how to work with autotools -- autoconf/automake/libtool and friends.

It gives you, source-code packaging, configuration, testing, installation. They are firendly for distribution packagers (deb/rpm).

They have quite steep learning curve, but they are very powerful tools for these tasks.

However, if you want to support MSVC compiler, I would suggest to take a look on CMake, IMHO it is less powerful and requires much more writing, but you would need this for Windows with all dllexport/import issues (or, in less gentle words -- crap).

This is what you are looking for.

0

精彩评论

暂无评论...
验证码 换一张
取 消