Fix the build error for 64bit
[platform/core/connectivity/bluetooth-share.git] / packaging / bluetooth-share.spec
1 %define TZ_SYS_SHARE /opt
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(pmapi)
34 BuildRequires:  pkgconfig(sysman)
35 BuildRequires:  pkgconfig(notification)
36 BuildRequires:  pkgconfig(appsvc)
37 BuildRequires:  pkgconfig(db-util)
38 BuildRequires:  pkgconfig(capi-content-media-content)
39 BuildRequires:  pkgconfig(storage)
40 BuildRequires:  pkgconfig(libtzplatform-config)
41 BuildRequires:  pkgconfig(cynara-client)
42 BuildRequires:  pkgconfig(cynara-session)
43 BuildRequires:  pkgconfig(cynara-creds-dbus)
44 BuildRequires:  pkgconfig(eventsystem)
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 mkdir -p  %{buildroot}%{TZ_SYS_SHARE}/bt-ftp
85 install -D -m 0755 %{SOURCE1004} %{buildroot}%{TZ_SYS_SHARE}/%{name}/ressources/init_db.sh
86
87 %post -n libbluetooth-share-devel -p /sbin/ldconfig
88
89 %post -n libbluetooth-share -p /sbin/ldconfig
90
91 %postun -n libbluetooth-share-devel -p /sbin/ldconfig
92
93 %postun -n libbluetooth-share -p /sbin/ldconfig
94
95 %files
96 %manifest %{name}.manifest
97 %defattr(-,root,root,-)
98 %{_bindir}/bluetooth-share
99 %{_datadir}/dbus-1/system-services/org.bluetooth.share.service
100 %{TZ_SYS_SHARE}/bt-ftp
101 %{TZ_SYS_SHARE}/%{name}
102
103 %files -n libbluetooth-share
104 %manifest libbluetooth-share.manifest
105 %defattr(-, root, root)
106 %ifarch aarch64
107 /usr/lib/libbluetooth-share-api.so.0.*
108 %else
109 %{_libdir}/libbluetooth-share-api.so.0.*
110 %endif
111
112 %files -n libbluetooth-share-devel
113 %manifest libbluetooth-share-devel.manifest
114 %defattr(-, root, root)
115 %{_includedir}/bluetooth-share-api/bluetooth-share-api.h
116 %ifarch aarch64
117 /usr/lib/libbluetooth-share-api.so
118 /usr/lib/pkgconfig/bluetooth-share-api.pc
119 %else
120 %{_libdir}/libbluetooth-share-api.so
121 %{_libdir}/pkgconfig/bluetooth-share-api.pc
122 %endif