From b1bebc13fbaffd6df47791911d2b3fe414f85d4e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 30 Jun 2013 10:52:58 +0200 Subject: cnijfilter: just a try (don't work for now) --- Makefile | 4 + cnijfilter.patch | 65 ++++++++++ cnijfilter.spec | 358 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 427 insertions(+) create mode 100644 Makefile create mode 100644 cnijfilter.patch create mode 100755 cnijfilter.spec diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1e65467 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../common/Makefile + diff --git a/cnijfilter.patch b/cnijfilter.patch new file mode 100644 index 0000000..9b92400 --- /dev/null +++ b/cnijfilter.patch @@ -0,0 +1,65 @@ +--- cnijfilter/src/bjfimage.c~ 2012-03-22 02:50:19.000000000 +0100 ++++ cnijfilter/src/bjfimage.c 2013-06-30 09:52:58.983829234 +0200 +@@ -1574,7 +1574,7 @@ + goto onErr; + } + +- if (setjmp (png_p->jmpbuf)) ++ if (setjmp (png_jmpbuf(png_p))) + { + png_destroy_read_struct(&png_p, &info_p, (png_infopp)NULL); + goto onErr; +diff -up cngpijmon/src/bjcupsmon_cups.c.old cngpijmon/src/bjcupsmon_cups.c +--- cngpijmon/src/bjcupsmon_cups.c.old 2013-06-30 10:02:28.794835687 +0200 ++++ cngpijmon/src/bjcupsmon_cups.c 2013-06-30 10:05:04.473382677 +0200 +@@ -17,8 +17,11 @@ + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + ++#define _IPP_PRIVATE_STRUCTURES ++ + /*** Includes ***/ + #include ++#include + #include + #include + #include +diff -up cngpij/cngpij/bjcups.c.old cngpij/cngpij/bjcups.c +--- cngpij/cngpij/bjcups.c.old 2013-06-30 10:10:42.377568925 +0200 ++++ cngpij/cngpij/bjcups.c 2013-06-30 10:11:08.554660902 +0200 +@@ -21,7 +21,10 @@ + #include + #endif // HAVE_CONFIG_H + ++#define _IPP_PRIVATE_STRUCTURES ++ + #include ++#include + #include + #include + #include +diff -up cngpijmnt/src/main.c.old cngpijmnt/src/main.c +--- cngpijmnt/src/main.c.old 2013-06-30 10:14:15.491317557 +0200 ++++ cngpijmnt/src/main.c 2013-06-30 10:14:31.777374754 +0200 +@@ -21,7 +21,10 @@ + #include + #endif // HAVE_CONFIG_H + ++#define _IPP_PRIVATE_STRUCTURES ++ + #include ++#include + #include + #include + #include +diff -up backend/src/cnij_backend_common.c.old backend/src/cnij_backend_common.c +--- backend/src/cnij_backend_common.c.old 2013-06-30 10:17:53.103081606 +0200 ++++ backend/src/cnij_backend_common.c 2013-06-30 10:18:01.226110208 +0200 +@@ -37,6 +37,7 @@ + + // CUPS Header + #include ++#include + #include + + // Header file for CANON diff --git a/cnijfilter.spec b/cnijfilter.spec new file mode 100755 index 0000000..7ee0cd4 --- /dev/null +++ b/cnijfilter.spec @@ -0,0 +1,358 @@ +%bcond_with prepare_fastbuild +%bcond_with fastbuild +%bcond_with build_common_package + +%global MODEL mg2200 +%global MODEL_NUM 402 + +%define VERSION 3.80 +%define RELEASE 1 + +%define _arc %(getconf LONG_BIT) + +%define _cupsbindir /usr/lib/cups +%define _cupsbindir64 /usr/lib64/cups + +%define _prefix /usr/local +%define _bindir %{_prefix}/bin +%define _ppddir /usr + +%define CNBP_LIBS libcnbpcmcm libcnbpcnclapi libcnbpcnclbjcmd libcnbpcnclui libcnbpess libcnbpo +%define COM_LIBS libcnnet +%define PRINT_PKG_PROGRAM ppd cnijfilter maintenance lgmon cngpijmon + +%define PKG %{MODEL}series + +Summary: IJ Printer Driver Ver.%{VERSION} for Linux +Name: cnijfilter-%{PKG} +Version: %{VERSION} +Release: %{RELEASE} +License: See the LICENSE*.txt file. +Vendor: CANON INC. +Group: Applications/Publishing + +Source0: cnijfilter-source-%{version}-%{release}.tar.gz +Patch0: cnijfilter.patch + +BuildRoot: %{_tmppath}/%{name}-root +BuildRequires: libtool +BuildRequires: gettext +BuildRequires: cups-devel +BuildRequires: gtk2-devel +BuildRequires: libpng-devel +BuildRequires: libxml2-devel +BuildRequires: libtiff-devel +BuildRequires: popt-devel + +Requires: cnijfilter-common >= %{version} +Requires: cups +Requires: popt + + +%package -n cnijfilter-common +Summary: IJ Printer Driver Ver.%{VERSION} for Linux +License: See the LICENSE*.txt file. +Vendor: CANON INC. +Group: Applications/Publishing +Requires: cups popt + + +%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. + +%description -n cnijfilter-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. + + +%prep +echo $RPM_BUILD_ROOT + +%if %{with fastbuild} +%setup -T -D -n cnijfilter-source-%{version}-%{RELEASE} +%else +%setup -q -n cnijfilter-source-%{version}-%{RELEASE} +%endif + +%patch0 -p0 + +%if ! %{with prepare_fastbuild} + +%if ! %{defined MODEL} +echo "#### Usage : rpmbuild -bb [spec file] --define=\"MODEL ipXXXX\" --define=\"MODEL_NUM YYY\" ####" +exit 1 +%endif + +%if ! %{defined MODEL_NUM} +echo "#### Usage : rpmbuild -bb [spec file] --define=\"MODEL ipXXXX\" --define=\"MODEL_NUM YYY\" ####" +exit 1 +%endif + +%endif + + +%build +%if %{with prepare_fastbuild} + +pushd ppd + ./autogen.sh --prefix=/usr --program-suffix=CN_IJ_MODEL +popd +pushd cnijfilter + ./autogen.sh --prefix=%{_prefix} --program-suffix=CN_IJ_MODEL --enable-libpath=%{_libdir}/bjlib --enable-binpath=%{_bindir} +popd +pushd maintenance + ./autogen.sh --prefix=%{_prefix} --program-suffix=CN_IJ_MODEL --datadir=%{_prefix}/share --enable-libpath=%{_libdir}/bjlib +popd +pushd lgmon + ./autogen.sh --prefix=%{_prefix} --program-suffix=CN_IJ_MODEL --enable-progpath=%{_bindir} +popd +pushd cngpijmon + ./autogen.sh --prefix=%{_prefix} --program-suffix=CN_IJ_MODEL --enable-progpath=%{_bindir} --datadir=%{_prefix}/share +popd + +%else + +%if %{with fastbuild} + for prg_name in %{PRINT_PKG_PROGRAM};do + pushd ${prg_name} + find . -name Makefile -print > file_lists + find . -name config.h -print >> file_lists + for fn in `cat file_lists`; do + if [ ! -f $fn.org ]; then + cp $fn $fn.org + fi + sed -e s/CN_IJ_MODEL_NUM/%{MODEL_NUM}/g $fn.org | sed -e s/CN_IJ_MODEL/%{MODEL}/ > cn_ij_tmp; mv cn_ij_tmp $fn + done + make clean + make + popd + done +%else +pushd ppd + ./autogen.sh --prefix=/usr --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 maintenance + ./autogen.sh --prefix=%{_prefix} --program-suffix=%{MODEL} --datadir=%{_prefix}/share --enable-libpath=%{_libdir}/bjlib + make clean + 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=%{_prefix}/share + make clean + make +popd +%endif + +%endif + + +pushd libs + ./autogen.sh --prefix=%{_prefix} +popd + +pushd cngpij + ./autogen.sh --prefix=%{_prefix} --enable-progpath=%{_bindir} +popd + +pushd cngpijmnt + ./autogen.sh --prefix=%{_prefix} --enable-progpath=%{_bindir} +popd + +pushd pstocanonij + ./autogen.sh --prefix=/usr --enable-progpath=%{_bindir} +popd + +pushd backend + ./autogen.sh --prefix=/usr +popd + +pushd backendnet + ./autogen.sh --prefix=%{_prefix} --enable-libpath=%{_libdir}/bjlib --enable-progpath=%{_bindir} LDFLAGS="-L../../com/libs_bin%{_arc}" +popd + +pushd cngpijmon/cnijnpr + ./autogen.sh --prefix=%{_prefix} --enable-libpath=%{_libdir}/bjlib +popd +make + + +%install +# make and install files for printer packages +pushd ppd + make install DESTDIR=${RPM_BUILD_ROOT} +popd + +pushd cnijfilter + make install DESTDIR=${RPM_BUILD_ROOT} +popd + +pushd maintenance + make install DESTDIR=${RPM_BUILD_ROOT} +popd + +pushd lgmon + make install DESTDIR=${RPM_BUILD_ROOT} +popd + +pushd cngpijmon + make install DESTDIR=${RPM_BUILD_ROOT} +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}%{_cupsbindir64}/filter +mkdir -p ${RPM_BUILD_ROOT}%{_cupsbindir64}/backend +mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/share/cups/model +mkdir -p ${RPM_BUILD_ROOT}/etc/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 755 ${RPM_BUILD_ROOT}%{_cupsbindir}/filter/pstocanonij ${RPM_BUILD_ROOT}%{_cupsbindir64}/filter/pstocanonij +install -c -m 755 ${RPM_BUILD_ROOT}%{_cupsbindir}/backend/cnijusb ${RPM_BUILD_ROOT}%{_cupsbindir64}/backend/cnijusb +install -c -m 755 ${RPM_BUILD_ROOT}%{_cupsbindir}/backend/cnijnet ${RPM_BUILD_ROOT}%{_cupsbindir64}/backend/cnijnet + +install -c -m 644 etc/*.rules ${RPM_BUILD_ROOT}/etc/udev/rules.d/ + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%post +if [ -x /sbin/ldconfig ]; then + /sbin/ldconfig +fi + +%postun +# remove cnbp* libs +for LIBS in %{CNBP_LIBS} +do + if [ -h %{_libdir}/${LIBS}%{MODEL_NUM}.so ]; then + rm -f %{_libdir}/${LIBS}%{MODEL_NUM}.so + fi +done +# remove directory +if [ "$1" = 0 ] ; then + rmdir -p --ignore-fail-on-non-empty %{_prefix}/share/locale/*/LC_MESSAGES + rmdir -p --ignore-fail-on-non-empty %{_prefix}/share/cngpijmon%{MODEL} + rmdir -p --ignore-fail-on-non-empty %{_prefix}/share/maintenance%{MODEL} + rmdir -p --ignore-fail-on-non-empty %{_bindir} +fi +if [ -x /sbin/ldconfig ]; then + /sbin/ldconfig +fi + +%post -n cnijfilter-common +if [ -e /usr/lib64/cups/backend/usb ] ; then + rm -f /usr/lib/cups/filter/pstocanonij + rm -f /usr/lib/cups/backend/cnijusb + rm -f /usr/lib/cups/backend/cnijnet + rmdir -p --ignore-fail-on-non-empty /usr/lib/cups/filter + rmdir -p --ignore-fail-on-non-empty /usr/lib/cups/backend +elif [ -e /usr/lib/cups/backend/usb ] ; then + rm -f /usr/lib64/cups/filter/pstocanonij + rm -f /usr/lib64/cups/backend/cnijusb + rm -f /usr/lib64/cups/backend/cnijnet + rmdir -p --ignore-fail-on-non-empty /usr/lib64/cups/filter + rmdir -p --ignore-fail-on-non-empty /usr/lib64/cups/backend +fi +if [ -x /sbin/ldconfig ]; then + /sbin/ldconfig +fi +if [ -x /sbin/udevadm ]; then + /sbin/udevadm control --reload-rules 2> /dev/null + /sbin/udevadm trigger --action=add --subsystem-match=usb 2> /dev/null +fi + +%postun -n cnijfilter-common +for LIBS in %{COM_LIBS} +do + if [ -h %{_libdir}/${LIBS}.so ]; then + rm -f %{_libdir}/${LIBS}.so + fi +done +if [ "$1" = 0 ] ; then + rmdir -p --ignore-fail-on-non-empty %{_libdir}/bjlib +fi +if [ -x /sbin/ldconfig ]; then + /sbin/ldconfig +fi + + +%files +%defattr(-,root,root) +%{_bindir}/cngpijmon%{MODEL} +%{_bindir}/lgmon%{MODEL} +%{_bindir}/maintenance%{MODEL} +%{_ppddir}/share/cups/model/canon%{MODEL}.ppd +%{_prefix}/share/locale/*/LC_MESSAGES/cngpijmon%{MODEL}.mo +%{_prefix}/share/locale/*/LC_MESSAGES/maintenance%{MODEL}.mo +%{_prefix}/share/cngpijmon%{MODEL}/* +%{_prefix}/share/maintenance%{MODEL}/* + +%{_bindir}/cif%{MODEL} +%{_libdir}/libcnbp*%{MODEL_NUM}.so* +%{_libdir}/bjlib/cif%{MODEL}.conf +%{_libdir}/bjlib/cnb_%{MODEL_NUM}0.tbl +%{_libdir}/bjlib/cnbpname%{MODEL_NUM}.tbl + +%doc LICENSE-cnijfilter-%{VERSION}JP.txt +%doc LICENSE-cnijfilter-%{VERSION}EN.txt +%doc LICENSE-cnijfilter-%{VERSION}SC.txt +%doc LICENSE-cnijfilter-%{VERSION}FR.txt + +%doc lproptions/lproptions-%{MODEL}-%{VERSION}JP.txt +%doc lproptions/lproptions-%{MODEL}-%{VERSION}EN.txt +%doc lproptions/lproptions-%{MODEL}-%{VERSION}SC.txt +%doc lproptions/lproptions-%{MODEL}-%{VERSION}FR.txt + +%files -n cnijfilter-common +%defattr(-,root,root) +%{_cupsbindir}/filter/pstocanonij +%{_cupsbindir}/backend/cnijusb +%{_cupsbindir}/backend/cnijnet +%{_cupsbindir64}/filter/pstocanonij +%{_cupsbindir64}/backend/cnijusb +%{_cupsbindir64}/backend/cnijnet +%{_bindir}/cngpij +%{_bindir}/cngpijmnt +%{_bindir}/cnijnpr +%{_bindir}/cnijnetprn +%{_libdir}/libcnnet.so* +%attr(644, lp, lp) %{_libdir}/bjlib/cnnet.ini + +/etc/udev/rules.d/*.rules + +%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 +* Sun Jun 30 2013 Remi Collet - 3.80-1 +- add patch for fedora 19 build + -- cgit