On Tue, Mar 3, 2009 at 3:14 PM, Jeff Johnson <[email protected]> wrote:
>
> On Mar 3, 2009, at 6:36 AM, Per Øyvind Karlsen wrote:
>
> 2009/3/3 Anders F Björklund <[email protected]>
>
>> Per Øyvind Karlsen wrote:
>>
>> I did the other day a fresh mandriva cooker install and noticed with rpm
>>> 4.6.0 a welcomed
>>> change, the automatic creation and use of a local ~/rpmbuild for user
>>> rather than /usr/src/rpm.
>>>
>>> Since this makes it easier to just get a working rpm build environment
>>> for user and also
>>> removes the implicit encouragement of packaging using /usr/src/rpm as
>>> root, would anyone
>>> have anything against introducing same behaviour as rpm.org in rpm5.orgHEAD?
>>>
>>
>> You can set that with the --with-path-sources configure option, if
>> scared of ~/.rpmmacros. I believe rpm.org uses "%{getenv:HOME}/rpmbuild"
>
> Yes, but what I also would like is the automatic creation of these
> directories as well.
>
>
> Everything except the automatic/lazy creation of %{_topdir} has existed in
> RPM for years IIRC. I certainly use some variant of the lazy creation daily
> while building packages in
> /X/%{NAME}
>
Yep. I forget to tell this. RPM5 have already the "nice", but not so "new",
rpm.org feature of automatic build creation.
For example
[t...@rhel5 ~]$ id
uid=10002(test) gid=10002(test) gruppi=10002(test)
context=root:system_r:unconfined_t:SystemLow-SystemHigh
[t...@rhel5 ~]$ ls -la * NO L DIRECTORY NOTICE
totale 88
drwx------ 3 test test 4096 3 mar 18:10 .
drwxr-xr-x 6 root root 4096 3 mar 18:05 ..
-rw------- 1 test test 214 3 mar 18:05 .bash_history
-rw-r--r-- 1 test test 33 3 mar 18:05 .bash_logout
-rw-r--r-- 1 test test 176 3 mar 18:05 .bash_profile
-rw-r--r-- 1 test test 124 3 mar 18:05 .bashrc
-rw-r--r-- 1 test test 515 3 mar 18:05 .emacs
drwxr-xr-x 4 test test 4096 3 mar 18:05 .mozilla
-rw-r--r-- 1 test test 383 3 mar 18:05 .rpmmacros
-rw------- 1 test test 1102 3 mar 18:10 .viminfo
-rw-r--r-- 1 test test 658 3 mar 18:05 .zshrc
[t...@rhel5 ~]$ cat <<EOF >.rpmmacros
%_topdir %(echo $HOME)/L
%_Ltopdir %{_topdir}/%{name}
%_Rtopdir %(echo $HOME)/%{name}
%_builddir %{_Ltopdir}
%_Rsourcedir %{_Rtopdir}
%_sourcedir %{_Ltopdir}
%_Rpatchdir %{_Rtopdir}
%_patchdir %{_Ltopdir}
%_Rspecdir %{_Rtopdir}
%_specdir %{_Ltopdir}
%_rpmdir %{_Ltopdir}
%_srcrpmdir %{_Ltopdir}
%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
%_tmppath %{_topdir}/tmp
EOF
# NOTICE ALL COLLAPSE ON L/%{name} in this example
[t...@rhel5 ~]$ rpm -Uvh /tmp/iftop-0.16-4.src.rpm
Preparing... ###########################################
[100%]
1:iftop ###########################################
[100%]
[t...@rhel5 ~]$
rpm -Uvh /tmp/iftop-0.16-4.src.rpm
Preparing... ###########################################
[100%]
1:iftop ###########################################
[100%]
[t...@rhel5 ~]$ ls -lR L
L:
totale 8
drwxr-xr-x 2 test test 4096 3 mar 18:14 iftop
L/iftop:
totale 168
-rw-rw-r-- 1 test test 153446 8 nov 2004 iftop-0.16.tar.gz
-rw-rw-r-- 1 test test 1343 7 apr 2005 iftop.spec
[t...@esil231 ~]$ rpmbuild -ba L/iftop/iftop.spec
Esecuzione(%prep): /bin/sh -e /home/test/L/tmp/rpm-tmp.344
+ umask 022
+ cd /home/test/L/iftop
+ LANG=C
.........................................
Regards