VineSeed ML アーカイブ



[VineSeed:17671] Re: update: self-build-setup

  • From: Munehiro Yamamoto <munepi@xxxxxxxxxxxxxxxx>
  • Subject: [VineSeed:17671] Re: update: self-build-setup
  • Date: Thu, 28 May 2009 10:39:24 +0900
$B;3K\!w@iMU$G$9!#(B

At Thu, 28 May 2009 00:02:46 +0900,
HARADA Kazutaka wrote:
> $BBh(B2$B2s(B $BDjNc(BIRC$B%_!<%F%#%s%0$GOC$,=P$?!"%S%k%IMQ$N%f!<%6!<$r(B
> $BJL$K:n$k!"$H$$$&7o$NBP1~$rF~$l$F$^$9!#(B
$B<B$O!"F|MKF|$NLk$K$3$N:n6H$H%F%9%H$r$7$F$$$^$7$?!#(B
spec $B$d(B sh $B$rGA$$$?8B$j$G$O!"(B
$B@lMQ%f!<%6$N%f!<%6L>0J30$O!"$@$$$?$$F1$846$8$G$7$?(B (^_^)
# selfbuildrpm/selfbuildrpm $B$H$$$&%f!<%6(B/$B%0%k!<%W$K$7$F$$$^$7$?!#(B

> $B6qBNE*$K$O(B
> (1).self-build-setup.spec $B$N(B %pre $B$G(B
>     %{_sbindir}/useradd -c 'Self build rpm' -u %{user_uid} \
>                         -d '/usr/lib/rpm' selfbuild 2> /dev/null || :
>     $B$H$7$F(B 'selfbuild' $B$H$$$&%f!<%6!<$r:n@.!#(B
>     (%{user_uid}=110 $B$H$7$F%^%/%m$GKAF,$GDj5A(B)
$B@lMQ$N(B uid/gid $B$r:n$C$F!"%G%#%l%/%H%j$O(B /usr/lib $B$G$O$J$/!"(B/var/lib $B$NJ}$,(B
$BE,@Z$@$H;W$$$^$9$,!"G!2?$G$7$g$&$+!)(B
$B$?$H$($P!"(B
  /var/lib/selfbuild
$B$J$I!#(B

%{_sbindir}/groupadd -f -r selfbuild -g %{group_uid}
%{_sbindir}/useradd -c 'Self build rpm' -u %{user_uid} \
                    -d '/var/lib/selfbuild' selfbuild 2> /dev/null || :

$B$^$?!":rHU(B IRC $B$G$"$l$3$lNkLZ$5$s$H2CF#$5$s$HAjCL$7$F$$$?$N$G$9$,!"(B
  $B%7%9%F%`MQ$NM=Ls:Q(B($B8GDj(B) UID/GID $B0lMw(B
  http://trac.vinelinux.org/wiki/WellKnownUigGid
$B$K$h$k$H!"(B
    * $B8GDj@_Dj$N%7%9%F%`MQ(BID $B$O(B 1 $(D"7(B 99 $B$G$9!#(B
    * $B<+F0@_Dj$N%7%9%F%`MQ(BID $B$O(B 100 $(D"7(B 499 $B$G$9!#(B
    * $B<+F0@_Dj$N0lHL%f!<%6MQ(BID $B$O(B 500 $(D"7(B $B$G$9!#(B 
$B$J$N$G!"(Buid $B$r(B 110 $B$K$7$F$$$k$N$O!"(B
$B$b$7$+$7$?$iB>$H$+$V$C$F$7$^$&2DG=@-$,$"$jF@$k$N$G!"(B
1 $B$+$i(B 99 $B$KJQ99$7$?J}$,NI$5$=$&$G$9!#(B

> (2).self-build-rpm.sh $B$NCf$G$O(B su $B%3%^%s%I$G%f!<%6!<;XDj$G(B rpmbuild
>     $B%3%^%s%I$r<B9T!#(B
> --- self-build-rpm.sh.orig	2009-05-27 23:48:07.000000000 +0900
> +++ self-build-rpm.sh	2009-05-27 23:47:04.000000000 +0900
> @@ -60,7 +60,9 @@
>  echo $"Building rpm packages..."
>  echo -n "      "
>  echo $"(see /var/tmp/$_NAME.log for detail.)"
> -if rpmbuild -bb --define="_topdir $_TOPDIR/rpm" /usr/share/$_NAME/$_SPEC >
> /var/tmp/$_NAME.log 2>&1; then
> +# now rpmbuild done by non-root user 'selfbuild'
> +chown -R selfbuild:selfbuild $_TOPDIR
> +if su selfbuild -c "rpmbuild -bb --define=\"_topdir $_TOPDIR/rpm\"
> /usr/share/$_NAME/$_SPEC > /var/tmp/$_NAME.log 2>&1"; then
>      echo -n "     "
>      echo $"rpm packages are successfully built."
>      if ls $_TOPDIR/rpm/RPMS/$_ARCH | grep -e "\.rpm$" > /dev/null ; then
> 
> $B$H$$$&Iw$K$7$F$_$^$7$?!#(B

> # $B@5D>$A$g$C$HIT0B$@$C$?$j$7$^$9!#(B
$B;d$O$$$m$$$m$HD4$Y$?$j$;$:!"(Bsu $B$H(B sudo $B$N%X%k%W$@$1$G(B
su selfbuildrpm -c $B$H$7$F$$$^$7$?(B (^_^)

%post $B$+$i(B %posttrans $B$K0\F0$7$?$N$G!"(B
$B8=:_2?$N%Q%C%1!<%8$,%S%k%I$5$l$F$$$k$N$+J,$+$j$^$;$s$+$i!"(B
 
self-build-rpm.sh $BFb$N(B

# get source

$B$N<jA0$/$i$$$K!"(B

echo -n "  "
echo "$__NAME"

$B$rDI2C$7$?J}$,NI$$$H;W$$$^$9!#(B

$B<h$j5^$.!"<:Ni$$$?$7$^$9!#(B

----------
$B;3K\(B $B=!9((B
Key ID: 0x7637A1D1
Key Fingerprint: 570B C7E6 E5F3 E14F 0898  3EB8 8ECC 8310 7637 A1D1