LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   RPM RPM_BUILD_ROOT not seeming to work (https://www.linuxquestions.org/questions/linux-software-2/rpm-rpm_build_root-not-seeming-to-work-923140/)

clcbluemont 01-10-2012 06:20 PM

RPM RPM_BUILD_ROOT not seeming to work
 
For some reason when I run as myself, ie. not root:
rpmbuild -vv -bb SPECS/build_windrvr.spec

I am dying at:
./setup_inst_dir
touch: cannot touch `/etc/.windriver.rc': Permission denied
./setup_inst_dir: line 17: /etc/.windriver.rc: Permission denied
make: *** [install] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.41869 (%install)

It appears that rpmbuild is trying to build in the root directory despite direct attempts to make that not happen. Any ideas why the folling spec files is causing this?:
%define _topdir /usr/src/redhat/rpmbuild
%define name WinDrvr
%define release 1
%define version 8.11
%define buildroot %{_topdir}/%{name}-%{version}-root

BuildRoot: /usr/src/redhat/rpmbuild/tmp
Summary: Project WinDriver
Name: %{name}
Version: %{version}
Release: %{release}
License: GPL
Prefix: /
Group: System Environment/Kernel
Source: %{name}-%{version}.tar.bz2
BuildRequires: %kernel_module_package_buildreqs

%description
WinDriver for Project.

%prep
%setup -n WD/WinDriver-v8.11/redist

%build
./configure --prefix=$RPM_BUILD_ROOT
make -j4

%install
make ROOT="$RPM_BUILD_ROOT" install

%files
%defattr(-,root,root)
/usr/lib/libwdapi811_32.so
/lib/modules/2.6.18-128.el5/kernel/drivers/misc/windrvr6.ko
/usr/local/bin/pcidemo.gcc.linux64.POWER5
/etc/init.d/load_windriver.sh
/etc/.windriver.rc


The spec file is ugly, but it is as it is because I can't seem to whack it into shape. Thank you for any time that you can give this.

unSpawn 01-10-2012 06:50 PM

Since you defined your %{buildroot} in the .spec file (though it's the wrong one: should reside under %_topdir which is some form of ~/[anydirname]/) and have run configure with the right --prefix it could be 'make install' isn't the right syntax (try 'make DESTDIR=$RPM_BUILD_ROOT install'?) else "setup_inst_dir" contents should have the prefix changed. If your %{buildroot} setting it isn't propagated through ./configure you could massage the script directly using 'sed'?..

clcbluemont 01-11-2012 04:02 PM

Thank you, it turns out --prefix has no affect on installation. Ran configure, and make with --prefix outside the RPM context. I guess a tarball may be a better way to go.

Was just hoping that I could build a SRPM in the case where the driver was used with another kernel version and non-Linux type could easily install.

unSpawn 01-11-2012 05:54 PM

Quote:

Originally Posted by clcbluemont (Post 4572230)
it turns out --prefix has no affect on installation.

That is not a problem with RPM but with the configure and generated Makefile. Installing components manually using 'install' in the %install section should be easy as I see you don't need to distribute much.


Quote:

Originally Posted by clcbluemont (Post 4572230)
I guess a tarball may be a better way to go. Was just hoping that I could build a SRPM in the case where the driver was used with another kernel version and non-Linux type could easily install.

Apparently you're thinking of distributing a LKM. Maybe look into using DKMS? (BTW I hope you've got any %license issues sorted out as Jungo's libwdapi811 isn't distributed under a typical F/OSS license AFAIK.)


All times are GMT -5. The time now is 01:00 PM.