Additioanl libelf package without of ASan
[platform/upstream/libelf0.git] / packaging / libelf0.spec
1 Name:           libelf0
2 Version:        0.8.13
3 Release:        0
4 License:        LGPL-2.1+
5 Summary:        An ELF Object File Access Library
6 Url:            http://www.mr511.de/software/
7 Group:          System/Libraries
8 Source:         libelf-%{version}.tar.bz2
9 Source2:        baselibs.conf
10 Source1001:     libelf0.manifest
11 BuildRequires:  pkgconfig
12 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
13
14 %description
15 The libelf package contains a library for accessing ELF object files.
16 Libelf allows you to access the internals of the ELF object file
17 format, so you can see the different sections of an ELF file.
18
19 %package devel
20 Summary:        Include Files and Libraries mandatory for Development
21 Group:          Development/Libraries/C and C++
22 Requires:       %{name} = %{version}
23 Requires:       glibc-devel,
24 Conflicts:      libelf1-devel
25
26 %description devel
27 This package contains all necessary include files and libraries needed
28 to develop applications that require these.
29
30 %if %{asan}
31 %package noasan-static
32 Summary:        An ELF Object File Access Library (static library build without of ASan)
33 Group:          Development/Libraries/C and C++
34 Requires:       glibc-devel,
35 Conflicts:      libelf1-devel
36
37 %description noasan-static
38 This package contains static library built without of ASan.
39 It is required for static builds in full ASan sanitized environment.
40 %endif
41
42 %prep
43 %setup -q -n libelf-%{version}
44 cp %{SOURCE1001} .
45
46 %build
47 export LDFLAGS+=" -z relro"
48 %configure --disable-nls
49 make %{?_smp_mflags}
50
51 %if %{asan}
52 /usr/bin/gcc-unforce-options
53 mkdir noasan
54 cd noasan
55 ../configure --disable-nls --disable-shared
56 make %{?_smp_mflags} all
57 cd ..
58 %endif
59
60 %install
61 make install instroot=%{buildroot}
62 %{?asan:cp ./noasan/lib/libelf.a %{buildroot}%{_libdir}/libelf-noasan.a}
63 # remove the wrapper includes
64 rm -f %{buildroot}%{_includedir}/*.h
65 # remove unneeded *.la and *.a files
66 rm -f %{buildroot}%{_libdir}/*.la
67
68 %post -p /sbin/ldconfig
69
70 %postun -p /sbin/ldconfig
71
72 %files
73 %manifest %{name}.manifest
74 %defattr(-,root,root)
75 %license COPYING.LIB 
76 %{_libdir}/libelf.so.*
77
78 %files devel
79 %manifest %{name}.manifest
80 %defattr(-,root,root)
81 %{_libdir}/libelf.so
82 %{_libdir}/libelf.a
83 %{_libdir}/pkgconfig/libelf.pc
84 %{_includedir}/libelf
85
86 %if %{asan}
87 %files noasan-static
88 %manifest %{name}.manifest
89 %defattr(-,root,root)
90 %{_libdir}/libelf-noasan.a
91 %endif
92
93 %changelog