[Title] Initial upload the browser for tizen 2.0
[profile/ivi/org.tizen.browser.git] / packaging / org.tizen.browser.spec
1 %define appdir /opt/apps/org.tizen.browser
2
3 Name:       org.tizen.browser
4 Summary:    webkit browser with EFL
5 Version: 0.0.1
6 Release:    1
7 Group:      misc
8 License:    TO_BE_FILLED
9 Source0:    %{name}-%{version}.tar.gz
10 Requires(post): /usr/bin/sqlite3
11
12 BuildRequires:  pkgconfig(eina)
13 BuildRequires:  pkgconfig(ecore)
14 BuildRequires:  pkgconfig(evas)
15 BuildRequires:  pkgconfig(ecore-evas)
16 BuildRequires:  pkgconfig(edbus)
17 BuildRequires:  pkgconfig(elementary)
18 BuildRequires:  pkgconfig(dlog)
19 BuildRequires:  pkgconfig(db-util)
20 BuildRequires:  pkgconfig(utilX)
21 BuildRequires:  pkgconfig(ui-gadget-1)
22 BuildRequires:  pkgconfig(tapi)
23 BuildRequires:  pkgconfig(secure-storage)
24 BuildRequires:  pkgconfig(libsoup-2.4)
25 BuildRequires:  pkgconfig(libxml-2.0)
26 BuildRequires:  pkgconfig(libssl)
27 BuildRequires:  pkgconfig(capi-location-manager)
28 BuildRequires:  pkgconfig(accounts-svc)
29 BuildRequires:  pkgconfig(ecore-input)
30 BuildRequires:  pkgconfig(ecore-imf)
31 BuildRequires:  pkgconfig(edje)
32 BuildRequires:  pkgconfig(cairo)
33 BuildRequires:  pkgconfig(ecore-x)
34 BuildRequires:  pkgconfig(ewebkit2)
35 BuildRequires:  pkgconfig(appsvc)
36 BuildRequires:  pkgconfig(devman)
37 BuildRequires:  pkgconfig(capi-appfw-application)
38 BuildRequires:  pkgconfig(capi-appfw-app-manager)
39 BuildRequires:  pkgconfig(capi-web-url-download)
40 BuildRequires:  pkgconfig(capi-network-connection)
41 BuildRequires:  pkgconfig(capi-system-haptic)
42 BuildRequires:  pkgconfig(shortcut)
43
44 BuildRequires:  pkgconfig(appcore-common)
45 BuildRequires:  pkgconfig(vconf)
46 BuildRequires:  pkgconfig(aul)
47 BuildRequires:  pkgconfig(bundle)
48 BuildRequires:  pkgconfig(gnutls)
49 BuildRequires:  pkgconfig(embryo)
50 BuildRequires:  pkgconfig(pkgmgr)
51 BuildRequires:  pkgconfig(notification)
52 BuildRequires:  pkgconfig(capi-base-common)
53 BuildRequires:  pkgconfig(syspopup-caller)
54 BuildRequires:  pkgconfig(pkgmgr)
55 BuildRequires:  pkgconfig(vconf-internal-keys)
56 BuildRequires:  pkgconfig(capi-system-device)
57 BuildRequires:  pkgconfig(capi-system-sensor)
58
59
60 BuildRequires:  cmake
61 BuildRequires:  gettext
62 BuildRequires:  edje-tools
63
64 %description
65 webkit browser with EFL.
66
67 %prep
68 %setup -q
69
70 %build
71 CFLAGS+=" -fPIC";export CFLAGS
72 CXXFLAGS+=" -fPIC";export CXXFLAGS
73 export LDFLAGS+="-Wl,--rpath=%{appdir}/lib -Wl,--hash-style=both -Wl,--as-needed"
74 LDFLAGS="$LDFLAGS"
75 cmake . -DCMAKE_INSTALL_PREFIX=%{appdir}
76
77 make %{?jobs:-j%jobs}
78
79 %install
80 %make_install
81
82 %post
83 mkdir -p /opt/dbspace/
84 ##### History ######
85 if [ ! -f /opt/dbspace/.browser-history.db ];
86 then
87         sqlite3 /opt/dbspace/.browser-history.db 'PRAGMA journal_mode=PERSIST;
88         CREATE TABLE history(id INTEGER PRIMARY KEY AUTOINCREMENT, address, title, counter INTEGER, visitdate DATETIME, favicon BLOB, favicon_length INTEGER, favicon_w INTEGER, favicon_h INTEGER);'
89 fi
90
91 ### Bookmark ###
92 if [ ! -f /opt/dbspace/.internet_bookmark.db ];
93 then
94         sqlite3 /opt/dbspace/.internet_bookmark.db 'PRAGMA journal_mode=PERSIST;
95         CREATE TABLE bookmarks(id INTEGER PRIMARY KEY AUTOINCREMENT, type INTEGER, parent INTEGER, address, title, creationdate, sequence INTEGER, updatedate, visitdate, editable INTEGER, accesscount INTEGER, favicon BLOB, favicon_length INTEGER, favicon_w INTEGER, favicon_h INTEGER);
96         create index idx_bookmarks_on_parent_type on bookmarks(parent, type);
97
98         insert into bookmarks (type, parent, title, creationdate, editable, sequence, accesscount) values(1, 0, "Bookmarks", DATETIME("now"),  0, 1, 0);'
99 fi
100
101 mkdir -p /opt/apps/org.tizen.browser/data/db/
102
103 ##### Geolocation ######
104 if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-geolocation.db ];
105 then
106         sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-geolocation.db 'PRAGMA journal_mode=PERSIST;
107         create table geolocation(id integer primary key autoincrement, address, accept INTEGER,updatedate DATETIME);'
108 fi
109
110 ##### Password ######
111 if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-credential.db ];
112 then
113         sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-credential.db 'PRAGMA journal_mode=PERSIST;
114         create table passwords(id integer primary key autoincrement, address, login, password)'
115 fi
116
117 ##### Most visited ######
118 if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-mostvisited.db ];
119 then
120         sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-mostvisited.db 'PRAGMA journal_mode=PERSIST;
121         create table mostvisited(id integer primary key, address, title, image)'
122
123         #default Sites
124         sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-mostvisited.db 'PRAGMA journal_mode=PERSIST;
125         insert into mostvisited values(0, "http://mobile.twitter.com/", "Twitter", "default_0");
126         insert into mostvisited values(1, "http://m.facebook.com/", "Facebook", "default_1");
127         insert into mostvisited values(2, "http://m.naver.com/", "Naver", "default_2");
128         insert into mostvisited values(3, "http://m.nate.com/", "Nate", "default_3")'
129 fi
130
131 #### USER AGENTS #####
132 if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser.db ];
133 then
134         sqlite3 /opt/apps/org.tizen.browser/data/db/.browser.db 'PRAGMA journal_mode=PERSIST;
135         create table user_agents(name primary key, value)'
136         # mobile
137         sqlite3 /opt/apps/org.tizen.browser/data/db/.browser.db 'PRAGMA journal_mode=PERSIST;
138         insert into user_agents values("Galaxy S", "Mozilla/5.0 (Linux; U; Android 2.3.7; en-gb; GT-I9000 Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
139         insert into user_agents values("Galaxy S II", "Mozilla/5.0 (Linux; U; Android 2.3.5; en-gb; GT-I9100 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
140         insert into user_agents values("Galaxy S III", "Mozilla/5.0 (Linux; U; Android 4.0.3; en-gb; GT-I9300 Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30");
141         insert into user_agents values("SLP Galaxy", "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; GT-I9500 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
142         insert into user_agents values("Tizen", "Mozilla/5.0 (Linux; U; Tizen 1.0; en-us) AppleWebKit/534.46 (KHTML, like Gecko) Mobile Tizen Browser/1.0");
143         insert into user_agents values("Galaxy Nexus", "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; Galaxy Nexus Build/IML74K) AppleWebKit/535.7 (KHTML, like Gecko) Mobile Safari/535.7");
144         insert into user_agents values("Samsung", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-I9200/1.0; U; Linux/SLP/2.0; ko-kr) AppleWebKit/534.4 (KHTML, like Gecko) Dolfin/2.0 Mobile");
145         insert into user_agents values("Samsung Dolfin", "SAMSUNG-GT-S8500/S8500XXJD2 SHP/VPP/R5 Dolfin/2.0 Nextreaming SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1");
146         insert into user_agents values("Apple iPhone 3", "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16");
147         insert into user_agents values("Apple iPhone 4", "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5");
148         insert into user_agents values("Apple iOS 5", "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3");
149         insert into user_agents values("Android 2.3 (Nexus One)", "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Nexus One Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
150         insert into user_agents values("Opera Mobi", "Opera/9.80 (Windows NT 6.1; U; Edition IBIS; en) Presto/2.6.30 Version/10.63");
151         insert into user_agents values("Samsung Bada", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8500/1.0; U; Bada/1.0; en-us) AppleWebKit/533.1 (KHTML, like Gecko) Dolfin/2.0 Mobile WVGA SMM-MMS/1.2.0 OPN-B");
152         insert into user_agents values("Orange TV", "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3 OrangeAppliTV/2.3.9");
153         insert into user_agents values("Chrome Browser for android", "Mozilla/5.0 (Linux; U; Android 4.0.1; ko-kr; Galaxy Nexus Build/ITL41F) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7");
154         insert into user_agents values("MANGO(Nokia 800C)", "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; Nokia; 800C)");
155         insert into user_agents values("System user agent", "");
156         insert into user_agents values("Samsung Bada 2.0", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8500/1.0; U; Bada/2.0; en-us) AppleWebKit/534.20 (KHTML, like Gecko) Mobile WVGA SMM-MMS/1.2.0 OPN-B Dolfin/3.0")'
157
158         # desktop
159         sqlite3 /opt/apps/org.tizen.browser/data/db/.browser.db 'PRAGMA journal_mode=PERSIST;
160         insert into user_agents values("Samsung Desktop", "Mozilla/5.0 (U; Linux/SLP/2.0; ko-kr) AppleWebKit/533.1 (KHTML, like Gecko)");
161         insert into user_agents values("Firefox 5", "Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1");
162         insert into user_agents values("Firefox 5 Fennec(Mobile)", "Mozilla/5.0 (Android; Linux armv7l; rv:5.0) Gecko/20110615 Firefox/5.0 Fennec/5.0");
163         insert into user_agents values("Safari 5.0", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7");
164         insert into user_agents values("Google Chrome 18.0", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.16 (KHTML, like Gecko) Chrome/18.0.1003.1 Safari/535.16");
165         insert into user_agents values("Internet Explorer 9", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)");
166         insert into user_agents values("Galaxy Tab 10.1", "Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; GT-P7100 Build/HRI83) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13");
167         insert into user_agents values("iPad 2", "Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5")'
168 fi
169
170
171 # create cookies db
172 if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-cookies.db ];
173 then
174         sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db 'CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER);'
175         #test cookie
176         #sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db 'INSERT INTO moz_cookies values(NULL, "cookies_name_test", "cookies_value_test", "www.cookies_test.com", "cookies_path_test", 2011, NULL, 1, 0);'
177 fi
178
179 # Change db file owner & permission
180 #chown :5000 /opt/apps/org.tizen.browser/data/db/.browser.db
181 #chown :5000 /opt/apps/org.tizen.browser/data/db/.browser.db-journal
182 #chown :5000 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db
183 #chown :5000 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db-journal
184 chown :5000 /opt/dbspace/.browser-history.db
185 chown :5000 /opt/dbspace/.browser-history.db-journal
186 chown :5000 /opt/dbspace/.internet_bookmark.db
187 chown :5000 /opt/dbspace/.internet_bookmark.db-journal
188 #chown :5000 /opt/apps/org.tizen.browser/data/db/.browser-credential.db
189 #chown :5000 /opt/apps/org.tizen.browser/data/db/.browser-credential.db-journal
190 #chown :5000 /opt/apps/org.tizen.browser/data/db/.browser-mostvisited.db
191 #chown :5000 /opt/apps/org.tizen.browser/data/db/.browser-mostvisited.db-journal
192 #chown :5000 /opt/apps/org.tizen.browser/data/db/.browser-geolocation.db
193 #chown :5000 /opt/apps/org.tizen.browser/data/db/.browser-geolocation.db-journal
194 chmod 660 /opt/apps/org.tizen.browser/data/db/.browser.db
195 chmod 660 /opt/apps/org.tizen.browser/data/db/.browser.db-journal
196 chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db
197 chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db-journal
198 chmod 666 /opt/dbspace/.browser-history.db
199 chmod 666 /opt/dbspace/.browser-history.db-journal
200 chmod 666 /opt/dbspace/.internet_bookmark.db
201 chmod 666 /opt/dbspace/.internet_bookmark.db-journal
202 chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-credential.db
203 chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-credential.db-journal
204 chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-mostvisited.db
205 chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-mostvisited.db-journal
206 chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-geolocation.db
207 chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-geolocation.db-journal
208
209 ##################################################
210 # set default vconf values
211 ##################################################
212 vconftool set -t string db/browser/browser_user_agent "System user agent" -g 5000 -f
213 vconftool set -t string db/browser/custom_user_agent "" -g 5000 -f
214
215 # Change file owner
216 chown -R 5000:5000 /opt/apps/org.tizen.browser/data
217
218 %files
219 %defattr(-,root,root,-)
220 /opt/apps/org.tizen.browser/bin/browser
221 /opt/apps/org.tizen.browser/data/screenshots/default_*
222 /opt/apps/org.tizen.browser/res/edje/*.edj
223 /opt/apps/org.tizen.browser/res/html/*
224 /opt/share/icons/default/small/org.tizen.browser.png
225 /opt/apps/org.tizen.browser/res/images/*.png
226 /opt/apps/org.tizen.browser/res/locale/*/*/browser.mo
227 /opt/apps/org.tizen.browser/data/default_application_icon.png
228 /opt/apps/org.tizen.browser/data/config_sample.xml
229 /opt/share/applications/org.tizen.browser.desktop
230 /opt/apps/org.tizen.browser/data/xml/