Apply Tizen directory path guide 62/61562/1
authorKichan Kwon <k_c.kwon@samsung.com>
Wed, 9 Mar 2016 02:02:26 +0000 (11:02 +0900)
committerKichan Kwon <k_c.kwon@samsung.com>
Wed, 9 Mar 2016 02:02:26 +0000 (11:02 +0900)
- But, there is no changed path

- /opt/etc -> TZ_SYS_ETC (/opt/etc)

Change-Id: Ie27e8df2519d991d74b3f94cabc5481e94f35e1a
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
configure.ac
packaging/dlog.spec
scripts/dlogctrl.in [moved from scripts/dlogctrl with 96% similarity]
src/libdlog/log.c
src/logger/logger.c

index 8bc8e11..f33e415 100755 (executable)
@@ -81,6 +81,10 @@ AC_CHECK_FUNCS([memset])
 PKG_PROG_PKG_CONFIG
 PKG_CHECK_MODULES([CAPI_BASE_COMMON], [capi-base-common])
 
+AC_SUBST(TZ_SYS_ETC)
+
 # output files
-AC_CONFIG_FILES([Makefile dlog.pc])
+AC_CONFIG_FILES([Makefile dlog.pc]
+                               scripts/dlogctrl
+                               )
 AC_OUTPUT
index 935cb67..e39650f 100755 (executable)
@@ -41,6 +41,7 @@ BuildRequires: libtool
 BuildRequires: pkgconfig(libsystemd-journal)
 BuildRequires: pkgconfig(capi-base-common)
 BuildRequires: pkgconfig(libudev)
+BuildRequires: pkgconfig(libtzplatform-config)
 Requires(post): coreutils
 Requires(post): /usr/bin/systemctl
 Requires(postun): /usr/bin/systemctl
@@ -88,9 +89,11 @@ cp %{SOURCE102} .
                %if %{?backend_journal} == ON
                        --enable-journal \
                %endif
-                       --enable-debug_mode
+                       --enable-debug_mode \
+                       TZ_SYS_ETC=%{TZ_SYS_ETC}
 make %{?jobs:-j%jobs} \
        CFLAGS+=-DKMSG_DEV_CONFIG_FILE=\\\"/run/dloginit.conf\\\" \
+       CFLAGS+=-DTZ_SYS_ETC=\\\"%{TZ_SYS_ETC}\\\" \
 %if %{?backend_journal} == ON
        CFLAGS+=-DDLOG_BACKEND_JOURNAL
 %endif
@@ -109,8 +112,8 @@ rm -rf %{buildroot}
 mkdir -p %{buildroot}/usr/bin/
 cp %{_builddir}/%{name}-%{version}/scripts/dlogctrl %{buildroot}/usr/bin/dlogctrl
 
-mkdir -p %{buildroot}/opt/etc
-cp %SOURCE201 %{buildroot}/opt/etc/dlog.conf
+mkdir -p %{buildroot}%{TZ_SYS_ETC}
+cp %SOURCE201 %{buildroot}%{TZ_SYS_ETC}/dlog.conf
 
 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants/
 
@@ -127,7 +130,7 @@ install -m 0644 %SOURCE303 %{buildroot}%{_unitdir}/dlog_logger.path
 ln -s ../dlog_logger.path %{buildroot}%{_unitdir}/multi-user.target.wants/dlog_logger.path
 
 # default set log output to external files
-cp %SOURCE202 %{buildroot}/opt/etc/dlog_logger.conf
+cp %SOURCE202 %{buildroot}%{TZ_SYS_ETC}/dlog_logger.conf
 
 %endif
 
@@ -178,7 +181,7 @@ systemctl daemon-reload
 %{_udevrulesdir}/01-dlog.rules
 %if %{?backend_journal} == OFF
 %attr(750,log,log) %{_bindir}/dlog_logger
-%attr(664,log,log) /opt/etc/dlog_logger.conf
+%attr(664,log,log) %{TZ_SYS_ETC}/dlog_logger.conf
 %{_unitdir}/dlog_logger.service
 %{_unitdir}/dlog_logger.path
 %{_unitdir}/multi-user.target.wants/dlog_logger.path
@@ -189,7 +192,7 @@ systemctl daemon-reload
 /usr/share/license/libdlog
 %{_libdir}/libdlog.so.0
 %{_libdir}/libdlog.so.0.0.0
-%attr(664,log,log) /opt/etc/dlog.conf
+%attr(664,log,log) %{TZ_SYS_ETC}/dlog.conf
 /usr/share/license/%{name}
 %attr(700,log,log) %{_sbindir}/dloginit
 %attr(-,log,log) %{_unitdir}/dloginit.service
similarity index 96%
rename from scripts/dlogctrl
rename to scripts/dlogctrl.in
index 8a4e724..9cac6f0 100755 (executable)
@@ -3,7 +3,7 @@
 MODE=none
 OBJ=none
 VAL=none
-CONFIG_PATH="/opt/etc"
+CONFIG_PATH=@TZ_SYS_ETC@
 
 function Usage()
 {
index 373feec..027ebd3 100755 (executable)
@@ -43,7 +43,7 @@
 #define LOG_BUF_SIZE   1024
 
 #define VALUE_MAX 2
-#define LOG_CONFIG_FILE "/opt/etc/dlog.conf"
+#define LOG_CONFIG_FILE TZ_SYS_ETC"/dlog.conf"
 
 #ifndef DLOG_BACKEND_JOURNAL
 static int log_fds[(int)LOG_ID_MAX] = { -1, -1, -1, -1 };
index 40b2ce1..4211638 100755 (executable)
@@ -46,7 +46,7 @@
 #define BUFFER_MAX 100
 #define INTERVAL_MAX 60*60
 
-#define CONFIG_FILE "/opt/etc/dlog_logger.conf"
+#define CONFIG_FILE TZ_SYS_ETC"/dlog_logger.conf"
 
 #define ARRAY_SIZE(name) (sizeof(name)/sizeof(name[0]))