Re: base directory for files section of spec file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I recommend that you make a tarball of your files.  This way you can 
generate a Source RPM so that you can reproduce the binary RPM 
regardless of that happens to your home directory.  

cd to template_dir. 
tar zcvf /usr/src/redhat/SOURCES/sourcefile.tgz *

Add the following BuildRoot directive to the top of the spec (verbatim). 
BuildRoot:  %{_tmppath}/%{name}-%{version}  

List your source (without a path): 
Source0:  sourcefile.tgz

In the %install section of the spec file: 
%install
cd $RPM_BUILD_ROOT
tar zxvf %{SOURCE0}

Now just list your files, without any special prefix.  RPM knows
to look in the $RPM_BUILD_ROOT
%files
/etc//file1.conf
/usr/local/bin/*
..

On Saturday 03 January 2004 02:08 am, Hugh Beaumont wrote:
> Hi List,
>
> I am writing a simple spec file which installs some files. No build, or
> install steps are done. I have a "template" file system inside my
> /home/my_user/ dir which I keep the files in. I want to be able to update
> those files and then re-build my rpm to put them in their proper place on
> the file system. A bit like if I tar'd them all up and then un-tarred them
> with a forced base dir of /
>
> Does that make sense?
>
> For example, If I have a set of files :
>
> /home/my_user/template_dir/etc/file1.conf
> /home/my_user/template_dir/usr/local/bin/some_file
> /home/my_user/template_dir/usr/local/doc/some_file.txt
>
> which I want rpm to install as:
>
> /etc/file1.conf
> /usr/local/bin/some_file
> /usr/local/doc/some_file.txt
>
> How would I go about doing this? I know I could have a post step to mv the
> file all around but I assume there is an easier and more elegant way.
>
> Any advice?
>
> Thanks!
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Find out what made the Top Yahoo! Searches of 2003
> http://search.yahoo.com/top2003
>
>
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/rpm-list

-- 
Bart Whiteley <bwhiteley@xxxxxxxxxx>
Novell, Inc.  The leading provider of information solutions. 
http://www.novell.com/


_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux