CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(image-viewer C)
-SET(PKG_NAME org.tizen.image-viewer)
+SET(PKG_NAME org.tizen.${PROJECT_NAME})
SET(SRCS
src/image-viewer.c
# install desktop file & icon
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-
SET(BINDIR "${PREFIX}/bin")
SET(RESDIR "${PREFIX}/res")
SET(DATADIR "${PREFIX}/data")
SET(ICONDIR "/usr/share/icons/default/small")
SET(EDJDIR "${RESDIR}/edje")
+FILE(MAKE_DIRECTORY data)
+
INSTALL(FILES ${PKG_NAME}.xml DESTINATION /usr/share/packages)
INSTALL(FILES ${PKG_NAME}.rule DESTINATION /opt/etc/smack/accesses.d)
INSTALL(DIRECTORY DESTINATION ${DATADIR})
+INSTALL(DIRECTORY "data" DESTINATION /opt/usr/apps/${PKG_NAME})
INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/appicon/${PKG_NAME}.png DESTINATION ${ICONDIR})
ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
-
INSTALL(FILES LICENSE.Flora DESTINATION /usr/share/license RENAME ${PKG_NAME})
-
+# Create data directory
-Name: org.tizen.image-viewer
-Summary: Image Viewer Application v1.0
-Version: 1.0.83
-Release: 1
-Group: misc
-License: Flora Software License
-
-Source0: %{name}-%{version}.tar.gz
-Source1001: org.tizen.image-viewer.manifest
+Name: org.tizen.image-viewer
+Summary: Image Viewer
+Version: 1.0.83
+Release: 1
+Group: Applications/Photo
+License: Flora
+Source0: %{name}-%{version}.tar.gz
+Source1001: %{name}.manifest
+BuildRequires: pkgconfig(appcore-efl)
+BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(edje)
+BuildRequires: pkgconfig(evas)
+BuildRequires: pkgconfig(ecore)
+BuildRequires: pkgconfig(ecore-x)
+BuildRequires: pkgconfig(ecore-input)
+BuildRequires: pkgconfig(bundle)
+BuildRequires: pkgconfig(sensor)
+BuildRequires: pkgconfig(ui-gadget-1)
+BuildRequires: pkgconfig(utilX)
+BuildRequires: pkgconfig(appsvc)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: cmake
+BuildRequires: edje-bin
+BuildRequires: embryo-bin
Requires: pkgmgr
-BuildRequires: pkgconfig(appcore-efl)
-BuildRequires: pkgconfig(elementary)
-BuildRequires: pkgconfig(edje)
-BuildRequires: pkgconfig(evas)
-BuildRequires: pkgconfig(ecore)
-BuildRequires: pkgconfig(ecore-x)
-BuildRequires: pkgconfig(ecore-input)
-BuildRequires: pkgconfig(bundle)
-BuildRequires: pkgconfig(sensor)
-BuildRequires: pkgconfig(ui-gadget-1)
-BuildRequires: pkgconfig(utilX)
-BuildRequires: pkgconfig(appsvc)
-BuildRequires: pkgconfig(vconf)
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(capi-appfw-application)
-
-BuildRequires: cmake
-BuildRequires: edje-bin
-BuildRequires: embryo-bin
%description
-Image Viewer Application v1.0.
-
-
+Tizen 2.x Reference Application.
+Various kinds of image files are supported.
%prep
%setup -q -n %{name}-%{version}
cp %{SOURCE1001} .
-
%build
-
-cmake . -DCMAKE_INSTALL_PREFIX="/usr/apps/org.tizen.image-viewer" -DRESDIR="/usr/apps/org.tizen.image-viewer/res" -DDATADIR="/opt/usr/apps/org.tizen.image-viewer/data"
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}/apps/%{name}/
make %{?jobs:-j%jobs}
%install
rm -rf %{buildroot}
%make_install
-mkdir -p %{buildroot}/usr/share/license
-
+mkdir -p %{buildroot}/%{_datarootdir}/license
%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
-%manifest org.tizen.image-viewer.manifest
-/opt/etc/smack/accesses.d/org.tizen.image-viewer.rule
-/usr/apps/org.tizen.image-viewer/*
-/usr/share/icons/default/small/org.tizen.image-viewer.png
-/usr/share/packages/org.tizen.image-viewer.xml
-
-/usr/share/license/%{name}
-
+/opt/etc/smack/accesses.d/%{name}.rule
+/opt/usr/apps/%{name}/*
+%{_prefix}/apps/%{name}/*
+%{_datarootdir}/icons/default/small/%{name}.png
+%{_datarootdir}/packages/%{name}.xml
+%{_datarootdir}/license/%{name}