packaging: removed '-Wl,as-needed' for build error.
[apps/core/preloaded/print-service.git] / packaging / print-service.spec
1 Name:       print-service
2 Summary:    Print service library
3 Version:    1.2.9
4 Release:    0
5 Group:      System/Libraries
6 License:    Apache-2.0 and GPL-2.0 and MIT
7 Source0:    %{name}-%{version}.tar.gz
8 Source1001: print-service.manifest
9 Source1002: print-driver-data.manifest
10 Source1003: print-service-tests.manifest
11 BuildRequires:    cmake
12 BuildRequires:    pkgconfig(dlog)
13 BuildRequires:    pkgconfig(eina)
14 BuildRequires:    pkgconfig(ecore)
15 BuildRequires:    pkgconfig(vconf)
16 BuildRequires:    pkgconfig(libtzplatform-config)
17 BuildRequires:    glib2-devel
18 BuildRequires:    binutils-devel
19 BuildRequires:    cups-devel
20 BuildRequires:    libxml2-devel
21 BuildRequires:    capi-appfw-application-devel
22 Requires:         tizen-platform-config-tools
23 Requires:         cups
24 Requires(post):   /sbin/ldconfig
25 Requires(postun): /sbin/ldconfig
26
27 BuildRoot:  %{_tmppath}/%{name}-%{version}-build
28
29 %description
30 Print-service library
31
32 %package devel
33 Summary:    Print library - development file
34 Group:      Development/Libraries
35 Requires:   %{name} = %{version}-%{release}
36
37 %description devel
38 Print library - development file
39
40 %package -n print-driver-data
41 Summary:    Printer data - ppd, cts, data files
42 Group:      Development/Libraries
43 Requires:   %{name} = %{version}-%{release}
44
45 %description -n print-driver-data
46 Printer data - ppd, cts, data files
47
48 %package tests
49 Summary:    Testing utilities
50 Group:      Development/Libraries
51 Requires:   %{name} = %{version}-%{release}
52
53 %description tests
54 Set of utilities for testing different parts of library
55
56 %prep
57 %setup -q
58
59 %build
60 cp %{SOURCE1001} .
61 cp %{SOURCE1002} .
62 cp %{SOURCE1003} .
63 export CFLAGS="$(echo $CFLAGS | sed 's/-Wl,--as-needed//g')"
64 export CXXFLAGS="$(echo $CXXFLAGS | sed 's/-Wl,--as-needed//g')"
65 export FFLAGS="$(echo $FFLAGS | sed 's/-Wl,--as-needed//g')"
66 %cmake . -DENABLE_OM_TESTS=On -DCMAKE_ETC=%{TZ_SYS_ETC}
67
68 %install
69 rm -rf %{buildroot}
70 %make_install
71 mkdir -p %{buildroot}/usr/share/license
72 cp %{_builddir}/%{buildsubdir}/LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
73 cp %{_builddir}/%{buildsubdir}/LICENSE.GPLv2 %{buildroot}/usr/share/license/print-driver-data
74 cat %{_builddir}/%{buildsubdir}/LICENSE.MIT >> %{buildroot}/usr/share/license/print-driver-data
75
76 %clean
77 rm -rf %{buildroot}
78
79 %post
80 /sbin/ldconfig
81
82 if ! [ -d %{TZ_SYS_ETC}/cups/ppd/hp ]
83 then
84         mkdir -p %{TZ_SYS_ETC}/cups/ppd/hp
85 fi
86 if ! [ -d %{TZ_SYS_ETC}/cups/ppd/epson ]
87 then
88         mkdir -p %{TZ_SYS_ETC}/cups/ppd/epson
89 fi
90 if ! [ -d %{TZ_SYS_ETC}/cups/ppd/samsung ]
91 then
92         mkdir -p %{TZ_SYS_ETC}/cups/ppd/samsung
93 fi
94 chown -R :%{TZ_SYS_USER_GROUP} %{TZ_SYS_ETC}/cups/ppd
95
96 %post -n print-driver-data
97 mkdir -p /usr/share/cups/model/samsung
98 ln -sf /usr/share/cups/ppd/samsung/cms /usr/share/cups/model/samsung/cms
99
100 %postun -n print-driver-data
101 if [ -e /usr/share/cups/model/samsung/cms ]
102 then
103         rm /usr/share/cups/model/samsung/cms
104 fi
105 if [ -f %{TZ_SYS_ETC}/cups/ppd/hp/hp.drv ]
106 then
107         rm %{TZ_SYS_ETC}/cups/ppd/hp/hp.drv
108 fi
109 if [ -f %{TZ_SYS_ETC}/cups/ppd/samsung/samsung.drv ]
110 then
111         rm %{TZ_SYS_ETC}/cups/ppd/samsung/samsung.drv
112 fi
113 if [ -f %{TZ_SYS_ETC}/cups/ppd/epson/epson.drv ]
114 then
115         rm %{TZ_SYS_ETC}/cups/ppd/epson/epson.drv
116 fi
117
118 %postun
119 /sbin/ldconfig
120
121
122 %files
123 %manifest print-service.manifest
124 %defattr(-,root,root,-)
125 %attr(0755,root,root) %{_bindir}/getppd
126 /usr/share/license/%{name}
127 %{_libdir}/*.so*
128 %exclude %{_libdir}/libopmap.so*
129
130 %files devel
131 %defattr(644,root,root,-)
132 %{_includedir}/print-service/*.h
133 %{_libdir}/pkgconfig/*
134
135 %files -n print-driver-data
136 %manifest print-driver-data.manifest
137 %defattr(-,root,root,-)
138 /usr/share/license/print-driver-data
139 %dir /usr/share/cups/ppd/
140 /usr/share/cups/ppd/*
141 %exclude %{TZ_SYS_ETC}/cups/ppd/hp_product.list
142 %exclude %{TZ_SYS_ETC}/cups/ppd/hp.list
143 %exclude %{TZ_SYS_ETC}/cups/ppd/epson.list
144 %exclude %{TZ_SYS_ETC}/cups/ppd/samsung.list
145
146 %files -n print-service-tests
147 %manifest print-service-tests.manifest
148 %defattr(-,root,root,-)
149 %{_bindir}/getppdvalue
150 %attr(0755,root,root) %{_bindir}/ppd_test.sh
151 %attr(0755,root,root) %{_bindir}/test-opmap
152 %attr(0755,root,root) %{_bindir}/print-test-opmap.sh
153 %{_libdir}/libopmap.so*
154 %attr(-,-,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_ETC}/cups/ppd/hp.list
155 %attr(-,-,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_ETC}/cups/ppd/hp_product.list
156 %attr(-,-,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_ETC}/cups/ppd/epson.list
157 %attr(-,-,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_ETC}/cups/ppd/samsung.list
158
159 %changelog
160