Packaging/rpm

In Mer we have tool package called spectacle that has collection of tools that are helping in some basics of packaging. In this guide the binary called specify is used to ease the start of the rpm packaging.

In this guide the package name is 'example-pkg and one should replace that with proper name when doing the own package.

Creating the initial version
specify --new=example-pkg This outputs the following lines Info: New spectacle yaml file created: example-pkg.yaml Q: Continue to edit the new file?(Y/n) After answering Y or pressing enter the default editor (vim) is started and template is shown. This template needs to be modified for your package needs. Name: ^^^ Summary: ^^^ Description: ^^^ Version: ^^^ Group: ^^^ Usually set to GPLv2, MIT or similar License: ^^^

Sources: List of source files one has in packaging. NOTE: patches have separate section. - ^^^ Requires: Packages that are required by this package, should be noted that dynamic library dependencies are automatically found by rpm and one doesn't need to list those here - ^^^ PkgBR: Package build requirements, these will appear as "BuildRequires: value" to .spec - ^^^ Package pkgconfig build requirements, these will appear as "BuildRequires: pkgconfig(value)" to .spec PkgConfigBR: - ^^^ In addition to the lines mentioned above following lines are often also used Patches: - ^^^ NoSetup: True Configure: none Builder: none
 * 1) Please replace all "^^^" with valid values, or remove the unused keys.
 * 2) And cleanup these comments lines for the best.

After saving and exiting the editor file called example-pkg.yaml is created to the current working directory.

From the .yaml file a .spec file is created with specify example-pkg.yaml This command returns some warning and/or errors depending on your .yaml file syntax validity.

After a successful run one should see following files in working directory example-pkg.spec example-pkg.yaml

# #  Name:       example-pkg Summary:   Example summary Version:   0.1 Release:   1 Group:     Example Group License:   GPLv2 Source100: example-pkg.yaml %description %{summary}. %prep %build %install rm -rf %{buildroot} %files %defattr(-,root,root,-)
 * 1) Do NOT Edit the Auto-generated Part!
 * 2) Generated by: spectacle version 0.25
 * 1) >> macros
 * 2) << macros
 * 1) >> setup
 * 2) << setup
 * 1) >> build pre
 * 2) << build pre
 * 1) >> build post
 * 2) << build post
 * 1) >> install pre
 * 2) << install pre
 * 1) >> install post
 * 2) << install post
 * 1) >> files
 * 2) << files