cnijfilter/cnijfilter.spec

239 lines
6.2 KiB
RPMSpec
Raw Normal View History

%define _arc %(getconf LONG_BIT)
%define _cupsbindir %{_libdir}/cups
# available models: ip100 , mx710 , mx890 , mx370 , mx430 , mx510 , e600
%define MODEL mx370
# ip100) CNCL_LIB_ID=303;;
# mx710) CNCL_LIB_ID=394;;
# mx890) CNCL_LIB_ID=395;;
# mx370) CNCL_LIB_ID=396;;
# mx430) CNCL_LIB_ID=397;;
# mx510) CNCL_LIB_ID=398;;
# e600) CNCL_LIB_ID=399;;
%define MODEL_NUM 396
Name: cnijfilter
Version: 3.70
Release: 1mamba
Summary: CUPS Printer Drivers for Canon printers
Group: System/Spooling
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://support-au.canon.com.au/contents/AU/EN/0100411802.html
Source: http://gdlp01.c-wss.com/gds/8/0100004118/01/cnijfilter-source-%{version}-1.tar.gz
Patch0: cnijfilter-3.70-libpng-1.5.patch
Patch1: cnijfilter-3.70-cups-build.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libatk-devel
BuildRequires: libcairo-devel
BuildRequires: libcups-devel
BuildRequires: libfontconfig-devel
BuildRequires: libfreetype-devel
BuildRequires: libgdk-pixbuf-devel
BuildRequires: libglib-devel
BuildRequires: libgtk2-devel
BuildRequires: libpango-devel
BuildRequires: libpng-devel
BuildRequires: libpopt-devel
BuildRequires: libtiff-devel
BuildRequires: libxml2-devel
## AUTOBUILDREQ-END
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
IJ Printer Driver for Linux.
This IJ Printer Driver provides printing functions for Canon Inkjet printers operating under the CUPS (Common UNIX Printing System) environment.
%package %{MODEL}series
Summary: CUPS Printers Driver for Canon %{MODEL} printers
License: GPL
Group: System/Spooling
Requires: %{name}-common = %{version}-%{release}
%description %{MODEL}series
IJ Printer Driver for Linux.
This IJ Printer Driver provides printing functions for Canon Inkjet printers operating under the CUPS (Common UNIX Printing System) environment.
This package contains the CUPS Printers Driver for Canon %{MODEL} printers.
%package common
Summary: Common files used by CUPS Printers Driver for Canon printers
License: GPL
Group: System/Spooling
Requires: cups
Requires(post):udev
%description common
IJ Printer Driver for Linux.
This IJ Printer Driver provides printing functions for Canon Inkjet printers operating under the CUPS (Common UNIX Printing System) environment.
This package contains common files used by CUPS Printers Driver for Canon printers.
%prep
%setup -q -n %{name}-source-%{version}-1
%patch0 -p0
%patch1 -p1
%build
pushd ppd
./autogen.sh --prefix=%{_prefix} --program-suffix=%MODEL
make clean
make
popd
pushd cnijfilter
./autogen.sh --prefix=%{_prefix} --program-suffix=%MODEL --enable-libpath=%{_libdir}/bjlib --enable-binpath=%{_bindir}
make clean
make
popd
pushd printui
./autogen.sh --prefix=%{_prefix} --program-suffix=%MODEL --datadir=%{_prefix}/share --enable-libpath=%{_libdir}/bjlib
make clean
make || make
popd
pushd lgmon
./autogen.sh --prefix=%{_prefix} --program-suffix=%MODEL --enable-progpath=%{_bindir}
make clean
make
popd
pushd cngpijmon
./autogen.sh --prefix=%{_prefix} --program-suffix=%MODEL --enable-progpath=%{_bindir} --datadir=%{_datadir}
make clean
make CFLAGS="-ldl"
popd
pushd libs
./autogen.sh --prefix=%{_prefix}
make
popd
pushd cngpij
./autogen.sh --prefix=%{_prefix} --enable-progpath=%{_bindir}
make
popd
pushd pstocanonij
./autogen.sh --prefix=%{_prefix} --enable-progpath=%{_bindir}
make
popd
pushd backend
./autogen.sh --prefix=%{_prefix}
make
popd
pushd backendnet
./autogen.sh --prefix=%{_prefix} --enable-libpath=%{_libdir}/bjlib --enable-progpath=%{_bindir} LDFLAGS="-L../../com/libs_bin%{_arc}"
make
popd
pushd cngpijmon/cnijnpr
./autogen.sh --prefix=%{_prefix} --enable-libpath=%{_libdir}/bjlib
make CFLAGS="-ldl"
popd
make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
# make and install files for printer packages
pushd ppd
%makeinstall
popd
pushd cnijfilter
%makeinstall
popd
pushd printui
%makeinstall
popd
pushd lgmon
%makeinstall
popd
pushd cngpijmon
%makeinstall
popd
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/bjlib
install -c -m 644 %{MODEL_NUM}/database/* ${RPM_BUILD_ROOT}%{_libdir}/bjlib
install -c -s -m 755 %{MODEL_NUM}/libs_bin%{_arc}/*.so.* ${RPM_BUILD_ROOT}%{_libdir}
mkdir -p ${RPM_BUILD_ROOT}%{_bindir}
mkdir -p ${RPM_BUILD_ROOT}%{_cupsbindir}/filter
mkdir -p ${RPM_BUILD_ROOT}%{_cupsbindir}/backend
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/cups/model
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/udev/rules.d/
install -c -m 644 com/ini/cnnet.ini ${RPM_BUILD_ROOT}%{_libdir}/bjlib
make install DESTDIR=${RPM_BUILD_ROOT}
install -c -s -m 755 com/libs_bin%{_arc}/*.so.* ${RPM_BUILD_ROOT}%{_libdir}
install -c -m 644 etc/*.rules ${RPM_BUILD_ROOT}/etc/udev/rules.d/
%find_lang cngpijmon%{MODEL}
%find_lang printui%{MODEL}
cat cngpijmon%{MODEL}.lang printui%{MODEL}.lang > %{name}.lang
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post %{MODEL}series
/sbin/ldconfig
:
%postun %{MODEL}series
/sbin/ldconfig
:
%post common
if [ $1 -ge 1 ]; then
/sbin/ldconfig
/sbin/udevadm control --reload-rules 2> /dev/null
/sbin/udevadm trigger --action=add --subsystem-match=usb 2> /dev/null
fi
:
%postun common
/sbin/ldconfig
:
%files %{MODEL}series -f %{name}.lang
%defattr(-,root,root)
%{_bindir}/cif%{MODEL}
%{_bindir}/cngpijmon%{MODEL}
%{_bindir}/lgmon%{MODEL}
%{_bindir}/printui%{MODEL}
%{_libdir}/libcnbp*%{MODEL_NUM}.so*
%{_libdir}/bjlib/cif%{MODEL}.conf
%{_libdir}/bjlib/cnb_%{MODEL_NUM}0.tbl
%{_libdir}/bjlib/cnbpname%{MODEL_NUM}.tbl
%{_datadir}/cups/model/canon%{MODEL}.ppd
%{_datadir}/cngpijmon%{MODEL}/*
%{_datadir}/printui%{MODEL}/*
%files common
%defattr(-,root,root)
%{_sysconfdir}/udev/rules.d/*.rules
%{_cupsbindir}/filter/pstocanonij
%{_cupsbindir}/backend/cnijusb
%{_cupsbindir}/backend/cnijnet
%{_bindir}/cngpij
%{_bindir}/cnijnpr
%{_bindir}/cnijnetprn
%{_libdir}/libcnnet.so*
%attr(644, lp, lp) %{_libdir}/bjlib/cnnet.ini
%doc LICENSE-cnijfilter-%{version}JP.txt
%doc LICENSE-cnijfilter-%{version}EN.txt
%doc LICENSE-cnijfilter-%{version}SC.txt
%doc LICENSE-cnijfilter-%{version}FR.txt
%changelog
* Fri Sep 28 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 1-1mamba
- package created by autospec