[Engine] patch for normal support of pkgmgr signal and thread problem
[framework/web/wrt-commons.git] / packaging / wrt-commons.spec
1 #sbs-git:public/pkgs/w/wrt-commons wrt-commons 0.2.25
2 Name:       wrt-commons
3 Summary:    Wrt common library
4 Version:    0.2.25
5 Release:    1
6 Group:      Development/Libraries
7 License:    Apache License, Version 2.0
8 URL:        N/A
9 Source0:    %{name}-%{version}.tar.gz
10 Source1001: packaging/wrt-commons.manifest 
11 BuildRequires:  cmake
12 BuildRequires:  pkgconfig(ecore)
13 BuildRequires:  pkgconfig(appcore-efl)
14 BuildRequires:  pkgconfig(libssl)
15 BuildRequires:  pkgconfig(sqlite3)
16 BuildRequires:  pkgconfig(dlog)
17 BuildRequires:  pkgconfig(glib-2.0)
18 BuildRequires:  pkgconfig(db-util)
19 BuildRequires:  pkgconfig(zlib)
20 BuildRequires:  pkgconfig(libpcrecpp)
21 BuildRequires:  pkgconfig(icu-i18n)
22 BuildRequires:  pkgconfig(libxml-2.0)
23 BuildRequires:  pkgconfig(openssl)
24 BuildRequires:  pkgconfig(cert-svc)
25 BuildRequires:  pkgconfig(libiri)
26 BuildRequires:  pkgconfig(libidn)
27
28 %description
29 Wrt common library
30
31 %package devel
32 Summary:    Wrt common library development headers
33 Group:      Development/Libraries
34 Requires:   %{name} = %{version}
35
36 %description devel
37 Wrt common library development headers
38
39 %prep
40 %setup -q
41
42 %build
43 cp %{SOURCE1001} .
44 export LDFLAGS+="-Wl,--rpath=%{_libdir} -Wl,--hash-style=both -Wl,--as-needed"
45 cmake . -DVERSION=%{version} \
46         -DDPL_LOG="OFF"      \
47         -DCMAKE_INSTALL_PREFIX=%{_prefix}
48 make %{?jobs:-j%jobs}
49
50 %install
51 %make_install
52
53 %clean
54 rm -rf %{buildroot}
55
56 %post
57 if [ $1 == 1 ]; then
58     echo "This is new install of wrt-commons"
59     echo "Calling /usr/bin/wrt_commons_reset_db.sh"
60     mkdir -p /opt/apps/widget/
61     /usr/bin/wrt_commons_reset_db.sh
62 else
63     # Find out old and new version of databases
64     WRT_OLD_DB_VERSION=`sqlite3 /opt/dbspace/.wrt.db ".tables" | grep "DB_VERSION_"`
65     WRT_NEW_DB_VERSION=`cat /usr/share/wrt-engine/wrt_db.sql | tr '[:blank:]' '\n' | grep DB_VERSION_`
66     echo "OLD wrt database version ${WRT_OLD_DB_VERSION}"
67     echo "NEW wrt database version ${WRT_NEW_DB_VERSION}"
68
69     if [ ${WRT_OLD_DB_VERSION} -a ${WRT_NEW_DB_VERSION} ]
70     then
71         if [ ${WRT_NEW_DB_VERSION} = ${WRT_OLD_DB_VERSION} ]
72         then
73             echo "Equal database detected so db installation ignored"
74         else
75             echo "Calling /usr/bin/wrt_commons_reset_db.sh"
76             /usr/bin/wrt_commons_reset_db.sh
77         fi
78     else
79         echo "Calling /usr/bin/wrt_commons_reset_db.sh"
80         /usr/bin/wrt_commons_reset_db.sh
81     fi
82 fi
83
84 mkdir -p /usr/etc/ace
85 mkdir -p /usr/apps/org.tizen.policy
86
87 # DBUS services fix
88 # WARNING: THIS IS TEMPORARY SOLUTION, AS THIS SHOULD NOT BE OUR
89 # RESPONSIBILITY!!! WE HAVE TO CONTACT TO DBUS MAINAINERS
90
91 if [ -f /var/lib/dbus/machine-id ]; then
92     echo "machine-id exists"
93 else
94     if [ -f /usr/var/lib/dbus/machine-id ]; then
95         echo "machine-id exists"
96     else
97         echo "Creating machine-id"
98         mkdir -p /usr/var/lib/dbus/
99         dbus-uuidgen > /usr/var/lib/dbus/machine-id
100         dbus-uuidgen --ensure=/usr/var/lib/dbus/machine-id
101     fi
102     mkdir -p /var/lib/dbus/
103     cp /usr/var/lib/dbus/machine-id /var/lib/dbus/
104 fi
105
106 echo "[WRT] wrt-commons postinst done ..."
107
108 %files
109 %manifest wrt-commons.manifest
110 %{_libdir}/*.so
111 %{_libdir}/*.so.*
112 /usr/share/wrt-engine/*
113 %attr(775,root,root) %{_bindir}/wrt_commons_reset_db.sh
114 %attr(775,root,root) %{_bindir}/wrt_commons_create_clean_db.sh
115
116 %files devel
117 %manifest wrt-commons.manifest
118 %{_includedir}/dpl-efl/*
119 %{_libdir}/pkgconfig/*.pc