Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

For our company needs, we need to sell one of our software on *nix-like system. How can we distribute and protect our software ?

I know that almost every program on linux is open-source, so how can we protect source code ?

Do we need distribute part of source code in object files ?

Software written in C.

share|improve this question

migrated from stackoverflow.com Jun 14 '11 at 20:17

This question came from our site for professional and enthusiast programmers.

1  
@twoface88: Source code protection really a common illusion –  Predator Jun 14 '11 at 19:15
    
Edited the title to make the question more obvious from the front page –  jkerian Jun 14 '11 at 19:25
add comment

5 Answers

You can distribute your program for Linux just as you would for Windows, by shipping your compiled code with any resources it will use. You don't need to include the source (unless your product is derived from GPL code). Just build without symbols and distribute the binaries. You'll probably want to statically link libraries to make distribution simpler.

share|improve this answer
1  
Do i need to have compiled version for every *nix-like system ? ubuntu, freebsd, centos, etc ? –  twoface88 Jun 14 '11 at 19:17
    
FreeBSD uses a different ABI, so yes you would, unless your customer's FreeBSD system uses a linux-compat layer. Ubuntu and CentOS will probably need different packages as their package managers are very different (apt vs the RPM-based yum). –  yan Jun 14 '11 at 19:26
1  
yan's last comment about "You'll probably want to statically link libraries to make distribution simpler" is pretty important here. Some libraries like glibc are pretty good at controlling their versioning, but many are not. It's not the distribution that will give you trouble, it's the supported software in each distribution. (For example, how many versions of Debian will you be supporting?) –  jkerian Jun 14 '11 at 19:30
    
all of most popular *nix systems –  twoface88 Jun 14 '11 at 19:59
    
One note about distribution avenues: If your selling a CD containing a package (.deb or .rpm etc) then you can't do this, but if your binary is freely available and you sell a license key that you use to activate the software, then you can create your own software repository. This makes distributing binaries and updates to your users easier by leveraging the existing package management systems. –  Jeff Welling Jun 14 '11 at 20:46
show 1 more comment

There is no requirement to distribute your software as open source. You protect your commercial software with a licence agreement - whether open source or not.

share|improve this answer
add comment

You can simply build an installer package exactly as you would on windows.
Redhat's .rpm and Debian/ubuntus .deb - are basically the same concept as Microsoft's MSI.

There are other package formats but almost everybody can use these two.

For details of the tools and steps needed to create the packages see:
Packaging software with RPM
Basics of the Debian package management system

share|improve this answer
    
If only there were an apt-get equivalent for MSI... –  dan04 Jun 15 '11 at 0:08
2  
@dan04, try the --credit_card_details and --keep_paying_for_new_versions flags –  Martin Beckett Jun 15 '11 at 2:22
add comment

There are many Software companies specializing in the protection of Software.

A good sample is the commercial application "GuardIT for Linux" what protects against reverse engineering and tampering: http://www.arxan.com/software-protection-products/embedded-linux-GuardIt/index.php

You can also obfuscate part of the code yourself to make reverse engineering a little bit more difficult. Crash course in code obfuscation: http://www.brandonparker.net/code_obf.php

share|improve this answer
    
That's good and accurate advice, but I'm not sure the questioner know that reverse engineering exists. In Windows or Linux. –  Philip Jun 14 '11 at 21:30
add comment

If making the source code available is impossible (for business reasons), the answer is simple: You ship the compiled binary. This means that you won't be able to leverage the various *nix package managers to handle compilation for you across the platforms you will support, but that's the tradeoff you make by not making your source code available.

Otherwise, you use a proprietary/commercial license and trust your users, just like many companies that target commercial code for *nix platforms.

share|improve this answer
    
most *nix package formats allow binary packages. –  Tim Williscroft Jun 15 '11 at 1:30
    
@Tim yes, but most don't allow closed source packages. In any event, they wouldn't be able to build the binaries if they don't have the source, which is the point of leveraging the package distributors. –  Rein Henrichs Jun 15 '11 at 1:34
    
if you're selling software you will have to run your own repository. –  Tim Williscroft Jun 15 '11 at 1:43
    
@Tim what's your point? –  Rein Henrichs Jun 15 '11 at 1:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.