Script started on Mon 21 May 2012 06:07:49 PM EDT $ # Unix/Linux Admin II build from source project typescript $ $ date Mon May 21 18:08:33 EDT 2012 sudo yum -y install rpm-sign ... output omitted... $ gpg --gen-key gpg (GnuPG) 1.4.12; Copyright (C) 2012 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire = key expires in n days w = key expires in n weeks m = key expires in n months y = key expires in n years Key is valid for? (0) 4m Key expires at Tue 18 Sep 2012 07:33:12 PM EDT Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) " Real name: Wayne Pollock Email address: wpollock@localhost Comment: Software Packager for MyLocalRepository You selected this USER-ID: "Wayne Pollock (Software Packager for MyLocalRepository) " Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key. Enter passphrase: Repeat passphrase: We need to generate a lot of random bytes. It is a good idea to perform some other action (type on the keyboard, move the mouse, utilize the disks) during the prime generation; this gives the random number generator a better chance to gain enough entropy. ..+++++ .+++++ gpg: key 9F19C168 marked as ultimately trusted public and secret key created and signed. gpg: checking the trustdb gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u gpg: next trustdb check due at 2012-09-18 pub 2048R/9F19C168 2012-05-21 [expires: 2012-09-18] Key fingerprint = 2791 3F20 1316 3B3A 611E 1DBC FDC5 15C7 ABA5 81AE uid Wayne Pollock (Software Packager for MyLocalRepository) sub 2048R/C16AFDB4 2012-05-21 [expires: 2012-09-18] $ rpmdev-setup-tree $ ls -at |head -n 4 .gnupg .rpmmacros ./ typescript $ cat .rpmmacros %_topdir %(echo $HOME)/rpmbuild %_smp_mflags %( \ [ -z "$RPM_BUILD_NCPUS" ] \\\ && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\ if [ "$RPM_BUILD_NCPUS" -gt 16 ]; then \\\ echo "-j16"; \\\ elif [ "$RPM_BUILD_NCPUS" -gt 3 ]; then \\\ echo "-j$RPM_BUILD_NCPUS"; \\\ else \\\ echo "-j3"; \\\ fi ) %__arch_install_post \ [ "%{buildarch}" = "noarch" ] || QA_CHECK_RPATHS=1 ; \ case "${QA_CHECK_RPATHS:-}" in [1yY]*) /usr/lib/rpm/check-rpaths ;; esac \ /usr/lib/rpm/check-buildroot $ cp .rpmmacros dot.rpmmacros-orig $ vi .rpmmacros ".rpmmacros" 22L, 651C written $ $ diff dot.rpmmacros-orig .rpmmacros 3a4,7 > %packager Wayne Pollock > %_signature gpg > %_gpg_name 9F19C168 > $ $ ls -l myhello* -rw-r-----. 1 wpollock wpollock 602 May 19 2009 myhello-1.0.spec -rw-r-----. 1 wpollock wpollock 77837 May 21 18:13 myhello-1.0.tgz $ $ cp myhello-1.0.tgz rpmbuild/SOURCES $ cp myhello-1.0.spec rpmbuild/SPECS/ $ cd rpmbuild/SPECS $ cat myhello-1.0.spec Name: myhello Version: 1.0 Release: 1%{?dist} Summary: Gnu hello Group: Applications/System License: GPL URL: http://www.gnu.org/software/hello/ Source: myhello-1.0.tgz Prefix: /usr/local BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %description Gnu hello is a sample project showing the Gnu build tool-chain. %prep %setup -q %build %configure make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc %{_mandir}/man1/hello.1.gz %{_bindir}/hello $ sudo rpm -e myhello $ hello bash: /usr/bin/hello: No such file or directory $ rpmbuild -bb --sign myhello-1.0.spec + umask 022 + cd /home/wpollock/rpmbuild/BUILD + LANG=C + export LANG + unset DISPLAY + cd /home/wpollock/rpmbuild/BUILD + rm -rf myhello-1.0 + /bin/tar -xf - + /usr/bin/gzip -dc /home/wpollock/rpmbuild/SOURCES/myhello-1.0.tgz + STATUS=0 + '[' 0 -ne 0 ']' + cd myhello-1.0 + /bin/chmod -Rf a+rX,u+w,g-w,o-w . + exit 0 + umask 022 + cd /home/wpollock/rpmbuild/BUILD + cd myhello-1.0 + LANG=C + export LANG + unset DISPLAY + CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' + export CFLAGS + CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' + export CXXFLAGS + FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -I/usr/lib/gfortran/modules' + export FFLAGS + LDFLAGS='-Wl,-z,relro ' + export LDFLAGS + ./configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info + make -j3 + exit 0 + umask 022 + cd /home/wpollock/rpmbuild/BUILD + '[' /home/wpollock/rpmbuild/BUILDROOT/myhello-1.0-1.fc16.i386 '!=' / ']' + rm -rf /home/wpollock/rpmbuild/BUILDROOT/myhello-1.0-1.fc16.i386 ++ dirname /home/wpollock/rpmbuild/BUILDROOT/myhello-1.0-1.fc16.i386 + mkdir -p /home/wpollock/rpmbuild/BUILDROOT + mkdir /home/wpollock/rpmbuild/BUILDROOT/myhello-1.0-1.fc16.i386 + cd myhello-1.0 + LANG=C + export LANG + unset DISPLAY + rm -rf /home/wpollock/rpmbuild/BUILDROOT/myhello-1.0-1.fc16.i386 + make install DESTDIR=/home/wpollock/rpmbuild/BUILDROOT/myhello-1.0-1.fc16.i386 + /usr/lib/rpm/find-debuginfo.sh --strict-build-id /home/wpollock/rpmbuild/BUILD/myhello-1.0 1 block + '[' '%{buildarch}' = noarch ']' + QA_CHECK_RPATHS=1 + case "${QA_CHECK_RPATHS:-}" in + /usr/lib/rpm/check-rpaths + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-compress + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1 + /usr/lib/rpm/redhat/brp-python-hardlink + /usr/lib/rpm/redhat/brp-java-repack-jars + umask 022 + cd /home/wpollock/rpmbuild/BUILD + cd myhello-1.0 + rm -rf /home/wpollock/rpmbuild/BUILDROOT/myhello-1.0-1.fc16.i386 + exit 0 Enter pass phrase: Pass phrase is good. /home/wpollock/rpmbuild/RPMS/i686/myhello-1.0-1.fc16.i686.rpm: /home/wpollock/rpmbuild/RPMS/i686/myhello-debuginfo-1.0-1.fc16.i686.rpm: $ cd ../RPMS/i686/ $ ls -l total 16 -rw-rw-r--. 1 wpollock wpollock 5001 May 21 18:30 myhello-1.0-1.fc16.i686.rpm -rw-rw-r--. 1 wpollock wpollock 6661 May 21 18:30 myhello-debuginfo-1.0-1.fc16.i686.rpm $ rpm -qi -p myhello-1.0-1.fc16.i686.rpm warning: myhello-1.0-1.fc16.i686.rpm: Header V4 RSA/SHA1 Signature, key ID 9f19c168: NOKEY Name : hello Version : 1.0 Release : 1.fc16 Architecture: i686 Install Date: (not installed) Group : Applications/System Size : 5800 License : GPL Signature : RSA/SHA1, Mon 21 May 2012 06:30:51 PM EDT, Key ID 44c3863a9f19c168 Source RPM : myhello-1.0-1.fc16.src.rpm Build Date : Mon 21 May 2012 06:30:46 PM EDT Build Host : localhost Relocations : /usr/local Packager : Wayne Pollock URL : http://www.gnu.org/software/hello/ Summary : Gnu hello Description : Gnu hello is a sample project showing the Gnu build tool-chain. $ sudo mkdir -p /var/myrepo $ sudo cp myhello-1.0-1.fc16.i686.rpm /var/myrepo $ cd /var/myrepo $ ls -la total 16 drwxr-xr-x. 2 root root 4096 May 21 18:32 ./ drwxr-xr-x. 23 root root 4096 May 21 18:31 ../ -rw-r--r--. 1 root root 5001 May 21 18:32 myhello-1.0-1.fc16.i686.rpm $ sudo createrepo . Spawning worker 0 with 1 pkgs Workers Finished Gathering worker results Saving Primary metadata Saving file lists metadata Saving other metadata Generating sqlite DBs Sqlite DBs complete $ export GNUPGHOME=~/.gnupg $ su -c 'gpg --detach-sign --armor repodata/repomd.xml' password: gpg: WARNING: unsafe ownership on homedir `/home/wpollock/.gnupg' You need a passphrase to unlock the secret key for user: "Wayne Pollock (Software Packager for MyLocalRepository) " 2048-bit RSA key, ID 9F19C168, created 2012-05-21 Enter passphrase: $ su -c 'gpg --export -a "Software Packager" > RPM-GPG-KEY-myrepokey.asc' gpg: WARNING: unsafe ownership on homedir `/home/wpollock/.gnupg' $ ls -lR .: total 16 -rw-r--r--. 1 root root 1792 May 21 18:41 RPM-GPG-KEY-myrepokey.asc -rw-r--r--. 1 root root 5001 May 21 18:32 myhello-1.0-1.fc16.i686.rpm drwxr-xr-x. 2 root root 4096 May 21 18:38 repodata/ ./repodata: total 32 -rw-r--r--. 1 root root 269 May 21 18:32 0214145214c8b0c2538ab96eec98c80a608b56d16fd678cdc1d40c4be78413fb-filelists.xml.gz -rw-r--r--. 1 root root 779 May 21 18:32 3f2295311515c1d350483aa98cbec91c48764ef9c51e601b9533d4b2afbd1653-filelists.sqlite.bz2 -rw-r--r--. 1 root root 716 May 21 18:32 75139f5f3729407b67e4c7a34587204e57da018459f57b33dd25a0acee1c5870-primary.xml.gz -rw-r--r--. 1 root root 1763 May 21 18:32 991e9543324a0f3e8a1222a61466c4b9ffda760f0a9d144ad4f052948944fc17-primary.sqlite.bz2 -rw-r--r--. 1 root root 229 May 21 18:32 aaf4cc8b377674217c567510090d527a67f6ab2ad6162d36f62f9eaef3244469-other.xml.gz -rw-r--r--. 1 root root 653 May 21 18:32 d93aae50e5420fffee7546dc27bff82a4e3960eacf5814ad87e5d1785ab7ae8e-other.sqlite.bz2 -rw-r--r--. 1 root root 2970 May 21 18:32 repomd.xml -rw-r--r--. 1 root root 490 May 21 18:38 repomd.xml.asc $ cd /etc/yum.repos.d $ ls adobe-linux-i386.repo fedora.repo rpmfusion-free-updates.repo rpmfusion-nonfree-updates-testing.repo fedora-updates-testing.repo rpmfusion-free-rawhide.repo rpmfusion-free.repo rpmfusion-nonfree-updates.repo fedora-updates.repo rpmfusion-free-updates-testing.repo rpmfusion-nonfree-rawhide.repo rpmfusion-nonfree.repo $ vi myrepo.repo $ ls -l total 52 -rw-r--r--. 1 root root 179 Jul 25 2007 adobe-linux-i386.repo -rw-r--r--. 1 root root 1163 Oct 25 2011 fedora-updates-testing.repo -rw-r--r--. 1 root root 1105 Oct 25 2011 fedora-updates.repo -rw-r--r--. 1 root root 1144 Oct 25 2011 fedora.repo -rw-r--r--. 1 root root 167 May 21 18:49 myrepo.repo -rw-r--r--. 1 root root 1325 Feb 27 16:24 rpmfusion-free-rawhide.repo -rw-r--r--. 1 root root 1260 May 17 2009 rpmfusion-free-updates-testing.repo -rw-r--r--. 1 root root 1200 Oct 28 2011 rpmfusion-free-updates.repo -rw-r--r--. 1 root root 1202 Oct 28 2011 rpmfusion-free.repo -rw-r--r--. 1 root root 1393 Feb 27 17:03 rpmfusion-nonfree-rawhide.repo -rw-r--r--. 1 root root 1305 May 17 2009 rpmfusion-nonfree-updates-testing.repo -rw-r--r--. 1 root root 1245 Feb 19 18:23 rpmfusion-nonfree-updates.repo -rw-r--r--. 1 root root 1247 Feb 19 18:23 rpmfusion-nonfree.repo $ $ cat myrepo.repo [myrepo] name=Wayne Pollock company local yum repo baseurl=file:///var/myrepo gpgcheck=1 repo_gpgcheck=1 gpgkey=file:///var/myrepo/RPM-GPG-KEY-myrepokey.asc enabled=1 $ cd $ sudo yum repolist Loaded plugins: langpacks, presto repo id repo name status adobe-linux-i386 Adobe Systems Incorporated 17 fedora Fedora 16 - i386 20,176 myrepo Wayne Pollock company local yum repo 1 rpmfusion-free RPM Fusion for Fedora 16 - Free 355 rpmfusion-free-updates RPM Fusion for Fedora 16 - Free - Updates 920 rpmfusion-nonfree RPM Fusion for Fedora 16 - Nonfree 150 rpmfusion-nonfree-updates RPM Fusion for Fedora 16 - Nonfree - Updates 447 updates Fedora 16 - i386 - Updates 7,049 repolist: 29,115 $ hello bash: hello: command not found... $ sudo yum install myhello Loaded plugins: langpacks, presto myrepo/signature | 490 B 00:00 ... Retrieving key from file:///var/myrepo/RPM-GPG-KEY-myrepokey.asc Importing GPG key 0x9F19C168: Userid : "Wayne Pollock (Software Packagers for MyLocalRepo) " Fingerprint: 13b7 7fd9 fadb 993a fec6 ed97 751c 3491 85da 1b2d From : /var/myrepo/RPM-GPG-KEY-myrepokey.asc Is this ok [y/N]: y myrepo/signature | 2.9 kB 00:08 ... myrepo/primary_db | 1.8 kB 00:00 ... Resolving Dependencies --> Running transaction check ---> Package myhello.i686 0:1.0-1.fc16 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================ Package Arch Version Repository Size ============================================================================ Installing: myhello i686 1.0-1.fc16 myrepo 5.0 k Transaction Summary ============================================================================ Install 1 Package Total download size: 5.0 k Installed size: 3.5 k Is this ok [y/N]: y Downloading Packages: warning: rpmts_HdrFromFdno: Header V4 RSA/SHA1 Signature, key ID 85da1b2d: NOKEY Public key for myhello-1.0-1.fc16.i686.rpm is not installed Retrieving key from file:///var/myrepo/RPM-GPG-KEY-myrepokey.asc Importing GPG key 0x9F19C168: Userid : "Wayne Pollock (Software Packagers for MyLocalRepo) " Fingerprint: 13b7 7fd9 fadb 993a fec6 ed97 751c 3491 85da 1b2d From : /var/myrepo/RPM-GPG-KEY-myrepokey.asc Is this ok [y/N]: y Running Transaction Check Running Transaction Test Transaction Test Succeeded Running Transaction Installing : myhello-1.0-1.fc16.i686 1/1 Verifying : myhello-1.0-1.fc16.i686 1/1 Installed: myhello.i686 0:1.0-1.fc16 Complete! $ hello Hey there, world! $ exit exit Script done on Mon 21 May 2012 07:20:42 PM EDT