From: Michael Shigorin <mike@altlinux.org> To: devel@lists.altlinux.org Cc: devel-ports@lists.altlinux.org Subject: Re: [devel-ports] renoarch: noarch.rpm -> src.rpm (собственно скрипт) Date: Tue, 16 Nov 2021 12:50:45 +0300 Message-ID: <20211116095044.GA27326@imap.altlinux.org> (raw) In-Reply-To: <20211113212653.GT26441@imap.altlinux.org> [-- Attachment #1: Type: text/plain, Size: 2190 bytes --] On Sun, Nov 14, 2021 at 12:26:53AM +0300, Michael Shigorin wrote: > В процессе обновления ruby в sisyphus_e2k (в 2.5.x-alt сильно > усложнились межпакетные зависимости и базовая сборочная система > с rpm-build-ruby) наконец надоело писать одноразовые спеки > руками по шаблону, сделал для такого скриптик; прилагаю, > вдруг ещё кому пригодится. *прилагаю* (спасибо glebfm@) > Применил так (запускать стоит в доступном на запись каталоге, > куда будут отложены спеки): > > $ rpmbuild -bs --nodeps --sign --define '_sourcedir %homedir/p10/noarch/RPMS' `renoarch ~/p10/noarch/RPMS/bundle-2.1.4-alt1.noarch.rpm ~/p10/noarch/RPMS/irb-2.7.3-alt1.3.noarch.rpm ~/p10/noarch/RPMS/rdoc-6.1.1-alt3.noarch.rpm ~/p10/noarch/RPMS/ri-6.1.1-alt3.noarch.rpm` > Enter pass phrase: > Pass phrase is good. > Generating signature: 1005 > Generating signature using GPG. > Wrote: /home/mike/LOCAL-RPM/SRPMS/bundle-2.1.4-alt1.re.src.rpm (w2.lzdio) > Generating signature: 1005 > Generating signature using GPG. > Wrote: /home/mike/LOCAL-RPM/SRPMS/irb-2.7.3-alt1.3.re.src.rpm (w2.lzdio) > Generating signature: 1005 > Generating signature using GPG. > Wrote: /home/mike/LOCAL-RPM/SRPMS/rdoc-6.1.1-alt3.re.src.rpm (w2.lzdio) > Generating signature: 1005 > Generating signature using GPG. > Wrote: /home/mike/LOCAL-RPM/SRPMS/ri-6.1.1-alt3.re.src.rpm (w2.lzdio) > > Если какие-либо пакеты лежат с правами 444, их придётся > скопировать отдельно и сделать chmod 644; в p10/noarch/RPMS > таким оказался, например, gem-test-unit-3.3.5-alt1.noarch.rpm > (вообще хорошо бы поправить в репозитории и консерватории). > > Ключик для SUF делать поленился, ограничившись переменной; > цель добавки -- иметь простую возможность быстро выделить, > какие пакеты подлежат разбутстрапливанию (ls *.re.noarch.rpm). > > Если у кого есть что готовое для задачи "упорядочить список > взаимозависимых пакетов для _добавления_ в репозиторий, буду > благодарен за указание; знаю про girar-nmu-sort-transaction, > но он > > PS: может, ещё всяких полезных скриптиков наберётся по портам > да сложим в какие alt-ports-utils? :) -- ---- WBR, Michael Shigorin / http://altlinux.org ------ http://opennet.ru / http://anna-news.info [-- Attachment #2: renoarch --] [-- Type: text/plain, Size: 1902 bytes --] #!/bin/bash # # turn a noarch package into srpm that "builds" into it again, # but without the actual build process -- effectively to get rid # of the need for BuildRequires during bootstraps; typical use: # $ rpm -bs --nodeps $(renoarch this.noarch.rpm) # (--define '_sourcedir /path/to/noarch/RPMS' might be useful too) # # NB: scripts/triggers not carried over [so far] [ -s "$1" ] || exit 1 # mark those; mandates release bump afterwards (NB: .re > .1) SUF=".re" q() { rpm -qp --qf="$1" "$2"; } mkspec() { rpm -qp "$1" >&/dev/null || exit 2 OUT="$(basename "$1")" OUT="${OUT%.rpm}.spec" export LANG=C.UTF-8 read N V R < <(q '%{name}\t%{version}\t%{release}\n' "$1") read E < <(q '%{epoch}\n' "$1"); E="${E/(none)/}" read S < <(q '%{summary}\n' "$1") read L < <(q '%{license}\n' "$1") #read G < <(q '%{group}\n' "$1") # unused #read D < <(q '%{description}\n' "$1") # unused P="$(rpm --eval '%packager')" P="${P/\%packager/Renoar C.H. <renoarch@localhost>}" { cat << EOF # bootstrap spec generated by $(basename "$0") on $(date +%Y-%m-%d) Name: $N Version: $V Release: $R$SUF EOF [ -z "$E" ] || cat << EOF Epoch: $E EOF cat << EOF Summary: piggyback the needed %name version License: $L Group: Development/Other Source: $(basename "$1") BuildArch: noarch AutoReqProv: no EOF { rpm -qp --requires "$1" | grep -v '^rpmlib' | sed 's,^,Requires: ,' echo rpm -qp --provides "$1" | sed 's,^,Provides: ,' } | sed 's,:[^ ].*$,,' # drop disttag [ -z "$SUF" ] || cat << EOF Provides: $N = ${E:+$E:}$V-$R EOF cat << EOF %description %summary %prep %setup -cT rpm2cpio %SOURCE0 | cpio -id %build # any "corrective" action here %install cp -a . %buildroot %files EOF rpm -qlp "$1" | grep -v "^(" cat << EOF %changelog * $(date '+%a %b %d %Y') $P ${E:+$E:}$V-$R$SUF - bootstrap package EOF } > "$OUT" && echo "$OUT" || rm "$OUT" } # repackage for i in "$@"; do mkspec "$i"; done
prev parent reply other threads:[~2021-11-16 9:50 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-13 21:26 [devel-ports] renoarch: noarch.rpm -> src.rpm Michael Shigorin 2021-11-15 11:14 ` Ivan A. Melnikov 2021-11-16 9:50 ` Michael Shigorin [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20211116095044.GA27326@imap.altlinux.org \ --to=mike@altlinux.org \ --cc=devel-ports@lists.altlinux.org \ --cc=devel@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux architecture porting This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel-ports/0 devel-ports/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel-ports devel-ports/ http://lore.altlinux.org/devel-ports \ devel-ports@lists.altlinux.org devel-ports@lists.altlinux.ru devel-ports@lists.altlinux.com public-inbox-index devel-ports Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel-ports AGPL code for this site: git clone https://public-inbox.org/public-inbox.git