]> git.pld-linux.org Git - packages/crnlib.git/blob - crnlib.spec
- added types patch (fixes build on LP64 systems)
[packages/crnlib.git] / crnlib.spec
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
4 Name:           crnlib
5 Version:        1.04
6 Release:        1
7 License:        ZLib
8 Group:          Libraries
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
12 # rm -rf crunch/bin*
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)
22
23 %description
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.
27
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.
32
33 %package devel
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
39
40 %description devel
41 Header files for crnlib library.
42
43 %description devel -l pl.UTF-8
44 Pliki nagłówkowe biblioteki crnlib.
45
46 %package static
47 Summary:        Static crnlib library
48 Summary(pl.UTF-8):      Statyczna biblioteka crnlib
49 Group:          Development/Libraries
50 Requires:       %{name}-devel = %{version}-%{release}
51
52 %description static
53 Static crnlib library.
54
55 %description static -l pl.UTF-8
56 Statyczna biblioteka crnlib.
57
58 %prep
59 %setup -q -n crunch
60 %patch0 -p1
61 %patch1 -p1
62
63 %{__sed} -i -e '/g++.*COMPILE_OPTIONS/s/g++/$(CXX)/' crnlib/Makefile
64 %{__sed} -i -e '/g++.*LINKER_OPTIONS/s/g++/$(CXXLINK)/' crnlib/Makefile
65
66 %build
67 %{__make} -C crnlib \
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"
72
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
76
77 %install
78 rm -rf $RPM_BUILD_ROOT
79 install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir}}
80
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}
84
85 %clean
86 rm -rf $RPM_BUILD_ROOT
87
88 %post   -p /sbin/ldconfig
89 %postun -p /sbin/ldconfig
90
91 %files
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
97
98 %files devel
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
105
106 %files static
107 %defattr(644,root,root,755)
108 %{_libdir}/libcrunch.a
This page took 0.071331 seconds and 3 git commands to generate.