From 73dd341e4cdd02af4355968698f91d64c76256b5 Mon Sep 17 00:00:00 2001 From: Kichan Kwon Date: Mon, 12 Dec 2016 13:28:00 +0900 Subject: [PATCH] Make system-configuration-debug - This package will make .debugmode file - In addition, switch for each conf file is added Change-Id: Ibe8297f70875700af248fa3f04cb2cfb1257d0b2 Signed-off-by: Kichan Kwon --- README | 4 +-- packaging/system-configuration.spec | 56 +++++++++++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 11 deletions(-) diff --git a/README b/README index 8400aae..4cc3598 100644 --- a/README +++ b/README @@ -3,8 +3,8 @@ 1. Introduction ===== -System configuration is the set of config files. - +System-configuration is the set of config files. +System-configuration-debug is package for developer debug binary. 2. Background ===== diff --git a/packaging/system-configuration.spec b/packaging/system-configuration.spec index 44d18cd..1763f60 100644 --- a/packaging/system-configuration.spec +++ b/packaging/system-configuration.spec @@ -1,18 +1,28 @@ Name: system-configuration Summary: Configuration for system packages -Version: 0.1 +Version: 0.1.1 Release: 1 Group: System/Configuration License: Apache-2.0 Source0: %{name}-%{version}.tar.gz Source1: %{name}.manifest +%define dlog_conf OFF + BuildRequires: pkgconfig(libtzplatform-config) %description Configuration files for system packages By modifying this package, each profile can use their own configuration +%package -n system-configuration-debug +Summary: System-configuration for developer binary +Group: System/Configuration +Conflicts: system-configuration + +%description -n system-configuration-debug +System-configuration for developer debug binary + %prep %setup -q cp %{SOURCE1} . @@ -20,16 +30,44 @@ cp %{SOURCE1} . %install mkdir -p %{buildroot}%{TZ_SYS_ETC} -install -m 0644 configs/dlog.sysconf %{buildroot}%{TZ_SYS_ETC}/dlog.sysconf +%if %{?dlog_conf} == ON + install -m 0644 configs/dlog.sysconf %{buildroot}%{TZ_SYS_ETC}/dlog.sysconf +%endif + +%posttrans -n system-configuration +%if %{?dlog_conf} == ON + mv %{TZ_SYS_ETC}/dlog.conf %{TZ_SYS_ETC}/dlog.conf.bak + ln -s %{TZ_SYS_ETC}/dlog.sysconf %{TZ_SYS_ETC}/dlog.conf +%endif + +%postun -n system-configuration +%if %{?dlog_conf} == ON + mv %{TZ_SYS_ETC}/dlog.conf.bak %{TZ_SYS_ETC}/dlog.conf +%endif + +%files -n system-configuration +%license LICENSE +%manifest system-configuration.manifest +%if %{?dlog_conf} == ON + %attr(664,log,log) %{TZ_SYS_ETC}/dlog.sysconf +%endif -%posttrans -mv %{TZ_SYS_ETC}/dlog.conf %{TZ_SYS_ETC}/dlog.conf.bak -ln -s %{TZ_SYS_ETC}/dlog.sysconf %{TZ_SYS_ETC}/dlog.conf +%posttrans -n system-configuration-debug +touch %{TZ_SYS_ETC}/.debugmode +%if %{?dlog_conf} == ON + mv %{TZ_SYS_ETC}/dlog.conf %{TZ_SYS_ETC}/dlog.conf.bak + ln -s %{TZ_SYS_ETC}/dlog.sysconf %{TZ_SYS_ETC}/dlog.conf +%endif -%postun -mv %{TZ_SYS_ETC}/dlog.conf.bak %{TZ_SYS_ETC}/dlog.conf +%postun -n system-configuration-debug +rm %{TZ_SYS_ETC}/.debugmode +%if %{?dlog_conf} == ON + mv %{TZ_SYS_ETC}/dlog.conf.bak %{TZ_SYS_ETC}/dlog.conf +%endif -%files +%files -n system-configuration-debug %license LICENSE %manifest system-configuration.manifest -%attr(664,log,log) %{TZ_SYS_ETC}/dlog.sysconf +%if %{?dlog_conf} == ON + %attr(664,log,log) %{TZ_SYS_ETC}/dlog.sysconf +%endif -- 2.7.4