RPM (Red Hat Package Manager) provides a standard way to install, update, and remove software packages. It defines the build process and package contents. The SPEC file contains build instructions and metadata. RPM builds are done in a standardized directory structure using the rpmbuild command and SPEC files. Signing packages provides security.
1 of 18
Downloaded 83 times
More Related Content
RPM: Speed up your deploy
1. RPM: Speed up your deploy Francesco Crippa - [email_address]
2. RPM: RedHat Package Manager Make your deploy: Fast Easy Standard Secure Predictable Every time it's the same deploy
3. Install, update and remove An RPM package contains files, directories, permissions and some scripts to easy manage software without interactive process [root@a~]# rpm -ih witick-1.5-4.noarch.rpm [root@a~]# rpm -Uh witick-1.5-4.noarch.rpm [root@a~]# rpm -e witick
4. Important Note... Please, be careful to the difference between ¡° Package Name ¡± and ¡° Package File Name ¡±: witick-1.5-4.noarch.rpm is the filename of ¡° witick ¡± package rpm -Uh < file_name > rpm -e < package_name > rpm -ql < package_name > yum install < package_name >
5. Yum: dependency semplified One of the most terrible pain with rpm is the dependecy between packages. Yum help you to solve this step... [root@a~]# rpm -Uh krb5-server-1.5-17.i386.rpm Error! Failed Dependecies krb5-libs = 1.5-17 is needed by krb5-server-1.5-17
6. RPM: Make it standard Java, C++ and Ruby applications could use very different delployment and building processes: Ant Maven MakeFile Rake ... RPM define the process to use right tools to build and deploy right application
8. RPM Build infrastructure To build an RPM you need a specific infrastructure: /~ .rpmmacros /rpmbuild /SOURCES /BUILD /RPMS /i386 /i686 /x86_64 /noarch SRPMS SPECS
9. .rpmmacros ~/.rpmmacros: Contains specific configuration for your user: %packager Francesco Crippa <fcrippa@byte-code.com> %vendor Byte-Code srl %_topdir /home/fcrippa/rpmbuild %_signature gpg %_gpg_name Francesco Crippa <fcrippa@byte-code.com>
10. All the magic is SPEC file All you nedd is SPEC file. It contains: Source files location Patches Meta-information about package (name, author, version...) Changelog Build process Install process Uninstall process Requirements for building Requirements for deploying
11. SPEC Head Summary: Hello world Name: hello-c Version: 1.0 Release: 1 License: GPL Group: Amusements/Games URL: http://www.byte-code.com Source0: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: i386 %description Hello world ...
13. Files and changelog %files %defattr(-,root,root,-) /bin/* %doc README.txt %config /etc/hello.conf %changelog * Sun Sep 16 2007 Francesco Crippa <fcrippa@byte-code.com> - 1.0 - Initial build.
14. Building RPM ¡°rpm-build¡± must be installed on your system --rmsource help you to keep free your hard disk --sign help you to sign package during building [root@a~]# rpmbuild -ba hello.spec [root@a~]# rpm -ba --sign -rmsource hello.spec
15. Sign your security It's possible to sign (or re-sign) your prefered rpms. Sign is made by GnuPG You can resign a signed package You can sign a package during rpm building
16. Racommendations You MUST not use RPM in %pre and %post Never use ¡°cp¡± and ¡°mv¡± in %pre and %post Increment version or release on every build You MUST not ask any question to the user during %pre and %post (process must be non-interactive!)
17. Next Step Continuos Build: Koji https://hosted.fedoraproject.org/projects/koji/ Version Tree Management: Bodhi https://hosted.fedoraproject.org/projects/bodhi/