Add multi-user support sandbox/kthierry/multiuser
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Wed, 12 Feb 2014 16:40:40 +0000 (17:40 +0100)
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Fri, 14 Feb 2014 08:44:40 +0000 (09:44 +0100)
Also clean a CMakeList.txt, replacing tabs by spaces.

Bug-Tizen: PTREL-253
Change-Id: I09b3c1196f6248849fdd39110ae1ffc439eb4d60
Signed-off-by: Kévin THIERRY <kevin.thierry@open.eurogiciel.org>
CMakeLists.txt
TC/CMakeLists.txt
TC/ppd_test.sh
TC/print-test-opmap.sh
include/pt_optionmapping.h
include/pt_ppd.h
packaging/print-service.spec
scripts/print-test-getppd.sh
src/pt_optionmapping.c
src/pt_ppd.c

index a03aad8e0a096ad2a2e6f75eb07dbc049cc7e716..6be1c28df2594b8ea9378556046d0de52e85f2f4 100755 (executable)
@@ -16,7 +16,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
 
 INCLUDE(FindPkgConfig)
 #pkg_check_modules(utils_pkgs REQUIRED ecore eina avahi cups dlog vconf capi-appfw-application)
-pkg_check_modules(utils_pkgs REQUIRED ecore eina dlog vconf capi-appfw-application)
+pkg_check_modules(utils_pkgs REQUIRED ecore eina dlog vconf capi-appfw-application libtzplatform-config)
 
 FOREACH(flag ${utils_pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -fdata-sections -ffunction-sections -Wl,--gc-sections")
index 72ec464913857300a51a176c4c4daa550822cb77..ae9b1d9fecb93aac2d54f0823a5eb4008eb190b7 100644 (file)
@@ -7,6 +7,7 @@ SET(PREFIX /usr)
 SET(BINDIR "${PREFIX}/bin")
 SET(LIBDIR ${LIB_INSTALL_DIR})
 SET(SRCS ppd_compare.c)
+SET(ETC ${CMAKE_ETC})
 
 SET(DB_LIB_NAME ptdb)
 SET(GETPPD getppd)
@@ -16,61 +17,61 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
 INCLUDE(FindPkgConfig)
 
 IF(ENABLE_OM_TESTS)
-       # Sources for OptionMapping tests's binaries
-       SET(SRCS_OM_TEST
-               test-automation.c)
-
-       # OptionMapping test automation
-       # Sources for OptionMapping library
-       SET(SRCS_OM_LIB
-               ../src/pt_optionmapping.c
-               ../src/pt_optionkeywords.c
-               ../src/pt_utils.c
-               ../src/pt_ppd.c)
-
-       SET(VERSION_MAJOR 1)
-       SET(VERSION "${VERSION_MAJOR}.0.1")
-       SET(OPMAP_LIB_NAME opmap)
-
-       SET(OPMAP_TEST_NAME test-opmap)
-       SET(OPMAP_TEST_SCRIPT print-test-opmap.sh)
-       SET(HP_LIST        hp.list)
-       SET(HP_PRDLIST     hp_product.list)
-       SET(EPSON_LIST     epson.list)
-       SET(SAMSUNG_LIST   samsung.list)
-       SET(PRINTLIST_DIR /opt/etc/cups/ppd/)
-
-       ADD_LIBRARY(${OPMAP_LIB_NAME} SHARED ${SRCS_OM_LIB})
-       SET_TARGET_PROPERTIES(${OPMAP_LIB_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
-       SET_TARGET_PROPERTIES(${OPMAP_LIB_NAME} PROPERTIES VERSION ${VERSION})
-
-       pkg_check_modules(test_pkgs REQUIRED ecore eina dlog)
-
-       FOREACH(flag ${test_pkgs_LDFLAGS})
+    # Sources for OptionMapping tests's binaries
+    SET(SRCS_OM_TEST
+        test-automation.c)
+
+    # OptionMapping test automation
+    # Sources for OptionMapping library
+    SET(SRCS_OM_LIB
+        ../src/pt_optionmapping.c
+        ../src/pt_optionkeywords.c
+        ../src/pt_utils.c
+        ../src/pt_ppd.c)
+
+    SET(VERSION_MAJOR 1)
+    SET(VERSION "${VERSION_MAJOR}.0.1")
+    SET(OPMAP_LIB_NAME opmap)
+
+    SET(OPMAP_TEST_NAME test-opmap)
+    SET(OPMAP_TEST_SCRIPT print-test-opmap.sh)
+    SET(HP_LIST        hp.list)
+    SET(HP_PRDLIST     hp_product.list)
+    SET(EPSON_LIST     epson.list)
+    SET(SAMSUNG_LIST   samsung.list)
+    SET(PRINTLIST_DIR  ${ETC}/cups/ppd/)
+
+    ADD_LIBRARY(${OPMAP_LIB_NAME} SHARED ${SRCS_OM_LIB})
+    SET_TARGET_PROPERTIES(${OPMAP_LIB_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
+    SET_TARGET_PROPERTIES(${OPMAP_LIB_NAME} PROPERTIES VERSION ${VERSION})
+
+    pkg_check_modules(test_pkgs REQUIRED ecore eina dlog libtzplatform-config)
+
+    FOREACH(flag ${test_pkgs_LDFLAGS})
         SET(OPMAP_TEST_LDFLAGS "${flag} ${OPMAP_TEST_LDFLAGS}")
-       ENDFOREACH(flag)
-
-       SET(OPMAP_TEST_LDFLAGS "${OPMAP_TEST_LDFLAGS} -lcups")
-
-       ADD_EXECUTABLE(${OPMAP_TEST_NAME} ${SRCS_OM_TEST})
-       TARGET_LINK_LIBRARIES(${OPMAP_TEST_NAME} ${OPMAP_LIB_NAME})
-       TARGET_LINK_LIBRARIES(${OPMAP_TEST_NAME} ${OPMAP_TEST_LDFLAGS})
-       TARGET_LINK_LIBRARIES(${OPMAP_TEST_NAME} ${DB_LIB_NAME})
-
-       ADD_CUSTOM_COMMAND(TARGET ${OPMAP_TEST_NAME} POST_BUILD
-                                          COMMAND ./create-printlist.sh "hp" ${CMAKE_SOURCE_DIR} ${HP_LIST}
-                                          COMMAND ./create-printlist.sh "hp_product" ${CMAKE_SOURCE_DIR} ${HP_PRDLIST}
-                                          COMMAND ./create-printlist.sh "epson" ${CMAKE_SOURCE_DIR} ${EPSON_LIST}
-                                          COMMAND ./create-printlist.sh "samsung" ${CMAKE_SOURCE_DIR} ${SAMSUNG_LIST}
-                                          COMMENT "Generate list of printers")
-
-       INSTALL(TARGETS ${OPMAP_TEST_NAME} DESTINATION ${BINDIR})
-       INSTALL(TARGETS ${OPMAP_LIB_NAME} LIBRARY DESTINATION ${LIBDIR})
-       INSTALL(FILES ${HP_LIST} DESTINATION ${PRINTLIST_DIR})
-       INSTALL(FILES ${HP_PRDLIST} DESTINATION ${PRINTLIST_DIR})
-       INSTALL(FILES ${SAMSUNG_LIST} DESTINATION ${PRINTLIST_DIR})
-       INSTALL(FILES ${EPSON_LIST} DESTINATION ${PRINTLIST_DIR})
-       INSTALL(FILES ${OPMAP_TEST_SCRIPT} DESTINATION ${BINDIR})
+    ENDFOREACH(flag)
+
+    SET(OPMAP_TEST_LDFLAGS "${OPMAP_TEST_LDFLAGS} -lcups")
+
+    ADD_EXECUTABLE(${OPMAP_TEST_NAME} ${SRCS_OM_TEST})
+    TARGET_LINK_LIBRARIES(${OPMAP_TEST_NAME} ${OPMAP_LIB_NAME})
+    TARGET_LINK_LIBRARIES(${OPMAP_TEST_NAME} ${OPMAP_TEST_LDFLAGS})
+    TARGET_LINK_LIBRARIES(${OPMAP_TEST_NAME} ${DB_LIB_NAME})
+
+    ADD_CUSTOM_COMMAND(TARGET ${OPMAP_TEST_NAME} POST_BUILD
+                        COMMAND ./create-printlist.sh "hp" ${CMAKE_SOURCE_DIR} ${HP_LIST}
+                        COMMAND ./create-printlist.sh "hp_product" ${CMAKE_SOURCE_DIR} ${HP_PRDLIST}
+                        COMMAND ./create-printlist.sh "epson" ${CMAKE_SOURCE_DIR} ${EPSON_LIST}
+                        COMMAND ./create-printlist.sh "samsung" ${CMAKE_SOURCE_DIR} ${SAMSUNG_LIST}
+                        COMMENT "Generate list of printers")
+
+    INSTALL(TARGETS ${OPMAP_TEST_NAME} DESTINATION ${BINDIR})
+    INSTALL(TARGETS ${OPMAP_LIB_NAME} LIBRARY DESTINATION ${LIBDIR})
+    INSTALL(FILES ${HP_LIST} DESTINATION ${PRINTLIST_DIR})
+    INSTALL(FILES ${HP_PRDLIST} DESTINATION ${PRINTLIST_DIR})
+    INSTALL(FILES ${SAMSUNG_LIST} DESTINATION ${PRINTLIST_DIR})
+    INSTALL(FILES ${EPSON_LIST} DESTINATION ${PRINTLIST_DIR})
+    INSTALL(FILES ${OPMAP_TEST_SCRIPT} DESTINATION ${BINDIR})
 ENDIF(ENABLE_OM_TESTS)
 
 # Compile and install getppd wrapper
index 6218e80e5b75379166db85067fb640fa4481baff..a73aa2560e4c8e6f5fd3482b017441ec90b387ba 100755 (executable)
@@ -1,18 +1,20 @@
 #!/bin/sh
 
+eval $(tzplatform-get TZ_SYS_ETC)
+
 #used in extraction test
 hp_drvgz_path="/usr/share/cups/ppd/hp/hp.drv.gz"
 samsung_drvgz_path="/usr/share/cups/ppd/samsung/samsung.drv.gz"
 epson_drvgz_path="/usr/share/cups/ppd/epson/epson.drv.gz"
 
-hp_drv_path="/opt/etc/cups/ppd/hp/hp.drv"
-samsung_drv_path="/opt/etc/cups/ppd/samsung/samsung.drv"
-epson_drv_path="/opt/etc/cups/ppd/epson/epson.drv"
+hp_drv_path=$TZ_SYS_ETC"/cups/ppd/hp/hp.drv"
+samsung_drv_path=$TZ_SYS_ETC"/cups/ppd/samsung/samsung.drv"
+epson_drv_path=$TZ_SYS_ETC"/cups/ppd/epson/epson.drv"
 
-hp_list_path="/opt/etc/cups/ppd/hp.list"
-hp_product_path="/opt/etc/cups/ppd/hp_product.list"
-samsung_list_path="/opt/etc/cups/ppd/samsung.list"
-epson_list_path="/opt/etc/cups/ppd/epson.list"
+hp_list_path=$TZ_SYS_ETC"/cups/ppd/hp.list"
+hp_product_path=$TZ_SYS_ETC"/cups/ppd/hp_product.list"
+samsung_list_path=$TZ_SYS_ETC"/cups/ppd/samsung.list"
+epson_list_path=$TZ_SYS_ETC"/cups/ppd/epson.list"
 
 epson_extraction_complete=0
 samsung_extraction_complete=0
@@ -470,7 +472,7 @@ echo "      Validation TEST - Epson                                                 "
 echo "===================================================================="
 
 EXTRACTION_COMPLETE=$epson_extraction_complete
-ORIGINAL_PPD_PATH="/opt/etc/cups/ppd/org_ppd/epson"
+ORIGINAL_PPD_PATH=$TZ_SYS_ETC"/cups/ppd/org_ppd/epson"
 VALID_PATH=$EPSON_VALID
 VALID_RESULT_PATH=$EPSON_VALID/result
 TEMP_PATH=$EPSON_TEMP
@@ -506,7 +508,7 @@ echo "      Validation TEST - Samsung                                                       "
 echo "===================================================================="
 
 EXTRACTION_COMPLETE=$samsung_extraction_complete
-ORIGINAL_PPD_PATH="/opt/etc/cups/ppd/org_ppd/samsung"
+ORIGINAL_PPD_PATH=$TZ_SYS_ETC"/cups/ppd/org_ppd/samsung"
 VALID_PATH=$SAMSUNG_VALID
 VALID_RESULT_PATH=$SAMSUNG_VALID/result
 TEMP_PATH=$SAMSUNG_TEMP
@@ -542,7 +544,7 @@ echo "      Validation TEST - HP                                                    "
 echo "===================================================================="
 
 EXTRACTION_COMPLETE=$hp_extraction_complete
-ORIGINAL_PPD_PATH="/opt/etc/cups/ppd/org_ppd/hp"
+ORIGINAL_PPD_PATH=$TZ_SYS_ETC"/cups/ppd/org_ppd/hp"
 VALID_PATH=$HP_VALID
 VALID_RESULT_PATH=$HP_VALID/result
 TEMP_PATH=$HP_TEMP
index 974cd9d7808a02c41fed8c7a1edbbe426cf56167..a98112d6bb6aa2b6852151943f40118e3eefeaeb 100755 (executable)
@@ -1,6 +1,8 @@
 #!/bin/bash
 
-PLIST_PATH="/opt/etc/cups/ppd/"
+eval $(tzplatform-get TZ_SYS_ETC)
+
+PLIST_PATH=$TZ_SYS_ETC"/cups/ppd/"
 HP_LIST="hp.list"
 EPSON_LIST="epson.list"
 SAMSUNG_LIST="samsung.list"
index ff13b1909474b0b738a88c63758992ba093c350c..14ab178aabd54e77f6c10c18aa9d0eeec198f0f1 100644 (file)
@@ -51,7 +51,7 @@ typedef struct {
 } pt_resolution_keyword;
 
 #undef PT_OPTIONCUBE_TEST_PRINT
-#define PT_USER_OPTION_CONFIG_FILE "/opt/etc/cups/ppd/settings.cfg"
+#define PT_USER_OPTION_CONFIG_FILE tzplatform_mkpath(TZ_SYS_ETC, "cups/ppd/settings.cfg")
 
 ppd_choice_t *pt_selected_choice(int op, pt_orientation_e p);
 void pt_parse_options(ppd_file_t *ppd);
index 6bf76e0876f790f62bb7c5550cf618f5857134d6..4ddf3e90556d88d99caa3f0175c032ea2c96c6c8 100644 (file)
@@ -23,7 +23,7 @@
 #define MAX_PATH_SIZE           512
 #define MAX_COMMAND_SIZE        128*128
 #define MANUFACTURER_NUM        3
-#define PPD_DIR                                "/opt/etc/cups/ppd"
+#define PPD_DIR                                 tzplatform_mkpath3(TZ_SYS_ETC, "cups", "ppd")
 
 /**
  *  This function let the app get ppd file for the specified printer
index 280c1f0ed186da54d4ff39599413bee59b4ba235..72916aad1bb16bbeb7c3877fe5711906e2c81266 100755 (executable)
@@ -1,52 +1,52 @@
-%global DATADIR /opt
-
 Name:       print-service
-Summary:    print service library
+Summary:    Print service library
 Version:    1.2.9
-Release:    1
+Release:    0
 Group:      System/Libraries
-License:    Flora Software License
+License:    Flora
 Source0:    %{name}-%{version}.tar.gz
 Source1001: print-service.manifest
 Source1002: print-driver-data.manifest
 Source1003: print-service-tests.manifest 
-BuildRequires: cmake
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(eina)
-BuildRequires: pkgconfig(ecore)
-BuildRequires: pkgconfig(vconf)
-BuildRequires: glib2-devel
-BuildRequires: binutils-devel
-BuildRequires: cups-devel
-BuildRequires: libxml2-devel
-BuildRequires: capi-appfw-application-devel
-Requires: glib2
-Requires: cups
-Requires(post):  /sbin/ldconfig
-Requires(postun):  /sbin/ldconfig
+BuildRequires:    cmake
+BuildRequires:    pkgconfig(dlog)
+BuildRequires:    pkgconfig(eina)
+BuildRequires:    pkgconfig(ecore)
+BuildRequires:    pkgconfig(vconf)
+BuildRequires:    pkgconfig(libtzplatform-config)
+BuildRequires:    glib2-devel
+BuildRequires:    binutils-devel
+BuildRequires:    cups-devel
+BuildRequires:    libxml2-devel
+BuildRequires:    capi-appfw-application-devel
+Requires:         tizen-platform-config-tools
+Requires:         cups
+Requires(post):   /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+
 BuildRoot:  %{_tmppath}/%{name}-%{version}-build
 
 %description
-print-service library
+Print-service library
 
 %package devel
-Summary:    print library - development file
+Summary:    Print library - development file
 Group:      Development/Libraries
 Requires:   %{name} = %{version}-%{release}
 
 %description devel
-print library - development file
+Print library - development file
 
 %package -n print-driver-data
-Summary:    printer data - ppd, cts, data files
+Summary:    Printer data - ppd, cts, data files
 Group:      Development/Libraries
 Requires:   %{name} = %{version}-%{release}
 
 %description -n print-driver-data
-printer data - ppd, cts, data files
+Printer data - ppd, cts, data files
 
 %package tests
-Summary:    testing utilities
+Summary:    Testing utilities
 Group:      Development/Libraries
 Requires:   %{name} = %{version}-%{release}
 
@@ -60,7 +60,7 @@ Set of utilities for testing different parts of library
 cp %{SOURCE1001} .
 cp %{SOURCE1002} .
 cp %{SOURCE1003} .
-%cmake . -DENABLE_OM_TESTS=On
+%cmake . -DENABLE_OM_TESTS=On -DCMAKE_ETC=%{TZ_SYS_ETC}
 
 %install
 rm -rf %{buildroot}
@@ -75,19 +75,19 @@ rm -rf %{buildroot}
 %post
 /sbin/ldconfig
 
-if ! [ -d /opt/etc/cups/ppd/hp ]
+if ! [ -d %{TZ_SYS_ETC}/cups/ppd/hp ]
 then
-       mkdir -p /opt/etc/cups/ppd/hp
+       mkdir -p %{TZ_SYS_ETC}/cups/ppd/hp
 fi
-if ! [ -d /opt/etc/cups/ppd/epson ]
+if ! [ -d %{TZ_SYS_ETC}/cups/ppd/epson ]
 then
-       mkdir -p /opt/etc/cups/ppd/epson
+       mkdir -p %{TZ_SYS_ETC}/cups/ppd/epson
 fi
-if ! [ -d /opt/etc/cups/ppd/samsung ]
+if ! [ -d %{TZ_SYS_ETC}/cups/ppd/samsung ]
 then
-       mkdir -p /opt/etc/cups/ppd/samsung
+       mkdir -p %{TZ_SYS_ETC}/cups/ppd/samsung
 fi
-chown -R 5000:5000 /opt/etc/cups/ppd
+chown -R :%{TZ_SYS_USER_GROUP} %{TZ_SYS_ETC}/cups/ppd
 
 %post -n print-driver-data
 mkdir -p /usr/share/cups/model/samsung
@@ -98,17 +98,17 @@ if [ -e /usr/share/cups/model/samsung/cms ]
 then
        rm /usr/share/cups/model/samsung/cms
 fi
-if [ -f /opt/etc/cups/ppd/hp/hp.drv ]
+if [ -f %{TZ_SYS_ETC}/cups/ppd/hp/hp.drv ]
 then
-       rm /opt/etc/cups/ppd/hp/hp.drv
+       rm %{TZ_SYS_ETC}/cups/ppd/hp/hp.drv
 fi
-if [ -f /opt/etc/cups/ppd/samsung/samsung.drv ]
+if [ -f %{TZ_SYS_ETC}/cups/ppd/samsung/samsung.drv ]
 then
-       rm /opt/etc/cups/ppd/samsung/samsung.drv
+       rm %{TZ_SYS_ETC}/cups/ppd/samsung/samsung.drv
 fi
-if [ -f /opt/etc/cups/ppd/epson/epson.drv ]
+if [ -f %{TZ_SYS_ETC}/cups/ppd/epson/epson.drv ]
 then
-       rm /opt/etc/cups/ppd/epson/epson.drv
+       rm %{TZ_SYS_ETC}/cups/ppd/epson/epson.drv
 fi
 
 %postun
@@ -134,10 +134,10 @@ fi
 /usr/share/license/print-driver-data
 %dir /usr/share/cups/ppd/
 /usr/share/cups/ppd/*
-%exclude %{DATADIR}/etc/cups/ppd/hp_product.list
-%exclude %{DATADIR}/etc/cups/ppd/hp.list
-%exclude %{DATADIR}/etc/cups/ppd/epson.list
-%exclude %{DATADIR}/etc/cups/ppd/samsung.list
+%exclude %{TZ_SYS_ETC}/cups/ppd/hp_product.list
+%exclude %{TZ_SYS_ETC}/cups/ppd/hp.list
+%exclude %{TZ_SYS_ETC}/cups/ppd/epson.list
+%exclude %{TZ_SYS_ETC}/cups/ppd/samsung.list
 
 %files -n print-service-tests
 %manifest print-service-tests.manifest
@@ -147,10 +147,10 @@ fi
 %attr(0755,root,root) %{_bindir}/test-opmap
 %attr(0755,root,root) %{_bindir}/print-test-opmap.sh
 %{_libdir}/libopmap.so*
-%attr(-,app,app) %{DATADIR}/etc/cups/ppd/hp.list
-%attr(-,app,app) %{DATADIR}/etc/cups/ppd/hp_product.list
-%attr(-,app,app) %{DATADIR}/etc/cups/ppd/epson.list
-%attr(-,app,app) %{DATADIR}/etc/cups/ppd/samsung.list
+%attr(-,-,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_ETC}/cups/ppd/hp.list
+%attr(-,-,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_ETC}/cups/ppd/hp_product.list
+%attr(-,-,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_ETC}/cups/ppd/epson.list
+%attr(-,-,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_ETC}/cups/ppd/samsung.list
 
 %changelog
 
index af9368951bdd0b1a1835dc98b07ce9bdb33cf3bc..9b6712013ff526781a4c749763350230a686608f 100755 (executable)
@@ -1,6 +1,8 @@
 #!/bin/bash
 
-PLIST_PATH="/opt/etc/cups/ppd/"
+eval $(tzplatform-get TZ_SYS_ETC)
+
+PLIST_PATH=$TZ_SYS_ETC"/cups/ppd/"
 HP_LIST="hp.list"
 EPSON_LIST="epson.list"
 SAMSUNG_LIST="samsung.list"
index 64903dd1911a997b47c94a23afa0b44b0fb3342b..27d0cf5b4ff4fd621d8c7fe3c4da4fac1978e032 100644 (file)
 
 #include <ctype.h>
 #include <stdbool.h>
+
+/* For multi-user support */
+#include <tzplatform_config.h>
+
 #include "pt_debug.h"
 #include "pt_common.h"
 #include "pt_utils.h"
index d83421a934d62b332f577970a4e84e94b91a773a..54fe3de56833f6d3e34770d6bc50797fedbeb7c1 100644 (file)
 #include <limits.h>
 #include <stdlib.h>
 
+/* For multi-user support */
+#include <tzplatform_config.h>
+
 #include <pt_db.h>
 #include "pt_debug.h"
 #include "pt_common.h"
 #include "pt_ppd.h"
 
 #define GETPPD "/usr/bin/getppd"
-#define CUPS_PPDDIR "/opt/etc/cups/ppd/"
-#define SAMSUNG_DRV "/opt/etc/cups/ppd/samsung/samsung.drv"
-#define SAMSUNG_DRV_GZ "/opt/etc/cups/ppd/samsung/samsung.drv.gz"
+#define CUPS_PPDDIR tzplatform_mkpath(TZ_SYS_ETC, "cups/ppd/")
+#define SAMSUNG_DRV tzplatform_mkpath(TZ_SYS_ETC, "cups/ppd/samsung/samsung.drv")
+#define SAMSUNG_DRV_GZ tzplatform_mkpath(TZ_SYS_ETC, "cups/ppd/samsung/samsung.drv.gz")
 #define SAMSUNG_DRV_GZ_ORG "/usr/share/cups/ppd/samsung/samsung.drv.gz"
-#define HP_DRV "/opt/etc/cups/ppd/hp/hp.drv"
-#define HP_DRV_GZ "/opt/etc/cups/ppd/hp/hp.drv.gz"
+#define HP_DRV tzplatform_mkpath(TZ_SYS_ETC, "cups/ppd/hp/hp.drv")
+#define HP_DRV_GZ tzplatform_mkpath(TZ_SYS_ETC, "cups/ppd/hp/hp.drv.gz")
 #define HP_DRV_GZ_ORG "/usr/share/cups/ppd/hp/hp.drv.gz"
-#define EPSON_DRV "/opt/etc/cups/ppd/epson/epson.drv"
-#define EPSON_DRV_GZ "/opt/etc/cups/ppd/epson/epson.drv.gz"
+#define EPSON_DRV tzplatform_mkpath(TZ_SYS_ETC, "cups/ppd/epson/epson.drv")
+#define EPSON_DRV_GZ tzplatform_mkpath(TZ_SYS_ETC, "cups/ppd/epson/epson.drv.gz")
 #define EPSON_DRV_GZ_ORG "/usr/share/cups/ppd/epson/epson.drv.gz"
-#define SAMSUNG_PPD_DIR "/opt/etc/cups/ppd/samsung"
-#define EPSON_PPD_DIR "/opt/etc/cups/ppd/epson"
-#define HP_PPD_DIR "/opt/etc/cups/ppd/hp"
+#define SAMSUNG_PPD_DIR tzplatform_mkpath(TZ_SYS_ETC, "cups/ppd/samsung")
+#define EPSON_PPD_DIR tzplatform_mkpath(TZ_SYS_ETC, "cups/ppd/epson")
+#define HP_PPD_DIR tzplatform_mkpath(TZ_SYS_ETC, "cups/ppd/hp")
 
 #define PPDC_PREFIX "ppdc: Writing ./"