Come al solito salvare il contenuto in un file con estenzione .sh
Code: Select all
#!/bin/bash
echo "SCRIPT universale per avere una macchina sforna rpm mib pronta all'uso";
echo "M.I.B. - 2009 by Odites";
ar=$(uname -m)
mkdir -p /home/$USER/rpm/{BUILD,RPMS/${ar},RPMS/noarch,SOURCES,SRPMS,SPECS,tmp}
echo "Per cortesia ci diresti il tuo nome e la tua mail?? [esempio: Odites <[email protected]>]" && read mail
echo "%_topdir /home/$USER/rpm
%_tmppath /home/$USER/rpm/tmp
%_bindir /usr/bin
%_mandir /usr/share/man
%_datadir /usr/share
%_sysconfdir /etc
# If you want your packages to be GPG signed automatically, add these three lines
# replacing 'Mandrivalinux' with your GPG name. You may also use rpm --resign
# to sign the packages later.
%_signature gpg
%_gpg_name Mandrivalinux
%_gpg_path ~/.gnupg
# Add your name and e-mail into the %packager field below. You may also want to
# also replace vendor with yourself.
%packager ${mail}
%distribution Mandriva Linux
%vendor MIB - Mandriva Italia Backports - http://mib.pianetalinux.org/
# If you want your packages to have your own distsuffix instead of mdv, add it
# here like this
%distsuffix mib" > /home/$USER/.rpmmacros
echo "Ora installiamo il necessario per compilare, per favore scrivi la tua password di root"
su root -c "/usr/sbin/urpmi rpm-build"
echo "ciao ciao" && exit
Code: Select all
sh nome_script.sh
PS: So che mi odiate per tutti questi script però mi sono utilissimi quando devo installare mandriva su una nuova macchina XD