cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [03/22] cassandra git commit: RPM - rpmbuild tolerate binaries in noarch, README update
Date Thu, 18 May 2017 17:48:27 GMT
RPM - rpmbuild tolerate binaries in noarch, README update

patch by Martin A. Langhoff; reviewed by Stefan Podkowinski for CASSANDRA-13433


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/480a612e
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/480a612e
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/480a612e

Branch: refs/heads/cassandra-2.2
Commit: 480a612eeffa6d3e77cd4f25676a90a2917da4a4
Parents: 486b82a
Author: Martin Langhoff <martin.langhoff@gmail.com>
Authored: Wed May 3 16:54:28 2017 -0400
Committer: Stefan Podkowinski <s.podkowinski@gmail.com>
Committed: Thu May 18 19:12:18 2017 +0200

----------------------------------------------------------------------
 redhat/README.md      | 19 ++++++++++---------
 redhat/cassandra.spec |  5 ++++-
 2 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/480a612e/redhat/README.md
----------------------------------------------------------------------
diff --git a/redhat/README.md b/redhat/README.md
index 0b2ab0d..cab42a7 100644
--- a/redhat/README.md
+++ b/redhat/README.md
@@ -7,25 +7,26 @@
 ### Step 1:
 - Build and copy sources to build tree:
 ```
-ant artifacts
-cp build/apache-cassandra-*-src.tar.gz $RPM_BUILD_DIR/SOURCES/
+ant artifacts -Drelease=true
 ```
 
 ### Step 2:
 - Since there is no version specified in the SPEC file, one needs to be passed at `rpmbuild`
time (example with 4.0):
 ```
-rpmbuild --define="version 4.0" -ba redhat/cassandra.spec
+mkdir -p build/rpmbuild/{BUILD,RPMS,SPECS,SRPMS}
+rpmbuild --define="version 4.0" \
+    --define="revision $(date +"%Y%m%d")git$(git rev-parse --short HEAD)%{?dist}" \
+    --define "_topdir $(pwd)/build/rpmbuild" \
+    --define "_sourcedir $(pwd)/build" \
+    -ba redhat/cassandra.spec
 ```
 
+Use revision value in the example above for git based snapshots. Change to `--define="revision
1"` for non-snapshot releases.
+
 - RPM files can be found in their respective build tree directories:
 ```
-ls -l $RPM_BUILD_DIR/{SRPMS,RPMS}/
+ls -l build/rpmbuild/{SRPMS,RPMS}/
 ```
 
 ### Hint:
 - Don't build packages as root..
-```
-# this makes your RPM_BUILD_DIR = ~/rpmbuild
-mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
-echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
-```

http://git-wip-us.apache.org/repos/asf/cassandra/blob/480a612e/redhat/cassandra.spec
----------------------------------------------------------------------
diff --git a/redhat/cassandra.spec b/redhat/cassandra.spec
index c3c22d0..ad4095d 100644
--- a/redhat/cassandra.spec
+++ b/redhat/cassandra.spec
@@ -2,10 +2,13 @@
 # Turn off the brp-python-bytecompile script
 %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
 
+# rpmbuild should not barf when it spots we ship
+# binary executable files in our 'noarch' package
+%define _binaries_in_noarch_packages_terminate_build   0
+
 %global username cassandra
 
 %define relname apache-cassandra-%{version}
-%define revision 1
 
 Name:          cassandra
 Version:       %{version}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message