Skip to content

The making of TRACE RPM

Eric Flumerfelt edited this page Jun 17, 2022 · 2 revisions

The Goal - what’s in the RPM

The TRACE rpm, when installed, puts the following into the specified destination:

  1. man pages (/usr/share/man/man1/)
  2. README (/usr/share/doc/trace-v3/)
  3. header files (/usr/include/TRACE/)
  4. trace_cntl utility (/usr/bin/)
  5. trace_delta.pl utility (/usr/bin/)
  6. trace.sh — profile.d functions (/etc/profile.d/)
  7. example programs (/usr/share/doc/trace-v3/)

More on man pages

The man pages were first written as regular text files on the packager’s machine, and saved into the online repository along with the compression instructions in the spec file. Instructions to install them along with useful “symbolic links” (sometimes called “soft links”) are in [[the %install and %files sections of TRACE.spec]].

-h2. Header files
h2. trace_cntl utility
mv rpmbuild/BUILD/trace-v3/Linux64bit+3.10-2.17/bin/trace_cntl /usr/bin/trace_cntl
Done
h2. trace_delta.pl
mv rpmbuild/BUILD/trace-v3/script/trace_delta.pl /usr/bin/trace_delta.pl
Done.
h2. profile.d functions
mv script/trace.sh.functions to /etc/profile.d/trace.sh
Done.-

The making of TRACE (binary) RPM (which implies the existence of a SRPM (.src.rpm))

  • Download Scientific Linux 7.x and create virtual machine via Oracle VM VirtualBox (SL7 is only supported by 64-bit processors).

Create RPM

Prerequisites

{{thumbnail(Prereq2.png, size=300, title=Prerequisites)}}

Tarball

{{thumbnail(archiving.png, size=300, title=Archiving)}}

  • Create “bare bones” TRACE.spec file(here is a “bare bones” cello.spec example) within ~/rpmbuild/SPECS directory using command: rpmdev-newspec TRACE.spec

In .spec file , add info about TRACE, as well as instructions for unpacking, building, and installing TRACE.

* As a basic test of a “filled-in” spec file, the rpmbuild -bl TRACE.spec should complete without errors.

* For example, the Version: and BuildRequires: fields, among others, should filled in or there will be errors:

/home/ron/rpmbuild/SPECS
mu2edaq01 :^) rpmbuild -bl TRACE.spec
error: line 10: Empty tag: BuildRequires:

Building the RPM

* Using rpmbuild with different options (after using rpmbuild with any of these options, the rpmbuild “tree” should be cleared before trying rpmbuild again to prevent failure of build due to attempting to create duplicate files):

* This command will go through the spec file up to the %prep section:

rpmbuild -bp ~/rpmbuild/SPECS/TRACE.spec

* This command will go through the spec file up to the %build section:

rpmbuild -bc ~/rpmbuild/SPECS/TRACE.spec

* This command will go through the spec file up to the %install section:

rpmbuild -bi ~/rpmbuild/SPECS/TRACE.spec

* This command will check the %files section of the spec file:

rpmbuild -bl ~/rpmbuild/SPECS/TRACE.spec

* This command will build both the source and binary rpms, placing them in /rpmbuild/SRPMS/ and/rpmbuild/RPMS/, respectively:

rpmbuild -ba ~/rpmbuild/SPECS/TRACE.spec

There is another rpmbuild option to build just the source rpm, but our focus is on building the binary because the main purpose of the source rpm is to build a binary from it. All of the spec file’s fields need to run to completion in order to build the binary.

{{thumbnail(building-the-rpm.png, size=300, title=Building the RPM)}}

Get the “create rpms” script

wget    https://github.com/art-daq/trace/repository/svn/raw/trunk/script/trace_rpms_from_repo.sh
chmod +x trace_rpms_from_repo.sh
./trace_rpms_from_repo.sh

OR

curl -O https://github.com/art-daq/trace/repository/svn/raw/trunk/script/trace_rpms_from_repo.sh
chmod +x trace_rpms_from_repo.sh
./trace_rpms_from_repo.sh

OR

sh -c "$(curl -fsSL https://github.com/art-daq/trace/repository/svn/raw/trunk/script/trace_rpms_from_repo.sh)"

OR (Is a kerberos login needed to export?)

svn export https://cdcvs.fnal.gov/subversion/trace-svn/trunk trace
chmod +x trace/script/trace_rpms_from_repo.sh
trace/script/trace_rpms_from_repo.sh

Learn about Makefile

Public access (via git only): git clone https://github.com/art-daq/trace.git
or svn: svn export http://cdcvs.fnal.gov/subversion/trace-svn/trunk/ trace

Clone this wiki locally