From Fedora Project Wiki
(Build section)
Line 38: Line 38:
== Build section ==
== Build section ==
Run command:
Run command:
  %{preupgrade_build} %{fedora_preupgrade_name}/%{name}/
  %{preupgrade_prep} %{fedora_preupgrade_name}/%{name}/
%{preupgrade_build} command has to success. Warning can be suppressed.
%{preupgrade_prep} command has to success. Warning can be suppressed.
== Install section ==
== Install section ==

Revision as of 13:17, 9 February 2015

This is a DRAFT.

Preupgrade Assistant contents Packaging guidelines

How to package a Preupgrade Assistant contents

Contents files are packaged as a subpackage of main package (e.g mariadb).

Naming guidelines

Every Preupgrade Assistant content subpackage name must start with preupgrade-assistant- followed by original package name.

For example Preupgrade Assistant content subpackage for mariadb will be named preupgrade-assistant-mariadb.


  • All packages must have
 Requires: preupgrade-assistant
 BuildRequires: preupgrade-assistant-devel

Devel package contains macros and contents validating check script.


  • All preupgrade-assistant-* subpackages must be architecture independent, i.e. have BuildArch: noarch.


  • Macro denoting the parent directory where the package files go is %{preupgrade_dir}. This currently expands to /usr/share/preupgrade.
  • Macro %{preupg_number} means source release from which the system is going to be upgraded, e.g. Fedora 22.
  • Macro %{postupg_number} means target release to which the system is going to be upgraded, e.g. Fedora 23.
  • Macro %{preupg_results} means where the contents files are generated
  • Macro %{fedora_preupgrade_name} means Fedora%{preupg_number}_%{postupg_number}, e.g. Fedora22_23
  • Macro %{fedora_preupgrade_dir} reference to /usr/share/preupgrade/%{fedora_preupgrade_name}

Prep section

Copy all contents files to %{fedora_preupgrade_name}/%{name} directory.

Content files are:

  • INI file
  • check_script (python or bash)
  • text file with solution description.

Build section

Run command:

%{preupgrade_prep} %{fedora_preupgrade_name}/%{name}/

%{preupgrade_prep} command has to success. Warning can be suppressed.

Install section

All files from preupgrade directory should be installed with

mkdir -p ${buildroot}%{fedora_preupgrade_dir}/%{name}
install -p -m 755 %{SourceY} ${buildroot}%{fedora_preupgrade_dir}/%{name}/
install -p -m 644 %{SourceZ} ${buildroot}%{fedora_preupgrade_dir}/%{name}/solution.txt
install -p -m 644 %{fedora_preupgrade_name}-%{preupg_results}/%{name}/group.xml ${buildroot}%{fedora_preupgrade_dir}/%{name}/group.xml

Files section

  • Directory where Preupgrade Assistant installs files and directories must be owned by the subpackage
%files -n preupgrade-assistant-%{name}
%dir %{fedora_preupgrade_dir}/%{name}
  • All files except text files should be listed like
%files -n preupgrade-assistant-%{name}
  • All text files from content should be listed via
%files -n preupgrade-assistant-%{name}
%doc %{fedora_preupgrade_dir}/%{name}/*.txt

Directory ownership

Directories %{preupgrade_dir} and %{fedora_preupgrade_dir} are owned by package preupgrade-assistant itself and should not be owned by your package.

Sample SPEC

Name:             foo
Version:          1.0
Release:          1%{?dist}
Summary:          An example package
License:          MIT

Source1:          foo.ini
Source3:          foo.txt

[Bulk of foo packaging elided]

%package -n preupgrade-assistant-%{name}
BuildRequires:    preupgrade-assistant-devel
Requires:         preupgrade-assistant

%description -n preupgrade-assistant-%{name}
Files used by preupgrade to assist with upgrading between
major releases of the foo package via fedup.

# Copy all content files to %{preupgrade_dir}
mkdir -p %{fedora_preupgrade_name}/%{name}
cp %{SOURCE1} %{fedora_preupgrade_name}/%{name}/%{SOURCE1}
cp %{SOURCE2} %{fedora_preupgrade_name}/%{name}/%{SOURCE2}
cp %{SOURCE3} %{fedora_preupgrade_name}/%{name}/%{SOURCE3}

%{preupgrade_build} %{fedora_preupgrade_name}/%{name}/

mkdir -p %{buildroot}%{fedora_preupgrade_dir}/%{name}
install -p -m 755 %{SOURCE2} %{buildroot}%{fedora_preupgrade_dir}/%{name}/%{SOURCE2}
install -p -m 644 %{SOURCE3} %{buildroot}%{fedora_preupgrade_dir}/%{name}/%{SOURCE3}
install -p -m 644 %{fedora_preupgrade_name}-%{preupg_results}/%{name}/group.xml %{buildroot}%{fedora_preupgrade_dir}/%{name}/group.xml

%files -n preupgrade-assistant-%{name}
%dir %{fedora_preupgrade_dir}/%{name}
%doc %{fedora_preupgrade_dir}/%{name}/*.txt