#6 fontconfig file need renaming now?
Closed by pnemade. Opened by pnemade.

Hi,

Thanks for suggesting to use %fontconfs instead %fontconfngs. I am working on few packages to convert. While working on this I found that at least packages like madan-fonts, google-croscore-fonts, fontconfig source files need to be renamed.

See https://src.fedoraproject.org/rpms/madan-fonts/pull-request/2#request_diff

Can macros be enhanced to take existing source file names like
%{name}-fontconfig.conf or %{fontname}-fontconfig.conf
and copy to destination file name as
%{fontname}.conf or as per new way %{fontpkgname}.conf

Regards,
Parag


Hi @paragn

The macros do not care at all about the naming of the fontconfig files, you can pass anything you want to %global fontconfs, as long as it exists by the time rpmbuild reaches %install things will work.

The number-%{fontpkgname}.conf in the fonts-rpm-templates examples is just a convenient convention that matches the way the new font packages are structured.

fontconfig, however, will care about the file naming for prioritizing reasons. As @tagoh noted in the past this is becoming unmaintainable as the number and complexity of available font packages grows. Therefore, priority numbers are deliberately removed from the API of the new macros.

fontconfig needs to completely re-think the configuration interface exposed to end-users and packagers to make it more resilient to font maker, packager and user mistakes, make config file ordering not matter in the general case, and scale to the level of complexity of current font projects.

This is the whole point of
https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/200

This is showcased by all the “”new syntax“ XML files in my packages. It’s a real-world proposal that works for the needs of real-world fonts. If this issue does not make any progress, and the generator is used as an excuse for it to not make any progress, I’ll just stop maintaining it and orphan all the font packages which are unmaintainable with the legacy fontconfig syntax.

https://src.fedoraproject.org/rpms/madan-fonts/pull-request/2#_2__54
→ you could probably use the %linuxtext macro here

https://src.fedoraproject.org/rpms/madan-fonts/pull-request/2#_2__62
→ generating OpenType from sources should really be done in %build. Use %prep to fix existing source files, not to generate new files. Using the proper rpm section is a lot more critical that one may think: all the tooling assumes you follow the model defined with those sections, and tooling updates are designed around those assumptions. specs that do stuff in the wrong section eventually fail.

As per https://fedoraproject.org/wiki/Simple_fonts_spec_template, old font packaging format we ensured fontconfig files be always installed (instead renamed) as
install -m 0644 -p %{SOURCE1} %{buildroot}%{_fontconfig_templatedir}/%{fontconf}

I understand its just filenames but after converting to new packaging format, new builds will install the source fontconf file name as it is. So, if this change is fine then I would like to make it as a uniform change to all packages I am going to convert. (I am trying to keep as much as possible old packaging file names)

Thanks for reviewing madan-fonts PR. I will use your suggestions and fix it.

I understand its just filenames but after converting to new packaging format, new builds will install the source fontconf file name as it is.

Yes, that’s what I meant about removing priority mangling from the macro API. You can either put the priority directly in the %SOURCEX filename (what the new templates suggest) or keep your source files as-is and do a cp/install to a filename that includes the priority in %prep. Either way will work.

The new macros allow removing completely the install step if sources (either detached sources or some file provided by upstream within the source archive) already have the desired target filename. They just need the list of files declared in %fontconfs to exist by the time %install is reached.

There is nothing more to discuss here. Hence closing this issue.

Metadata Update from @pnemade:
- Issue status updated to: Closed (was: Open)

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/i18n/fonts-rpm-macros/issues/6

Please continue any further discussion there.

Metadata