]>
Commit | Line | Data |
---|---|---|
ee037b96 ER |
1 | # TODO |
2 | # - merge/handle crunch-wordlist | |
3 | # file /usr/bin/crunch from install of crnlib-1.04-2.x86_64 conflicts with file from package crunch-wordlist-3.6-0.2.x86_64 | |
4 | # | |
fb6fa1b1 JB |
5 | # NOTE: we use "crnlib" because plain "crunch" or "libcrunch" isn't unique project name |
6 | Summary: crunch/crnlib - advanced DXTn texture compression library | |
7 | Summary(pl.UTF-8): crunch/crnlib - zaawansowana biblioteka do kompresji tekstur DXTn | |
8 | Name: crnlib | |
9 | Version: 1.04 | |
06e41d6f | 10 | Release: 2 |
fb6fa1b1 JB |
11 | License: ZLib |
12 | Group: Libraries | |
1bd7afbc JB |
13 | #Source0Download: https://github.com/BinomialLLC/crunch/releases |
14 | # v104 came from old googlecode repo: | |
fb6fa1b1 JB |
15 | # svn co http://crunch.googlecode.com/svn/tags/v104 crunch |
16 | # rm -rf crunch/bin* | |
17 | # tar cJf crunch-104.tar.xz -x .svn crunch | |
18 | Source0: crunch-104.tar.xz | |
19 | # Source0-md5: f92837bba95abf27d6bd9ae0b2b04863 | |
20 | Patch0: %{name}-c++.patch | |
b5d2702a | 21 | Patch1: %{name}-types.patch |
1bd7afbc | 22 | URL: https://github.com/BinomialLLC/crunch |
fb6fa1b1 JB |
23 | BuildRequires: libstdc++-devel |
24 | BuildRequires: libtool | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %description | |
28 | crnlib is a lossy texture compression library for developers that ship | |
29 | content using the DXT1/5/N or 3DC compressed color/normal map/cubemap | |
30 | mipmapped texture formats. | |
31 | ||
32 | %description -l pl.UTF-8 | |
33 | crnlib to biblioteka stratnej kompresji dla programistów | |
34 | dostarczających dane przy użyciu formatów tekstur (kolorów, map | |
35 | normalnych i innych) z zastosowaną kompresją DXT1/5/N lub 3DC. | |
36 | ||
37 | %package devel | |
38 | Summary: Header files for crnlib library | |
39 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki crnlib | |
40 | Group: Development/Libraries | |
41 | Requires: %{name} = %{version}-%{release} | |
42 | Requires: libstdc++-devel | |
43 | ||
44 | %description devel | |
45 | Header files for crnlib library. | |
46 | ||
47 | %description devel -l pl.UTF-8 | |
48 | Pliki nagłówkowe biblioteki crnlib. | |
49 | ||
50 | %package static | |
51 | Summary: Static crnlib library | |
52 | Summary(pl.UTF-8): Statyczna biblioteka crnlib | |
53 | Group: Development/Libraries | |
54 | Requires: %{name}-devel = %{version}-%{release} | |
55 | ||
56 | %description static | |
57 | Static crnlib library. | |
58 | ||
59 | %description static -l pl.UTF-8 | |
60 | Statyczna biblioteka crnlib. | |
61 | ||
62 | %prep | |
63 | %setup -q -n crunch | |
64 | %patch0 -p1 | |
b5d2702a | 65 | %patch1 -p1 |
fb6fa1b1 JB |
66 | |
67 | %{__sed} -i -e '/g++.*COMPILE_OPTIONS/s/g++/$(CXX)/' crnlib/Makefile | |
68 | %{__sed} -i -e '/g++.*LINKER_OPTIONS/s/g++/$(CXXLINK)/' crnlib/Makefile | |
69 | ||
70 | %build | |
71 | %{__make} -C crnlib \ | |
72 | CXX="libtool --mode=compile %{__cxx}" \ | |
73 | CXXLINK="libtool --mode=link %{__cxx}" \ | |
74 | COMPILE_OPTIONS="%{rpmcflags} -fomit-frame-pointer -ffast-math -fno-math-errno -fno-strict-aliasing -Wall -Wno-unused-value -Wno-unused" \ | |
75 | LINKER_OPTIONS="%{rpmldflags} -lpthread" | |
76 | ||
77 | libtool --mode=link %{__cxx} %{rpmldflags} -o crnlib/libcrunch.la crnlib/{crnlib,crn_*,lzma_*}.lo -rpath %{_libdir} -lpthread | |
78 | # relink using shared library | |
79 | libtool --mode=link %{__cxx} %{rpmldflags} -o crnlib/crunch crnlib/{crunch,corpus_gen,corpus_test}.o crnlib/libcrunch.la -lpthread | |
80 | ||
81 | %install | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir},%{_bindir}} | |
84 | ||
85 | libtool --mode=install install crnlib/libcrunch.la $RPM_BUILD_ROOT%{_libdir} | |
86 | cp -p inc/*.h $RPM_BUILD_ROOT%{_includedir} | |
87 | install crnlib/crunch $RPM_BUILD_ROOT%{_bindir} | |
88 | ||
89 | %clean | |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | ||
92 | %post -p /sbin/ldconfig | |
93 | %postun -p /sbin/ldconfig | |
94 | ||
95 | %files | |
96 | %defattr(644,root,root,755) | |
97 | %doc license.txt readme.txt | |
98 | %attr(755,root,root) %{_bindir}/crunch | |
99 | %attr(755,root,root) %{_libdir}/libcrunch.so.*.*.* | |
100 | %attr(755,root,root) %ghost %{_libdir}/libcrunch.so.0 | |
101 | ||
102 | %files devel | |
103 | %defattr(644,root,root,755) | |
104 | %attr(755,root,root) %{_libdir}/libcrunch.so | |
105 | %{_libdir}/libcrunch.la | |
106 | %{_includedir}/crn_decomp.h | |
107 | %{_includedir}/crnlib.h | |
108 | %{_includedir}/dds_defs.h | |
109 | ||
110 | %files static | |
111 | %defattr(644,root,root,755) | |
112 | %{_libdir}/libcrunch.a |