여백에 도장 찍기

rpmbuild 본문

CentOS 7/RPM Build

rpmbuild

Linzyseo 2018. 12. 13. 09:52

rpmbuild를 진행해보도록 하겠습니다.  

 

rpmbuild를 하기 위한 사전작업은 다음과 같습니다. 

1)  rpm-build 설치 

[root@localhost ~]# yum install -y rpm-build

2) gpg-key 생성 

   : root 계정은 권고되지 않으므로 일반 유저 계정을 생성해, 해당 유저에서 rpmbuild 과정을 수행하도록 하겠습니다. 

[root@localhost ~]# yum install -y rng-tools 

[root@localhost ~]# rngd -r /dev/urandom
Initalizing available sources
Enabling RDSEED rng support
Enabling JITTER rng support
gpg-agent --use-standard-socket --daemon
gpg-agent[7348]: directory `/root/.gnupg' created
gpg-agent[7348]: directory `/root/.gnupg/private-keys-v1.d' created
GPG_AGENT_INFO=/root/.gnupg/S.gpg-agent:7349:1; export GPG_AGENT_INFO;

[root@localhost ~]# su - builduser
[builduser@localhost ~]$ cat <<EOF | gpg --batch --no-tty --gen-key
> %echo Generating a standard key
> Key-Type: default
> Key-Length: 2048
> Subkey-Type: default
> Subkey-Length: 2048
> Name-Real: myName
> Name-Email: myEmail@gmail.com
> Expire-Date: 10y
> Passphrase: myPassword
> %commit
> %echo done
> EOF
gpg: Generating a standard key
gpg: key 7D1183A7 marked as ultimately trusted
gpg: done

 

2-1) gpg 지문 확인 

[builduser@localhost ~]$ gpg --fingerprint
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: next trustdb check due at 2028-12-09
/home/builduser/.gnupg/pubring.gpg
----------------------------------
pub   2048R/7D1183A7 2018-12-12 [expires: 2028-12-09]
      Key fingerprint = 5397 0617 E7F9 5AD3 8E67  F4C2 77B5 DA38 7D11 83A7
uid                  myName <myEmail@gmail.com>
sub   2048R/1565E48F 2018-12-12 [expires: 2028-12-09]
 

2-2) gpg key file 추출 

[builduser@localhost ~]$ gpg -a -o RPM-GPG-KEY-builduser --export 7D1183A7
[builduser@localhost ~]$ cat RPM-GPG-KEY-builduser 
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.22 (GNU/Linux)
mQENBFwQ2rIBCADWeSBimVp+iYD8OypxarVzQ6MoZ57aZp/S3kasu3KXYvxOaKBa
... 
dvQ1wSh8qwxtUtucqlaAp1VTR9cnzRk1Gz/H99DSzEHJCYPPGOjUA3/Y=GBh/
-----END PGP PUBLIC KEY BLOCK-----
[builduser@localhost ~]$ echo '%_gpg_name 7D1183A7' > ~/.rpmmacros
[builduser@localhost ~]$ cat ~/.rpmmacros 
%_gpg_name 7D1183A7

 

'CentOS 7 > RPM Build' 카테고리의 다른 글

Download RPM package using YumDonwloader on CentOS7  (0) 2019.02.08
RPM 명령어  (0) 2019.01.09
RPM 패키지 만들기 (rpmbuild)  (0) 2018.12.12
Comments