Source code examples for RPM use cases
Source code is human-readable instructions to the computer that describe how to perform a computation. Source code is expressed by using a programming language.
The following versions of the Hello World program written in three different programming languages cover major RPM Package Manager use cases:
Hello Worldwritten in BashThe bello project implements
Hello Worldin Bash. The implementation contains only thebelloshell script. The purpose of this program is to outputHello Worldon the command line.The
bellofile has the following contents:#!/bin/bash printf "Hello World\n"
Hello Worldwritten in PythonThe pello project implements
Hello Worldin Python. The implementation contains only thepello.pyprogram. The purpose of the program is to outputHello Worldon the command line.The
pello.pyfile has the following contents:#!/usr/bin/python3 print("Hello World")
Hello Worldwritten in CThe cello project implements
Hello Worldin C. The implementation contains only thecello.candMakefilefiles. The resultingtar.gzarchive therefore has two files in addition to theLICENSEfile. The purpose of the program is to outputHello Worldon the command line.The
cello.cfile has the following contents:#include <stdio.h> int main(void) { printf("Hello World\n"); return 0; }
Hello World program.