aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 84152ca20a0822fd5fb1c57974e5f3aec487e45b (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
# Mageia RPM Setup

This package contains configuration and scripts related to the use of RPM in Mageia. It is ultimately released and packaged as `rpm-mageia-setup`.

Some files are packaged in .in files. These files allow you to pre-process certainly paths and configure options and inject them into the built scripts.

## About macros

Only redefine macros in this package if the upstream RPM one is not fit for purpose in Mageia. Please only do this as a last resort and try to work with upstream whenever possible.

All macros having same body in all architectures should go into macros.in. If the macros body change depending on architecture, then:

1. add a symbolic value into `macros-perarch.in` (e.g. @FOO@)
2. add the value into `make_macrosfiles.sh.in`

### Example

`macros.in` contains:

    %_libdir /usr/%_lib

`macros-perarch.in` contains:

    %_lib @LIB@

`make_macrosfiles.sh.in` contains (among other things):

    MINPUT="$1"
    ARCH="$2"

    LIB=lib

    case $ARCH in
        …
        amd64|x86_64)
        LIB=lib64
        ;;
        …
    esac

    cat "$MINPUT" | sed \
        -e "s,@LIB@,$LIB,g"


## Testing the monster

First and easy way:

    $ make test

Live tests:

    $ ./configure --with-rpmconfdir=$fakeroot --with-rpmlibdir=/usr/lib/rpm --with-rpmsysconfdir=/etc

This will configure the package for an installation into fakeroot, using rpm files in `/usr/lib/rpm`.

    $ make
    $ make install

Now we can tell rpm to use fake config:

    $ rpm --rcfile $fakeroot/mageia/rpmrc other command...

Happy Hacking!