3078619b806f9460d893032dfb62e3d4a802efa1
[apps/core/preloaded/print-service.git] / packaging / print-service.spec
1 %global DATADIR /opt
2
3 Name:       print-service
4 Summary:    print service library
5 Version:    1.2.4
6 Release:    14
7 Group:      System/Libraries
8 License:    Flora Software License
9 Source0:    %{name}-%{version}.tar.gz
10 BuildRequires: cmake
11 BuildRequires: pkgconfig(dlog)
12 BuildRequires: pkgconfig(eina)
13 BuildRequires: pkgconfig(ecore)
14 BuildRequires: pkgconfig(vconf)
15 BuildRequires: glib2-devel
16 BuildRequires: binutils-devel
17 BuildRequires: cups-devel
18 BuildRequires: libxml2-devel
19 BuildRequires: capi-appfw-application-devel
20 Requires: glib2
21 Requires: cups
22 Requires(post):  /sbin/ldconfig
23 Requires(postun):  /sbin/ldconfig
24 BuildRoot:  %{_tmppath}/%{name}-%{version}-build
25
26 %description
27 print-service library
28
29 %package devel
30 Summary:    print library - development file
31 Group:      Development/Libraries
32 Requires:   %{name} = %{version}-%{release}
33
34 %description devel
35 print library - development file
36
37 %package -n print-driver-data
38 Summary:    printer data - ppd, cts, data files
39 Group:      Development/Libraries
40 Requires:   %{name} = %{version}-%{release}
41
42 %description -n print-driver-data
43 printer data - ppd, cts, data files
44
45 %prep
46 %setup -q
47
48 %build
49 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DENABLE_OM_TESTS=On
50
51 %install
52 rm -rf %{buildroot}
53 %make_install
54 mkdir -p %{buildroot}/usr/share/license
55 cp %{_builddir}/%{buildsubdir}/LICENSE.Flora %{buildroot}/usr/share/license/%{name}
56 cp %{_builddir}/%{buildsubdir}/LICENSE.Flora %{buildroot}/usr/share/license/print-driver-data
57
58 %clean
59 rm -rf %{buildroot}
60
61 %post
62 /sbin/ldconfig
63
64 if ! [ -d /opt/etc/cups/ppd/hp ]
65 then
66         mkdir -p /opt/etc/cups/ppd/hp
67 fi
68 if ! [ -d /opt/etc/cups/ppd/epson ]
69 then
70         mkdir -p /opt/etc/cups/ppd/epson
71 fi
72 if ! [ -d /opt/etc/cups/ppd/samsung ]
73 then
74         mkdir -p /opt/etc/cups/ppd/samsung
75 fi
76 chown -R 5000:5000 /opt/etc/cups/ppd
77
78 if [ -f /usr/lib/rpm-plugins/msm.so ]
79 then
80         chsmack -a mobileprint /opt/etc/cups/ppd/
81         chsmack -a mobileprint /opt/etc/cups/ppd/hp
82         chsmack -a mobileprint /opt/etc/cups/ppd/epson
83         chsmack -a mobileprint /opt/etc/cups/ppd/samsung
84         chsmack -t /opt/etc/cups/ppd
85         chsmack -t /opt/etc/cups/ppd/hp
86         chsmack -t /opt/etc/cups/ppd/epson
87         chsmack -t /opt/etc/cups/ppd/samsung
88 fi
89
90 %post -n print-driver-data
91 mkdir -p /usr/share/cups/model/samsung
92 ln -sf /usr/share/cups/ppd/samsung/cms /usr/share/cups/model/samsung/cms
93
94 %postun -n print-driver-data
95 if [ -e /usr/share/cups/model/samsung/cms ]
96 then
97         rm /usr/share/cups/model/samsung/cms
98 fi
99 if [ -f /opt/etc/cups/ppd/hp/hp.drv ]
100 then
101         rm /opt/etc/cups/ppd/hp/hp.drv
102 fi
103 if [ -f /opt/etc/cups/ppd/samsung/samsung.drv ]
104 then
105         rm /opt/etc/cups/ppd/samsung/samsung.drv
106 fi
107 if [ -f /opt/etc/cups/ppd/epson/epson.drv ]
108 then
109         rm /opt/etc/cups/ppd/epson/epson.drv
110 fi
111
112 %postun
113 /sbin/ldconfig
114
115 %post devel
116 # 1. libraries
117 #    chown root:root /usr/lib/libcups.so
118 #    chown root:root /usr/lib/libcupsmime.so
119 #    chown root:root /usr/lib/libcupsppdc.so
120 #    chown root:root /usr/lib/libcupsimage.so
121 #    chown root:root /usr/lib/libcupsdriver.so
122 # 2. executables
123 # 3. configurations
124     #chown root:root /usr/lib/pkgconfig/cups.pc
125 #    chown root:root /usr/include/cups/cups.h
126 #    chown root:root /usr/include/cups/dir.h
127 #    chown root:root /usr/include/cups/driver.h
128 #    chown root:root /usr/include/cups/file.h
129 #    chown root:root /usr/include/cups/http.h
130 #    chown root:root /usr/include/cups/adminutil.h
131 #    chown root:root /usr/include/cups/array.h
132 #    chown root:root /usr/include/cups/backend.h
133 #    chown root:root /usr/include/cups/mime.h
134 #    chown root:root /usr/include/cups/ppd.h
135 #    chown root:root /usr/include/cups/ppdc.h
136 #    chown root:root /usr/include/cups/image.h
137 #    chown root:root /usr/include/cups/ipp.h
138 # Change file owner
139 # 1. libraries
140 #    chown root:root /usr/lib/libavahi-client.so.3
141 # 2. executables
142 # 3. configurations
143 #    chown root:root /usr/lib/pkgconfig/avahi-client.pc
144 #    chown root:root /usr/include/avahi-client/client.h
145 #    chown root:root /usr/include/avahi-client/lookup.h
146 #    chown root:root /usr/include/avahi-client/publish.h
147 # Change file owner
148 # 1. libraries       
149 #    chown root:root /usr/lib/libavahi-common.so.3
150 # 2. executables
151 # 3. configurations
152     #chown root:root /usr/lib/pkgconfig/avahi-common.pc.pc
153 #    chown root:root /usr/include/avahi-common/address.h
154 #    chown root:root /usr/include/avahi-common/alternative.h
155 #    chown root:root /usr/include/avahi-common/cdecl.h
156 #    chown root:root /usr/include/avahi-common/defs.h
157 #    chown root:root /usr/include/avahi-common/domain.h
158 #    chown root:root /usr/include/avahi-common/error.h
159 #    chown root:root /usr/include/avahi-common/gccmacro.h
160 #    chown root:root /usr/include/avahi-common/llist.h
161 #    chown root:root /usr/include/avahi-common/malloc.h
162 #    chown root:root /usr/include/avahi-common/rlist.h
163 #    chown root:root /usr/include/avahi-common/simple-watch.h
164 #    chown root:root /usr/include/avahi-common/strlst.h
165 #    chown root:root /usr/include/avahi-common/thread-watch.h
166 #    chown root:root /usr/include/avahi-common/timeval.h
167 #    chown root:root /usr/include/avahi-common/watch.h
168 # 1. libraries    
169 #    chown root:root /usr/lib/libavahi-core.so.5
170 # 2. executables
171 # 3. configurations
172 #    chown root:root /usr/lib/pkgconfig/avahi-core.pc
173 # Change file permissions
174 # 3. configurations
175 chmod 644 /usr/lib/pkgconfig/print-service.pc
176 chmod 644 /usr/include/print-service/pt_api.h
177
178 %files
179 %manifest print-service.manifest
180 %defattr(-,root,root,-)
181 %attr(0755,root,root) %{_bindir}/getppd
182 /usr/share/license/%{name}
183 %{_libdir}/*.so*
184 %exclude %{_libdir}/libopmap.so*
185
186 %files devel
187 %defattr(-,root,root,-)
188 %{_bindir}/getppdvalue
189 %attr(0755,root,root) %{_bindir}/ppd_test.sh
190 %{_includedir}/print-service/*.h
191 %{_libdir}/pkgconfig/*
192
193 # OptionMapping testing
194 %attr(0755,root,root) %{_bindir}/test-opmap
195 %attr(0755,root,root) %{_bindir}/print-test-opmap.sh
196 %{_libdir}/libopmap.so*
197 %attr(-,app,app) %{DATADIR}/etc/cups/ppd/hp.list
198 %attr(-,app,app) %{DATADIR}/etc/cups/ppd/hp_product.list
199 %attr(-,app,app) %{DATADIR}/etc/cups/ppd/epson.list
200 %attr(-,app,app) %{DATADIR}/etc/cups/ppd/samsung.list
201
202 %files -n print-driver-data
203 %manifest print-driver-data.manifest
204 %defattr(-,root,root,-)
205 /usr/share/license/print-driver-data
206 %dir /usr/share/cups/ppd/
207 /usr/share/cups/ppd/*
208 #/usr/share/cups/ppd/samsung/cms/*
209 %exclude %{DATADIR}/etc/cups/ppd/hp_product.list
210 %exclude %{DATADIR}/etc/cups/ppd/hp.list
211 %exclude %{DATADIR}/etc/cups/ppd/epson.list
212 %exclude %{DATADIR}/etc/cups/ppd/samsung.list
213 %changelog