Austin Acton wrote:
> Since Han is working on an updated skeleton file, I thought some of you
> might be interested in this.
>
> This is a little script that I use all the time to make a non-root RPM
> building environment (directories, .rpmrc, .rpmmacros).
My approach was going to be to do this all from inside a .rpmmacros
file, but I haven't gotten around to adding the making of directories
yet. Try this rpmmacros file for size ...
To complete it, one would replace
%_my_rpmdir %{_my_homedir}/rpm
with something like this:
%_my_rpmdir %([ -e %{_my_homedir}/rpm ] || mkdir -p %{_my_homedir}/rpm;
echo %{_my_homedir}/rpm)
Obviouly this would appear a few times in the .rpmmacros file, so it
should be replace with another macro which takes the directory as argument.
Then, rpm-build or something else could place this .rpmmacros in /etc/skel
> P.S. At the very least, this should be installed on klama!
I don't know, I just scp'ed my .rpmmacros file and did a 'mkdir -p
'~/rpm/{tmp,BUILD,SOURCES,SPECS,RPMS/{noarch,i586}}'
Buchan
--
|--------------Another happy Mandrake Club member--------------|
Buchan Milne Mechanical Engineer, Network Manager
Cellphone * Work +27 82 472 2231 * +27 21 8828820x121
Stellenbosch Automotive Engineering http://www.cae.co.za
GPG Key http://ranger.dnsalias.com/bgmilne.asc
1024D/60D204A7 2919 E232 5610 A038 87B1 72D6 AC92 BA50 60D2 04A7
# This .rpmmacros is set up so that you can just configure the
# parameters below, and then by default you will have official
# mandrake releases (default), PLF releases (plf) and you own RPMs
# kept seperately.
# The directory structure is by default like this:
# ~/rpm/{tmp,BUILD,SOURCES}
# ~/rpm/mdk/{SRPMS.$REL,RPMS.$REL/{i586,noarch},SPECS.$REL}
# ~/rpm/plf/{src,$REL/{i586,noarch},SPECS}
# These you should configure for yourself, but defaults should be reasonable
%_my_homedir %(echo $HOME)
# Where scripts are found (like find-requires-nonvidia)
%_my_bindir %{_my_homedir}/bin
%_my_rpmdir %{_my_homedir}/rpm
# Use the comment field of the passwd entry as name:
%_my_name %(getent passwd $USER|awk -F: '{print $5}')
# Use this if you workstation has working mail:
%_my_mail %(echo $USER@`hostname`)
# Use this if your machines have working mail for their domain:
#%_my_mail %(echo $USER@`hostname -d`)
# If you have a Mandrake account, assume it's with the same username:
%_mdk_mail %(echo $[EMAIL PROTECTED])
%_plf_mail %(echo $USER@`hostname`)
%_my_ext %(echo $USER|cut -b1-3)
# More configuration options, but shouldn't need to be changed:
%_mdk_vendor MandrakeSoft
%_plf_ext plf
%_plf_vendor Penguin Liberation Front
%_target linux
%vendor %(echo %release | awk --source '{v = "%_mdk_vendor"} /plf$/ { v
= "%_plf_vendor" } /%_my_ext$/ { v = "%_my_realname" } { print v}')
%distro_rel %(awk '{print $4}' /etc/mandrake-release)
%distro mdk%{distro_rel}
%_topdir %(echo %release | awk '{v = "%{_my_rpmdir}/mdk"} /plf$/ { v =
"%{_my_rpmdir}/%{_plf_ext}" } /%{_my_ext}$/ { v = "%{_my_rpmdir}/%{_my_ext}" } { print
v}')
%_rpmdir %(echo %release | awk '{v = "%_topdir/RPMS.%distro"} /plf$/ {
v = "%_topdir/%distro_rel" } { print v}')
%_srcrpmdir %(echo %release | awk '{v = "%_topdir/SRPMS.%distro"} /plf$/ {
v = "%_topdir/src" } { print v}')
# Have only one directory of each of these:
%_tmppath %{_my_rpmdir}/tmp
%_builddir %{_my_rpmdir}/BUILD
#%_sourcedir %{_my_rpmdir}/SOURCES.empty
%_sourcedir %{_my_rpmdir}/SOURCES
%packager %(echo %release | awk '{v = "%{_my_name} <%{_my_mail}>"} /mdk$/
{ v = "%{_my_name} <%{_mdk_mail}>" } { print v}')
%_signature gpg
%_gpg_name %{_my_name}
%_gpg_path ~/.gnupg
%distribution Mandrake Linux
%__find_requires %{_my_bindir}/find-requires-nonvidia %{?buildroot:%{buildroot}}