Beginner Help: GNU Hello Lang File Conflict

I’m trying to learn how to use OSC and OBS, and building the GNU Hello package. However, I’m running into an issue following the tutorial, which has the spec file set up the way I do (it works in the tutorial). However, I get some sort of build error about packages conflicting near the end of the build. Hopefully someone can point me in the right direction!
Link to spec file: File hello.spec of Package hello - openSUSE Build Service
Error: openSUSE Paste

@cbmiller remove “%{_datadir}/locale/*/LC_MESSAGES/hello.mo” you also don’t need the license in the language package…

The “%find_lang %{name}” puts the list of files in the “%{name}.lang”.

Thanks, removing that part makes it work! I just want to make sure I understand why. What I understand now is:

  1. %find_lang will automatically find all the hello.mo files corresponding to different languages, so using the %{_datadir}/locale/*/LC_MESSAGES/hello.mo pattern in %files is no longer needed.
  2. %lang_package will repackage those files into a subpackage hello-lang, which has a no-arch target.
  3. With both the datadir pattern used under %files and the %lang_package, there will be duplicate language files created: some in the main hello package, and some in the hello-lang package.

So, in this case we just let %lang_package and %find_lang do their thing and omit the datadir pattern, and then it is only packaged once (in the subpackage).

@cbmiller yes to 1,2 and 3 :wink: If you built locally (with osc) you could look in the buildroot and would see a file called “%{name}.lang” where %name is from the spec name. In that file is the list of files, your sub package uses the “-f” (file) to use that list rather than a big long list…

I would recommend adding no C so it’s excluded;

%find_lang %{name} %{?no_lang_C}

This helps with the auto-recommends of lang packages;
Ref my cherrytree package: https://build.opensuse.org/projects/openSUSE:Factory/packages/cherrytree/files/cherrytree.spec?expand=1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.