source: spec/trunk/SPECS/hplip.spec@ 1036

Last change on this file since 1036 was 828, checked in by Silvan Scherrer, 9 years ago

spec: added first hplip version

File size: 9.8 KB
Line 
1#define svn_url e:/trees/hplip/trunk
2%define svn_url http://svn.netlabs.org/repos/ports/hplip/trunk
3%define svn_rev 1600
4
5%define without_sane 1
6%define without_dbus 1
7%define without_fax 1
8
9Summary: HP Linux Imaging and Printing Project
10Name: hplip
11Version: 3.16.3
12Release: 1%{?dist}
13License: GPLv2+ and MIT and BSD
14
15Url: http://hplip.sourceforge.net/
16Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
17Vendor: bww bitwise works GmbH
18
19# @todo: decide if we need that to
20# if we do it as well, also remove the coment in the post section
21#Source1: hpcups-update-ppds.sh
22
23Requires: %{name}-libs = %{version}-%{release}
24#Requires: python-pillow
25Requires: cups
26#Requires: wget
27%if 0%{!?without_dbus:1}
28Requires: python-dbus
29%endif
30#Requires: gnupg
31# /usr/lib/udev/rules.d
32#Requires: systemd
33
34BuildRequires: autoconf automake libtool
35#BuildRequires: net-snmp-devel
36BuildRequires: cups-devel
37BuildRequires: python-devel
38BuildRequires: libjpeg-devel
39#BuildRequires: desktop-file-utils
40BuildRequires: libusb1-devel
41BuildRequires: openssl-devel
42%if 0%{!?without_sane:1}
43BuildRequires: sane-backends-devel
44%endif
45%if 0%{!?without_dbus:1}
46BuildRequires: pkgconfig(dbus-1)
47%endif
48
49# Make sure we get postscriptdriver tags.
50#BuildRequires: python-cups
51
52# macros: %%{_tmpfilesdir}, %%{_udevrulesdir}
53#BuildRequires: systemd
54
55# hpijs was merged into main package in 3.15.7-2
56Obsoletes: hpijs < 1:%{version}-%{release}
57Provides: hpijs = 1:%{version}-%{release}
58
59%description
60The Hewlett-Packard Linux Imaging and Printing Project provides
61drivers for HP printers and multi-function peripherals.
62
63%package common
64Summary: Files needed by the HPLIP printer and scanner drivers
65License: GPLv2+
66
67%description common
68Files needed by the HPLIP printer and scanner drivers.
69
70%package libs
71Summary: HPLIP libraries
72License: GPLv2+ and MIT
73Requires: %{name}-common = %{version}-%{release}
74Requires: python
75Obsoletes: %{name}-compat-libs < %{version}-%{release}
76
77%description libs
78Libraries needed by HPLIP.
79
80%package gui
81Summary: HPLIP graphical tools
82License: BSD
83Requires: python-PyQt4
84Requires: python-reportlab
85# hpssd.py
86#Requires: python-gobject
87Requires: %{name} = %{version}-%{release}
88%if 0%{!?without_sane:1}
89Requires: libsane-hpaio = %{version}-%{release}
90%endif
91
92%description gui
93HPLIP graphical tools.
94
95%if 0%{!?without_sane:1}
96%package -n libsane-hpaio
97Summary: SANE driver for scanners in HP's multi-function devices
98License: GPLv2+
99Obsoletes: libsane-hpoj < 0.91
100Provides: libsane-hpoj = 0.91
101Requires: sane-backends
102Requires: %{name}-libs = %{version}-%{release}
103
104%description -n libsane-hpaio
105SANE driver for scanners in HP's multi-function devices (from HPOJ).
106%endif
107
108%debug_package
109
110%prep
111%if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0}
112%setup -q
113%else
114%setup -n "%{name}-%{version}" -Tc
115svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
116rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
117(cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
118%endif
119
120
121%build
122# Work-around Makefile.am imperfections.
123sed -i 's|^AM_INIT_AUTOMAKE|AM_INIT_AUTOMAKE([foreign])|g' configure.in
124# Upstream uses old libtool, which causes problems (due to libhpmud requiring
125# libhpdiscovery) when we try to remove rpath from it.
126# Regenerating all autotools files works-around these rpath issues.
127autoreconf --verbose --force --install
128
129%configure \
130%if 0%{!?without_sane:1}
131 --enable-scan-build \
132%else
133 --disable-scan-build \
134%endif
135 --enable-gui-build \
136 --disable-foomatic-rip-hplip-install \
137 --enable-qt4 --enable-hpcups-install --enable-cups-drv-install \
138 --enable-foomatic-drv-install \
139 --enable-hpijs-install \
140%if 0%{!?without_fax:1}
141 --enable-fax-build \
142%else
143 --enable-fax-build=no \
144 --enable-dbus-build=no \
145%endif
146%if 0%{?without_dbus:1}
147 --enable-dbus-build=no \
148%endif
149 --disable-policykit --with-mimedir=%{_datadir}/cups/mime \
150 --disable-network-build --enable-shared --disable-static \
151 --with-cupsbackenddir=%{_cups_serverbin}/backend \
152 --with-cupsfilterdir=%{_cups_serverbin}/filter \
153 --with-icondir=%{_datadir}/applications \
154 --with-systraydir=%{_sysconfdir}/xdg/autostart
155
156make %{?_smp_mflags}
157
158
159%install
160mkdir -p %{buildroot}%{_bindir}
161make install DESTDIR=%{buildroot}
162
163# Remove unpackaged files
164rm -rf %{buildroot}%{_sysconfdir}/sane.d \
165 %{buildroot}%{_docdir} \
166 %{buildroot}%{_datadir}/hal \
167 %{buildroot}%{_datadir}/hplip/pkservice.py \
168 %{buildroot}%{_bindir}/hp-pkservice \
169 %{buildroot}%{_datadir}/applications \
170
171rm -f %{buildroot}%{_bindir}/hp-logcapture \
172 %{buildroot}%{_bindir}/hp-doctor \
173 %{buildroot}%{_datadir}/hplip/logcapture.py \
174 %{buildroot}%{_datadir}/hplip/doctor.py
175
176rm -f %{buildroot}%{_bindir}/foomatic-rip \
177 %{buildroot}%{_libdir}/cups/filter/foomatic-rip \
178 %{buildroot}%{_libdir}/*.la \
179 %{buildroot}%{python_sitearch}/*.la \
180 %{buildroot}%{_libdir}/sane/*.la \
181 %{buildroot}%{_datadir}/cups/model/foomatic-ppds \
182 %{buildroot}%{_datadir}/ppd/HP/*.ppd
183
184
185# Regenerate hpcups PPDs on upgrade if necessary (bug #579355).
186#install -p -m755 %{SOURCE1} %{buildroot}%{_bindir}/hpcups-update-ppds
187
188# Images in docdir should not be executable (bug #440552).
189find doc/images -type f -exec chmod 644 {} \;
190
191# Create an empty plugins directory to make sure it gets the right
192# SELinux file context (bug #564551).
193%{__mkdir_p} %{buildroot}%{_datadir}/hplip/prnt/plugins
194
195# Create an empty var/run/hplip directory
196%{__mkdir_p} %{buildroot}%{_localstatedir}/run/hplip
197
198# Remove files we don't want to package.
199rm -f %{buildroot}%{_datadir}/hplip/hpaio.desc
200rm -f %{buildroot}%{_datadir}/hplip/hplip-install
201rm -rf %{buildroot}%{_datadir}/hplip/install.*
202rm -f %{buildroot}%{_datadir}/hplip/uninstall.*
203rm -f %{buildroot}%{_bindir}/hp-uninstall
204rm -f %{buildroot}%{_datadir}/hplip/upgrade.*
205rm -f %{buildroot}%{_bindir}/hp-upgrade
206rm -f %{buildroot}%{_datadir}/hplip/hpijs.drv.in.template
207rm -f %{buildroot}%{_datadir}/cups/mime/pstotiff.types
208rm -f %{buildroot}%{_datadir}/hplip/fax/pstotiff*
209rm -rf %{buildroot}%{_libdir}/systemd
210
211# The systray applet doesn't work properly (displays icon as a
212# window), so don't ship the launcher yet.
213rm -rf %{buildroot}%{_sysconfdir}/xdg
214
215# as there is no devel package we don't ship the *.a files either
216rm -f %{buildroot}%{_libdir}/*.a \
217 %{buildroot}%{python_sitearch}/*.a
218
219%files
220%doc COPYING doc/*
221# ex-hpijs
222%{_bindir}/hpijs.exe
223# ex-hpijs
224#%{_bindir}/hpcups-update-ppds
225%{_bindir}/hp-align
226%{_bindir}/hp-clean
227%{_bindir}/hp-colorcal
228%{_bindir}/hp-config_usb_printer
229%{_bindir}/hp-devicesettings
230%{_bindir}/hp-diagnose_plugin
231%{_bindir}/hp-diagnose_queues
232%{_bindir}/hp-fab
233%{_bindir}/hp-faxsetup
234%{_bindir}/hp-firmware
235%{_bindir}/hp-info
236%{_bindir}/hp-levels
237%{_bindir}/hp-linefeedcal
238%{_bindir}/hp-makecopies
239%{_bindir}/hp-makeuri
240%{_bindir}/hp-plugin
241%{_bindir}/hp-pqdiag
242%{_bindir}/hp-printsettings
243%{_bindir}/hp-probe
244%{_bindir}/hp-query
245%{_bindir}/hp-scan
246%{_bindir}/hp-sendfax
247%{_bindir}/hp-setup
248%{_bindir}/hp-testpage
249%{_bindir}/hp-timedate
250%{_bindir}/hp-unload
251%{_bindir}/hp-wificonfig
252%{_cups_serverbin}/backend/*.exe
253# ex-hpijs
254%{_cups_serverbin}/filter/*.exe
255%{_cups_serverbin}/filter/hpps
256%{_cups_serverbin}/filter/pstotiff
257# ex-hpijs
258%{_datadir}/cups/drv/*
259%if 0%{!?without_fax:1}
260%{_datadir}/cups/mime/pstotiff.convs
261%endif
262# Files
263%{_datadir}/hplip/align.py*
264%{_datadir}/hplip/check-plugin.py*
265%{_datadir}/hplip/clean.py*
266%{_datadir}/hplip/colorcal.py*
267%{_datadir}/hplip/config_usb_printer.py*
268%{_datadir}/hplip/devicesettings.py*
269%{_datadir}/hplip/diagnose_plugin.py*
270%{_datadir}/hplip/diagnose_queues.py*
271%{_datadir}/hplip/fab.py*
272%if 0%{!?without_fax:1}
273%{_datadir}/hplip/fax
274%endif
275%{_datadir}/hplip/faxsetup.py*
276%{_datadir}/hplip/firmware.py*
277%{_datadir}/hplip/hpdio.py*
278%{_datadir}/hplip/hplip_clean.sh
279%{_datadir}/hplip/hpssd*
280%{_datadir}/hplip/info.py*
281%{_datadir}/hplip/__init__.py*
282%{_datadir}/hplip/levels.py*
283%{_datadir}/hplip/linefeedcal.py*
284%{_datadir}/hplip/makecopies.py*
285%{_datadir}/hplip/makeuri.py*
286%{_datadir}/hplip/plugin.py*
287%{_datadir}/hplip/pqdiag.py*
288%{_datadir}/hplip/printsettings.py*
289%{_datadir}/hplip/probe.py*
290%{_datadir}/hplip/query.py*
291%{_datadir}/hplip/scan.py*
292%{_datadir}/hplip/sendfax.py*
293%{_datadir}/hplip/setup.py*
294%{_datadir}/hplip/testpage.py*
295%{_datadir}/hplip/timedate.py*
296%{_datadir}/hplip/unload.py*
297%{_datadir}/hplip/wificonfig.py*
298# Directories
299%{_datadir}/hplip/base
300%{_datadir}/hplip/copier
301%{_datadir}/hplip/data/ldl
302%{_datadir}/hplip/data/localization
303%{_datadir}/hplip/data/pcl
304%{_datadir}/hplip/data/ps
305%{_datadir}/hplip/installer
306%{_datadir}/hplip/pcard
307%{_datadir}/hplip/prnt
308%if 0%{!?without_sane:1}
309%{_datadir}/hplip/scan
310%endif
311%{_datadir}/ppd
312#%{_sharedstatedir}/hp
313%dir %attr(0775,root,lp) %{_localstatedir}/run/hplip
314#%{_tmpfilesdir}/hplip.conf
315%{_sysconfdir}/udev/rules.d/56-hpmud.rules
316
317%files common
318%license COPYING
319%dir %{_sysconfdir}/hp
320%config(noreplace) %{_sysconfdir}/hp/hplip.conf
321%dir %{_datadir}/hplip
322%dir %{_datadir}/hplip/data
323%{_datadir}/hplip/data/models
324
325%files libs
326%{_libdir}/hpip*.dll
327#%{_libdir}/hpdis*.dll
328%{_libdir}/hpmud*.dll
329# Python extension
330%{python_sitearch}/*.dll
331
332%files gui
333%{_bindir}/hp-check
334%{_bindir}/hp-print
335%{_bindir}/hp-systray
336%{_bindir}/hp-toolbox
337#%{_datadir}/applications/*.desktop
338# Files
339%{_datadir}/hplip/check.py*
340%{_datadir}/hplip/print.py*
341%{_datadir}/hplip/systray.py*
342%{_datadir}/hplip/toolbox.py*
343# Directories
344%{_datadir}/hplip/data/images
345%{_datadir}/hplip/ui4
346
347%if 0%{!?without_sane:1}
348%files -n libsane-hpaio
349%{_libdir}/sane/sane-*.dll
350%endif
351
352%post
353#%{_bindir}/hpcups-update-ppds &>/dev/null ||:
354
355#%post libs -p /sbin/ldconfig
356
357#%postun libs -p /sbin/ldconfig
358
359%changelog
360* Mon Jun 13 2016 Silvan Scherrer <silvan.scherrer@aroa.ch> - 3.16.3-1
361- initial port
Note: See TracBrowser for help on using the repository browser.