Re: include external file in %pre section

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

 



On Fri, 2005-07-29 at 14:21 +0000, Dick wrote:
> Paul Nasrat <pnasrat <at> redhat.com> writes:
> > Something like this should work.
> > Source1: included.txt
> > ...
> > 
> > %pre
> > cat > /tmp/included << @EOF
> > %include %SOURCE1
> > @EOF
> 
> Are you sure? I thought that the sources are only available at build phase, not
> at installation phase.

It's not available at installation phase - but all macros are expanded
at build time - so the included file is expanded at build time.

I tested this.

cat ../SOURCES/included.txt
IAMINCLUDED

Trivial spec:

Summary: Includer
Name: includer
Version: 1.0
Release: 1
License: BSD
Group: Development/Libraries
AutoReqProv: no
Source1: included.txt
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
BuildArch: noarch
%description
Other.

%pre
cat > /tmp/included << @EOF
%include %SOURCE1
@EOF

%files

rpm -qp --scripts ../RPMS/includer-1.0-1.noarch.rpm
preinstall scriptlet (using /bin/sh):
cat > /tmp/included << @EOF
IAMINCLUDED
@EOF

Paul


[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