1 # NOTE: we use "crnlib" because plain "crunch" or "libcrunch" isn't unique project name
2 Summary: crunch/crnlib - advanced DXTn texture compression library
3 Summary(pl.UTF-8): crunch/crnlib - zaawansowana biblioteka do kompresji tekstur DXTn
9 #Source0Download: http://code.google.com/p/crunch/downloads/list
10 # but no Linux-supporting releases there
11 # svn co http://crunch.googlecode.com/svn/tags/v104 crunch
13 # tar cJf crunch-104.tar.xz -x .svn crunch
14 Source0: crunch-104.tar.xz
15 # Source0-md5: f92837bba95abf27d6bd9ae0b2b04863
16 Patch0: %{name}-c++.patch
17 Patch1: %{name}-types.patch
18 URL: http://code.google.com/p/crunch/
19 BuildRequires: libstdc++-devel
20 BuildRequires: libtool
21 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 crnlib is a lossy texture compression library for developers that ship
25 content using the DXT1/5/N or 3DC compressed color/normal map/cubemap
26 mipmapped texture formats.
28 %description -l pl.UTF-8
29 crnlib to biblioteka stratnej kompresji dla programistów
30 dostarczających dane przy użyciu formatów tekstur (kolorów, map
31 normalnych i innych) z zastosowaną kompresją DXT1/5/N lub 3DC.
34 Summary: Header files for crnlib library
35 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki crnlib
36 Group: Development/Libraries
37 Requires: %{name} = %{version}-%{release}
38 Requires: libstdc++-devel
41 Header files for crnlib library.
43 %description devel -l pl.UTF-8
44 Pliki nagłówkowe biblioteki crnlib.
47 Summary: Static crnlib library
48 Summary(pl.UTF-8): Statyczna biblioteka crnlib
49 Group: Development/Libraries
50 Requires: %{name}-devel = %{version}-%{release}
53 Static crnlib library.
55 %description static -l pl.UTF-8
56 Statyczna biblioteka crnlib.
63 %{__sed} -i -e '/g++.*COMPILE_OPTIONS/s/g++/$(CXX)/' crnlib/Makefile
64 %{__sed} -i -e '/g++.*LINKER_OPTIONS/s/g++/$(CXXLINK)/' crnlib/Makefile
68 CXX="libtool --mode=compile %{__cxx}" \
69 CXXLINK="libtool --mode=link %{__cxx}" \
70 COMPILE_OPTIONS="%{rpmcflags} -fomit-frame-pointer -ffast-math -fno-math-errno -fno-strict-aliasing -Wall -Wno-unused-value -Wno-unused" \
71 LINKER_OPTIONS="%{rpmldflags} -lpthread"
73 libtool --mode=link %{__cxx} %{rpmldflags} -o crnlib/libcrunch.la crnlib/{crnlib,crn_*,lzma_*}.lo -rpath %{_libdir} -lpthread
74 # relink using shared library
75 libtool --mode=link %{__cxx} %{rpmldflags} -o crnlib/crunch crnlib/{crunch,corpus_gen,corpus_test}.o crnlib/libcrunch.la -lpthread
78 rm -rf $RPM_BUILD_ROOT
79 install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir}}
81 libtool --mode=install install crnlib/libcrunch.la $RPM_BUILD_ROOT%{_libdir}
82 cp -p inc/*.h $RPM_BUILD_ROOT%{_includedir}
83 install crnlib/crunch $RPM_BUILD_ROOT%{_bindir}
86 rm -rf $RPM_BUILD_ROOT
88 %post -p /sbin/ldconfig
89 %postun -p /sbin/ldconfig
92 %defattr(644,root,root,755)
93 %doc license.txt readme.txt
94 %attr(755,root,root) %{_bindir}/crunch
95 %attr(755,root,root) %{_libdir}/libcrunch.so.*.*.*
96 %attr(755,root,root) %ghost %{_libdir}/libcrunch.so.0
99 %defattr(644,root,root,755)
100 %attr(755,root,root) %{_libdir}/libcrunch.so
101 %{_libdir}/libcrunch.la
102 %{_includedir}/crn_decomp.h
103 %{_includedir}/crnlib.h
104 %{_includedir}/dds_defs.h
107 %defattr(644,root,root,755)
108 %{_libdir}/libcrunch.a