Tuesday, June 26, 2012

Edit Dependesi Paket .Deb

Pada saat saya akan menginstall driver printer Canon Pixma IP1980 ataupun IP1300 untuk Linux Mint Debian Edition ataupun Ubuntu baru ternyata membutuhkan dependensi libcupsys2, padahal dependensi tersebut sudah berganti nama di linux turunan debian menjadi libcups2. File-file deb tersebut bisa didownload di link bawah ini:
menghasilkan file:
cnijfilter-common_3.00-1_i386.deb  
cnijfilter-ip1900series_3.00-1_i386.deb
Nah didalam file tersebut di file controlnya kita bisa lihat dependesinya
Package: cnijfilter-common
Version: 3.00-1
Section: graphics
Priority: optional
Architecture: i386
Depends: libc6 (>= 2.3.4-1), libcupsys2 (>= 1.2.1), libpopt0 (>= 1.7)
Installed-Size: 152
Maintainer: Canon Inc. <sup-debian@list.canon.co.jp>
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.

Kita akan mengubahnya menjadi seperti ini:
Package: cnijfilter-common
Version: 3.00-1
Section: graphics
Priority: optional
Architecture: i386
Depends: libc6 (>= 2.3.4-1), libcups2 (>= 1.2.1), libpopt0 (>= 1.7)
Installed-Size: 152
Maintainer: Canon Inc. <sup-debian@list.canon.co.jp>
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.


Ok, untuk mengedit itu ternyata sangatlah mudah. Kita hanya perlu membuat script, simpan script dibawah ini di folder yang ada driver deb canon yang kita download tadi

#!/bin/bash

if [[ -z "$1" ]]; then
echo "Syntax: $0 debfile"
exit 1
fi

DEBFILE="$1"
TMPDIR=`mktemp -d /tmp/deb.XXXXXXXXXX` || exit 1
OUTPUT=`basename "$DEBFILE" .deb`.modfied.deb

if [[ -e "$OUTPUT" ]]; then
echo "$OUTPUT exists."
rm -r "$TMPDIR"
exit 1
fi

dpkg-deb -x "$DEBFILE" "$TMPDIR"
dpkg-deb --control "$DEBFILE" "$TMPDIR"/DEBIAN

if [[ ! -e "$TMPDIR"/DEBIAN/control ]]; then
echo DEBIAN/control not found.

rm -r "$TMPDIR"
exit 1
fi

CONTROL="$TMPDIR"/DEBIAN/control

MOD=`stat -c "%y" "$CONTROL"`
vi "$CONTROL"

if [[ "$MOD" == `stat -c "%y" "$CONTROL"` ]]; then
echo Not modfied.
else
echo Building new deb...
dpkg -b "$TMPDIR" "$OUTPUT"
fi

rm -r "$TMPDIR"

misalnya kita simpan dengan nama editdeb
Buat menjadi file executable
chmod +x editdeb


Edit cnijfilter-common_3.00-1_i386.deb
./editdeb cnijfilter-common_3.00-1_i386.deb 

Tampil

Package: cnijfilter-common
Version: 3.00-1
Section: graphics
Priority: optional
Architecture: i386
Depends: libc6 (>= 2.3.4-1), libcupsys2 (>= 1.2.1), libpopt0 (>= 1.7)
Installed-Size: 152
Maintainer: Canon Inc. <sup-debian@list.canon.co.jp>
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.


Ubah menjadi

Package: cnijfilter-common
Version: 3.00-1
Section: graphics
Priority: optional
Architecture: i386
Depends: libc6 (>= 2.3.4-1), libcups2 (>= 1.2.1), libpopt0 (>= 1.7)
Installed-Size: 152
Maintainer: Canon Inc. <sup-debian@list.canon.co.jp>
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.


Simpan dengan perintah Esc, :wq, Enter

Edit  cnijfilter-ip1900series_3.00-1_i386.deb
./editdeb cnijfilter-ip1900series_3.00-1_i386.deb

Akan tampil

Package: cnijfilter-ip1900series
Version: 3.00-1
Section: graphics
Priority: optional
Architecture: i386
Depends: libatk1.0-0 (>= 1.9.0), libc6 (>= 2.3.4-1), libcairo2 (>= 1.0.2-2), libcupsys2 (>= 1.2.1), libfontconfig1 (>= 2.3.0), libglib2.0-0 (>= 2.10.0), libgtk2.0-0 (>= 2.8.0), libpango1.0-0 (>= 1.12.3), libpng12-0 (>= 1.2.8rel), libpopt0 (>= 1.7), libtiff4, libx11-6, libxcursor1 (>> 1.1.2), libxext6, libxfixes3, libxi6, libxinerama1, libxml2 (>= 2.6.24), libxrandr2, libxrender1, cnijfilter-common (>= 3.00)
Installed-Size: 8764
Maintainer: Canon Inc. <sup-debian@list.canon.co.jp>
Source: cnijfilter-common
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.


Sehingga menjadi

Package: cnijfilter-ip1900series
Version: 3.00-1
Section: graphics
Priority: optional
Architecture: i386
Depends: libatk1.0-0 (>= 1.9.0), libc6 (>= 2.3.4-1), libcairo2 (>= 1.0.2-2), libcups2 (>= 1.2.1), libfontconfig1 (>= 2.3.0), libglib2.0-0 (>= 2.10.0), libgtk2.0-0 (>= 2.8.0), libpango1.0-0 (>= 1.12.3), libpng12-0 (>= 1.2.8rel), libpopt0 (>= 1.7), libtiff4, libx11-6, libxcursor1 (>> 1.1.2), libxext6, libxfixes3, libxi6, libxinerama1, libxml2 (>= 2.6.24), libxrandr2, libxrender1, cnijfilter-common (>= 3.00)
Installed-Size: 8764
Maintainer: Canon Inc. <sup-debian@list.canon.co.jp>
Source: cnijfilter-common
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.


Sehingga akan dihasilkan 2 file
cnijfilter-common_3.00-1_i386.modfied.deb
cnijfilter-ip1900series_3.00-1_i386.modfied.deb

Nah kedua file tersebut sudah benar dependensinya, kita tinggal menginstallnya

Semoga bermanfaat


Dari : patenpisan.com dengan sedikit perubahan