[vagrant@rpmbuild packages-el5]$ tree -L 3
.
|-- BUILD
|-- INSTALL
| |-- rpm-tmp.77572
| |-- rpm-xfer.KLH3wV
| |-- rpm-xfer.efPw5T
| `-- rpm-xfer.rRGHv9
|-- RPMS
..
| |-- collectd-4.10.2-3.el5.src.rpm
| |-- collectd-4.10.2-3.el5.x86_64.rpm
| |-- collectd-4.10.3-10.el5.src.rpm
| |-- collectd-4.10.3-10.el5.x86_64.rpm
| |-- collectd-apache-4.10.2-3.el5.x86_64.rpm
| |-- collectd-apache-4.10.3-10.el5.x86_64.rpm
| |-- collectd-carbon-0.0.2-1.e20819b.noarch.rpm
| |-- collectd-carbon-0.0.2-1.e20819b.src.rpm
| |-- collectd-debuginfo-4.10.2-3.el5.x86_64.rpm
| |-- collectd-debuginfo-4.10.3-10.el5.x86_64.rpm
| |-- collectd-dns-4.10.2-3.el5.x86_64.rpm
| |-- collectd-dns-4.10.3-10.el5.x86_64.rpm
| |-- collectd-email-4.10.2-3.el5.x86_64.rpm
| |-- collectd-email-4.10.3-10.el5.x86_64.rpm
| |-- collectd-ipmi-4.10.2-3.el5.x86_64.rpm
| |-- collectd-ipmi-4.10.3-10.el5.x86_64.rpm
| |-- collectd-mysql-4.10.2-3.el5.x86_64.rpm
| |-- collectd-mysql-4.10.3-10.el5.x86_64.rpm
| |-- collectd-nginx-4.10.2-3.el5.x86_64.rpm
| |-- collectd-nginx-4.10.3-10.el5.x86_64.rpm
| |-- collectd-nut-4.10.2-3.el5.x86_64.rpm
| |-- collectd-nut-4.10.3-10.el5.x86_64.rpm
| |-- collectd-ping-4.10.2-3.el5.x86_64.rpm
| |-- collectd-ping-4.10.3-10.el5.x86_64.rpm
| |-- collectd-postgresql-4.10.2-3.el5.x86_64.rpm
| |-- collectd-postgresql-4.10.3-10.el5.x86_64.rpm
| |-- collectd-rrdtool-4.10.2-3.el5.x86_64.rpm
| |-- collectd-rrdtool-4.10.3-10.el5.x86_64.rpm
| |-- collectd-sensors-4.10.2-3.el5.x86_64.rpm
| |-- collectd-sensors-4.10.3-10.el5.x86_64.rpm
| |-- collectd-snmp-4.10.2-3.el5.x86_64.rpm
| |-- collectd-snmp-4.10.3-10.el5.x86_64.rpm
| |-- collectd-virt-4.10.2-3.el5.x86_64.rpm
| |-- collectd-virt-4.10.3-10.el5.x86_64.rpm
| |-- collectd-web-4.10.2-3.el5.x86_64.rpm
| |-- collectd-web-4.10.3-10.el5.x86_64.rpm
..
| |-- repodata
| | |-- filelists.xml.gz
| | |-- other.xml.gz
| | |-- primary.xml.gz
| | `-- repomd.xml
..
|-- SOURCES
..
| |-- collectd-4.10.2
| | |-- collectd-4.10.2-configure-OpenIPMI.patch
| | |-- collectd-4.10.2-include-collectd.d.patch
| | |-- collectd-4.10.2-python-callback.patch
| | |-- collectd-4.10.2.tar.bz2
| | |-- collectd-httpd.conf
| | |-- collectd.spec
| | `-- collection.conf
| |-- collectd-4.10.3
| | |-- collectd-4.10.2-include-collectd.d.patch
| | |-- collectd-4.10.3.tar.bz2
| | |-- collectd-httpd.conf
| | |-- collectd.spec
| | `-- collection.conf
..
Created
February 14, 2012 10:51
-
-
Save dcarley/1825765 to your computer and use it in GitHub Desktop.
RPM build environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All packages need to be built from the root of a given VCS checkout. | |
%_topdir %(echo $PWD) | |
# Use separate directories for each package to prevent clutter. | |
%_sourcedir %{_topdir}/SOURCES/%{name}-%{version} | |
%_specdir %{_sourcedir} | |
# Common build/install paths. | |
%_tmppath %{_topdir}/INSTALL | |
%_builddir %{_topdir}/BUILD | |
# Store all output in a single location. | |
%_rpmdir %{_topdir}/RPMS | |
%_srcrpmdir %{_topdir}/RPMS | |
%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm | |
%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
SPEC=$1 | |
shift | |
SRPM=$(rpmbuild -bs --nodeps $SPEC | awk '/Wrote: .*/ {print $2}') | |
[[ -n $SRPM && -f $SRPM ]] | |
sudo -u mock mock $SRPM $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment