CentOSのSRPMをダウンロードしてspecファイルを取り出す

  • 5
    Like
  • 0
    Comment
More than 1 year has passed since last update.

準備

yum install -y yum-utils
awk '{
ver=$3
print "[os-SRPM]\n" \
      "name=CentOS-" ver " - os SRPM\n" \
      "baseurl=http://vault.centos.org/" ver "/os/Source/\n" \
      "\n" \
      "[updates-SRPM]\n" \
      "name=CentOS-" ver " - updates SRPM\n" \
      "baseurl=http://vault.centos.org/" ver "/updates/Source/\n" \
      "\n" \
      "[extras-SRPM]\n" \
      "name=CentOS-" ver " - extras SRPM\n" \
      "baseurl=http://vault.centos.org/" ver "/extras/Source/\n"
}' /etc/redhat-release > /etc/yum.repos.d/CentOS-SRPM.repo

SRPMのダウンロードとSPECファイル取り出し

pcreの例

mkdir /tmp/work
cd /tmp/work
yumdownloader --source pcre
rpm2cpio pcre-7.8-4.el6.src.rpm | cpio -idmv

参考