LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   RPM Spec file (https://www.linuxquestions.org/questions/linux-software-2/rpm-spec-file-499065/)

adddy 11-06-2006 04:58 AM

RPM Spec file
 
--------------------------------------------------------------------------------

I have made a RPM package for a software the spec file is

Summary: Roamware VSMS
Name: RWARVSMS
Version: 6.0
Release: R60805
Copyright: Roamware Inc. Cupertino, USA.
Group: Application
Source: RWARVSMS-6.0.tar.gz
Vendor : Roamware Inc.

%description
It contains binary, cfg, shared libraries, prompts and application specific cron, operations, troubleshooting scripts.

%prep

%setup -q

%install
mkdir -p /opt/Roamware
cp -dRf * /opt/Roamware

%post
#find /opt/Roamware/ -name "*" -exec touch {} \;
cd /opt/Roamware/scripts/
find . -name "*.sh" -exec chmod +x {} \;
find . -name "*.pl" -exec chmod +x {} \;
cd /opt/Roamware/binaries/vsms/bin
find . -name "*" -exec chmod +x {} \;
chown -R roamware /opt/Roamware
chgrp -R roamware /opt/Roamware

%clean
rm -rf

%files

%defattr(-,root,root)

%doc
/opt/Roamware/binaries/vsms/config/vsms.cfg
/opt/Roamware/binaries/vsms/bin/VSMS
/opt/Roamware/logs/vsms/cdr/offline/
/opt/Roamware/libs/libasn1ber.so
/opt/Roamware/libs/libasn1rt.so
/opt/Roamware/libs/libasn1rt.so
/opt/Roamware/scripts/operations/vsms/vsmsperl.ini
/opt/Roamware/scripts/operations/vsms/vsmsperl.pl
/opt/Roamware/scripts/operations/vsms/StartVSMS.sh
/opt/Roamware/scripts/operations/vsms/vsmsperl_demo.pl
/opt/Roamware/scripts/operations/vsms/StopVSMS.sh
/opt/Roamware/scripts/operations/vsms/VSMS.sh
/opt/Roamware/scripts/operations/vsms/AppMonitor.ini
/opt/Roamware/scripts/troubleshooting/vsms/VSMS.ini
/opt/Roamware/scripts/cron/vsms/PurgeUtil.pl
/opt/Roamware/scripts/cron/vsms/PurgeUtil.ini
/opt/Roamware/scripts/perl-pm/vsms/RFC.pm
/opt/Roamware/scripts/perl-pm/vsms/RWIVR.pm
/opt/Roamware/scripts/perl-pm/vsms/RPCModuleDefs.pm
/opt/Roamware/prompts/vsms/en/tryAfterSometime.wav
/opt/Roamware/prompts/vsms/en/noRecentSentMsg.wav
/opt/Roamware/prompts/vsms/en/welcome.wav
/opt/Roamware/prompts/vsms/en/allMsgDeleted.wav
/opt/Roamware/prompts/vsms/en/noMesgInPreviousSession.wav
/opt/Roamware/prompts/vsms/en/tryAgainLater.wav
/opt/Roamware/prompts/vsms/en/noSentMsg.wav
/opt/Roamware/prompts/vsms/en/noMesgInNextSession.wav
/opt/Roamware/prompts/vsms/en/getdigits.wav
/opt/Roamware/prompts/vsms/en/menu.wav
/opt/Roamware/prompts/vsms/en/allSentMsgDeleted.wav
/opt/Roamware/prompts/vsms/en/curMsgSaved.wav
/opt/Roamware/prompts/vsms/en/allReceivedMsgDeleted.wav
/opt/Roamware/prompts/vsms/en/noFilesToPlay.wav
/opt/Roamware/prompts/vsms/en/recipientQuotaExceeded.wav
/opt/Roamware/prompts/vsms/en/noPreviousMsg.wav
/opt/Roamware/prompts/vsms/en/curMsgDeleted.wav
/opt/Roamware/prompts/vsms/en/menu1.wav
/opt/Roamware/prompts/vsms/en/senderQuotaExceeded.wav
/opt/Roamware/prompts/vsms/en/noNextMsg.wav
/opt/Roamware/prompts/vsms/en/cliNotPresent.wav
/opt/Roamware/prompts/vsms/en/noReplayMsg.wav
/opt/Roamware/prompts/vsms/en/noRecentMsg.wav
/opt/Roamware/prompts/vsms/en/menu2.wav

%pre

%changelog
--------------------------------------------------------------------------
if their are changes in source files ,then file names in SPEC file also need to be change.
I have tried putting * instead of file names,but while installing the package it brings all other files from other packages also..
is their any way were do need to put file names in the file section.

unSpawn 11-06-2006 05:30 AM

Remember to *not* build RPM's as root account user. Using wildcards does work. I've made some changes to your spec file to test it:
Code:

Summary: Roamware VSMS
Name: RWARVSMS
Version: 6.0
Release: R60805
Copyright: Roamware Inc. Cupertino, USA.
Group: Application
Source: %{name}-%{version}.tar.gz
Vendor : Roamware Inc.
BuildRoot: %{_tmppath}/%{name}-%{version}

%description
It contains binary, cfg, shared libraries, prompts and application specific cron, operations, troubleshooting scripts.

%prep
%setup -q

%install
mkdir -p ${RPM_BUILD_ROOT}/opt/Roamware
cp -dRf *${RPM_BUILD_ROOT}/opt/Roamware

%post

%clean
if [ -d %{buildroot} ] ; then
  rm -rf %{buildroot}
fi

%files
%defattr(-,root,root)
/opt/Roamware/*

%changelog


adddy 11-06-2006 06:43 AM

RPM spec file
 
can u plz tell me how to run this spec file

adddy 11-06-2006 06:47 AM

plz tell me how to run this command

i m doing it like (without root login) in new directory were i have created all directories SPECS,BUILD,SOURCES,ETC

rpmbuild -ba RWARVSMS-6.0.spec

but i m getting an error message likeerror: File /usr/src/redhat/SOURCES/RWARVSMS-6.0.tar.gz: No such file or directory

unSpawn 11-06-2006 07:07 AM

rpmbuild -ba RWARVSMS-6.0.spec
but i m getting an error message likeerror: File /usr/src/redhat/SOURCES/RWARVSMS-6.0.tar.gz: No such file or directory

Then you miss an rpm resource file. Touch ~/.rpmmacros and fill it with this:
Code:

%_topdir        /home/YOURACCOUNTNAME/redhat
%_tmppath        %{_topdir}/tmp
%_builddir        %{_topdir}/BUILD
%_rpmdir        %{_topdir}/RPMS
%_sourcedir        %{_topdir}/SOURCES
%_specdir        %{_topdir}/SPECS
%_srcrpmdir        %{_topdir}/SRPMS

Note this makes all the SPECS, BUILD, SOURCES and such relative to your /home/YOURACCOUNTNAME/redhat directory.

adddy 11-06-2006 07:23 AM

how to fill rpmmacros.plz tell.

unSpawn 11-06-2006 02:14 PM

how to fill rpmmacros.
Uh. Copy and paste?

adddy 11-06-2006 10:46 PM

hai plz tell in brief were to paste it.
as rpm macros dont open

unSpawn 11-07-2006 05:02 AM

plz tell in brief were to paste it.
as rpm macros dont open


I already told you: "touch ~/.rpmmacros" which is short for "create a file called .rpmmacros in your home directory". Maybe you should read a generic *NIX tutorial like Rute's first?


All times are GMT -5. The time now is 11:57 PM.