Skip to content

Commit

Permalink
curl/git: ensure curl is built with rpath entries so that git find ne…
Browse files Browse the repository at this point in the history
…cessary sub-dependencies when linking with libcurl.
  • Loading branch information
danielhams committed Jan 7, 2020
1 parent 9095bff commit e5a6173
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
10 changes: 8 additions & 2 deletions README.md
Expand Up @@ -18,12 +18,14 @@ NOTE: Unlike `didbsng` - sgug-rse _must not_ use a "personal .rpmmacros" file -

(1) Download the artifacts for the latest version from the github releases tab (assuming they aren't too big).

You'll find three archives:
You'll find three main archives - and there might be "fix" archives too that need to be extracted:

```
sgug-rse-selfhoster-0.0.1alpha.tar.gz
sgug-rse-srpms-0.0.1alpha.tar.gz
sgug-rse-rpms-0.0.1alpha.tar.gz
sgug-rse-blahfix-0.0.Xalpha.tar.gz
```

(2) Extract the selfhoster archive under /usr as root (important, sgug-rse _installation_ files are root owned and managed):
Expand All @@ -44,12 +46,16 @@ mkdir -p ~/rpmbuild/SRPMS
mkdir -p ~/rpmbuild/RPMS
```

(4) As your user extract the SRPMs and RPMs in the right place:
(4) As your user extract the SRPMs and RPMs in the right place.

This should include any fixes:

```
cd ~/rpmbuild
gunzip -dc /path/to/sgug-rse-srpms-0.0.1alpha.tar.gz | tar xf -
gunzip -dc /path/to/sgug-rse-rpms-0.0.1alpha.tar.gz | tar xf -
# Optional
gunzip -dc /path/to/sgug-rse-blahfix-0.0.Xalpha.tar.gz | tar xf -
```

(5) You'll need to clone this repo (sgug-rse) -
Expand Down
12 changes: 9 additions & 3 deletions packages/curl/SPECS/curl.spec
Expand Up @@ -219,6 +219,8 @@ export SHELL="%{_bindir}/sh"
export SHELL_PATH="$SHELL"
export CONFIG_SHELL="$SHELL"
export PERL="%{_bindir}/perl"
export CFLAGS="-R%{_libdir} $CFLAGS"
export LDFLAGS="-rpath %{_libdir} $LDFLAGS"
mkdir build-{full,minimal}
export common_configure_opts=" \
--cache-file=../config.cache \
Expand Down Expand Up @@ -270,9 +272,9 @@ export common_configure_opts=" \
)

# avoid using rpath
sed -e 's/^runpath_var=.*/runpath_var=/' \
-e 's/^hardcode_libdir_flag_spec=".*"$/hardcode_libdir_flag_spec=""/' \
-i build-{full,minimal}/libtool
#sed -e 's/^runpath_var=.*/runpath_var=/' \
# -e 's/^hardcode_libdir_flag_spec=".*"$/hardcode_libdir_flag_spec=""/' \
# -i build-{full,minimal}/libtool

make %{?_smp_mflags} V=1 -C build-minimal
make %{?_smp_mflags} V=1 -C build-full
Expand All @@ -282,6 +284,8 @@ export SHELL="%{_bindir}/sh"
export SHELL_PATH="$SHELL"
export CONFIG_SHELL="$SHELL"
export PERL="%{_bindir}/perl"
export CFLAGS="-R%{_libdir} $CFLAGS"
export LDFLAGS="-rpath %{_libdir} $LDFLAGS"
# we have to override LD_LIBRARY_PATH because we eliminated rpath
LD_LIBRARYN32_PATH="$RPM_BUILD_ROOT%{_libdir}:$LD_LIBRARYN32_PATH"
export LD_LIBRARYN32_PATH
Expand All @@ -302,6 +306,8 @@ export SHELL="%{_bindir}/sh"
export SHELL_PATH="$SHELL"
export CONFIG_SHELL="$SHELL"
export PERL="%{_bindir}/perl"
export CFLAGS="-R%{_libdir} $CFLAGS"
export LDFLAGS="-rpath %{_libdir} $LDFLAGS"
# install and rename the library that will be packaged as libcurl-minimal
make DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" install -C build-minimal/lib
rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.{la,so}
Expand Down

0 comments on commit e5a6173

Please sign in to comment.