Ticket #169: libpoll.spec

File libpoll.spec, 2.7 KB (added by Lewis Rosenthal, 8 years ago)

updated spec for libpoll (libpoll-devel) which adds examples

Line 
1# Note: this package should go away (become an alias for libc-devel)
2# once http://trac.netlabs.org/libc/ticket/353 is resolved.
3
4Summary: System V poll system call emulation.
5Name: libpoll-devel
6Version: 1.5.1
7Release: 3%{?dist}
8License: BSD
9URL: http://software.clapper.org/poll/
10
11Group: Development/Libraries
12
13# https://github.com/bmc/poll/archive/release-1.5.1.zip
14Source: poll-release-1.5.1.zip
15
16BuildRequires: gcc
17
18Requires: libc-devel
19
20%description
21This package implements the System V poll(2) system call for Unix-like systems
22that do not support poll. For instance, the following Unix-like operating
23systems do not support poll:
24
25    NetBSD, prior to version 1.3
26    FreeBSD, prior to version 3.0
27    OpenBSD, prior to version 2.0
28    BSD/OS. (See the BSD/OS man pages.)
29    Apple's Mac OS X (prior to OS X 10.3)
30    QNX version 6
31    4.4 BSD Lite 2 (not generally used by production systems)
32    386BSD (pretty much obsolete these days)
33    OS/2 (and derivatives)
34
35poll provides a method for multiplexing input and output on multiple open file
36descriptors; in traditional BSD systems, that capability is provided by
37select(2). While the semantics of select differ from those of poll, poll can
38be readily emulated in terms of select, which is exactly what this small piece
39of software does.
40
41%prep
42%setup -q -n poll-release-%{version}
43
44# Add extra POLL constants used by some sources.
45# @todo We can't use patch directly because of EOLs (forced --binary on OS/2).
46tr -d '\r' > poll.diff <<"EOF"
47--- poll.h.b
48+++ poll.h
49@@ -78,6 +78,11 @@
50 #define POLLHUP        0x10
51 #define POLLNVAL   0x20
52
53+#define POLLRDNORM  0x0040
54+#define POLLRDBAND  0x0080
55+#define POLLWRNORM  0x0100
56+#define POLLWRBAND  0x0200
57+
58 struct pollfd
59 {
60     int     fd;
61EOF
62patch < poll.diff
63
64%build
65gcc %{optflags} -c poll.c -o poll.o
66ar rv poll_s.a poll.o
67emxomf poll_s.a -o poll_s.lib
68
69# Add support for #include <poll.h>
70echo "#include <sys/poll.h>" > nosys_poll.h
71
72%install
73rm -rf %{buildroot}
74mkdir -p %{buildroot}%{_includedir}
75install -m 644 nosys_poll.h %{buildroot}%{_includedir}/poll.h
76mkdir -p %{buildroot}%{_includedir}/sys
77install -m 644 poll.h %{buildroot}%{_includedir}/sys
78mkdir -p %{buildroot}%{_libdir}
79install -m 755 poll_s.a poll_s.lib %{buildroot}%{_libdir}
80
81%clean
82rm -rf %{buildroot}
83
84%files
85%defattr(-,root,root)
86%doc CHANGELOG.md INSTALL README.md LICENSE
87%{_includedir}/poll.h
88%{_includedir}/sys/poll.h
89%{_libdir}/poll_s.a
90%{_libdir}/poll_s.lib
91
92%changelog
93* Wed Jan 27 2016 Dmitriy Kuminov <coding@dmik.org> 1.5.1-3
94- Add poll_s.a (for use with ld, e.g. in non-Zomf mode).
95
96* Wed Dec 22 2015 Dmitriy Kuminov <coding@dmik.org> 1.5.1-2
97- Add POLLRD* and POLLWR* constants.
98
99* Tue Dec 22 2015 Dmitriy Kuminov <coding@dmik.org> 1.5.1-1
100- Initial package for version 1.5.1.