pkgconfig file renabmed to libelf0
[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 %{?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 }
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 %{?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 }
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 # rename pc file to prevent conflict with libelf 0.178
68 mv %{buildroot}%{_libdir}/pkgconfig/libelf.pc %{buildroot}%{_libdir}/pkgconfig/libelf0.pc
69
70 %post -p /sbin/ldconfig
71
72 %postun -p /sbin/ldconfig
73
74 %files
75 %manifest %{name}.manifest
76 %defattr(-,root,root)
77 %license COPYING.LIB 
78 %{_libdir}/libelf.so.*
79
80 %files devel
81 %manifest %{name}.manifest
82 %defattr(-,root,root)
83 %{_libdir}/libelf.so
84 %{_libdir}/libelf.a
85 %{_libdir}/pkgconfig/libelf0.pc
86 %{_includedir}/libelf
87
88 %{?asan:
89 %files noasan-static
90 %manifest %{name}.manifest
91 %defattr(-,root,root)
92 %{_libdir}/libelf-noasan.a
93 }
94
95 %changelog