Re: Why are my binary files going into the bin/ folder

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

 



On Thu, Jan 8, 2009 at 2:52 PM, Paul Krauss <pkrauss@xxxxxxxxxxxx> wrote:
> Creating a binary only rpm with 2 executables in it
>
> I am creating the *.rpm as a non-root user by setting the %_topdir in
> .rpmmacros
>
> My BuildRoot in the *.spec is set to /opt/%{name}
>
> My .rpm is created in the /RPMS folder and I ship it to my destination
> computer.
>
>
>
> However, when I install the rpm on the destination computer the binaries are
> put in the /bin/ folder
>
>

Your spec file's install command determines where files are put.  If
you put them into $BUILDROOT/bin, then they show up on /bin in your
system.  A mistake like that may happen if you don't have the prefix
set properly in your configure statement, or if the environment's
prefix variable is set to / rather than /usr.  There would be some
command like "make install DESTDIR=$BUILDROOT/usr" or "make
PREFIX=$BUILDROOT/usr" or maybe /usr is replaced by a macro like
%_prefix or something. Your spec file should hava  files statement as
well that grabs the files you need.

You can check this without installing the questionable rpm, by the way.
Look at the rpm you created.  Run

rpm -qilp your-rpm.i386.rpm

it lists the files in there.

To get this right, I suggest you take a spec file from some existing
project and just edit it to your purpose.  Starting from scratch leads
to mistakes, such as installing files in /bin.

Here's a very small spec file I use to install one file from the
package.  This will probably help you see what to do


Name:           emacs-ess-kups
Url:            http://pj.freefaculty.org/
License:        GPL
Group:          User Interface/Desktops
Version:        1.0
Release:        1%{?dist}

Summary:        Emacs startup configuration for KU lab meta package
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source5:        http://pj.freefaculty.org/%{version}/emacs-ess-kups.el


Requires:       R, emacs, emacs-ess


%description
Emacs-ess configuration for KU political science.


%install
rm -rf %{buildroot}

mkdir -p %{buildroot}/usr/share/emacs/site-lisp/site-start.d
install -m 755 %{SOURCE5} $RPM_BUILD_ROOT/usr/share/emacs/site-lisp/site-start.d

%clean
rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
/usr


%changelog
* Fri Feb 1 2008 Paul Johnson <pauljohn@xxxxxx> 0.1
- Create
pj

>
> Why aren't they going into the /opt/ folder like I wanted?
>
>
>
> Thanks
>
> _______________________________________________
> Rpm-list mailing list
> Rpm-list@xxxxxxxxxxxxx
> http://lists.rpm.org/mailman/listinfo/rpm-list
>
>



-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/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