Farinet wrote:I have a USB Wlan stick (D-Link DWA 140) which should work under linux and i even found the packages which should contain the needed drivers (rt2870-2.4.0.1-1.fc13.src.rpm and rt2870-firmware-2.3.0.0-1mamba.noarch.rpm - using another computer). I tried to install that packages by "yum localinstall <packagename>" but that didn't work. Yum told me it did not find the Terrasoft mirror and it could not resolve the name - which i'm taking in the way, yum is looking to get an internet connection, which obviously is impossible until i' m not getting to work the wifi (in one way or another).
A src.rpm includes the original source archive, any patches, a .spec file which tells the rpmbuild command how to extract, patch, compile, what/where files are installed, build requirements, special requirements to run, etc. So you can't install a src.rpm (aka SRPM) that way, but it's often useful to use one for creating your own rebuild of an rpm for your system.
The noarch.rpm means you should be able to install it on any CPU architecture, but still it may be for a particular Linux distribution so there's no guarantee it will work.
Creating an rpm package from a srpm package is not terribly difficult, but it's best to configure your system for building them first. So here goes...
Steps:
1. Set up your system so you can build RPMs using your regular user account instead of root:
Create the directories needed: (logged in as regular user, not root)
- Code: Select all
mkdir ~/rpmbuild
- Code: Select all
cd rpmbuild
- Code: Select all
mkdir BUILD RPMS SOURCES SPECS SRPMS
Create an .rpmmacros file in your home directory which points to the ~/rpmbuild directory you just created:
- Code: Select all
echo %_topdir $HOME/rpmbuild > ~/.rpmmacros
The contents of ~/.rpmmacros file should look something like this now:
%_topdir /home/bill/rpmbuild(with your username instead of mine, of course)
2. Then you can either try a straight rebuild of the src.rpm or use
rpm to install the src.rpm and build from the .spec file (which is a text file you can review or modify as needed).
If you install the src.rpm using this (still as regular user, not root!):
rpm -ivh /path/to/your.src.rpm
It will install the source archive and spec file in your ~/rpmbuild/SOURCES and ~/rpmbuild/SPECS directories you created earlier. NOTE: Recent versions of Fedora and probably other distros use a different version of rpm/rpmbuild that may create problems when you try to install the src.rpm using the method above. In that case, you can open the src.rpm in the archive manager (file-roller) and extract the files to the appropriate directories manually).
For rebuilding a src.rpm with no changes, you can try:
setarch ppc rpmbuild --rebuild --ppc /path/to/your.src.rpm
If you want to build from the .spec file (which you may want to review since it will (usually) show packages required to build), then:
cd ~/rpmbuild/SPECS
setarch ppc rpmbuild -ba --ppc filename.spec
(replace filename with actual name of spec file)
If the
rpmbuild command isn't found you'll need to install that -- I believe it should be on your install DVD. You can browse the contents of the DVD and just double-click on it to open in software installer if needed. Or use
rpm -ivh /path/to/the.rpm to install ...
3. Assuming rpmbuild manages to finish with an
exit 0 (no error) you should have a new rpm package in your ~/rpmbuild/RPMS/ppc (or noarch depending on what you're building) directory which you can install using the
rpm -ivh command. Note that
rpm doesn't fetch dependencies for you, so if the package requires other rpm's you'll need to install them manually as well.
There are huge amounts of documentation on rpm building, spec files, etc. so this is just a very quick crash-course!