From 033fe54f44dcb913f52b0bf67633bc5bc6adcce2 Mon Sep 17 00:00:00 2001 From: "yoonki.park" Date: Tue, 27 Mar 2012 10:11:33 +0900 Subject: [PATCH] [Title] make hello project's name changeable, create rpm spec file for agent project [Type] [Module] [Priority] [Jira#] [Redmine#] 4778 [Problem] [Cause] [Solution] [TestCase] Change-Id: Ibaed946b2c5cc26d899c1dce4ccce8bc01c2dd5b --- .../AgentProject/CMakeLists.txt | 4 +- .../AgentProject/debian/changelog | 2 +- .../AgentProject/debian/control | 6 +-- .../AgentProject/debian/rules | 10 +---- .../AgentProject/packaging/agent.spec | 49 ++++++++++++++++++++++ .../AgentProject/template.xml | 23 ++++++---- .../HelloWorldProject/debian/changelog | 6 +-- .../HelloWorldProject/debian/control | 14 +++---- .../HelloWorldProject/debian/rules | 22 +++++----- .../HelloWorldProject/packaging/hello.spec | 18 ++++---- .../HelloWorldProject/template.xml | 14 +++---- 11 files changed, 106 insertions(+), 62 deletions(-) create mode 100644 org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/packaging/agent.spec diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/CMakeLists.txt b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/CMakeLists.txt index 82dee25..f2f4b28 100644 --- a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/CMakeLists.txt +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/CMakeLists.txt @@ -68,5 +68,5 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/com.samsung.${PROJECT_NAME}.desktop.i INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/com.samsung.${PROJECT_NAME}.desktop DESTINATION /opt/share/applications) INSTALL(DIRECTORY DESTINATION ${DATADIR}) - - +INSTALL(DIRECTORY DESTINATION ${LIBDIR}) +INSTALL(DIRECTORY DESTINATION ${RESDIR}) \ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/debian/changelog b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/debian/changelog index f2b8c34..8feee67 100644 --- a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/debian/changelog +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/debian/changelog @@ -2,4 +2,4 @@ $(projectName) (0.0.0-1) unstable; urgency=low * initial release - -- Author Thu, 26 Jan 2012 14:52:56 +0900 + -- $(author) <$(e-mail)> Thu, 26 Jan 2012 14:52:56 +0900 diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/debian/control b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/debian/control index 97155db..9795dd1 100644 --- a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/debian/control +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/debian/control @@ -1,16 +1,16 @@ Source: $(projectName) Priority: extra -Maintainer: Author +Maintainer: $(author) <$(e-mail)> Build-Depends: debhelper (>= 5), libappcore-agent-dev, dlog-dev Standards-Version: 0.1.0 Package: com.samsung.$(projectName) Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: agent application +Description: $(description) Package: com.samsung.$(projectName)-dbg Section: debug Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: agent application (unstripped) +Description: agent application (unstripped) \ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/debian/rules b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/debian/rules index 39a3e43..390480a 100644 --- a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/debian/rules +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/debian/rules @@ -32,12 +32,8 @@ configure-stamp: dh_testdir # Add here commands to configure the package. CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" cmake . -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DVERSION=$(VERSION) - - - touch configure-stamp - build: build-stamp build-stamp: configure-stamp @@ -88,9 +84,6 @@ clean: dh_clean - - - install: build dh_testdir dh_testroot @@ -100,7 +93,6 @@ install: build # Add here commands to install the package into debian/info-alarm. $(MAKE) DESTDIR=$(CURDIR)/debian/com.samsung.$(projectName) install - # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. @@ -137,4 +129,4 @@ binary-arch: build install dh_builddeb binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure +.PHONY: build clean binary-indep binary-arch binary install configure \ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/packaging/agent.spec b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/packaging/agent.spec new file mode 100644 index 0000000..0c470bb --- /dev/null +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/packaging/agent.spec @@ -0,0 +1,49 @@ +Name: com.samsung.$(projectName) +Version: 0.1.0 +Release: 1 +License: To be filled +Summary: agent application +Packager: $(author) <$(e-mail)> +Group: Application +Source: %{name}-%{version}.tar.gz + +BuildRequires: cmake +BuildRequires: pkgconfig(appcore-agent) +BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(dlog) + +%description +$(description) + +%define PREFIX "/opt/apps/com.samsung.$(projectName)" +%define RESDIR "/opt/apps/com.samsung.$(projectName)/res" + +%prep +%setup -q + +%build +export LDFLAGS="${LDFLAGS} -Wl,--rpath,/usr/lib -Wl,--rpath,%{PREFIX}/lib -Wl,--hash-style=both -Wl,--as-needed" +export CFLAGS="${CFLAGS} -fPIC" +export CXXFLAGS="${CXXFLAGS} -fPIC" +cmake . -DCMAKE_INSTALL_PREFIX=%{PREFIX} -DVERSION=%{Version} +# Call make instruction with smp support +make %{?jobs:-j%jobs} +touch configure-stamp + +%install +%make_install + +%clean +rm -f build-stamp configure-stamp + +%files +%defattr(644, app, app) +%attr(755, app, app) /opt/apps/%{name}/bin +/opt/apps/%{name}/lib +/opt/apps/%{name}/data +/opt/apps/%{name}/res/ +/opt/share/applications + +%changelog +* Thu Jan 26 2012 $(author) <$(e-mail)> + - initial release \ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/template.xml b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/template.xml index 5b99152..bd3ac14 100644 --- a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/template.xml +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/AgentProject/template.xml @@ -45,12 +45,12 @@ hidden="false" persist="false"/> - + - + @@ -69,10 +69,10 @@ - - - - + + + + @@ -93,7 +93,7 @@ - + @@ -104,12 +104,17 @@ + + + + + - - + + diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/changelog b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/changelog index 8db3a56..99516aa 100644 --- a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/changelog +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/changelog @@ -1,5 +1,5 @@ -com.samsung.hello (1.0.0) unstable; urgency=low +$(projectName) (0.0.0-1) unstable; urgency=low - * Initial Release + * initial release - -- Author Fri, 22 Jul 2011 17:32:27 +0900 \ No newline at end of file + -- $(author) <$(e-mail)> Sat, 24 Mar 2012 17:32:27 +0900 \ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/control b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/control index 05ebaa0..2a60cb3 100644 --- a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/control +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/control @@ -2,12 +2,10 @@ # THIS FILE IS CREATED AUTOMATICALLY. DO NOT DELETE OR MODIFY THIS FILE. ################################################################################# -Source: com.samsung.hello -Maintainer: Author -Standards-Version: 1.0.0 +Source: com.samsung.$(projectName) +Maintainer: $(author) <$(e-mail)> +Standards-Version: 0.0.1 -Package: com.samsung.hello -description: none -Architecture: any -XB-Permission: -XB-RequiredHardware: +Package: com.samsung.$(projectName) +description: $(description) +Architecture: any \ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/rules b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/rules index 88e033a..5590a02 100644 --- a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/rules +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/debian/rules @@ -11,30 +11,30 @@ configure-stamp: dh_testdir # Add here commands to configure the package. touch configure-stamp - + build: build-stamp build-stamp: configure-stamp dh_testdir # Add here commands to build the package. mkdir -p bin - $(CC) $(CFLAGS) $(LDFLAGS) src/hello.c -o bin/hello + $(CC) $(CFLAGS) $(LDFLAGS) src/$(projectName).c -o bin/$(projectName) touch build-stamp - -clean: + +clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # Add here commands to clean up before the build process. dh_clean - + install: build dh_testdir dh_testroot - dh_clean -k + dh_clean -k dh_installdirs # Add here commands to install the package. mkdir -p debian/tmp/usr/bin - cp bin/hello debian/tmp/usr/bin/ + cp bin/$(projectName) debian/tmp/usr/bin/ # Build architecture-independent files here. binary-indep: build install @@ -43,12 +43,12 @@ binary-indep: build install binary-arch: build install dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs dh_installexamples dh_install --sourcedir=debian/tmp # dh_installmenu -# dh_installdebconf +# dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installpam @@ -59,12 +59,12 @@ binary-arch: build install # dh_installinfo dh_installman dh_link - dh_strip +# dh_strip dh_compress dh_fixperms # dh_perl dh_makeshlibs - dh_installdeb + dh_installdeb # dh_shlibdeps dh_gencontrol dh_md5sums diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/packaging/hello.spec b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/packaging/hello.spec index 4b7c5f7..95e5905 100644 --- a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/packaging/hello.spec +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/packaging/hello.spec @@ -1,26 +1,26 @@ -Name: com.samsung.hello -Version: 1.0.0 +Name: com.samsung.$(projectName) +Version: 0.0.1 Release: 1 License: To be filled -Summary: Your copyright notice -Packager: bluleo78 +Summary: helloworld application (unstripped) +Packager: $(author) <$(e-mail)> Group: Application Source: %{name}-%{version}.tar.gz %description -Your copyright notice +$(description) %prep %setup -q %build mkdir -p bin -gcc src/hello.c -o bin/hello +gcc src/$(projectName).c -o bin/$(projectName) touch build-stamp %install echo "INSTALL" mkdir -p $RPM_BUILD_ROOT/usr/bin -cp bin/hello $RPM_BUILD_ROOT/usr/bin +cp bin/$(projectName) $RPM_BUILD_ROOT/usr/bin %clean rm -f build-stamp configure-stamp @@ -30,5 +30,5 @@ rm -f build-stamp configure-stamp %attr(755, root, root) /usr/bin %changelog -* Sat Mar 24 2012 bluleo78 - - Initial Release +* Sat Mar 24 2012 Author + - initial release \ No newline at end of file diff --git a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/template.xml b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/template.xml index 6244d56..cfb24e0 100644 --- a/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/template.xml +++ b/org.tizen.nativeplatform/templates/InhouseFrameworkPackages/HelloWorldProject/template.xml @@ -45,18 +45,18 @@ hidden="false" persist="false"/> - + - + - + @@ -78,10 +78,10 @@ - + - + @@ -95,6 +95,6 @@ - - + + -- 2.7.4