LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   RPM: Copying files to desired loc using %install directive (https://www.linuxquestions.org/questions/linux-software-2/rpm-copying-files-to-desired-loc-using-install-directive-145518/)

raqueeb 02-12-2004 10:47 PM

RPM: Copying files to desired loc using %install directive
 
Hello there!

I'm little confused about the rpm's spec file. I was trying to create
a rpm where I just need to copy some files to desired directories and
edit some existing system configuration files. So I thougth of not
making any Makefile cause I'll copy the required files from source tar
ball file as placed in default /usr/src/redhat/SOURCES directory and
modify few existing files from %install directive in spec file placed
in default SPECS directory.

Sample to do list:

1. Please create a directory "/usr/X11R6/lib/X11/fonts/bangla" and
copy the font files in that directory.

2. Copy the file "bn_BD" in "/usr/share/i18n/locales/" directory.

<snip>
10. Now you need to edit a file to indicate the fonts path. Edit the
file "/etc/fonts/fonts.conf" and add line(s) as section below that.
<dir>/usr/X11R6/lib/X11/fonts/bangla</dir>

Now, when I used RUST (rusthq.com), it generated a spec file for
me.

--------
%install

$MKDIR -p $RPM_BUILD_ROOT/usr/X11R6/lib/X11/fonts/bangla
$MKDIR -p $RPM_BUILD_ROOT/usr/share/i18n/locales

$CP ./usr/X11R6/lib/X11/fonts/bangla/muktibold.ttf $RPM_BUILD_ROOT/usr/X11R6/lib/X11/fonts/bangla/muktibold.ttf
$CP ./usr/share/i18n/locales/bn_BD $RPM_BUILD_ROOT/usr/share/i18n/locales/bn_BD
--------

Now, why is it creating directories and copying files in
$RPM_BUILD_ROOT which I've assigned in /tmp dir? Is it not enough that
I copy those files using these lines ....?

cp -f ./font/*.* /usr/X11R6/lib/X11/fonts/bangla/
cp -f bn_BD /usr/share/i18n/locales/

I thought that if I include the files list in %files directive it
should copy those automatically to desired location, shouldn't it?

%files
/usr/X11R6/lib/X11/fonts/bangla/muktibold.ttf
/usr/share/i18n/locales/bn_BD

How do I copy executable files to all home directories using shell
script, please?

I read both redhat rpm guide and maximum rpm, but they mostly dealt
with Makefile. Thanks for your time.

Thanks in advance.

Raqueeb Hassan
Democratic Republic of Congo


All times are GMT -5. The time now is 11:42 PM.