Add the default path in the script file
[platform/core/connectivity/bluetooth-share.git] / packaging / bluetooth-share.spec
1 %define TZ_SYS_DATA /opt/data/
2
3 Name:       bluetooth-share
4 Summary:    Bluetooth file share Agent
5 Version:    0.0.47
6 Release:    0
7 Group:      Network & Connectivity/Bluetooth
8 License:    Apache-2.0
9 Source0:    %{name}-%{version}.tar.gz
10 Source1001: %{name}.manifest
11 Source1002: libbluetooth-share.manifest
12 Source1003: libbluetooth-share-devel.manifest
13 Source1004: init_db.sh
14 Requires(post): coreutils
15 Requires(post): smack
16 BuildRequires:  cmake
17 BuildRequires:  gettext-tools
18 BuildRequires:  pkgconfig(appcore-efl)
19 BuildRequires:  pkgconfig(bluetooth-api)
20 BuildRequires:  pkgconfig(glib-2.0)
21 BuildRequires:  pkgconfig(aul)
22 BuildRequires:  pkgconfig(dlog)
23 BuildRequires:  pkgconfig(sqlite3)
24 BuildRequires:  pkgconfig(ecore)
25 # Same check as in tizen-extensions-crosswalk. A per-package or global
26 # bcond would be better, but for now let's follow Crosswalk's approach.
27 #%if "%{profile}" == "mobile"
28 #BuildRequires:  pkgconfig(calendar-service2)
29 #BuildRequires:  pkgconfig(contacts-service2)
30 #%endif
31 BuildRequires:  pkgconfig(vconf)
32 BuildRequires:  pkgconfig(syspopup-caller)
33 BuildRequires:  pkgconfig(deviced)
34 BuildRequires:  pkgconfig(notification)
35 BuildRequires:  pkgconfig(appsvc)
36 BuildRequires:  pkgconfig(db-util)
37 BuildRequires:  pkgconfig(capi-content-media-content)
38 BuildRequires:  pkgconfig(storage)
39 BuildRequires:  pkgconfig(libtzplatform-config)
40 BuildRequires:  pkgconfig(cynara-client)
41 BuildRequires:  pkgconfig(cynara-session)
42 BuildRequires:  pkgconfig(cynara-creds-dbus)
43 BuildRequires:  pkgconfig(eventsystem)
44 BuildRequires:  pkgconfig(storage)
45
46 %description
47 Bluetooth File Share Agent
48
49 %package -n libbluetooth-share
50 Summary:    Bluetooth share library
51 Group:      Development/Libraries
52 Requires:   %{name} = %{version}-%{release}
53
54 %description -n libbluetooth-share
55 Bluetooth share library
56
57 %package -n libbluetooth-share-devel
58 Summary:    Development package for libbluetooth-share
59 Group:      Development/Libraries
60 Requires:   %{name} = %{version}-%{release}
61
62 %description -n libbluetooth-share-devel
63 Development package for libbluetooth-share
64
65 %prep
66 %setup -q
67 cp %{SOURCE1001} %{SOURCE1002} %{SOURCE1003} .
68
69 %build
70 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
71 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
72 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
73
74 export CFLAGS+=" -fpie -fvisibility=hidden"
75 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
76
77 %cmake . \
78         -DCMAKE_INSTALL_PREFIX=%{_prefix}
79 make
80
81 %install
82 %make_install
83
84 install -D -m 0755 %{SOURCE1004} %{buildroot}%{TZ_SYS_DATA}/%{name}/init_db.sh
85 install -D -m 0644 packaging/bluetooth-share.service %{buildroot}%{_libdir}/systemd/system/bluetooth-share.service
86
87 #%post
88 #/sbin/ldconfig
89 #%{TZ_SYS_DATA}/%{name}/init_db.sh
90
91 %post -n libbluetooth-share-devel -p /sbin/ldconfig
92
93 %post -n libbluetooth-share -p /sbin/ldconfig
94 ln -sf %{_libdir}/systemd/system/bluetooth-share.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
95
96 %postun -n libbluetooth-share-devel -p /sbin/ldconfig
97
98 %postun -n libbluetooth-share -p /sbin/ldconfig
99
100 %files
101 %manifest %{name}.manifest
102 %defattr(-,root,root,-)
103 %{_bindir}/bluetooth-share
104 #%{_datadir}/dbus-1/system-services/org.bluetooth.share.service
105 %{TZ_SYS_DATA}/%{name}/init_db.sh
106 %{_libdir}/systemd/system/bluetooth-share.service
107
108 %files -n libbluetooth-share
109 %manifest libbluetooth-share.manifest
110 %defattr(-, root, root)
111 %{_libdir}/libbluetooth-share-api.so.0.*
112
113 %files -n libbluetooth-share-devel
114 %manifest libbluetooth-share-devel.manifest
115 %defattr(-, root, root)
116 %{_includedir}/bluetooth-share-api/bluetooth-share-api.h
117 %{_libdir}/libbluetooth-share-api.so
118 %{_libdir}/pkgconfig/bluetooth-share-api.pc