packaging: added devel, and test subpackages, bumped version.
[profile/ivi/speech-recognition.git] / packaging / speech-recognition.spec
1 %{!?_with_debug:%{!?_without_debug:%define _with_debug 1}}
2 %{!?_with_sphinx:%{!?_without_sphinx:%define _with_sphinx 1}}
3 %{!?_with_festival:%{!?_without_festival:%define _with_festival 1}}
4 %{!?_with_wrt:%{!?_without_wrt:%define _with_wrt 1}}
5 %{!?_with_dbus:%{!?_without_dbus:%define _without_dbus 1}}
6
7 Summary: Speech recognition service for Tizen
8 Name: speech-recognition
9 Version: 0.0.4
10 Release: 0
11 License: BSD-3-Clause
12 Group: Base/Utilities
13 URL: https://github.com/otcshare/speech-recognition
14 Source0: %{name}-%{version}.tar.gz
15
16 BuildRequires: pkgconfig(libpulse)
17 BuildRequires: pkgconfig(murphy-common)
18 BuildRequires: pkgconfig(murphy-pulse)
19 BuildRequires: pkgconfig(murphy-glib)
20 BuildRequires: pkgconfig(libudev)
21 BuildRequires: pkgconfig(json)
22 %if %{?_with_sphinx:1}%{!?_with_sphinx:0}
23 BuildRequires: pkgconfig(pocketsphinx)
24 BuildRequires: pkgconfig(sphinxbase)
25 %endif
26 %if %{?_with_festival:1}%{!?_with_festival:0}
27 BuildRequires: festival-devel
28 %endif
29 %if %{?_with_dbus:1}%{!?_with_dbus:0}
30 BuildRequires: pkgconfig(dbus-1)
31 %endif
32
33 Requires: pulseaudio
34 %if %{?_with_sphinx:1}%{!?_with_sphinx:0}
35 Requires: sphinxbase
36 Requires: pocketsphinx
37 %endif
38 %if %{?_with_festival:1}%{!?_with_festival:0}
39 BuildRequires: festival-devel
40 Requires: festival
41 %endif
42
43
44 %description
45 SRS/Winthorpe speech recognition system service.
46
47 %package devel
48 Summary: The header files and libraries needed for SRS/Winthorpe clients
49 Group: Development/Libraries
50 Requires: %{name} = %{version}
51
52 %description devel
53 This package contains header files and libraries necessary for development.
54
55 %package tests
56 Summary: Various test binaries for SRS/Winthorpe
57 Group: Development/Debug
58 Requires: %{name} = %{version}
59
60 %description tests
61 This package contains various test binaries for SRS/Winthorpe.
62
63 %prep
64 %setup -q -n %{name}-%{version}
65
66 %build
67 %if %{?_with_debug:1}%{!?_with_debug:0}
68 export CFLAGS="-O0 -g3"
69 export CXXFLAGS="-O0 -g3"
70 V="V=1"
71 %endif
72
73 CONFIG_OPTIONS=""
74
75 %if %{?_with_sphinx:1}%{!?_with_sphinx:0}
76 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-sphinx"
77 %else
78 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-sphinx"
79 %endif
80
81 %if %{?_with_festival:1}%{!?_with_festival:0}
82 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-festival"
83 %else
84 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-festival"
85 %endif
86
87 %if %{?_with_wrt:1}%{!?_with_wrt:0}
88 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-wrt-client"
89 %else
90 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-wrt-client"
91 %endif
92
93 %if %{?_with_dbus:1}%{!?_with_dbus:0}
94 CONFIG_OPTIONS="$CONFIG_OPTIONS --enable-gpl --enable-dbus"
95 %else
96 CONFIG_OPTIONS="$CONFIG_OPTIONS --disable-dbus"
97 %endif
98
99
100 ./bootstrap && \
101     %configure $CONFIG_OPTIONS && \
102     make
103
104 %install
105 rm -fr $RPM_BUILD_ROOT
106
107 %make_install
108
109 # Install dictionaries, configuration and service files.
110 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig \
111     $RPM_BUILD_ROOT/lib/systemd/user \
112     $RPM_BUILD_ROOT%{_sysconfdir}/speech-recognition \
113     $RPM_BUILD_ROOT%{_datadir}/speech-recognition/dictionaries/demo \
114     $RPM_BUILD_ROOT%{_libdir}/srs/scripts \
115     $RPM_BUILD_ROOT%{_datadir}/dbus-1/services
116
117 /usr/bin/install -m 644 packaging/speech-recognition.conf \
118     $RPM_BUILD_ROOT%{_sysconfdir}/speech-recognition
119 /usr/bin/install -m 644 packaging/speech-recognition.env \
120     $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/speech-recognition
121 /usr/bin/install -m 644 packaging/speech-recognition.service \
122     $RPM_BUILD_ROOT/lib/systemd/user
123 /usr/bin/install -m 644 \
124     -t $RPM_BUILD_ROOT%{_datadir}/speech-recognition/dictionaries/demo \
125     dictionaries/demo/demo.*
126 /usr/bin/install -m 755 packaging/start-speech-service.sh \
127      $RPM_BUILD_ROOT%{_libdir}/srs/scripts
128 /usr/bin/install -m 755 packaging/org.tizen.srs.service \
129      $RPM_BUILD_ROOT%{_datadir}/dbus-1/services
130
131 %clean
132 rm -rf $RPM_BUILD_ROOT
133
134 %post
135 ldconfig
136
137 %postun
138 ldconfig
139
140 %files
141 %defattr(-,root,root,-)
142 %{_sbindir}/srs-daemon
143 %if %{?_with_dbus:1}%{!?_with_dbus:0}
144 %{_bindir}/srs-client
145 %endif
146 %{_libdir}/srs
147 %{_libdir}/libsrs*.so.*
148 %{_sysconfdir}/speech-recognition/speech-recognition.conf
149 %{_sysconfdir}/sysconfig/speech-recognition
150 %{_datadir}/speech-recognition/dictionaries
151 /lib/systemd/user/speech-recognition.service
152 %{_datadir}/dbus-1/services/org.tizen.srs.service
153
154 %files devel
155 %defattr(-,root,root,-)
156 %{_includedir}/srs
157 %{_libdir}/libsrs*.so
158 %{_libdir}/pkgconfig/srs*.pc
159
160 %files tests
161 %defattr(-,root,root,-)
162 %{_bindir}/srs-native-client