Fix macro expansion in the spec file.
[platform/upstream/gcd.git] / packaging / gcd.spec
1 %define gcc_version %(LANG=C gcc --version | head -1 | sed 's/.* (.*) \\([0-9]\\.[0-9]\\).*$/\\1/')
2
3 Name:       gcd
4 Summary:    GCD(Grand Central Dispatch) library
5 Version:    1.0
6 Release:    1
7 License:    Apache-2.0 and BSD-2-Clause
8 Group:      System/Libraries
9 Source0:    %{name}-%{version}.tar.gz
10 BuildRequires:  clang
11
12
13 %description
14 GCD(Grand Central Dispatch) library.
15
16 %package devel
17 Summary:    GCD(Grand Central Dispatch) library
18 Requires:   %{name} = %{version}-%{release}
19
20 %description devel
21 GCD(Grand Central Dispatch) library. (DEV)
22
23
24 %prep
25 %setup -q -n gcd-1.0
26
27 %build
28
29 cd kqueue-1.0.4
30 ./configure --prefix=/usr
31 make
32 cd ..
33 cd pthread_workqueue-0.8.2
34 ./configure --prefix=/usr
35 make
36 cd ..
37 cd BlocksRuntime-0.1
38 ./configure --prefix=/usr
39 make
40 cd ..
41 cd dispatch-1.0
42 export KQUEUE_CFLAGS="-I../../kqueue-1.0.4/include"
43 export KQUEUE_LIBS="/usr/lib"
44 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:%{_builddir}/%{name}-%{version}/BlocksRuntime-0.1"
45 export CFLAGS="$CFLAGS -L%{_builddir}/%{name}-%{version}/BlocksRuntime-0.1 -lBlocksRuntime -I%{_builddir}/%{name}-%{version}/BlocksRuntime-0.1 -Xlinker --build-id"
46
47 %ifarch %{ix86}
48 export CC="clang -target i586-tizen-linux"
49 export CFLAGS="$CFLAGS -Xlinker -L/usr/lib/gcc/i586-tizen-linux/%{gcc_version}"
50 export COMPILER_PATH=/usr/lib/gcc/i586-tizen-linux/%{gcc_version}
51 %else
52 export CC="clang -target %{_target_cpu}-tizen-linux-gnueabi"
53 export CFLAGS="$CFLAGS -Xlinker -L/usr/lib/gcc/%{_target_cpu}-tizen-linux-gnueabi/%{gcc_version}"
54 export COMPILER_PATH=/usr/lib/gcc/%{_target_cpu}-tizen-linux-gnueabi/%{gcc_version}
55 %endif
56
57 ./configure --with-blocks-runtime=/usr/lib --prefix=/usr
58 make
59 cd ..
60
61 %install
62 cd kqueue-1.0.4
63 make DESTDIR=$RPM_BUILD_ROOT install
64 gzip $RPM_BUILD_ROOT/usr/share/man/man2/kqueue.2
65 gzip $RPM_BUILD_ROOT/usr/share/man/man2/kevent.2
66 cd ..
67 cd pthread_workqueue-0.8.2
68 make DESTDIR=$RPM_BUILD_ROOT install
69 cd ..
70 cd BlocksRuntime-0.1
71 make DESTDIR=$RPM_BUILD_ROOT install
72 cd ..
73 cd dispatch-1.0
74 %ifarch %{ix86}
75 export COMPILER_PATH=/usr/lib/gcc/i586-tizen-linux/%{gcc_version}
76 %else
77 export COMPILER_PATH=/usr/lib/gcc/%{_target_cpu}-tizen-linux-gnueabi/%{gcc_version}
78 %endif
79 make DESTDIR=$RPM_BUILD_ROOT install
80 cd ..
81
82 find %{?buildroot:%{buildroot}} -regex ".*\\.la$" | xargs rm -f --
83
84 %post -p /sbin/ldconfig
85
86 %postun -p /sbin/ldconfig
87
88 %files
89 %defattr(-,root,root)
90 %manifest gcd.manifest
91 %license LICENSE
92 %{_libdir}/libkqueue.so.0
93 %{_libdir}/libkqueue.so.0.0
94 %{_libdir}/libpthread_workqueue.so.0
95 %{_libdir}/libpthread_workqueue.so.0.0
96 %{_libdir}/libBlocksRuntime.so.0
97 %{_libdir}/libBlocksRuntime.so.0.0
98 %{_libdir}/libdispatch.so.0
99 %{_libdir}/libdispatch.so.0.0.0
100
101 %files devel
102 %{_includedir}/kqueue/sys/event.h
103 %{_libdir}/libkqueue.so
104 %{_libdir}/libkqueue.a
105 %{_libdir}/pkgconfig/libkqueue.pc
106 %{_includedir}/pthread_workqueue.h
107 %{_libdir}/libpthread_workqueue.so
108 %{_includedir}/Block.h
109 %{_includedir}/Block_private.h
110 %{_libdir}/libBlocksRuntime.so
111 %{_includedir}/dispatch/*.h
112 %{_libdir}/libdispatch.a
113 %{_libdir}/libdispatch.so
114 /usr/share/man/man3/pthread_workqueue.3.gz
115 /usr/share/man/man2/kqueue.2.gz
116 /usr/share/man/man2/kevent.2.gz
117 /usr/share/man/man3/dispatch*