Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

echo "BEMATECH"
echo "BEMATECH CUPS Driver 1.0.0 Removing Start"
echo "---------------------------------------"
echo ""

if [ -e /usr/lib/cups/filter/rastertobema ]
then
echo "Removing rastertobema"
rm -f /usr/lib/cups/filter/rastertobema
fi

if [ -d /usr/share/cups/model/BEMATECH ]
then
echo "Removing dir .../cups/model/BEMATECH"
rm -rf /usr/share/cups/model/BEMATECH
fi

echo "Removing Complete!!!"
echo ""

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh

echo "BEMATECH"
echo "BEMATECH CUPS Driver 1.0.0 Removing Start"
echo "---------------------------------------"
echo ""

if [ -z $1 ]
then
echo "Please Set Destination Directory in order for us to remove ppd files"
echo "(ex)"
echo "#>./remove.ubuntu /usr/share/ppd/gutenprint/5.0/en [Enter]"
echo ""
exit 1
fi

if [ -e /usr/lib/cups/filter/rastertobema ]
then
echo "Removing rastertobema"
rm -f /usr/lib/cups/filter/rastertobema
fi

if [ -d /usr/share/cups/model/BEMATECH ]
then
echo "Removing dir .../cups/model/BEMATECH"
rm -rf /usr/share/cups/model/BEMATECH
else
echo "Removing ppd files...."
rm -rf $1/MP-2500TH.ppd.gz
fi

echo "Removing Complete!!!"
echo ""

Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#!/bin/sh

echo "BEMATECH"
echo "BEMATECH CUPS Driver 1.0.0 installation Start"
echo "---------------------------------------"
echo ""
echo "Models included:"
echo " BEMATECH MP-2500TH"

ROOT_UID=0

if [ -z $RPMBUILD ] && [ "$UID" -ne "$ROOT_UID" ]
then
echo "This script requires root user access."
echo "Re-run as root user."
exit 1
fi

if [ ! -z $DESTDIR ]
then
echo "DESTDIR set to $DESTDIR"
echo ""
fi

SERVERROOT=$(grep '^ServerRoot' /etc/cups/cupsd.conf | awk '{print $2}')

if [ -z $FILTERDIR ] || [ -z $PPDDIR ]
then
echo "Searching for ServerRoot, ServerBin, and DataDir tags in /etc/cups/cupsd.conf"
echo ""

if [ -z $FILTERDIR ]
then
SERVERBIN=$(grep '^ServerBin' /etc/cups/cupsd.conf | awk '{print $2}')

if [ -z $SERVERBIN ]
then
echo "ServerBin tag not present in cupsd.conf - using default"
FILTERDIR=usr/lib/cups/filter
elif [ ${SERVERBIN:0:1} = "/" ]
then
echo "ServerBin tag is present as an absolute path"
FILTERDIR=$SERVERBIN/filter
else
echo "ServerBin tag is present as a relative path - appending to ServerRoot"
FILTERDIR=$SERVERROOT/$SERVERBIN/filter
fi
fi

echo ""

if [ -z $PPDDIR ]
then
DATADIR=$(grep '^DataDir' /etc/cups/cupsd.conf | awk '{print $2}')

if [ -z $DATADIR ]
then
echo "DataDir tag not present in cupsd.conf - using default"
PPDDIR=/usr/share/cups/model/BEMATECH
elif [ ${DATADIR:0:1} = "/" ]
then
echo "DataDir tag is present as an absolute path"
PPDDIR=$DATADIR/model/BEMATECH
else
echo "DataDir tag is present as a relative path - appending to ServerRoot"
PPDDIR=$SERVERROOT/$DATADIR/model/BEMATECH
fi
fi

echo ""

echo "ServerRoot = $SERVERROOT"
echo "ServerBin = $SERVERBIN"
echo "DataDir = $DATADIR"
echo ""
fi

echo "Copying rastertobema filter to $DESTDIR/$FILTERDIR"
mkdir -p $DESTDIR/$FILTERDIR
chmod +x rastertobema
cp rastertobema $DESTDIR/$FILTERDIR
echo ""

echo "Copying Model PPD files to $DESTDIR/$PPDDIR"
mkdir -p $DESTDIR/$PPDDIR
cp *.gz $DESTDIR/$PPDDIR
echo ""

if [ -z $RPMBUILD ]
then
echo "Restarting CUPS"
if [ -x /etc/software/init.d/cups ]
then
/etc/software/init.d/cups stop
/etc/software/init.d/cups start
elif [ -x /etc/rc.d/init.d/cups ]
then
/etc/rc.d/init.d/cups stop
/etc/rc.d/init.d/cups start
elif [ -x /etc/init.d/cups ]
then
/etc/init.d/cups stop
/etc/init.d/cups start
elif [ -x /sbin/init.d/cups ]
then
/sbin/init.d/cups stop
/sbin/init.d/cups start
elif [ -x /etc/software/init.d/cupsys ]
then
/etc/software/init.d/cupsys stop
/etc/software/init.d/cupsys start
elif [ -x /etc/rc.d/init.d/cupsys ]
then
/etc/rc.d/init.d/cupsys stop
/etc/rc.d/init.d/cupsys start
elif [ -x /etc/init.d/cupsys ]
then
/etc/init.d/cupsys stop
/etc/init.d/cupsys start
elif [ -x /sbin/init.d/cupsys ]
then
/sbin/init.d/cupsys stop
/sbin/init.d/cupsys start
else
echo "Could not restart CUPS"
fi
echo ""
fi

echo "Install Complete"
echo "Add printer queue using K Menu -> Utilities -> Printing -> Printing Manager, or"
echo "Add printer queue using OS tool, http://localhost:631, or http://127.0.0.1:631"
echo ""

Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#!/bin/sh

echo "BEMATECH"
echo "BEMATECH CUPS Driver 1.0.0 installation Start"
echo "---------------------------------------"
echo ""
echo "Models included:"
echo " BEMATECH MP-2500TH"

ROOT_UID=0

if [ -z $RPMBUILD ] && [ "$UID" -ne "$ROOT_UID" ]
then
echo "This script requires root user access."
echo "Re-run as root user."
exit 1
fi

if [ ! -z $DESTDIR ]
then
echo "DESTDIR set to $DESTDIR"
echo ""
fi

if [ -z $1 ]
then
echo "Please Set Destination Directory in order for us to copy ppd files"
echo "(ex)"
echo "#>./setup.ubuntu /usr/share/ppd/gutenprint/5.0/en [Enter]"
echo ""
exit 1
fi


SERVERROOT=$(grep '^ServerRoot' /etc/cups/cupsd.conf | awk '{print $2}')

if [ -z $FILTERDIR ] || [ -z $PPDDIR ]
then
echo "Searching for ServerRoot, ServerBin, and DataDir tags in /etc/cups/cupsd.conf"
echo ""

if [ -z $FILTERDIR ]
then
SERVERBIN=$(grep '^ServerBin' /etc/cups/cupsd.conf | awk '{print $2}')

if [ -z $SERVERBIN ]
then
echo "ServerBin tag not present in cupsd.conf - using default"
FILTERDIR=usr/lib/cups/filter
else
echo "ServerBin tag is present as a relative path - appending to ServerRoot"
FILTERDIR=$SERVERROOT/$SERVERBIN/filter
fi
fi

echo ""

if [ -z $PPDDIR ]
then
DATADIR=$(grep '^DataDir' /etc/cups/cupsd.conf | awk '{print $2}')

if [ -z $DATADIR ]
then
echo "DataDir tag not present in cupsd.conf - using default"
PPDDIR=$1
else
echo "DataDir tag is present as a relative path - appending to ServerRoot"
PPDDIR=$SERVERROOT/$DATADIR/model/BEMATECH
fi
fi

echo ""

echo "ServerRoot = $SERVERROOT"
echo "ServerBin = $SERVERBIN"
echo "DataDir = $DATADIR"
echo ""
fi

echo "Copying rastertobema filter to $DESTDIR/$FILTERDIR"
mkdir -p $DESTDIR/$FILTERDIR
chmod +x rastertobema
cp rastertobema $DESTDIR/$FILTERDIR
echo ""

echo "Copying Model PPD files to $DESTDIR/$PPDDIR"
mkdir -p $DESTDIR/$PPDDIR
cp *.gz $DESTDIR/$PPDDIR
echo ""

if [ -z $RPMBUILD ]
then
echo "Restarting CUPS"
if [ -x /etc/software/init.d/cups ]
then
/etc/software/init.d/cups stop
/etc/software/init.d/cups start
elif [ -x /etc/rc.d/init.d/cups ]
then
/etc/rc.d/init.d/cups stop
/etc/rc.d/init.d/cups start
elif [ -x /etc/init.d/cups ]
then
/etc/init.d/cups stop
/etc/init.d/cups start
elif [ -x /sbin/init.d/cups ]
then
/sbin/init.d/cups stop
/sbin/init.d/cups start
elif [ -x /etc/software/init.d/cupsys ]
then
/etc/software/init.d/cupsys stop
/etc/software/init.d/cupsys start
elif [ -x /etc/rc.d/init.d/cupsys ]
then
/etc/rc.d/init.d/cupsys stop
/etc/rc.d/init.d/cupsys start
elif [ -x /etc/init.d/cupsys ]
then
/etc/init.d/cupsys stop
/etc/init.d/cupsys start
elif [ -x /sbin/init.d/cupsys ]
then
/sbin/init.d/cupsys stop
/sbin/init.d/cupsys start
else
echo "Could not restart CUPS"
fi
echo ""
fi

echo "Install Complete"
echo "Add printer queue using K Menu -> Utilities -> Printing -> Printing Manager, or"
echo "Add printer queue using OS tool, http://localhost:631, or http://127.0.0.1:631"
echo ""

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
VPATH = src:ppd:bin

ppds = MP-2500TH.ppd.gz

DEFS=
LIBS=-lcupsimage -lcups

ifdef RPMBUILD
DEFS=-DRPMBUILD
LIBS=-ldl
endif

define dependencies
@if [ ! -e /usr/include/cups ]; then echo "CUPS headers not available - exiting"; exit 1; fi
@if ! (ls /usr/lib | grep libcups.* > /dev/null); then echo "libcups not available - exiting"; exit 1; fi
@if ! (ls /usr/lib | grep libcupsimage.* > /dev/null); then echo "libcupsimage not available - exiting"; exit 1; fi
endef

# define init
# @if [ ! -e bin ]; then echo "mkdir bin"; mkdir bin; fi
# endef

.PHONY: install
install: $(ppds)
@if [ ! -e install ]; then echo "Please run make package first."; exit 1; fi
# installing
cp ppd/*.gz install
cd install; exec ./setup

.PHONY: remove
remove:
#removing from default location (other locations require manual removal)
@if [ -e /usr/lib/cups/filter/rastertobema ]; then echo "Removing rastertobema"; rm -f /usr/lib/cups/filter/rastertobema; fi
@if [ -d /usr/share/cups/model/BEMATECH ]; then echo "Removing dir .../cups/model/BEMATECH"; rm -rf /usr/share/cups/model/BEMATECH; fi

.PHONY: help
help:
# Help for VENDOR THERMAL PRINTER CUPS Driver make utility usage
#
# command purpose
# ------------------------------------
# make install execute the setup shell script from the install directory [ root user permissions required ]
# make remove removes installed files from your system (assumes default install lication) [ root user permissions required ]

$(ppds): %.ppd.gz: %.ppd
# gzip ppd file
gzip -c $< >> ppd/$@

Loading