- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Redhat Linux package "rpmbuild" question
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2006 09:36 AM
06-12-2006 09:36 AM
Redhat Linux package "rpmbuild" question
How are you?
Sorry to bother, I just have a quick question regarding Redhat Linux 3.0 & 4.0 packaging via rpmbuild.
For some packages, we have to run shell scripts before package is installed and after package is installed. I know I can put shell scripts into "pkg.spec" file as "%pre" and "%post" before performing "rpmbuild". But this way will make the "pkg.sepc" file very long and not easy to troubleshoot. I would like to use seperate pre shell script and post shell script, but I am not sure how to integragte them into the "pkg.spec" file in order to run shell scripts before package instlalation, and after installation.
For instance, pkg.spec file
Summary: test
name: test
%pre
ksh /tmp/pkgpre.sh ????
(syntax to integrate the shell pre script; need to put shell into specific location?
% post
ksh /tmp/pkgpost.sh ???
syntax to integrate the shell pre script; need to put shell into specific location?
If you can advise when you get a chance, I would appreciate it.
Thank you in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2006 02:27 PM
06-12-2006 02:27 PM
Re: Redhat Linux package "rpmbuild" question
I've never added shell scripts, but the document of creating RPM has these lines:
You can put scripts in that get run before and after the installation and uninstallation of binary packages. A main reason for this is to do things like run ldconfig after installing or removing packages that contain shared libraries. The macros for each of the scripts is as follows:
%pre is the macro to do pre-install scripts.
%post is the macro to do post-install scripts.
%preun is the macro to do pre-uninstall scripts.
%postun is the macro to do post-uninstall scripts.
The contents of these sections should just be any sh style script, though you do not need the #!/bin/sh.
So, I'd recommend you to get rid of the preceding ksh and so that in %post section for example you have only /tmp/pkgpost.sh
Hope it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2006 04:00 AM
06-13-2006 04:00 AM
Re: Redhat Linux package "rpmbuild" question
Thank you very much for the information.
The issue I have is that the shell scripts for pre, post are very long, if I put them into the "pkg.spec" file, it would make the spec file too long to read & throubleshooting.
I would think I can use seperate shell scripts, just not sure how to integrate them into the spec file. I went through some Linux package docs, none of them mentions it. Any recommendations?
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2006 08:36 AM
06-13-2006 08:36 AM
Re: Redhat Linux package "rpmbuild" question
I think what Alexander was mentioning was that most systems don't have 'ksh' installed on them.
For %pre, try to cut it down to the essentials, and put it in the SPEC file directly.
For the %post, you can do basically anything you want, as you can include any files you want in the RPM it's self.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2006 06:56 PM
06-13-2006 06:56 PM
Re: Redhat Linux package "rpmbuild" question
I strongly suggest to read the wiki pages located here:http://fedoraproject.org/wiki/Packaging/Guidelines