Search
j0ke.net Open Build Service
>
Projects
>
stresslinux
>
stresslinux-build-key
> stresslinux-build-key.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File stresslinux-build-key.spec of Package stresslinux-build-key
# # spec file for package stresslinux-build-key (Version 1.0) # # norootforbuild Name: stresslinux-build-key BuildRequires: gpg License: GPL v2 or later Group: System/Packages Provides: sl-build-key Requires: gpg AutoReqProv: off Summary: The public gpg key for rpm package signature verification Version: 1.0 Release: 4 Source0: stresslinux-build-key.gpg Source1: dumpsigs BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %define pubring usr/lib/rpm/gnupg/pubring.gpg %define slring usr/lib/rpm/gnupg/stresslinux-build-key.gpg PreReq: sh-utils gpg fileutils mktemp %description This package contains the gpg key that is used to sign official stresslinux rpm packages. It will be installed as a keyring in /usr/lib/rpm/gnupg/pubring.gpg. Administrators who wish to add their own keys to verify against should use the following commandline command to add the key to the keyring as used by RPM: gpg --no-options --no-default-keyring \ --keyring /usr/lib/rpm/gnupg/pubring.gpg --import %prep rm -f foobarnosuchfileordirectory #%setup %build %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/usr/lib/rpm/gnupg install %{SOURCE0} $RPM_BUILD_ROOT/%{slring} install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/usr/lib/rpm/gnupg touch $RPM_BUILD_ROOT/%{pubring} touch $RPM_BUILD_ROOT/%{pubring}~ %files %defattr(644,root,root) %attr(755,root,root) %dir /usr/lib/rpm/gnupg %attr(755,root,root) /usr/lib/rpm/gnupg/dumpsigs %config /%{slring} %ghost /%{pubring} %ghost /%{pubring}~ %post if [ ! -f %{pubring} ]; then touch %{pubring} fi echo -n "importing stresslinux build key to rpm keyring... " TF=`mktemp /tmp/gpg.XXXXXX` if [ -z "$TF" ]; then echo "stresslinux-build-key::post: cannot make temporary file. Fatal error." exit 20 fi if [ -z "$HOME" ]; then HOME=/root fi if [ ! -d "$HOME" ]; then mkdir "$HOME" fi gpg -q --batch --no-options < /dev/null > /dev/null 2>&1 || true # no kidding... gpg won't initialize correctly without being called twice. gpg < /dev/null > /dev/null 2>&1 || true gpg < /dev/null > /dev/null 2>&1 || true gpg -q --batch --no-options --no-default-keyring --no-permission-warning \ --keyring %{slring} --export -a > $TF a="$?" gpg -q --batch --no-options --no-default-keyring --no-permission-warning \ --keyring %{pubring} --import < $TF b="$?" rm -f "$TF" if [ "$a" = 0 -a "$b" = 0 ]; then echo "done." else echo "importing the key from the file %{slring}" echo "returned an error. This should not happen. It may not be possible" echo "to properly verify the authenticity of rpm packages from stresslinux sources." echo "The keyring containing the stresslinux rpm package signing key can be found" echo "in the root directory of the first CD (DVD) of your stresslinux product." exit -1 fi ### import stresslinux package build key to roots gpg keyring if test -f root/.gnupg/pubring.gpg ; then chroot . usr/bin/gpg --export --armor --no-default-keyring \ --keyring %{slring} buildservice@j0ke.net \ | chroot . usr/bin/gpg --import || true if ! chroot . usr/bin/gpg --list-keys buildservice@j0ke.net >/dev/null 2>&1 ; then echo "gpg import for buildservice@j0ke.net failed, please import manually" >&2 fi else cp %{slring} root/.gnupg/pubring.gpg fi chmod 600 root/.gnupg/pubring.gpg %changelog * Sat Aug 02 2009 Carsten Schoene <cs@linux-administrator.com> - 1.0-1 - initial package