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>
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")
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)
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
#!/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
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
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
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
#!/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"
} 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);
#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
-%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}
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}
%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
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
/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
%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
#!/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"
#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"
#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 ./"