updated the build files to be able to choose between static modules and dynamic modules even if the main library is static
This commit is contained in:
@ -5,10 +5,12 @@
|
||||
%define __brp_remove_la_files /bin/true
|
||||
%define source_date_epoch_from_changelog 0
|
||||
|
||||
%define enable_mod_ffi 0
|
||||
%define enable_mod_mysql 0
|
||||
%define enable_mod_ffi 1
|
||||
%define enable_mod_memc 1
|
||||
%define enable_mod_mysql 1
|
||||
%define enable_mod_uci 0
|
||||
|
||||
Summary: HAWK Interpreter
|
||||
Summary: Hawk Interpreter
|
||||
Name: @PACKAGE_NAME@
|
||||
Version: @PACKAGE_VERSION@
|
||||
Release: 1%{?dist}
|
||||
@ -21,24 +23,64 @@ Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
%if %{enable_mod_ffi}
|
||||
## prep_cif_var() available since 3.0.11
|
||||
BuildRequires: libffi-devel >= 3.0.11
|
||||
BuildRequires: libffi-devel%{?_isa} >= 3.0.11
|
||||
%endif
|
||||
%if %{enable_mod_memc}
|
||||
BuildRequires: libmemcached-devel%{?_isa} >= 1.0.18
|
||||
%endif
|
||||
%if %{enable_mod_mysql}
|
||||
BuildRequires: mysql-devel
|
||||
BuildRequires: mariadb-connector-c-devel%{?_isa}
|
||||
%endif
|
||||
%if %{enable_mod_uci}
|
||||
BuildRequires: libuci-devel%{?_isa}
|
||||
%endif
|
||||
|
||||
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||
|
||||
%description
|
||||
HAWK Interpreter
|
||||
Hawk Interpreter
|
||||
|
||||
%if %{enable_mod_ffi}
|
||||
%package ffi
|
||||
Summary: Hawk ffi module
|
||||
Group: System Environment/Libraries
|
||||
Requires: @PACKAGE_NAME@ = %{version}
|
||||
Requires: libffi%{?_isa} >= 3.0.11
|
||||
|
||||
%description ffi
|
||||
This package contains the ffi module file for Hawk.
|
||||
%endif
|
||||
|
||||
%if %{enable_mod_memc}
|
||||
%package memc
|
||||
Summary: Hawk memc module
|
||||
Group: System Environment/Libraries
|
||||
Requires: @PACKAGE_NAME@ = %{version}
|
||||
Requires: libmemcached-libs%{?_isa} >= 1.0.18
|
||||
|
||||
%description memc
|
||||
This package contains the memc module file for Hawk.
|
||||
%endif
|
||||
|
||||
%if %{enable_mod_mysql}
|
||||
%package mysql
|
||||
Summary: Hawk mysql module
|
||||
Group: System Environment/Libraries
|
||||
Requires: @PACKAGE_NAME@ = %{version}
|
||||
## tricky to specify the right mysql/mariadb client library.
|
||||
Requires: mariadb-connector-c%{?_isa}
|
||||
|
||||
%description mysql
|
||||
This package contains the mysql module file for Hawk.
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files for HAWK
|
||||
Summary: Development files for Hawk
|
||||
Group: System Environment/Libraries
|
||||
Requires: @PACKAGE_NAME@ = %{version}
|
||||
|
||||
%description devel
|
||||
The header files and libraries for developing applications with HAWK.
|
||||
The header files and libraries for developing applications with Hawk.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
@ -51,10 +93,9 @@ CFLAGS="${RPM_OPT_FLAGS} -fPIC" CXXFLAGS="${RPM_OPT_FLAGS} -fPIC" ./configure \
|
||||
--prefix=%{_prefix} \
|
||||
--libdir=%{_libdir} \
|
||||
--sysconfdir=%{_sysconfdir} \
|
||||
--enable-static=yes \
|
||||
--enable-shared=no \
|
||||
--enable-static=yes \
|
||||
--enable-shared=yes \
|
||||
--enable-static-module=yes \
|
||||
--enable-dynamic-module=yes \
|
||||
--enable-wide-char="yes:2w" \
|
||||
--enable-intmax=no \
|
||||
--enable-fltmax=no \
|
||||
@ -67,6 +108,11 @@ CFLAGS="${RPM_OPT_FLAGS} -fPIC" CXXFLAGS="${RPM_OPT_FLAGS} -fPIC" ./configure \
|
||||
%else
|
||||
--enable-mod-ffi=no \
|
||||
%endif
|
||||
%if %{enable_mod_memc}
|
||||
--enable-mod-memcached=yes \
|
||||
%else
|
||||
--enable-mod-memcached=no \
|
||||
%endif
|
||||
%if %{enable_mod_mysql}
|
||||
--with-mysql=yes \
|
||||
--enable-mod-mysql=yes \
|
||||
@ -74,8 +120,7 @@ CFLAGS="${RPM_OPT_FLAGS} -fPIC" CXXFLAGS="${RPM_OPT_FLAGS} -fPIC" ./configure \
|
||||
--with-mysql=no \
|
||||
--enable-mod-mysql=no \
|
||||
%endif
|
||||
--enable-mod-memcached=no \
|
||||
--enable-mod-sed=yes \
|
||||
--enable-mod-sed=yes:static \
|
||||
--enable-mod-uci=no ##CC=gcc44 CXX=g++44
|
||||
|
||||
make
|
||||
@ -86,6 +131,7 @@ rm -rf %{buildroot}%{_libdir}/pkgconfig
|
||||
rm -f %{buildroot}%{_bindir}/uni-case
|
||||
rm -f %{buildroot}%{_bindir}/uni-prop
|
||||
rm -f %{buildroot}%{_bindir}/hawk[0-9][0-9] ## delete binaries from the samples directory
|
||||
rm -rf %{buildroot}%{_libdir}/libhawk-*.la %{buildroot}%{_libdir}/libhawk-*.a ## delete static libraries of dynamic modules
|
||||
|
||||
%check
|
||||
make check
|
||||
@ -102,9 +148,25 @@ rm -rf "%{buildroot}"
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/hawk
|
||||
%{_libdir}/libhawk.so*
|
||||
|
||||
%if %{enable_mod_ffi}
|
||||
%files ffi
|
||||
%{_libdir}/libhawk-ffi.so*
|
||||
%endif
|
||||
|
||||
%if %{enable_mod_memc}
|
||||
%files memc
|
||||
%{_libdir}/libhawk-memc.so*
|
||||
%endif
|
||||
|
||||
%if %{enable_mod_mysql}
|
||||
%files mysql
|
||||
%{_libdir}/libhawk-mysql.so*
|
||||
%endif
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%{_includedir}/*
|
||||
%{_libdir}/*.a
|
||||
%{_libdir}/*.la
|
||||
%{_libdir}/libhawk.a
|
||||
%{_libdir}/libhawk.la
|
||||
|
Reference in New Issue
Block a user