Skip to content

Commit 5dd9e7a

Browse files
committed
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 location 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 <[email protected]>
1 parent 4f2c2a3 commit 5dd9e7a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/packaging/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ pkgconfig_DATA = pnetcdf.pc
1212
# GNU autoconf allows DESTDIR variable when running 'make install' which will
1313
# prepend it before all installation names.
1414
install-data-hook:
15-
$(SED_I) -e 's|INSTALL_PREFIX|$(DESTDIR)$(prefix)|g ; s|INSTALL_EXEC_PREFIX|$(DESTDIR)$(exec_prefix)|g' $(DESTDIR)$(libdir)/pkgconfig/pnetcdf.pc
15+
$(SED_I) -e 's|INSTALL_PREFIX|$(prefix)|g ; s|INSTALL_EXEC_PREFIX|$(exec_prefix)|g' $(DESTDIR)$(libdir)/pkgconfig/pnetcdf.pc
1616

1717

src/utils/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ dist-hook:
3636
# GNU autoconf allows DESTDIR variable when running 'make install' which will
3737
# prepend it before all installation names.
3838
install-exec-hook:
39-
$(SED_I) -e 's|INSTALL_PREFIX|$(DESTDIR)$(prefix)|g ; s|INSTALL_EXEC_PREFIX|$(DESTDIR)$(exec_prefix)|g' $(DESTDIR)$(bindir)/pnetcdf-config
39+
$(SED_I) -e 's|INSTALL_PREFIX|$(prefix)|g ; s|INSTALL_EXEC_PREFIX|$(exec_prefix)|g' $(DESTDIR)$(bindir)/pnetcdf-config
4040
chmod +x $(DESTDIR)$(bindir)/pnetcdf-config
4141

0 commit comments

Comments
 (0)