Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RPM spec file template #109

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

minfrin
Copy link
Contributor

@minfrin minfrin commented Apr 21, 2021

This spec file depends on the name of the tag and resulting source tarball
following the standard naming convertion of %{name}-%{version}, which is
currently not the case for v0.0.3.

This spec file depends on the name of the tag and resulting source tarball
following the standard naming convertion of %{name}-%{version}, which is
currently not the case for v0.0.3.
@AmokHuginnsson
Copy link
Owner

Hello.
Thank you for this contribution.
I have noticed that replxx.spec file in both generated and included in the committed source code.

Can you remove replxx.spec file from your commit?

@minfrin
Copy link
Contributor Author

minfrin commented May 13, 2021

I have noticed that replxx.spec file in both generated and included in the committed source code.

Can you remove replxx.spec file from your commit?

I can - but can you confirm it is handling correctly by cmake?

The ultimately requirement for spec files to work is that a file called something.spec exists in the tarball of the release. At that point making the package is a one-liner "rpmbuild -tb replxx-0.0.3.tar.gz".

If cmake is able to generate the spec file before the release is made as part of the release tarball, then it's correct to delete the spec file.

If however you're using github generated release tarballs, then the spec file needs to be checked in for it to work.

@AmokHuginnsson
Copy link
Owner

Other solution would be to ditch CPACK and replxx.spec.in and use Version: %(clever shell...) in replxx.spec directly to get version number in spec file.

@minfrin
Copy link
Contributor Author

minfrin commented May 13, 2021

Other solution would be to ditch CPACK and replxx.spec.in and use Version: %(clever shell...) in replxx.spec directly to get version number in spec file.

Not aware that that's a thing?

RPM starts with the spec file, and then uses it to find everything else. It is a convenience thing for the specfile to be called something.spec and placed in tarball. In the world of autoconf it's one of the possible autogenerated files that go in the autogenerated tarballs.

Ot to put it another way, it;s a checken and egg - %(clever shell) has nothing to go on to find the version number. It's just how RPM works.

@AmokHuginnsson
Copy link
Owner

Version: ??? is not specified as an explicit value e.g. Version: 0.0.4 to avoid duplication of version number (0.0.4) which is already specified in CMakeLists.txt, so Version: %(clever shell...) could fetch version number explicitly.

@minfrin
Copy link
Contributor Author

minfrin commented May 13, 2021

Alas RPM doesn't work like that.

As soon as you create nonstandard spec files, tools like COPR break.

The basics are that the following two commands should work, and the build should do whatever needs to be done to make them work:

  • rpmbuild -tb replxx-0.0.4.tar.gz
  • rpmbuild -ts replxx-0.0.4.tar.gz

I know how to do this with autoconf, I have no idea how cmake does it unfortunately. In theory it should use the cmake equivalent of autoconf "make dist". Cannot find any cmake info on how to do this, as google can't tell the difference between cmake the tool and cmake the tool being used by other projects.

@AmokHuginnsson
Copy link
Owner

This pull request will not be merged with both replxx.spec and replxx.spec.in files present at the same time.

@minfrin
Copy link
Contributor Author

minfrin commented May 25, 2021

It's your project, you can modify this PR as you require.

Remember that RPM works a specific way, if you don't follow the way RPM wants you to do things, RPM won't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants