Re: make rpm

Andreas Dilger (adilger@turbolinux.com)
Mon, 30 Jul 2001 13:34:28 -0600 (MDT)


Alan writes:
> scripts/mkspec

Probably clearer to make it a "here" document (untested). EXTRASHORT could
have been left inline (inside ``), but it is a bit clearer this way, I think.

#!/bin/sh
#
# Output a simple RPM spec file that uses no fancy features requring
# RPM v4. This is intended to work with any RPM distro.
#
# The only gothic bit here is redefining install_post to avoid
# stripping the symbols from files in the kernel which we want
#
EXTRASHORT=`echo $EXTRAVERSION | sed -e "s/-//"`

cat - << EOT
Name: kernel
Summary: The Linux Kernel
Version: $VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRASHORT
Release: `cat .version`
Copyright: GPL
Group: System Environment/Kernel
Vendor: The Linux Community
URL: http://www.kernel.org
Source: kernel-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRASHORT.tar.gz
BuildRoot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root
%define __spec_install_post /usr/lib/rpm/brp-compress || :

%description
The Linux Kernel, the operating system core itself

%prep
%setup -q

%build
make oldconfig dep clean bzImage modules

%install
mkdir -p $RPM_BUILD_ROOT/boot $RPM_BUILD_ROOT/lib $RPM_BUILD_ROOT/lib/modules
INSTALL_MOD_PATH=$RPM_BUILD_ROOT make modules_install
cp arch/i386/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION

%clean
#echo -rf $RPM_BUILD_ROOT

%files
%defattr (-, root, root)
%dir /lib/modules
lib/modules/$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION

EOT

-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/