summaryrefslogtreecommitdiff
path: root/ACE/rpmbuild/README
blob: af6684ecc3b88b7456d699877d385aa4eefb2690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Building RPM from source tarball
================================================================

It is possible to build directly from a source tarball if it contains
a valid spec file.

Before you can run rpmbuild, you need to setup a directory tree and a
.rpmmacros file.

Setup directory tree
----------------------------------------------------------------

You may already have one in /usr/src/RPM, but as rebuilding packages
as root is evil, we recommend that you create one in a place where
your normal user account allows you to write, such as your home
directory. This build tree should have the following structure:

    rpm
    |-- BUILD
    |-- RPMS
    |-- SOURCES
    |-- SPECS
    |-- SRPMS
    `-- tmp

The following command should build what you need:

    mkdir -p ${HOME}/rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}

Setup rpmbuild configuration file
----------------------------------------------------------------

Now you need to do some rpm configuration. A simple ~/.rpmmacros with
the following contents should be enough:

    cat > ~/.rpmmacros <<EOF
    %_topdir        %(echo ${HOME}/rpm)
    %_tmppath       %{_topdir}/tmp

    %packager       Firstname Lastname <your.address@here>

    # Have built RPMs land in RPMS/ instead of RPMS/<arch>/
    %_rpmfilename  %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
    EOF

Make sure to replace the %packager fields with your actual name and email address.

Important Details
----------------------------------------------------------------

There are some important details:

* The tarball name must have the ACE version in the name, for example:

    ACE+TAO-src-6.3.3.tar.gz

* The spec file inside the tarball
 (ACE_wrappers/rpmbuild/ace-tao.spec) must have the correct version
  numbers for ACE and TAO at the top:

    %define ACEVER  6.3.3
    %define TAOVER  2.3.3

* The following files in the source distribution must have the correct
  version numbers:

    ACE_wrappers/ace/Version.h
    ACE_wrappers/TAO/tao/Version.h


Building the RPM
----------------------------------------------------------------

You can kick off the rpmbuild anywhere; the tarball will be unpacked
and built in your rpmbuild directory described in the previous
section.

    rpmbuild -tb your-tarball.tar.gz

Some packages take quite a while to build.


Harvesting the Binary RPM
----------------------------------------------------------------

When the build completes, the binary rpms are deposited in rpm/RPMS.

    ls -lart ${HOME}/rpm/RPMS

Please let me know if there are questions/problems.

-- Ken Sedgwick (ken@bonsai.com)