]> git.pld-linux.org Git - packages/callweaver.git/blob - callweaver.spec
- add logrotate and few missing dirs
[packages/callweaver.git] / callweaver.spec
1 # TODO:
2 # - user/group
3 # - fix init scripts
4 %bcond_with     misdn
5 %bcond_with     javascript
6 #
7 %define snap    20070426
8 Summary:        PBX in software
9 Summary(pl.UTF-8):      Programowy PBX
10 Name:           callweaver
11 Version:        1.1.99
12 Release:        0.%{snap}.1
13 License:        GPL
14 Group:          Applications
15 Source0:        http://devs.callweaver.org/trunk_snapshots/%{name}-%{version}.%{snap}.tar.gz
16 # Source0-md5:  d27ff0129fb8b6058aa310e70dfd0410
17 Source1:        %{name}.init
18 Source2:        %{name}.sysconfig
19 Source3:        %{name}.logrotate
20 URL:            http://www.callweaver.org/
21 BuildRequires:  bluez-libs-devel
22 BuildRequires:  curl-devel
23 BuildRequires:  libogg-devel
24 BuildRequires:  libtiff-devel
25 BuildRequires:  libvorbis-devel
26 BuildRequires:  loudmouth-devel
27 %{?with_misdn:BuildRequires:    mISDN-devel}
28 BuildRequires:  mysql-devel
29 BuildRequires:  ncurses-devel
30 BuildRequires:  opendbx-devel
31 BuildRequires:  popt-devel
32 BuildRequires:  postgresql-devel
33 BuildRequires:  readline-devel
34 BuildRequires:  rpmbuild(macros) >= 1.268
35 BuildRequires:  spandsp-devel >= 1:0.0.4
36 BuildRequires:  speex-devel
37 BuildRequires:  sqlite3-devel
38 BuildRequires:  unixODBC-devel
39 BuildRequires:  zaptel-devel
40 BuildRequires:  zlib-devel
41 Requires(post,preun):   /sbin/chkconfig
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %description
45 Open Source PBX and telephony toolkit. It is, in a sense, middleware
46 between Internet and telephony channels on the bottom, and Internet
47 and telephony applications at the top.
48
49 %description -l pl.UTF-8
50 PBX i zestaw narzędziowy do telefonii o otwartych źródłach. Jest to
51 middleware między kanałami internetowymy i telefonicznymi z dołu a
52 aplikacjami internetowymi i telefonicznymi z góry.
53
54 %package devel
55 Summary:        Header files for callweaver
56 Summary(pl.UTF-8):      Pliki nagłówkowe callweavera
57 Group:          Development/Libraries
58 Requires:       %{name} = %{version}-%{release}
59
60 %description devel
61 Header files for callweaver.
62
63 %description devel -l pl.UTF-8
64 Pliki nagłówkowe callweavera.
65
66 %prep
67 %setup -q -n %{name}-%{version}.%{snap}
68
69 # temporary fix
70 sed -i -e 's#^>EOF#EOF#' configure*
71
72 %build
73 %configure \
74         %{?with_misdn:--with-chan_misdn} \
75         --with-chan_fax \
76         --with-chan_bluetooth \
77         --enable-odbc \
78         --with-cdr_odbc \
79         --with-res_config_odbc \
80         --with-res_odbc \
81         --enable-mysql \
82         --with-cdr_mysql \
83         --with-res_config_mysql \
84         --enable-postgresql \
85         --with-cdr_pgsql \
86         --with-res_config_pgsql \
87         --with-res_config_curl \
88         --enable-jabber \
89         --with-res_jabber \
90 %if %{with javascript}
91         --enable-javascript \
92         --with-res_js \
93 %endif
94         --with-res_sqlite \
95         --with-directory-layout=lsb
96
97 %{__make} -j1
98
99 %install
100 rm -rf $RPM_BUILD_ROOT
101 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d}
102
103 %{__make} -j1 install \
104         DESTDIR=$RPM_BUILD_ROOT
105
106 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
107 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
108 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
109
110 %clean
111 rm -rf $RPM_BUILD_ROOT
112
113 %pre
114 %groupadd -g 192 %{name}
115 %useradd -u 192 -d /var/lib/callweaver -s /bin/false -c "callweaver" -g %{name} %{name}
116
117 %post
118 /sbin/chkconfig --add %{name}
119 %service %{name} restart
120
121
122 %preun
123 if [ "$1" = "0" ]; then
124         %service -q %{name} stop
125         /sbin/chkconfig --del %{name}
126 fi
127
128 %postun
129 if [ "$1" = "0" ]; then
130         %userremove callweaver
131         %groupremove %{name}
132 fi
133
134 %files
135 %defattr(644,root,root,755)
136 %doc AUTHORS BUGS CREDITS ChangeLog HARDWARE InstallGuide.txt README SECURITY sounds.txt
137 %doc doc
138 %dir %{_sysconfdir}/%{name}
139 %attr(640,root,callweaver) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.*
140 %attr(755,root,root) %{_bindir}/*
141 %attr(755,root,root) %{_sbindir}/*
142 %dir %{_libdir}/%{name}
143 %attr(755,root,root) %{_libdir}/%{name}/*.so.*
144 %{_libdir}/%{name}/*.la
145 %dir %{_libdir}/%{name}/modules
146 %attr(755,root,root) %{_libdir}/%{name}/modules/*.so
147 %{_libdir}/%{name}/modules/*.la
148 %{_datadir}/%{name}
149
150 %attr(750,root,callweaver) %dir %{_var}/lib/callweaver
151 %attr(750,callweaver,root) %dir %{_var}/log/callweaver
152 %attr(750,callweaver,root) %dir %{_var}/log/callweaver/*
153 %attr(750,callweaver,root) %dir %{_var}/run/callweaver
154 %attr(750,callweaver,root) %dir %{_var}/spool/callweaver
155
156 %attr(754,root,root) /etc/rc.d/init.d/%{name}
157 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
158 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
159
160 %files devel
161 %defattr(644,root,root,755)
162 %{_includedir}/%{name}
This page took 0.09575 seconds and 3 git commands to generate.