- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Trying to build a custom RPM
Operating System - Linux
1819681
Members
3548
Online
109605
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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-10-2005 02:21 AM
тАО06-10-2005 02:21 AM
Hi all, I am trying to build a custom RPM, based on 2 shell scripts I wrote. The problems I have are 2-fold
1. rpmbuild wants a "patch" entry in the spec file. Unfortunately I build my scripts properly the first time so don't need patches - how do I get "rpmbuild" to recognise this?
2. Self-extraction / installation
According to the documentation I found on rpmbuild on www.rom.org, , anything in the "%build" or "%install" are just script commands, so when I fake out the Patch problem above, nothing gets created in the destination directory nor in the $RPM_BUILD_ROOT directory.
Belows is my spec file. I create a tar and gziped it with the 2 scripts in. Any advice on what is going wrong here?
Share and Enjoy! Ian
---------------------------------
Summary: A set of programs to build a LINUX System via FTP
Name: linux_ftp_build
Version: 0.9.0
Release: 1
Copyright: GPL
Group: Applications/System
Source: linux_ftp_build.tar.gz
Patch:
BuildRoot: /var/tmp/${name}-buildroot
%description
A set of scripts designed for BOBBOBBOBBOBBOBBOBOBBOBOBOB for taking a
base install of RH Enterprise 3 Linux and allowing selection of a standard
set of patches / tools to be ftp'ed down and implemented. Also contains
useful scripts for setting up networking etc post-install.
%prep
%setup -c
%patch
%build
cp -rp $RPM_BUILD_ROOT/* /home
ll $RPM_BUILD_ROOT
%install
# install -m 755 linux_ftp_build.sh $RPM_BUILD_ROOT/linux_ftp_build.sh
# install -m 755 master_post_implement.sh $RPM_BUILD_ROOT/master_post_implement.sh
ll $RPM_BUILD_ROOT
%clean
# :rm -rf $RPM_BUILD_ROOT/${name}-buildroot
%files
%defattr(-,root,root)
%doc
/home/linux_ftp_build.sh
/home/master_post_implement.sh
%changelog
* Fri Jun 10 2005 Ian Dennison
Initial build and rollout
1. rpmbuild wants a "patch" entry in the spec file. Unfortunately I build my scripts properly the first time so don't need patches - how do I get "rpmbuild" to recognise this?
2. Self-extraction / installation
According to the documentation I found on rpmbuild on www.rom.org, , anything in the "%build" or "%install" are just script commands, so when I fake out the Patch problem above, nothing gets created in the destination directory nor in the $RPM_BUILD_ROOT directory.
Belows is my spec file. I create a tar and gziped it with the 2 scripts in. Any advice on what is going wrong here?
Share and Enjoy! Ian
---------------------------------
Summary: A set of programs to build a LINUX System via FTP
Name: linux_ftp_build
Version: 0.9.0
Release: 1
Copyright: GPL
Group: Applications/System
Source: linux_ftp_build.tar.gz
Patch:
BuildRoot: /var/tmp/${name}-buildroot
%description
A set of scripts designed for BOBBOBBOBBOBBOBBOBOBBOBOBOB for taking a
base install of RH Enterprise 3 Linux and allowing selection of a standard
set of patches / tools to be ftp'ed down and implemented. Also contains
useful scripts for setting up networking etc post-install.
%prep
%setup -c
%patch
%build
cp -rp $RPM_BUILD_ROOT/* /home
ll $RPM_BUILD_ROOT
%install
# install -m 755 linux_ftp_build.sh $RPM_BUILD_ROOT/linux_ftp_build.sh
# install -m 755 master_post_implement.sh $RPM_BUILD_ROOT/master_post_implement.sh
ll $RPM_BUILD_ROOT
%clean
# :rm -rf $RPM_BUILD_ROOT/${name}-buildroot
%files
%defattr(-,root,root)
%doc
/home/linux_ftp_build.sh
/home/master_post_implement.sh
%changelog
* Fri Jun 10 2005 Ian Dennison
Initial build and rollout
Building a dumber user
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-10-2005 10:34 AM
тАО06-10-2005 10:34 AM
Solution
Wow, it's been a while since I tried doing this without a source-tree that needs to be built!
A few things.. ${name} should be %{name}.
As you have no patches, get rid of the Patch and %patch lines.
Do you actually have a 'linux_ftp_build.tar.gz' with these two scripts in it? Or are the scripts in '/home/...' ?
RPM first extracts the files in 'Source' to '/usr/src/redhat/BUILD/'. It then does the %prep section (nicely done), followed by the %build section. As there are no Makefile's involved, yea, you have to do fun things.
In %build, you want to copy the two files to '$RPM_BUILD_ROOT/' so that %files can grab them from there.
After that, you're all set!
I made a few quick modifications to your spec file, and this is how it looks:
Summary: A set of programs to build a LINUX System via FTP
Name: linux_ftp_build
Version: 0.9.0
Release: 1
Copyright: GPL
Group: Applications/System
Source: linux_ftp_build.tar.gz
BuildRoot: /var/tmp/%{name}-buildroot
%description
A set of scripts designed for BOBBOBBOBBOBBOBBOBOBBOBOBOB for taking a
base install of RH Enterprise 3 Linux and allowing selection of a standard
set of patches / tools to be ftp'ed down and implemented. Also contains
useful scripts for setting up networking etc post-install.
%prep
%setup -c
%build
pwd
mkdir -p $RPM_BUILD_ROOT/home/
cp -rp/* $RPM_BUILD_ROOT/home/
ls -l $RPM_BUILD_ROOT
%install
# install -m 755 linux_ftp_build.sh $RPM_BUILD_ROOT/linux_ftp_build.sh
# install -m 755 master_post_implement.sh $RPM_BUILD_ROOT/master_post_implement.sh
ls -l $RPM_BUILD_ROOT
%clean
# :rm -rf $RPM_BUILD_ROOT/${name}-buildroot
%files
%defattr(-,root,root)
%doc
/home/linux_ftp_build.sh
/home/master_post_implement.sh
%changelog
* Fri Jun 10 2005 Ian Dennison
Initial build and rollout
A few things.. ${name} should be %{name}.
As you have no patches, get rid of the Patch and %patch lines.
Do you actually have a 'linux_ftp_build.tar.gz' with these two scripts in it? Or are the scripts in '/home/...' ?
RPM first extracts the files in 'Source' to '/usr/src/redhat/BUILD/'. It then does the %prep section (nicely done), followed by the %build section. As there are no Makefile's involved, yea, you have to do fun things.
In %build, you want to copy the two files to '$RPM_BUILD_ROOT/' so that %files can grab them from there.
After that, you're all set!
I made a few quick modifications to your spec file, and this is how it looks:
Summary: A set of programs to build a LINUX System via FTP
Name: linux_ftp_build
Version: 0.9.0
Release: 1
Copyright: GPL
Group: Applications/System
Source: linux_ftp_build.tar.gz
BuildRoot: /var/tmp/%{name}-buildroot
%description
A set of scripts designed for BOBBOBBOBBOBBOBBOBOBBOBOBOB for taking a
base install of RH Enterprise 3 Linux and allowing selection of a standard
set of patches / tools to be ftp'ed down and implemented. Also contains
useful scripts for setting up networking etc post-install.
%prep
%setup -c
%build
pwd
mkdir -p $RPM_BUILD_ROOT/home/
cp -rp
ls -l $RPM_BUILD_ROOT
%install
# install -m 755 linux_ftp_build.sh $RPM_BUILD_ROOT/linux_ftp_build.sh
# install -m 755 master_post_implement.sh $RPM_BUILD_ROOT/master_post_implement.sh
ls -l $RPM_BUILD_ROOT
%clean
# :rm -rf $RPM_BUILD_ROOT/${name}-buildroot
%files
%defattr(-,root,root)
%doc
/home/linux_ftp_build.sh
/home/master_post_implement.sh
%changelog
* Fri Jun 10 2005 Ian Dennison
Initial build and rollout
One long-haired git at your service...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2005 12:09 AM
тАО06-13-2005 12:09 AM
Re: Trying to build a custom RPM
Just delete the %patch line. And one more thing -- the 2 scripts /home/linux_ftp_build.sh and /home/master_post_implement.sh should be under %files not under %doc.
-Ross
-Ross
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-14-2005 01:58 AM
тАО06-14-2005 01:58 AM
Re: Trying to build a custom RPM
Thanks for the assistance.
I have corrected the Spec file (and found a bug where the files are copied to /var/tmp/%{name}/home/%{name}-%{version} rather than /var/tmp/%{name}/home/) and generated and installed the files.
Share and Enjoy! Ian Dennison
I have corrected the Spec file (and found a bug where the files are copied to /var/tmp/%{name}/home/%{name}-%{version} rather than /var/tmp/%{name}/home/) and generated and installed the files.
Share and Enjoy! Ian Dennison
Building a dumber user
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP