Your SlideShare is downloading. ×
Rpm cheatbook
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Rpm cheatbook

578

Published on

Rpm, RedHat Package Manager …

Rpm, RedHat Package Manager

File Can be downloaded from:
http://community.scmgalaxy.com/

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total Views
578
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
1
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. RPM Cheat SheetInstallation: rpm -ihv <package name> rpmbuild -ba - build binary and source rpmsUpgrade: rpm -Uhv <package name> rpmbuild -bb - build binary rpmFreshen: rpm -Fhv <package names> rpmbuild -bs - build source rpmErase: rpm -e <package name> rpmbuild --rebuild package.src.rpm - binary package 4m srcQuery: rpm -q[option] <package name> RPM Divided into sections -qi = Query Package Information %description -ql = List Package Files %prep -qf = Query which package a file belongs %buildto. %install %files.deb: Debian, Ubuntu and derived .rpm: RedHat, Fedora, SuSE, Mandrivarpm -V[option] <package name> : Compare information about installed package files with informationstored in rpm database and note any discrepancies.Example%define name nano%define version 2.0.9%define release 1Summary : Pico editor clone with enhancementsName : %{name}Version : %{version}Release : %{release}License : GPLGroup : Applications/EditorsURL : http://www.nano-editor.org/Source : http://www.nano-editor.org/dist/v2.0/%{name}-%{version}.tar.gzBuildRoot : %{_tmppath}/%{name}-%{version}-rootBuildRequires : autoconf, automake, gettext-devel, ncursesdevel%descriptionGNU nano is a small and friendly text editor. It aims toemulate the Pico text editor while also offering a fewenhancements.%prep%setup -q%build%configure --enable-allmake%installrm -rf %{buildroot}make DESTDIR="%{buildroot}" install%files%defattr(-,root,root)%doc AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README THANKS
  • 2. Stage Reads Writes Action%prep %_sourcedir %_builddir This reads the sources and patches in the source directory %_sourcedir (usually ~/rpmbuild/SOURCES). It unpackages the sources to a subdirectory underneath the build directory %_builddir (usually ~/rpmbuild/BUILD/) and applies the patches.%build %_builddir %_builddir This compiles the files underneath the build directory %_builddir (usually ~/rpmbuild/BUILD/). This is often implemented by running some variation of "./configure ; make".%check %_builddir %_builddir Check that the software works properly. This is often implemented by running some variation of "make test". Many packages dont implement this stage.%install %_builddir %_buildrootdir This reads the files underneath the build directory %_builddir (usually ~/rpmbuild/BUILD/) and writes to a directory underneath the build root directory %_buildrootdir (usually ~/rpmbuild/BUILDROOT). The files that are written are the files that are supposed to be installed when the binary package is installed by an end-user. Beware of the weird terminology: The build root directory is not the same as the build directory. This is often implemented by running "make install".bin %_buildrootdir %_rpmdir This reads the files underneath the build root directory %_buildrootdir (usually ~/rpmbuild/BUILDROOT/) to create binary RPM packages underneath the RPM directory %_rpmdir (usually ~/rpmbuild/RPMS/). Inside the RPM directory is a directory for each architecture, and a "noarch" directory for packages that apply to any architecture. These RPM files are the packages for users to install.src %_sourcedir %_srcrpmdir This creates a source RPM package (.src.rpm) inside the source RPM directory %_srcrpmdir (usually ~/rpmbuild/SRPMS). These files are needed for reviewing and updating packages.Macro Name Name Usually Purpose%_specdir Specification ~/rpmbuild/SPECS RPM specifications (.spec) files directory%_sourcedir Source ~/rpmbuild/SOURCES Pristine source package (e.g., directory tarballs) and patches%_builddir Build directory ~/rpmbuild/BUILD Source files are unpacked and compiled in a subdirectory underneath this.%_buildrootdir Build root ~/rpmbuild/BUILDROOT Files are installed under here directory during the %install stage.%_rpmdir Binary RPM ~/rpmbuild/RPMS Binary RPMs are created stored directory under here.%_srcrpmdir Source RPM ~/rpmbuild/SRPMS Source RPMs are created and directory stored here.

×