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 URL: http://code.google.com/p/crunch/
18 BuildRequires: libstdc++-devel
19 BuildRequires: libtool
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23 crnlib is a lossy texture compression library for developers that ship
24 content using the DXT1/5/N or 3DC compressed color/normal map/cubemap
25 mipmapped texture formats.
27 %description -l pl.UTF-8
28 crnlib to biblioteka stratnej kompresji dla programistów
29 dostarczających dane przy użyciu formatów tekstur (kolorów, map
30 normalnych i innych) z zastosowaną kompresją DXT1/5/N lub 3DC.
33 Summary: Header files for crnlib library
34 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki crnlib
35 Group: Development/Libraries
36 Requires: %{name} = %{version}-%{release}
37 Requires: libstdc++-devel
40 Header files for crnlib library.
42 %description devel -l pl.UTF-8
43 Pliki nagłówkowe biblioteki crnlib.
46 Summary: Static crnlib library
47 Summary(pl.UTF-8): Statyczna biblioteka crnlib
48 Group: Development/Libraries
49 Requires: %{name}-devel = %{version}-%{release}
52 Static crnlib library.
54 %description static -l pl.UTF-8
55 Statyczna biblioteka crnlib.
61 %{__sed} -i -e '/g++.*COMPILE_OPTIONS/s/g++/$(CXX)/' crnlib/Makefile
62 %{__sed} -i -e '/g++.*LINKER_OPTIONS/s/g++/$(CXXLINK)/' crnlib/Makefile
66 CXX="libtool --mode=compile %{__cxx}" \
67 CXXLINK="libtool --mode=link %{__cxx}" \
68 COMPILE_OPTIONS="%{rpmcflags} -fomit-frame-pointer -ffast-math -fno-math-errno -fno-strict-aliasing -Wall -Wno-unused-value -Wno-unused" \
69 LINKER_OPTIONS="%{rpmldflags} -lpthread"
71 libtool --mode=link %{__cxx} %{rpmldflags} -o crnlib/libcrunch.la crnlib/{crnlib,crn_*,lzma_*}.lo -rpath %{_libdir} -lpthread
72 # relink using shared library
73 libtool --mode=link %{__cxx} %{rpmldflags} -o crnlib/crunch crnlib/{crunch,corpus_gen,corpus_test}.o crnlib/libcrunch.la -lpthread
76 rm -rf $RPM_BUILD_ROOT
77 install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir}}
79 libtool --mode=install install crnlib/libcrunch.la $RPM_BUILD_ROOT%{_libdir}
80 cp -p inc/*.h $RPM_BUILD_ROOT%{_includedir}
81 install crnlib/crunch $RPM_BUILD_ROOT%{_bindir}
84 rm -rf $RPM_BUILD_ROOT
86 %post -p /sbin/ldconfig
87 %postun -p /sbin/ldconfig
90 %defattr(644,root,root,755)
91 %doc license.txt readme.txt
92 %attr(755,root,root) %{_bindir}/crunch
93 %attr(755,root,root) %{_libdir}/libcrunch.so.*.*.*
94 %attr(755,root,root) %ghost %{_libdir}/libcrunch.so.0
97 %defattr(644,root,root,755)
98 %attr(755,root,root) %{_libdir}/libcrunch.so
99 %{_libdir}/libcrunch.la
100 %{_includedir}/crn_decomp.h
101 %{_includedir}/crnlib.h
102 %{_includedir}/dds_defs.h
105 %defattr(644,root,root,755)
106 %{_libdir}/libcrunch.a