Difference between revisions of "Creating rpm packages"
From Notes_Wiki
(Created page with "<yambe:breadcrumb>Rpm|Rpm</yambe:breadcrumb> =Creating rpm packages= # Install '<tt>rpmdevtools</tt>' and '<tt>rpmlint</tt>' packages # Use '<tt>rpmdev-setuptree</tt>' comman...") |
m |
||
Line 1: | Line 1: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[System administration tools]] > [[Package management tools]] > [[Rpm|rpm]] > [[Creating rpm packages]] | |||
# Install '<tt>rpmdevtools</tt>' and '<tt>rpmlint</tt>' packages | # Install '<tt>rpmdevtools</tt>' and '<tt>rpmlint</tt>' packages | ||
Line 54: | Line 53: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[System administration tools]] > [[Package management tools]] > [[Rpm|rpm]] > [[Creating rpm packages]] |
Latest revision as of 12:20, 28 July 2022
Home > CentOS > CentOS 6.x > System administration tools > Package management tools > rpm > Creating rpm packages
- Install 'rpmdevtools' and 'rpmlint' packages
- Use 'rpmdev-setuptree' command to create rpmbuild folder and sub-folders in current users home folder
- Create 'hello.txt' file using 'echo hello > ~/rpmbuild/SOURCES/hello.txt'
- Create 'hello_world.spec' file with following contents:
- Name: hello_world
- Version: 1.0
- Release: 1%{?dist}
- Summary: Test hello world package to learn rpm
- License: GPL
- URL: http://www.sbarjatiya.com/
- Source0: hello.txt
- %description
- Just a test package to learn RPM
- %prep
- cp $RPM_SOURCE_DIR/hello.txt $RPM_BUILD_DIR
- %build
- %install
- rm -rf $RPM_BUILD_ROOT
- mkdir -p $RPM_BUILD_ROOT
- cp hello.txt $RPM_BUILD_ROOT
- %clean
- rm -rf $RPM_BUILD_ROOT
- %files
- %defattr(-,root,root,-)
- /hello.txt
- %changelog
- * Tue Oct 10 2013 Saurabh Barjatiya <barjatiya.saurabh@gmail.com>
- - Created spec file for hello_world project with hello.txt file
- Go to '~/rpmbuild/SPECS' folder
- Use 'rpmbuild -ba hello_world.spec' command to create rpm file
- Test created rpm using 'sudo rpm -ivh ../RPMS/x86_64/hello*.rpm'
- Verify there is hello.txt file in / using 'ls -l /'
Steps learned using http://rpmbuildtut.wordpress.com/ and http://www.rpm.org/max-rpm/ch-rpm-build.html
Home > CentOS > CentOS 6.x > System administration tools > Package management tools > rpm > Creating rpm packages