Git init
[external/iniparser.git] / packaging / iniparser.spec
1 Name:       iniparser
2 Summary:    Stand-alone ini file parsing library
3 Version:    2.17
4 Release:    1
5 Group:      Applications/Databases
6 License:    MIT
7 URL:        http://ndevilla.free.fr/iniparser/
8 Source:     http://ndevilla.free.fr/iniparser/iniparser-%{version}.tar.gz
9 Requires(post): /sbin/ldconfig
10 Requires(postun): /sbin/ldconfig
11
12 %description
13 iniparser is a free stand-alone ini file parsing library.
14 It is written in portable ANSI C and should compile anywhere.
15 iniparser is distributed under an MIT license.
16
17 %package devel
18 Summary:    Development tools for stand-alone ini file parsing library
19 Group:      Development/Libraries
20 Requires:   %{name} = %{version}-%{release}
21
22 %description devel
23 This package contains the header files and development documentation
24 for %{name}. If you like to develop programs using %{name}, you will need
25 to install %{name}-devel.
26
27 %prep
28 %setup -q
29
30 %build
31
32 LDFLAGS="-Wl,--rpath=%{_prefix}/lib -Wl,--hash-style=both -Wl,--as-needed $LDFLAGS" \
33         make prefix=%{_prefix}
34
35 make %{?jobs:-j%jobs}
36
37 %install
38 rm -rf %{buildroot}
39
40 mkdir -p $RPM_BUILD_ROOT/%{_libdir}
41 install -m 755 libiniparser.so.0 $RPM_BUILD_ROOT/%{_libdir}
42 ln -s libiniparser.so.0 $RPM_BUILD_ROOT/%{_libdir}/libiniparser.so
43 mkdir -p $RPM_BUILD_ROOT/%{_includedir}
44 install -m 755 src/*.h $RPM_BUILD_ROOT/%{_includedir}
45 install -m 755 src/*.h $RPM_BUILD_ROOT/%{_includedir}
46 mkdir -p $RPM_BUILD_ROOT/%{_libdir}/pkgconfig
47 cat > $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/%{name}.pc <<EOF
48 prefix = %{_prefix}
49 exec_prefix = %{_exec_prefix}
50 libdir = %{_libdir}
51 includedir = %{_includedir}
52
53 Name : iniparser
54 Description : a free stand-alone ini file parsing library.
55 Version : %{version}
56 Libs : -L\${libdir} -liniparser
57 Cflags : -I\${includedir}
58
59 EOF
60
61 %post -p /sbin/ldconfig
62
63 %postun -p /sbin/ldconfig
64
65 %files
66 %{_libdir}/*.so.*
67
68 %files devel
69 %{_includedir}/*.h
70 %{_libdir}/*.so
71 %{_libdir}/pkgconfig/*.pc