Tizen:Common armv7l build fix
[platform/upstream/gcd.git] / packaging / gcd.spec
1 Name:       gcd
2 Summary:    GCD(Grand Central Dispatch) library
3 Version:    1.0
4 Release:    1
5 License:    Apache-2.0 and BSD-2-Clause
6 Group:      System/Libraries
7 Source0:    %{name}-%{version}.tar.gz
8 BuildRequires:  clang
9
10 %description
11 Grand Central Dispatch (GCD) is a technology developed by Apple Inc.
12
13 %package devel
14 Summary:    GCD(Grand Central Dispatch) library
15 Requires:   %{name} = %{version}-%{release}
16
17 %description devel
18 Grand Central Dispatch (GCD) is a technology developed by Apple Inc. (DEV)
19
20 %prep
21 %setup -q -n %{name}-%{version}
22
23 %build
24 for sub_pkg in kqueue-1.0.4 \
25                pthread_workqueue-0.8.2 \
26                BlocksRuntime-0.1; do
27     pushd ${sub_pkg}
28     %configure
29     make
30     popd
31 done
32
33 pushd dispatch-1.0
34 export KQUEUE_CFLAGS="-I../../kqueue-1.0.4/include"
35 export KQUEUE_LIBS="%{_libdir}"
36 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:%{_builddir}/%{name}-%{version}/BlocksRuntime-0.1"
37 export CFLAGS="$CFLAGS -L%{_builddir}/%{name}-%{version}/BlocksRuntime-0.1 -lBlocksRuntime -I%{_builddir}/%{name}-%{version}/BlocksRuntime-0.1 -Xlinker --build-id"
38
39 export COMPILER_PATH="%{_libdir}/gcc/$(gcc -v 2>&1 | grep Target | sed -e 's/.*\s//')/$(gcc -v 2>&1 | grep 'gcc version' | sed -e 's/gcc\sversion\s//;s/\.[[:digit:]]\s.*$//')"
40
41 %ifarch %{ix86}
42 export CC="clang -target i586-tizen-linux"
43 export CFLAGS="$CFLAGS -Xlinker -L$COMPILER_PATH"
44 %else
45 export CC="clang -target %{_target_cpu}-tizen-linux"
46 export CFLAGS="$CFLAGS -Xlinker -L$COMPILER_PATH"
47 %endif
48
49 %configure --with-blocks-runtime=%{_libdir}
50 make
51 popd
52
53 %install
54 for sub_pkg in kqueue-1.0.4 \
55                pthread_workqueue-0.8.2 \
56                BlocksRuntime-0.1 \
57                dispatch-1.0; do
58     pushd ${sub_pkg}
59     %make_install
60     popd
61 done
62
63 %post -p /sbin/ldconfig
64
65 %postun -p /sbin/ldconfig
66
67 %files
68 %defattr(-,root,root)
69 %manifest gcd.manifest
70 %license LICENSE
71 %{_libdir}/libkqueue.so.*
72 %{_libdir}/libpthread_workqueue.so.*
73 %{_libdir}/libBlocksRuntime.so.*
74 %{_libdir}/libdispatch.so.*
75
76 %files devel
77 %{_includedir}/kqueue/sys/event.h
78 %{_libdir}/libkqueue.so
79 %{_libdir}/pkgconfig/libkqueue.pc
80 %{_includedir}/pthread_workqueue.h
81 %{_libdir}/libpthread_workqueue.so
82 %{_includedir}/Block.h
83 %{_includedir}/Block_private.h
84 %{_libdir}/libBlocksRuntime.so
85 %{_includedir}/dispatch/*.h
86 %{_libdir}/libdispatch.so
87 %{_mandir}/man2/*.gz
88 %{_mandir}/man3/*.gz