How do I install an entire directory under /var with rpm

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

 



> I am at total confused. Look though several example, to try to
> create a spec file to install some simple shell scripts in a
> specified directory location (e.g. /var/q-statusLinux) to collect
> data (no compiled program required). I can update the package
> registered, but can not make rpm install the program. I want to more
> this around on several servers. Here is my simple spec file. What AmI
missing?

Based on the spec, I'd say its that you aren't actually doing anything with
the contents of the tarball.  I made some comments inline below.  Here are
some reference links that are very helpful:

http://fedoraproject.org/wiki/Packaging/Guidelines
http://fedoraproject.org/wiki/Packaging/RPMMacros
https://fedoraproject.org/wiki/PackageMaintainers/Packaging_Tricks
http://www.redhat.com/promo/summit/2008/downloads/pdf/Wednesday_130pm_Tom_Callaway_OSS.pdf


> My tar-gz file for the spec file consist of the entire directory
> with the collection scripts, I wish to install (e.g. q-
> StatusLinux-5.10.tar.gz). I want this code directory installed under
> /var (e.g. /var/q-statusLinux). Can rpm do this or does it only work
> with c-code?  If it can how do I make this happen?
It handles compiled and uncompiled code just fine, uncompiled is just a
little different because you don't have the whole make && make install
process.

>
-------------------------------------------------------------------------------------------

> # RPM Spec file for q-StatusLinux 5.10
> # No debuginfo:
> #%%define debug_package %{nil}
>
> %define _topdir  /home/mbarto/rpm
> %define _tmppath %{_topdir}/tmp
>
> %define name      q-statusLinux
> %define summary   q-Status Linux Collections Scripts for Server Client.
> %define version   5.10
> %define release   Base
> %define license   GPL
> %define group     Applications/System
> %define source    %{name}-%{version}.tar.gz
> %define url       http://www.logiqwest.com
> %define vendor    LogiQwest
> %define packager  Michael Barto
> %define buildroot %{_tmppath}/%{name}-root
>
You really shouldnt do it this way.  The following entries generate the
defines you did just above here.

> Name:      %{name}
> Summary:   %{summary}
> Version:   %{version}
> Release:   %{release}
> License:   %{license}
> Group:     %{group}
> Source0:   %{source}
> BuildArch: noarch
> Requires:  filesystem, bash, grep
> Provides:  %{name}
> URL:       %{url}
> Buildroot: %{buildroot}
>
> %description
> Collection scripts for q-status, a Web 2.0 based server analysis and
> configuration program that places at the system administrator's
> finger tips the
> ability to display and analyze the hardware and software for their
servers.
>
> %prep
> %setup -q
>
> %build
>
> %install
here you need to do some work with the contents of the tarball ie:

rm -rf %{buildroot}
mkdir -p %{buildroot}%{_localstatedir} # Btw.. why are you putting scripts
in /var???
cp -pr %{name} %{buildroot}%{_localstatedir}

>
> %clean
> rm -rf %{buildroot}
>
> %files
> %defattr(-,root,root)
Here you need to list each of the files that are now in the
/var/q-statusLinux directory



-greg



[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