Monthly Archives: March 2014

Protected: Multiple PuppetMasters

This content is password protected. To view it please enter your password below:

Building Our Own RPMS

# yum install rpm-build redhat-rpm-config pinentry-gtk.x86_64 # adduser build # sudo su – build $ mkdir -p -m 700 ~/.gnupg $ gpg-agent –daemon –use-standard-socket –pinentry-program /usr/bin/pinentry-curses Do export the output from this line If don’t have key yet: gpg –gen-key On Centos6, if you find gpg-agent[1783]: command get_passphrase failed: Operation cancelled gpg: cancelled by user Login directly to the box using build, do not use sudo and generate again the key. If asked for random keyboard or mouse, do generate random with other shell: $ sudo rngd -r /dev/urandom $ mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} Create a file called .rpmmacros that contains something like below:

$ cat .rpmmacros
%_topdir %(echo $HOME)/rpmbuild
%_signature gpg
%_gpg_path %(echo $HOME)/.gnupg
%_gpg_name F77xxxxx
%_gpgbin /usr/bin/gpg
You can get the F77xxxx from the gpg list key:
$ gpg --list-keys
/home/build/.gnupg/pubring.gpg
------------------------------
pub   20172K/F77xxxx 2011-11-05
uid                  Build System 
When ready, put your rpm source inside SRPMS and install it.
rpm -Uvh package.src.rpm
Enter SPECS folder and rebuild:
rpmbuild -bb --sign yourpackage.spec
Then check and look for RPM inside RPMS folder. To create public key
$ gpg --armor --export
To check your public GPG key:
www.pgpdump.net
]]>