-1

I am naive programmer, may be my question will be stupid. But still, my question becomes headache. I have following questions.

suppose i am performing some task like printing hello on monitor screen. Then which is better way to write this task into package or application? But i know, if package is required, then should be included into recipe of build.

Questions:
1. What is the difference between package and application in linux?
2. How to decide, whether task should be written into package or application? I means, what is deciding factor that task should be package or application in linux?

Regards
Linux Learner.

Embedded Programmer
  • 519
  • 4
  • 8
  • 22
  • You write userspace code for an application program. Packages are not a coding concern, but are for **system integration** or **maintenance** to deliver and install files. – sawdust Sep 26 '13 at 10:30

1 Answers1

1

Many newbies confuse the terms recipe, package and application. An application is simply a program that runs and does something. It might be a single binary executable image, such as your hello world example, or it might be composed of several binary executable files and a collection of shared libraries, modules and configuration files, such as Apache.

In Linux, the term "package" has its own special meaning. A package can be though of as a "collection of related files" containing whatever you want in it. There are several popular package formats, with the most popular being .deb (Debian) and .rpm (Redhat Package Manager). Another format popular with embedded developers is .ipk, which is basically a lightweight package format more suitable for embedded. Virtually anyone familiar with Linux has done operations with packages. Debian-based distributions use apt-get and other utilities for adding and deleting packages from their system. Fedora and others use the yum and/or rpm utility. For embedded systems using .ipk, one uses opkg* for managing packages.

A "recipe" in openembedded and Yocto Project terminology is a special file that ends in .bb, and contains metadata that describes how to build something, usually an image or an application program or shared library. By default a recipes produce several packages, but can produce many more (or even none.) For example, a typical recipe builds a binary package, a doc package, a -dev package containing headers and shared libs if applicable, and a -dbg package containing the binary with debug symbols.

If you build your application under openembedded or Yocto Project, a package containing your application will automatically be built. It's up to you how you use that package.

challinan
  • 2,584
  • 18
  • 13