summaryrefslogtreecommitdiff
path: root/packaging/capi-media-controller.spec
blob: e50ab2dbfa5071d92f62360e6b56a0554107a279 (plain)
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
Name:       capi-media-controller
Summary:    Multimedia Controller for player application
Version:    0.0.18
Release:    1
Group:      System/Libraries
License:    Apache-2.0
Source0:    %{name}-%{version}.tar.gz
Source1:    mediacontroller.service
Source2:    mediacontroller.socket
BuildRequires:  cmake
BuildRequires:  sqlite
BuildRequires:  pkgconfig(capi-base-common)
BuildRequires:  pkgconfig(dlog)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(db-util)
BuildRequires:  pkgconfig(aul)
BuildRequires:  pkgconfig(bundle)
BuildRequires:  pkgconfig(security-server)
BuildRequires:  pkgconfig(libsystemd-daemon)

%description
A media controller library in SLP C API

%package -n mediacontroller
Summary:    media Controller service server

%description -n mediacontroller
A media controller library in SLP C API

%package devel
Summary:    Multimedia Controller for player Library (DEV)
Group:      Development/Libraries
Requires:   %{name} = %{version}-%{release}

%description devel
A media controller library in SLP C API

%prep
%setup -q

%build
export CFLAGS+=" -Wextra -Wno-array-bounds"
export CFLAGS+=" -Wno-ignored-qualifiers -Wno-unused-parameter -Wshadow"
export CFLAGS+=" -Wwrite-strings -Wswitch-default"
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
export CFLAGS+=" -DGST_EXT_TIME_ANALYSIS -include stdint.h"

%if 0%{?sec_build_binary_debug_enable}
export CFLAGS+=" -DTIZEN_DEBUG_ENABLE"
export CXXFLAGS+=" -DDTIZEN_DEBUG_ENABLE"
export FFLAGS+=" -DTIZEN_DEBUG_ENABLE"
%endif

cmake . -DCMAKE_INSTALL_PREFIX=/usr -DFULLVER=%{version} -DMAJORVER=${MAJORVER}

make %{?jobs:-j%jobs}

%install
rm -rf %{buildroot}
%make_install

# Daemon & socket activation
mkdir -p %{buildroot}%{_libdir}/systemd/system
mkdir -p %{buildroot}%{_libdir}/systemd/system/sockets.target.wants
install -m 644 %{SOURCE1} %{buildroot}/usr/lib/systemd/system/mediacontroller.service
install -m 644 %{SOURCE2} %{buildroot}%{_libdir}/systemd/system/mediacontroller.socket
ln -s ../mediacontroller.socket %{buildroot}%{_libdir}/systemd/system/sockets.target.wants/mediacontroller.socket

#Create DB
mkdir -p %{buildroot}/opt/usr/dbspace
sqlite3 %{buildroot}/opt/usr/dbspace/.media_controller.db 'PRAGMA journal_mode = PERSIST; PRAGMA user_version=1;'

mkdir -p %{buildroot}/usr/share/license
cp LICENSE.APLv2.0 %{buildroot}/usr/share/license/%{name}

%post
# DB permission & SMACK
chmod 644 /opt/usr/dbspace/.media_controller.db
chmod 644 /opt/usr/dbspace/.media_controller.db-journal

chown 200:5000 /opt/usr/dbspace/.media_controller.db*

if [ -f /opt/usr/dbspace/.media_controller.db ]
then
	chsmack -a 'mediacontroller::db' /opt/usr/dbspace/.media_controller.db*
fi

%files
%defattr(-,root,root,-)
%{_libdir}/*.so.*
#%{_bindir}/*			//disable tests
%manifest capi-media-controller.manifest
%attr(660,system,app) /opt/usr/dbspace/.media_controller.db
%attr(660,system,app) /opt/usr/dbspace/.media_controller.db-journal
%config(noreplace) /opt/usr/dbspace/.media_controller.db
%config(noreplace) /opt/usr/dbspace/.media_controller.db-journal
/usr/share/license/%{name}

%files -n mediacontroller
%defattr(-,system,system,-)
%{_bindir}/mediacontroller
%manifest media-controller-service.manifest
%{_libdir}/systemd/system/mediacontroller.service
%{_libdir}/systemd/system/mediacontroller.socket
%{_libdir}/systemd/system/sockets.target.wants/mediacontroller.socket
/usr/share/license/%{name}

%files devel
%defattr(-,root,root,-)
%{_libdir}/*.so
%{_includedir}/media/*.h
%{_libdir}/pkgconfig/capi-media-controller.pc