build: Fix installation

I'd only been testing builds, but we really should have been testing
the runtime too.
This commit is contained in:
Colin Walters 2016-02-25 15:00:23 -05:00
parent 4cc19b0c9a
commit 6d29112807

View File

@ -16,6 +16,7 @@ URL: https://github.com/projectatomic/rpm-ostree
# We always run autogen.sh # We always run autogen.sh
BuildRequires: autoconf automake libtool git BuildRequires: autoconf automake libtool git
# For docs # For docs
BuildRequires: chrpath
BuildRequires: gtk-doc BuildRequires: gtk-doc
BuildRequires: gnome-common BuildRequires: gnome-common
BuildRequires: gobject-introspection BuildRequires: gobject-introspection
@ -37,6 +38,9 @@ BuildRequires: python-sphinx
Requires: ostree >= 2014.6 Requires: ostree >= 2014.6
# We're using RPATH to pick up our bundled version
%global __requires_exclude ^libhif[.]so[.].*$
%description %description
This tool binds together the world of RPM packages with the OSTree This tool binds together the world of RPM packages with the OSTree
model of bootable filesystem trees. It provides commands usable both model of bootable filesystem trees. It provides commands usable both
@ -57,11 +61,11 @@ tar xf %{SOURCE1}
%build %build
(cd libhif (cd libhif
cmake \ cmake \
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix}/libexec/rpm-ostree \ -DCMAKE_INSTALL_PREFIX:PATH=%{_libexecdir}/rpm-ostree \
-DINCLUDE_INSTALL_DIR:PATH=%{_prefix}/libexec/rpm-ostree/include \ -DINCLUDE_INSTALL_DIR:PATH=%{_libexecdir}/rpm-ostree/include \
-DLIB_INSTALL_DIR:PATH=%{_libdir}/rpm-ostree/ \ -DLIB_INSTALL_DIR:PATH=%{_libexecdir}/rpm-ostree \
-DSYSCONF_INSTALL_DIR:PATH=%{_prefix}/libexec/rpm-ostree/etc \ -DSYSCONF_INSTALL_DIR:PATH=%{_libexecdir}/rpm-ostree/etc \
-DSHARE_INSTALL_PREFIX:PATH=%{_prefix}/libexec/rpm-ostree/share \ -DSHARE_INSTALL_PREFIX:PATH=%{_libexecdir}/rpm-ostree/share \
-DLIB_SUFFIX=64 \ -DLIB_SUFFIX=64 \
-DBUILD_SHARED_LIBS:BOOL=ON . -DBUILD_SHARED_LIBS:BOOL=ON .
make %{?_smp_mflags} make %{?_smp_mflags}
@ -77,10 +81,22 @@ EOF
export PKG_CONFIG_PATH=$(pwd)/libhif/libhif${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH} export PKG_CONFIG_PATH=$(pwd)/libhif/libhif${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
export LD_LIBRARY_PATH=$(pwd)/libhif/libhif${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} export LD_LIBRARY_PATH=$(pwd)/libhif/libhif${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
env NOCONFIGURE=1 ./autogen.sh env NOCONFIGURE=1 ./autogen.sh
%configure --disable-silent-rules --enable-gtk-doc %configure --disable-silent-rules --enable-gtk-doc LDFLAGS='-Wl,-rpath=%{_libdir}/rpm-ostree'
make %{?_smp_mflags} make %{?_smp_mflags}
%install %install
(cd libhif
make install DESTDIR=$RPM_BUILD_ROOT
for path in %{_libdir}/python2.7 %{_libexecdir}/rpm-ostree/include %{_libexecdir}/rpm-ostree/pkg-config \
%{_libexecdir}/rpm-ostree/share/man; do \
rm $RPM_BUILD_ROOT/${path} -rf; \
done
install -d $RPM_BUILD_ROOT/%{_libdir}/rpm-ostree
# Cherry pick the shared library...
mv $RPM_BUILD_ROOT/%{_libexecdir}/rpm-ostree/lib*/libhif*.so.* $RPM_BUILD_ROOT/%{_libdir}/rpm-ostree
# and nuke everything else.
rm $RPM_BUILD_ROOT/%{_libexecdir}/rpm-ostree -rf
)
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p -c" make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p -c"
find $RPM_BUILD_ROOT -name '*.la' -delete find $RPM_BUILD_ROOT -name '*.la' -delete