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