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