Commit 3758f5c
Fix errors when building an RPM
Building an RPM for OpenHPC of pnetcdf fails with:
```
+ /usr/lib/rpm/check-buildroot
/home/ohpc/rpmbuild/BUILDROOT/pnetcdf-gnu14-mvapich2-ohpc-1.14.0-19999.ci.ohpc.x86_64/opt/ohpc/pub/libs/gnu14/mvapich2/pnetcdf/1.14.0/bin/pnetcdf-config:prefix=/home/ohpc/rpmbuild/BUILDROOT/pnetcdf-gnu14-mvapich2-ohpc-1.14.0-19999.ci.ohpc.x86_64/opt/ohpc/pub/libs/gnu14/mvapich2/pnetcdf/1.14.0
/home/ohpc/rpmbuild/BUILDROOT/pnetcdf-gnu14-mvapich2-ohpc-1.14.0-19999.ci.ohpc.x86_64/opt/ohpc/pub/libs/gnu14/mvapich2/pnetcdf/1.14.0/bin/pnetcdf-config:exec_prefix=/home/ohpc/rpmbuild/BUILDROOT/pnetcdf-gnu14-mvapich2-ohpc-1.14.0-19999.ci.ohpc.x86_64/opt/ohpc/pub/libs/gnu14/mvapich2/pnetcdf/1.14.0
/home/ohpc/rpmbuild/BUILDROOT/pnetcdf-gnu14-mvapich2-ohpc-1.14.0-19999.ci.ohpc.x86_64/opt/ohpc/pub/libs/gnu14/mvapich2/pnetcdf/1.14.0/lib/pkgconfig/pnetcdf.pc:prefix=/home/ohpc/rpmbuild/BUILDROOT/pnetcdf-gnu14-mvapich2-ohpc-1.14.0-19999.ci.ohpc.x86_64/opt/ohpc/pub/libs/gnu14/mvapich2/pnetcdf/1.14.0
/home/ohpc/rpmbuild/BUILDROOT/pnetcdf-gnu14-mvapich2-ohpc-1.14.0-19999.ci.ohpc.x86_64/opt/ohpc/pub/libs/gnu14/mvapich2/pnetcdf/1.14.0/lib/pkgconfig/pnetcdf.pc:exec_prefix=/home/ohpc/rpmbuild/BUILDROOT/pnetcdf-gnu14-mvapich2-ohpc-1.14.0-19999.ci.ohpc.x86_64/opt/ohpc/pub/libs/gnu14/mvapich2/pnetcdf/1.14.0
Found '/home/ohpc/rpmbuild/BUILDROOT/pnetcdf-gnu14-mvapich2-ohpc-1.14.0-19999.ci.ohpc.x86_64' in installed files; aborting
```
The reason is that the variable DESTDIR is added to the path of the
binary location. This is, however, wrong. DESTDIR is the directory where
the files are installed but not where they are located in the final
RPM.
Keeping DESTDIR for the file location is correct but not for the path
where the files are located.
With this patch applied, it is possible to create an RPM without errors
like above.
Signed-off-by: Adrian Reber <areber@redhat.com>1 parent fffdf92 commit 3758f5c
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
0 commit comments