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

Enhancement: Update rpm spec files with autogen options #206

Open
jcsiadal opened this issue Oct 17, 2019 · 5 comments
Open

Enhancement: Update rpm spec files with autogen options #206

jcsiadal opened this issue Oct 17, 2019 · 5 comments
Assignees

Comments

@jcsiadal
Copy link
Collaborator

Autogen.sh command line options should update the configure parameters in the specfiles. When using the CI system, identical options need to be configured for both the autogen.sh and RPM spec.in file.

It would be useful for the configure script in the generated specfile to include the parameters passed to the initial autogen script. It also seems logical that autogen should pre-configure all source files.

@jmstover
Copy link
Contributor

jmstover commented Oct 17, 2019

The spec file from common has the following:

%build
%configure
%{__make} %{?mflags}

The %configure macro, is going to be running the configure script with defaults like:

--prefix=%{_prefix} --localstatedir=%{_localstatedir}

So, whatever the system macros are set to ... that's what will be getting used. It's basically going to pass the macro value for all configure options it can. If you have a dist tarball, you can override this by doing like:

rpmbuild -tb --define '_prefix /usr/local' warewulf-common.tar.gz

Edit: Honestly, there really isn't a connection between the autogen.sh script, and the RPM build at all. The autogen script just runs an initial ./configure run for building from the source tree. IIRC that was added just so it could be written:

./autogen.sh
make dist

Instead of

./autogen.sh
./configure
make dist

The Spec file in the resulting tarball builds based on the macro values of the build host instead of having hard coded values.

@jcsiadal
Copy link
Collaborator Author

If you look at my CentOS8 PR, you can see that I'm appending the %configure macro. This came about yesterday while trying to figure out why the build worked perfectly in a manual install, but failed in CircleCI.

It would be fairly easy to add the autgen switches too. The question is whether overloading the same switches results in an error, or if configure works like gcc and uses the last switch value.

@jmstover
Copy link
Contributor

jmstover commented Oct 17, 2019

Looks like it uses the last one passed ... at least with the --prefix option.

$ ./configure --prefix=/usr --prefix=/opt/warewulf
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
  [ ... ]
$ egrep ^prefix Makefile
prefix = /opt/warewulf

Edit: Changed second --prefix from a non-default location... Whee! :)

@bensallen
Copy link
Member

@jcsiadal is there anything still outstanding in this issue?

@jcsiadal
Copy link
Collaborator Author

No, but since you determined that all is good with configure, it's an easy fix (much appreciated). I'll own this because I believe that any option I pass to autogen needs to be reflected in all generated components.

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

No branches or pull requests

3 participants