diff options
author | Julien Dessaux | 2020-04-28 17:29:52 +0200 |
---|---|---|
committer | Julien Dessaux | 2020-04-28 17:29:52 +0200 |
commit | 6cc9d8c72a56563b6d1a12b8b441dfa9dde345e9 (patch) | |
tree | 042852f7a8a18f65c8d5191234c8ed1cb85fd8a4 /content/en/blog/miscellaneous/building-rpms.md | |
parent | Initial import (diff) | |
download | www-6cc9d8c72a56563b6d1a12b8b441dfa9dde345e9.tar.gz www-6cc9d8c72a56563b6d1a12b8b441dfa9dde345e9.tar.bz2 www-6cc9d8c72a56563b6d1a12b8b441dfa9dde345e9.zip |
Long overdue first commit with content
Diffstat (limited to '')
-rw-r--r-- | content/en/blog/miscellaneous/building-rpms.md | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/content/en/blog/miscellaneous/building-rpms.md b/content/en/blog/miscellaneous/building-rpms.md new file mode 100644 index 0000000..99667eb --- /dev/null +++ b/content/en/blog/miscellaneous/building-rpms.md @@ -0,0 +1,29 @@ +--- +title: "Building rpm packages" +linkTitle: "Building rpm packages" +date: 2016-02-22 +description: > + Building rpm packages +--- + +Here is how to build locally an rpm package. Tested at the time on a centos 7. + +## Setup your environment + +First of all, you have to use a non-root account. + + - Create the necessary directories : `mkdir -p ~/rpmbuild/{BUILD,RPMS,S{OURCE,PEC,RPM}S}` + - Tell rpmbuild where to build by adding the following in your `.rpmmacros` file : `echo -e “%_topdir\t$HOME/rpmbuild” » ~/.rpmmacros` + +## Building package + +There are several ways to build a rpm, depending on what kind of stuff you have to deal with. + +### Building from a tar.gz archive containing a .spec file + +Run the following on you .tar.gz archive : `rpmbuild -tb memcached-1.4.0.tar.gz`. When the building process ends, you will find your package in a `$HOME/rpmbuild/RPMS/x86_64/` like directory, depending on your architecture. + +### Building from a spec file + + - `rpmbuild -v -bb ./contrib/redhat/collectd.spec` + - If you are missing some dependencies : `rpmbuild -v -bb ./contrib/redhat/collectd.spec 2>&1 |awk '/is needed/ {print $1;}'|xargs yum install -y` |