forked from hb9xar/siproxd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsiproxd.spec.in
130 lines (95 loc) · 3.39 KB
/
siproxd.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
%define name @PACKAGE@
%define ver @VERSION@
%define release 1
%define serial 1
%define prefix %{_prefix}
%define sysconfdir /etc
%define piddir /var/run/siproxd/
%define regdir /var/lib/siproxd/
%define siproxduser %{name}
Name: %{name}
Summary: A SIP masquerading proxy with RTP support
Version: %{ver}
Release: %{release}
License: GPL, (c) 2002-2011 Thomas Ries
Group: Applications/Communications
Source0: %{name}-%{ver}.tar.gz
URL: http://siproxd.sourceforge.net/
BuildRoot: %{_tmppath}/%{name}-%{ver}-root
Requires: libosip2 >= 3.0.0
BuildRequires: libosip2 >= 3.0.0
BuildRequires: libosip2-devel >= 3.0.0
Vendor: Thomas Ries
Packager: Thomas Ries <[email protected]>
%description
Siproxd is a proxy/masquerading daemon for SIP (Session Initiation
Protocol), which is used in IP telephony.
It handles registrations of SIP clients on a private IP network
and performs rewriting of the SIP message bodies to make SIP
connections work via a masquerading firewall (NAT).
It allows SIP software clients (like kphone, linphone) or SIP
hardware clients (Voice over IP phones which are SIP-compatible,
such as those from Cisco, Grandstream or Snom) to work behind
an IP masquerading firewall or NAT router.
%prep
%setup -q
%build
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix} \
--sysconfdir=%{sysconfdir} \
--disable-doc
make
%install
make prefix=$RPM_BUILD_ROOT%{prefix} \
sysconfdir=$RPM_BUILD_ROOT%{sysconfdir} \
install
mv %{buildroot}%{sysconfdir}/siproxd.conf.example \
%{buildroot}%{sysconfdir}/siproxd.conf
# edit siproxd.conf and put correct username
sed -i "s/user\ =\ nobody/user\ =\ %{siproxduser}/" \
%{buildroot}%{sysconfdir}/siproxd.conf
# will be added separately below
rm -r %{buildroot}%{_defaultdocdir}/%{name}
install -d %{buildroot}%{_initrddir}/
install contrib/siproxd.init %{buildroot}%{_initrddir}/siproxd
install -d %{buildroot}%{piddir}
install -d %{buildroot}%{regdir}
%clean
rm -rf %{buildroot}
%files
%defattr(-, root, root)
%doc COPYING README AUTHORS INSTALL NEWS ChangeLog
%doc doc/FAQ doc/FLI4L_HOWTO.txt doc/sample_*.txt
%attr(0755,root,root) %{_sbindir}/siproxd
%config %{sysconfdir}/siproxd.conf
%config %{sysconfdir}/siproxd_passwd.cfg
%attr(0755,root,root) %{_initrddir}/siproxd
%attr(0755,root,root) %{_libdir}/%{name}/
%attr(0700,%{siproxduser},root) %{piddir}
%attr(0700,%{siproxduser},root) %{regdir}
%pre
getent group %{siproxduser} &>/dev/null || groupadd -r %{siproxduser}
getent passwd %{siproxduser} &>/dev/null || \
/usr/sbin/useradd -r -g %{siproxduser} -s /sbin/nologin -c %{siproxduser} \
-d %{regdir} %{siproxduser}
%post
echo "Edit the config file %{sysconfigdir}/siproxd.conf!"
/sbin/chkconfig --add %{name}
%preun
if [ $1 = 0 ]; then
/sbin/service %{name} stop
/sbin/chkconfig --del %{name}
fi
%changelog
* Fri Oct 09 2004 Thomas Ries <[email protected]>
- startup script in /etc/rc.d/init.d/siproxd
- create directories for PID and registration files
* Fri Oct 31 2003 Thomas Ries <[email protected]>
- siproxd is now installed to sbin directory
* Fri Oct 24 2003 Thomas Ries <[email protected]>
- added config files and some more doc files
- rename sample config file and remind user to edit it.
- minor cleanup
* Sat Aug 30 2003 Thomas Ries <[email protected]>
- always use /etc as sysconfdir
* Sat Sep 21 2002 Thomas Ries <[email protected]>
- first RPM support