LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File mingw32-freerdp-libs.spec of Package mingw32-freerdp-libs (Project home:felfert)

%define xname freerdp
%define rel 3%{?dist}

%global __strip %{_mingw32_strip}
%global __objdump %{_mingw32_objdump}
%global _use_internal_dependency_generator 0
%global __find_requires %{_mingw32_findrequires}
%global __find_provides %{_mingw32_findprovides}
%define __debug_install_post %{_mingw32_debug_install_post}

Name:           mingw32-%{xname}-libs
Version:        1.0.1git
Release:        %{rel}
Summary:        Core libraries implementing the RDP protocol

Group:          System Environment/Libraries
License:        ASL 2.0
URL:            http://www.freerdp.com/
Source0:        freerdp-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch

BuildRequires:  cmake
BuildRequires:  mingw32-filesystem >= 49
BuildRequires:  mingw32-gcc-c++
BuildRequires:  mingw32-binutils
BuildRequires:  mingw32-openssl

%description
Libraries from the FreeRDP project.

%package static
Summary:        Core libraries implementing the RDP protocol
Group:          System Environment/Libraries
%description static
Libraries from the FreeRDP project; static variant

%{_mingw32_debug_package}

%prep
%setup -q -n %{xname}-%{version}

%build

build() {
    _bdir=build_$1
    _sharg=OFF
    _depext=a
    if [ $1 = shared ] ; then
        _sharg=ON
        _depext=dll.a
    fi
    mkdir $_bdir
    cd $_bdir
    mingw32-cmake \
        -DCMAKE_VERBOSE_MAKEFILE=OFF \
        -DWITH_CLIENT=OFF -DWITH_SSE2=OFF -DWITH_SSE2_TARGET=OFF -DWITH_CUNIT=OFF \
        -DBUILD_SHARED_LIBS=$_sharg \
        -DOPENSSL_INCLUDE_DIR=%{_mingw32_includedir} \
        -DLIB_EAY=%{_mingw32_libdir}/libcrypto.$_depext \
        -DSSL_EAY=%{_mingw32_libdir}/libssl.$_depext \
        ..
    make
#%{?_smp_mflags}
    cd ..
}

build static
build shared

%install
make -C build_static install DESTDIR=%{buildroot}
make -C build_shared install DESTDIR=%{buildroot}
mkdir -p %{buildroot}%{_mingw32_bindir}

# cmake installs dll's into lib instead of bin
mv %{buildroot}%{_mingw32_libdir}/*.dll %{buildroot}%{_mingw32_bindir}

# Set permissions on lib*.dll.a so that strip works.
chmod 0755 %{buildroot}%{_mingw32_libdir}/*.dll.a

find %{buildroot} -name "*.a" | grep -v .dll.a |
    sed -n -e "s#^%{buildroot}##p" > static-libs

%clean
rm -rf %{buildroot}

%files static -f static-libs
%defattr(-,root,root,-)

%files
%defattr(-,root,root,-)
%doc LICENSE README ChangeLog
%{_mingw32_bindir}/*.dll
%{_mingw32_includedir}/*
%{_mingw32_libdir}/*.dll.a
%{_mingw32_libdir}/pkgconfig/%{xname}.pc
%{_mingw32_datadir}/%{xname}

%changelog
* Wed Apr 25 2012 Fritz Elfert <fritz@fritz-elfert.de> - 1.0.1git-3
- Fixed all warnings
* Tue Apr 24 2012 Fritz Elfert <fritz@fritz-elfert.de> - 1.0.1git-2
- Misc build fixes
* Tue Apr 24 2012 Fritz Elfert <fritz@fritz-elfert.de> - 1.0.1git-1
- Initial release