contrib/liboping.spec: Added example spec file.
[liboping.git] / contrib / liboping.spec
1 Name:           liboping
2 Version:        1.3.4 
3 Release:        1%{?dist}
4 Summary:        Ping library intended for use in network monitoring applications
5
6 Group:          System Environment/Libraries
7 License:        GPLv2
8 URL:            http://verplant.org/liboping/
9 Source0:        http://verplant.org/liboping/files/liboping-%{version}.tar.gz 
10 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
11
12 #TODO - find all build requirements using a clean system
13 #BuildRequires:         
14
15 %description
16 The %{name} package is a C library to generate ICMP echo requests, better known 
17 as “ping packets”. It is intended for use in network monitoring applications or
18 applications that would otherwise need to fork ping(1) frequently. It is like 
19 ping, ping6, and fping rolled into one.
20
21 %package        devel
22 Summary:        Development files for %{name}
23 Group:          Development/Libraries
24 Requires:       %{name} = %{version}-%{release}
25
26 %description    devel
27 The %{name}-devel package contains libraries and header files for
28 developing applications that use %{name}.
29
30 %package        perl
31 Summary:        Perl bindings for %{name}
32 Group:          Development/Libraries
33 Requires:       %{name} = %{version}-%{release}
34 Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
35
36 %description    perl
37 The %{name}-perl package contains a perl module for perl programs
38 that use %{name}.
39
40
41 %prep
42 %setup -q
43
44
45 %build
46 #Install perl bindings to vendor_perl instead of site_perl
47 %configure --disable-static --with-perl-bindings='INSTALLDIRS=vendor OPTIMIZE="%{optflags}"'
48 #The application uses a local copy of libtool, we need to remove rpath with the
49 #following two lines (see https://fedoraproject.org/wiki/Packaging/Guidelines#Beware_of_Rpath)
50 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
51 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
52 make %{?_smp_mflags}
53
54
55 %install
56 rm -rf %{buildroot}
57 make install DESTDIR=%{buildroot}
58 chmod -R u+w %{buildroot}/*
59 find %{buildroot} -name '*.la' -exec rm -f {} ';'
60 find %{buildroot} -type f -name .packlist -exec rm -f {} ';'
61 find %{buildroot} -type f -name '*.bs' -a -size 0 -exec rm -f {} ';'
62 find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';'
63 find %{buildroot} -type f -name perllocal.pod -exec rm -f {} ';'
64
65 %clean
66 rm -rf %{buildroot}
67
68
69 %post -p /sbin/ldconfig
70
71 %postun -p /sbin/ldconfig
72
73
74 %files
75 %defattr(-,root,root,-)
76 %doc AUTHORS COPYING NEWS README ChangeLog
77 %{_libdir}/*.so.*
78 %{_bindir}/oping
79 %{_mandir}/man8/oping.8*
80
81
82 %files devel
83 %defattr(-,root,root,-)
84 %{_includedir}/*
85 %{_libdir}/*.so
86 %{_mandir}/man3/liboping.3*
87 %{_mandir}/man3/ping_construct.3*
88 %{_mandir}/man3/ping_get_error.3*
89 %{_mandir}/man3/ping_host_add.3*
90 %{_mandir}/man3/ping_iterator_get.3*
91 %{_mandir}/man3/ping_iterator_get_context.3*
92 %{_mandir}/man3/ping_iterator_get_info.3*
93 %{_mandir}/man3/ping_send.3*
94 %{_mandir}/man3/ping_setopt.3*
95
96 %files perl
97 %defattr(-,root,root,-)
98 %doc bindings/perl/README bindings/perl/Changes
99 # For arch-specific packages: vendorarch
100 %{perl_vendorarch}/*
101 %exclude %dir %{perl_vendorarch}/auto/
102 %{_mandir}/man3/Net::Oping.3pm*
103
104
105 %changelog
106 * Fri Jan 22 2010 Benjamin Petrin <b.petrin@wpi.edu> - 1.3.4-1
107 - Initial package