Difference between revisions of "Build rpm packages with checkinstall"

From Linuxintro
imported>ThorstenStaerk
(Created page with "This is an example how to build rpm packages using the checkinstall tool. We will a program and create an rpm package from it.")
 
imported>ThorstenStaerk
Line 1: Line 1:
 
This is an example how to [[build rpm packages]] using the checkinstall tool. We will a program and create an [[rpm]] [[package]] from it.
 
This is an example how to [[build rpm packages]] using the checkinstall tool. We will a program and create an [[rpm]] [[package]] from it.
 +
 +
= The program =
 +
Here is our program, hello world:
 +
<pre>
 +
cat >main.c <<EOF
 +
#include <stdio.h>
 +
 +
int main()
 +
{
 +
  printf("hello world");
 +
}
 +
EOF
 +
</pre>
 +
 +
= The Makefile =
 +
To [[build]] our program, we need a [[makefile]]. Here is how we create it:
 +
<pre>
 +
cat >Makefile <<EOF
 +
all:hello
 +
 +
hello: main.c
 +
        gcc main.c -o hello
 +
EOF
 +
sed -i "s/        /\t/g" Makefile
 +
</pre>

Revision as of 15:59, 6 February 2011

This is an example how to build rpm packages using the checkinstall tool. We will a program and create an rpm package from it.

The program

Here is our program, hello world:

cat >main.c <<EOF
#include <stdio.h>

int main()
{
  printf("hello world");
}
EOF

The Makefile

To build our program, we need a makefile. Here is how we create it:

cat >Makefile <<EOF
all:hello

hello: main.c
        gcc main.c -o hello
EOF
sed -i "s/        /\t/g" Makefile