mirror of https://github.com/apache/cassandra
RPM - rpmbuild tolerate binaries in noarch, README update
patch by Martin A. Langhoff; reviewed by Stefan Podkowinski for CASSANDRA-13433
This commit is contained in:
parent
486b82a6b0
commit
480a612eef
|
|
@ -7,25 +7,26 @@
|
||||||
### Step 1:
|
### Step 1:
|
||||||
- Build and copy sources to build tree:
|
- Build and copy sources to build tree:
|
||||||
```
|
```
|
||||||
ant artifacts
|
ant artifacts -Drelease=true
|
||||||
cp build/apache-cassandra-*-src.tar.gz $RPM_BUILD_DIR/SOURCES/
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 2:
|
### Step 2:
|
||||||
- Since there is no version specified in the SPEC file, one needs to be passed at `rpmbuild` time (example with 4.0):
|
- 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:
|
- 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:
|
### Hint:
|
||||||
- Don't build packages as root..
|
- 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
|
|
||||||
```
|
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,13 @@
|
||||||
# Turn off the brp-python-bytecompile script
|
# 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')
|
%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
|
%global username cassandra
|
||||||
|
|
||||||
%define relname apache-cassandra-%{version}
|
%define relname apache-cassandra-%{version}
|
||||||
%define revision 1
|
|
||||||
|
|
||||||
Name: cassandra
|
Name: cassandra
|
||||||
Version: %{version}
|
Version: %{version}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue