From: Anas Nashif Date: Sun, 15 Sep 2013 15:37:37 +0000 (-0400) Subject: Cleanup spec file X-Git-Tag: accepted/tizen/generic/20140312.102024~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b13e3859b3ea476cb390d9a50638a95118f3fb45;p=platform%2Fupstream%2Fgcd.git Cleanup spec file - Do not install libraries in devel package - Install license correctly - remove .la files - use macro for gcc version Change-Id: Ia5945ecdf5146c42cdb20a9508a20ff847b17673 Signed-off-by: Anas Nashif --- diff --git a/packaging/gcd.spec b/packaging/gcd.spec index ad2b3fa..7d2cebe 100644 --- a/packaging/gcd.spec +++ b/packaging/gcd.spec @@ -1,3 +1,5 @@ +%define gcc_version %(LANG=C gcc --version | head -1 | sed 's/.* (.*) \([0-9]\.[0-9]\).*$/\1/') + Name: gcd Summary: GCD(Grand Central Dispatch) library Version: 1.0 @@ -5,28 +7,25 @@ Release: 1 License: Apache-2.0 and BSD-2-Clause Group: System/Libraries Source0: %{name}-%{version}.tar.gz -#Provides: libdispatch.so.0 libkqueue.so.0 libBlocksRuntime.so.0 libpthread_workqueue.so.0 BuildRequires: clang %description GCD(Grand Central Dispatch) library. -%package devel +%package devel Summary: GCD(Grand Central Dispatch) library -Group: System/Libraries -Requires: %{name} = %{version}-%{release} - -%description devel -GCD(Grand Central Dispatch) library. (DEV) +Requires: %{name} = %{version}-%{release} + +%description devel +GCD(Grand Central Dispatch) library. (DEV) + %prep %setup -q -n gcd-1.0 %build -export GCCVER=$(LANG=C gcc --version | head -1 | sed 's/\([a-z+]*\) \((.*)\) \([0-9\.]*\)\(.*\)/\3/') - cd kqueue-1.0.4 ./configure --prefix=/usr make @@ -47,12 +46,12 @@ export CFLAGS="$CFLAGS -L%{_builddir}/%{name}-%{version}/BlocksRuntime-0.1 -lBlo %ifarch %{ix86} export CC="clang -target i586-tizen-linux" -export CFLAGS="$CFLAGS -Xlinker -L/usr/lib/gcc/i586-tizen-linux/4.8" -export COMPILER_PATH=/usr/lib/gcc/i586-tizen-linux/4.8 +export CFLAGS="$CFLAGS -Xlinker -L/usr/lib/gcc/i586-tizen-linux/%{gcc_version}" +export COMPILER_PATH=/usr/lib/gcc/i586-tizen-linux/%{gcc_version} %else export CC="clang -target %{_target_cpu}-tizen-linux-gnueabi" -export CFLAGS="$CFLAGS -Xlinker -L/usr/lib/gcc/%{_target_cpu}-tizen-linux-gnueabi/4.8" -export COMPILER_PATH=/usr/lib/gcc/%{_target_cpu}-tizen-linux-gnueabi/4.8 +export CFLAGS="$CFLAGS -Xlinker -L/usr/lib/gcc/%{_target_cpu}-tizen-linux-gnueabi/%{gcc_version}" +export COMPILER_PATH=/usr/lib/gcc/%{_target_cpu}-tizen-linux-gnueabi/%{gcc_version} %endif ./configure --with-blocks-runtime=/usr/lib --prefix=/usr @@ -73,29 +72,23 @@ make DESTDIR=$RPM_BUILD_ROOT install cd .. cd dispatch-1.0 %ifarch %{ix86} -export COMPILER_PATH=/usr/lib/gcc/i586-tizen-linux/$GCCVER +export COMPILER_PATH=/usr/lib/gcc/i586-tizen-linux/%{gcc_version} %else -export COMPILER_PATH=/usr/lib/gcc/armv7l-tizen-linux-gnueabi/$GCCVER +export COMPILER_PATH=/usr/lib/gcc/%{_target_cpu}-tizen-linux-gnueabi/%{gcc_version} %endif make DESTDIR=$RPM_BUILD_ROOT install cd .. -mkdir -p %{buildroot}/usr/share/license -cp %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name} - -%clean -[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT} +find %{?buildroot:%{buildroot}} -regex ".*\\.la$" | xargs rm -f -- -%post -/sbin/ldconfig +%post -p /sbin/ldconfig -%postun -/sbin/ldconfig +%postun -p /sbin/ldconfig %files -%manifest gcd.manifest -/usr/share/license/%{name} %defattr(-,root,root) +%manifest gcd.manifest +%license LICENSE %{_libdir}/libkqueue.so.0 %{_libdir}/libkqueue.so.0.0 %{_libdir}/libpthread_workqueue.so.0 @@ -108,27 +101,19 @@ cp %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{nam %files devel %{_includedir}/kqueue/sys/event.h %{_libdir}/libkqueue.so -%{_libdir}/libkqueue.so.0 -%{_libdir}/libkqueue.so.0.0 -%{_libdir}/libkqueue.la %{_libdir}/libkqueue.a %{_libdir}/pkgconfig/libkqueue.pc -/usr/share/man/man2/kqueue.2.gz -/usr/share/man/man2/kevent.2.gz %{_includedir}/pthread_workqueue.h %{_libdir}/libpthread_workqueue.so -%{_libdir}/libpthread_workqueue.so.0 -%{_libdir}/libpthread_workqueue.so.0.0 -/usr/share/man/man3/pthread_workqueue.3.gz %{_includedir}/Block.h %{_includedir}/Block_private.h %{_libdir}/libBlocksRuntime.so -%{_libdir}/libBlocksRuntime.so.0 -%{_libdir}/libBlocksRuntime.so.0.0 %{_includedir}/dispatch/*.h %{_libdir}/libdispatch.a -%{_libdir}/libdispatch.la -/usr/share/man/man3/dispatch* %{_libdir}/libdispatch.so +/usr/share/man/man3/pthread_workqueue.3.gz +/usr/share/man/man2/kqueue.2.gz +/usr/share/man/man2/kevent.2.gz +/usr/share/man/man3/dispatch* %changelog