-
Notifications
You must be signed in to change notification settings - Fork 416
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
Make the configure script more packaging-friendly #98
Conversation
configure
Outdated
@@ -44,8 +44,8 @@ while getopts ":ho:-:p" opt; do | |||
# process --long-options | |||
case "$OPTARG" in | |||
help) usage ;; | |||
*=*) opt=${OPTARG%%=*}; val=${OPTARG#*=} | |||
eval "$opt=$val" ;; | |||
*=*) opt=${OPTARG%=*}; val=${OPTARG#*=} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason for changing %%
to %
? The %%
seems preferable, since it should be possible for option values to contain =
themselves, i.e. --prefix=/my/weird=dir/
. Maybe not likely to be needed unless more general flags are added down the road, but afaict it doesn't hurt to keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, kind of a typo because I initially tried to do the s/-/_/
substitution here and forgot to restore it properly.
Ok with the change other than my quibble about |
configure
Outdated
@@ -81,6 +81,9 @@ fi | |||
if echo ${etcdir} | grep -qs /usr; then | |||
etcdir=$(echo ${etcdir} | sed -e "s^/usr^^") | |||
fi | |||
if [ -n "$sysconfdir" ]; then | |||
etcdir=$sysconfdir | |||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add it to the usage as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. By the way you may want to revisit the etcdir
fixup because /usr/local/etc
is actually the correct place for locally installed programs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I didn't know that. Thanks for the info.
Thanks for the review, I just pushed fixes accordingly. |
Hi all! I was able to change this
into this
with the above changes. Will make Fedora packaging gods smile I suppose. Anyways, I get a package build error now that I haven't investigated yet (Can be totally unrelated to this PR.)
@dridi I am the someone who submitted the package spec for review. Thanks for working on this. (BTW, are you able to sponsor me with that review request? 😉) |
Amend previous comment: FYI, I actually still need to pass |
@dridi It'd be better if you could fold the fixes into the original commits and force push them to overwrite the branch. |
Changes in this PR are unrelated to above build error it seems. I get the build error in current master, too. I'll investigate later. From me: 👍 |
@bkircher Thanks for the confirmation, please make it a separete issue. Providing detailed build instructions with |
Rebased. |
@dridi I forgot to say that I'd like to add your Signed-off-by line into the commit logs. Please read doc/contributing.md and add your sign-off. Sorry for the inconvenience! |
Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
For RPM or Deb packaging where a configure script is expected to be compatible with autotools, long options may contain additional dashes that shouldn't be evaluated as variable names. Instead dashes are turned into underscores. At the same time, protect the $val with 'simple quotes' as it is done for positional arguments to avoid accidentally running commands when values contain whitespaces. While this takes care of whitespaces, there is still the possibility to run into a 'single quote' in the value but this is less likely. Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
On Fedora or Red Hat systems, flags may be passed as long options without a value. On Fedora, a %configure macro is available to uniformly set up configure-based projects but it eats up the prefix: ./configure [...] --disable-dependency-tracking --prefix=/usr [...] Since this notation is not even documented, the '--long-option=value' notation can be enforced. Long options without a value are silently ignored. Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
The only fix needed for the $etcdir is when /usr is the prefix. Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Signed off, apologies on my side for not researching it. I think you can make it more noticeable if you move it to the root of your repository and rename it to
To see it in action: https://github.com/varnishcache/varnish-cache/issues/new |
Looks useful. I'll take a look, thanks for the info! |
Hello,
Someone's trying to introduce
uftrace
on Fedora [1] and I'd like to see this move forward. One problem is that the configure script doesn't meet packaging expectations, which is fixed in 77dcd9c ca9d704. That should make downstream maintainers lives easier since they'd less likely need to manually update the packaging whenever a guideline changes.I also polished the script a bit.
Dridi
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1398922