LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 01-29-2008, 12:11 AM   #1
AutoC
Member
 
Registered: Jan 2008
Posts: 30

Rep: Reputation: 15
rpm spec file help


here is the rpm spec file i've written so far
Quote:
Version: 1.0
Release: 1
License: GPL
Group: Applications/Office

Source0: mmi-1.0-1.tar.gz
URL: NA
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
The Multi-Modal Interface reads input from a file and feeds it to the tty buffer
which displays it in the current window
#
# Prep Section
#
%prep
%setup -q
#
# Build Section
#
%build
make clean
make
#
# Install Section
#
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/lib/modules/$(shell uname -r)/kernel/drivers/char/
cp mmiModule.ko $RPM_BUILD_ROOT/lib/modules/$(shell uname -r)/kernel/drivers/char/
mkdir -p $RPM_BUILD_ROOT/etc/
echo "rm -rf /dev/char_device &> /dev/null" >> $RPM_BUILD_ROOT/etc/rc.local
echo "/bin/mknod /dev/char_device c 101 0" >>$RPM_BUILD_ROOT/etc/rc.local
echo "chmod 777 /dev/char_device" >>$RPM_BUILD_ROOT/etc/rc.local
echo "modprobe -a mmi" >> $RPM_BUILD_ROOT/etc/rc.local
echo "alias mmi mmiModule" >> $RPM_BUILD_ROOT/etc/modprobe.conf
mkdir -p $RPM_BUILD_ROOT/bin/
mkdir -p $RPM_BUILD_ROOT/dev/
$RPM_BUILD_ROOT/bin/mknod $RPM_BUILD_ROOT/dev/char_device c 101 0
chmod 777 $RPM_BUILD_ROOT/dev/char_device
depmod
modprobe -a mmi
#
# Clean Section
#
%clean
rm -rf $RPM_BUILD_ROOT
Usually its not that difficult but this is a character driver rpm.So any help with the install section is appreciated.All the commands to install the driver are in there.
Because it does everything in virtual directories,it created new versions of rc.local and modprobe.conf and says mknod couldnt be found.

Last edited by AutoC; 01-29-2008 at 03:00 AM.
 
Old 01-29-2008, 07:42 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592
Please post your build log.
 
Old 01-29-2008, 10:28 PM   #3
AutoC
Member
 
Registered: Jan 2008
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by unSpawn View Post
Please post your build log.
Ive modified my spec file..this is the one

Quote:
#
# Preamble in spec file for Multi-Modal Interface
#
Summary: A Multi-Modal Interface to the computer.
Name: mmi
Version: 1.0
Release: 1
License: GPL
Group: System Environment/Kernel

Source0: mmi-1.0-1.tar.gz
URL: NA
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
The Multi-Modal Interface reads input from a file and feeds it to the tty buffer
which displays it in the current window
#
# Prep Section
#
%prep
%setup -q
#
# Build Section
#
%build
make clean
make
#
# Install Section
#
%install
rm -rf $RPM_BUILD_ROOT
#
# Clean Section
#
%clean
rm -rf $RPM_BUILD_ROOT
#
# Post Section
#
%post
kversion =`uname -r`
mkdir -p /lib/modules/$(kversion)/kernel/drivers/char/
cp mmiModule.ko /lib/modules/$(kversion)/kernel/drivers/char/
mkdir -p /etc/
mkdir -p /usr/lib/debug/
mkdir -p /bin/
mkdir -p /dev/
mknod /dev/mmi-1.0 c 101 0
chmod 777 /dev/mmi-1.0
echo "rm -rf /dev/mmi-1.0 &> /dev/null" >> /etc/rc.local
echo "mknod /dev/mmi-1.0 c 101 0" >> /etc/rc.local
echo "chmod 777 /dev/mmi-1.0" >> /etc/rc.local
echo "modprobe -a mmiModule" >> /etc/rc.local
depmod
modprobe -a mmiModule
#
# Files Section
#
%files
%defattr(-,root,root)
/lib/modules/$(kversion)/kernel/drivers/char/mmiModule.ko
/dev/mmi-1.0
my log is as follows

Quote:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.18105
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /usr/src/redhat/BUILD
+ rm -rf mmi-1.0
+ /usr/bin/gzip -dc /usr/src/redhat/SOURCES/mmi-1.0-1.tar.gz
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd mmi-1.0
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.18105
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd mmi-1.0
+ LANG=C
+ export LANG
+ unset DISPLAY
+ make clean
make -C /lib/modules/2.6.11-1.1369_FC4/build M=/usr/src/redhat/BUILD/mmi-1.0 clean
make[1]: Entering directory `/usr/src/kernels/2.6.11-1.1369_FC4-i686'
CLEAN /usr/src/redhat/BUILD/mmi-1.0/.tmp_versions
make[1]: Leaving directory `/usr/src/kernels/2.6.11-1.1369_FC4-i686'
+ make
make -C /lib/modules/2.6.11-1.1369_FC4/build M=/usr/src/redhat/BUILD/mmi-1.0 modules
make[1]: Entering directory `/usr/src/kernels/2.6.11-1.1369_FC4-i686'
CC [M] /usr/src/redhat/BUILD/mmi-1.0/mmiModule.o
Building modules, stage 2.
MODPOST
CC /usr/src/redhat/BUILD/mmi-1.0/mmiModule.mod.o
LD [M] /usr/src/redhat/BUILD/mmi-1.0/mmiModule.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.11-1.1369_FC4-i686'
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.1587
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd mmi-1.0
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /var/tmp/mmi-1.0-1-root
+ /usr/lib/rpm/find-debuginfo.sh /usr/src/redhat/BUILD/mmi-1.0
find: /var/tmp/mmi-1.0-1-root: No such file or directory
0 blocks
find: /var/tmp/mmi-1.0-1-root/usr/lib: No such file or directory
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
Processing files: mmi-1.0-1
error: File not found: /var/tmp/mmi-1.0-1-root/lib/modules/$(kversion)/kernel/drivers/char/mmiModule.ko
error: File not found: /var/tmp/mmi-1.0-1-root/dev/mmi-1.0
Processing files: mmi-debuginfo-1.0-1


RPM build errors:
File not found: /var/tmp/mmi-1.0-1-root/lib/modules/$(kversion)/kernel/drivers/char/mmiModule.ko
File not found: /var/tmp/mmi-1.0-1-root/dev/mmi-1.0
thanks for any help
 
Old 01-30-2008, 08:25 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592Reputation: 3592
Ah. You don't %install anything. Make %install install the %_builddir/mmiModule.ko into $RPM_BUILD_ROOT/lib/modules/$(kversion)/kernel/drivers/char/.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rpm (or .spec file) newbie question powah Red Hat 2 08-28-2007 10:44 AM
rpm spec file alrawab Linux - General 2 03-28-2007 06:39 AM
RPM Spec file adddy Linux - Software 8 11-07-2006 05:02 AM
%file attribute for RPM SPEC files Brian of Gep Fedora 0 06-15-2004 07:12 PM
RPM Spec file creation: %file section question davidas Linux - Newbie 0 03-16-2004 10:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 07:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration