Skip to content

Package templates

Florian Festi edited this page Oct 2, 2018 · 2 revisions

Templates for sub packages

All still rough unfinished ideas!

The idea is that many sub packages are so generic that there is no real reason for the packager to type all the details in. Instead the sub packages should be stored somewhere out side the package and only included when needed. Either by a single line or even automatically.

The idea here is to use normal %package syntax for this but extend it a bit so it can do everything needed.

Features needed

Those may need being switched on per package

  • Don't error on a file not found
  • Don't error on a package without files - just drop the package silently
  • Be able to "steal" files from other packages
    • File gets removed from other package
    • Useful to be able to split files out into a sub package easily
    • Needs some solution for multiple packages fighting over the files
  • Allow overwriting a previously defined section/scriptlet/preamble value
  • Allow appending the file list
  • Have a new %include like directive that looks in a global location
    • Have a way to pass parameters?
  • Have an instance of the sub package per already existing (sub) package
    • Have access to the parent package's data like name, description, summary, ...
    • Be able to filter own files depending to the ones in the parent package
  • Have sub packages that expand into multiple packages depending on matched files
    • E.g. for language packs
    • Use part of file match in name and through out preamble values
    • Still need clear semantics for multiple matches and different patterns

Devel template

%package devel
Summary: Development files for %{name}
%description devel
Development files for package %{name}.
%{description}

%files devel
/usr/include
%{_libdir}/lib*.so
%{_libdir}/lib*.a
%{_mandir}/man2
%{_mandir}/man3
%{_datadir}/pkgconfig
%{_libdir}/pkgconfig
%{_datadir}/cmake
%{_datadir}/vala

Lang Pack template

%package lang-%{LANG}
Description: Language files for %{name} in %{LANG}
%files
%{_datadir}/%{name}/${LANG}/*.mo

Debuginfo template

Noarch template