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