aboutsummaryrefslogtreecommitdiff
path: root/rhel
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-08-25 10:18:47 -0700
committerBen Pfaff <blp@nicira.com>2011-09-15 11:19:59 -0700
commitd56bfe387167efbf99600cb2c054dd36f7ae6033 (patch)
treeb416c3ef3dba37517a2fab3bc827620d71641c7d /rhel
parent109b8459218973f7fba72fc606bcdbbb306592de (diff)
rhel: Fix "make distcheck" failure due to regenerating spec files.
We want to regenerate the RPM spec files whenever the version number changes, hence the dependency on config.status. But that means that we try to modify the spec files even when the version number doesn't change, which cause "make distcheck" to fail because it write-protects the source directory. So this commit instead just "touch"es the spec files when they don't really change, which still works OK with a write-protected source directory.
Diffstat (limited to 'rhel')
-rw-r--r--rhel/automake.mk13
1 files changed, 7 insertions, 6 deletions
diff --git a/rhel/automake.mk b/rhel/automake.mk
index 34abe5b9..d3c089b5 100644
--- a/rhel/automake.mk
+++ b/rhel/automake.mk
@@ -18,15 +18,16 @@ EXTRA_DIST += \
rhel/openvswitch.spec.in \
rhel/usr_share_openvswitch_scripts_sysconfig.template
+update_spec = \
+ ($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
+ < $(srcdir)/rhel/$(@F).in > $(@F).tmp || exit 1; \
+ if cmp -s $(@F).tmp $@; then touch $@; rm $(@F).tmp; else mv $(@F).tmp $@; fi
$(srcdir)/rhel/openvswitch-kmod-rhel5.spec: rhel/openvswitch-kmod-rhel5.spec.in $(top_builddir)/config.status
- ($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
- < $(srcdir)/rhel/openvswitch-kmod-rhel5.spec.in > $@
+ $(update_spec)
$(srcdir)/rhel/openvswitch-kmod-rhel6.spec: rhel/openvswitch-kmod-rhel6.spec.in $(top_builddir)/config.status
- ($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
- < $(srcdir)/rhel/openvswitch-kmod-rhel6.spec.in > $@
+ $(update_spec)
$(srcdir)/rhel/openvswitch.spec: rhel/openvswitch.spec.in $(top_builddir)/config.status
- ($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
- < $(srcdir)/rhel/openvswitch.spec.in > $@
+ $(update_spec)