Permalink
Browse files

Moved files in /usr/lib/ to /usr/share as requested in issue #44

  • Loading branch information...
simoncadman committed Jan 11, 2014
1 parent 96bb561 commit def17bc1f4bb871fc5813d9b8029964cc82ca483
View
@@ -2,20 +2,25 @@ language: python
python:
- "2.6"
- "2.7"
+virtualenv:
+ system_site_packages: true
before_install:
- sudo apt-get update -qq
- - sudo apt-get install -qq debhelper autotools-dev cups-ppdc libcups2-dev cups
+ - sudo apt-get install -qq debhelper autotools-dev cups-ppdc libcups2-dev cups python-cups python-httplib2 imagemagick
- pip install httplib2 pycups pytest-cov --use-mirrors
install:
- ./configure
- sudo gpasswd -a `whoami` lpadmin
- sudo make install
- sudo cupsctl --debug-logging
- - sudo cp .coveragerc /usr/local/lib/cloudprint-cups/
+ - sudo cp .coveragerc /usr/local/share/cloudprint-cups/
- sudo cp testfiles/testppd.ppd /usr/share/cups/model/testppd.ppd
script:
- - cd /usr/local/lib/cloudprint-cups/
- - sudo chmod -R o+rw .
+ - cd /usr/local/share/cloudprint-cups/
+ - sudo chmod 777 .
+ - sudo chmod o+rw testfiles
+ - sudo ./upgrade.py
+ - sudo python -m compileall .
- py.test --cov .
- sudo cat /var/log/cups/cloudprint_log /var/log/cups/error_log
- sudo unlink /usr/share/cups/model/testppd.ppd
View
@@ -1,4 +1,5 @@
prefix = $(DESTDIR)@prefix@
+destprefix = @prefix@
srcdir = @srcdir@
INSTALL = @INSTALL@
cupsdriver = ${DESTDIR}@cupsserverpath@/driver/
@@ -9,24 +10,20 @@ cupsgroup = @cupsgroup@
all: backend.py
install: all
- mkdir -p ${prefix}/lib/cloudprint-cups/oauth2client
- mkdir -p ${prefix}/lib/cloudprint-cups/testfiles
- ${INSTALL} ${srcdir}/*.py ${prefix}/lib/cloudprint-cups/
- ${INSTALL} ${srcdir}/full-test.sh ${prefix}/lib/cloudprint-cups/
- ${INSTALL} -m 644 ${srcdir}/testfiles/* ${prefix}/lib/cloudprint-cups/testfiles/
- ${INSTALL} -m 644 ${srcdir}/oauth2client/*.py ${prefix}/lib/cloudprint-cups/oauth2client/
+ mkdir -p ${prefix}/share/cloudprint-cups/oauth2client
+ mkdir -p ${prefix}/share/cloudprint-cups/testfiles
+ ${INSTALL} ${srcdir}/*.py ${prefix}/share/cloudprint-cups/
+ ${INSTALL} ${srcdir}/full-test.sh ${prefix}/share/cloudprint-cups/
+ unlink ${prefix}/share/cloudprint-cups/pre-commit.py
+ ${INSTALL} -m 644 ${srcdir}/testfiles/* ${prefix}/share/cloudprint-cups/testfiles/
+ ${INSTALL} -m 644 ${srcdir}/oauth2client/*.py ${prefix}/share/cloudprint-cups/oauth2client/
mkdir -p ${cupsbackend}
mkdir -p ${cupsdriver}
mkdir -p ${cupsmodel}
- mkdir -p $(DESTDIR)/var/log/cups/
- touch $(DESTDIR)/var/log/cups/cloudprint_log
-ifeq ($(NOPERMS),1)
- ${INSTALL} ${srcdir}/backend.py ${cupsbackend}cloudprint
- ${INSTALL} ${srcdir}/dynamicppd.py ${cupsdriver}cupscloudprint
-else
- ${INSTALL} -g `groups root | cut -d' ' -f1` -o root -m 755 ${srcdir}/backend.py ${cupsbackend}cloudprint
- ${INSTALL} -g `groups root | cut -d' ' -f1` -o root -m 755 ${srcdir}/dynamicppd.py ${cupsdriver}cupscloudprint
- chown root:${cupsgroup} $(DESTDIR)/var/log/cups/cloudprint_log
- chown -R root:${cupsgroup} ${prefix}/lib/cloudprint-cups/
- chmod 660 $(DESTDIR)/var/log/cups/cloudprint_log
+ ln -f -s ${destprefix}/share/cloudprint-cups/backend.py ${cupsbackend}cloudprint
+ ln -f -s ${destprefix}/share/cloudprint-cups/dynamicppd.py ${cupsdriver}cupscloudprint
+ ${INSTALL} -m 644 ${srcdir}/README.md ${prefix}/share/cloudprint-cups/README.md
+ ${INSTALL} -m 644 ${srcdir}/COPYING ${prefix}/share/cloudprint-cups/COPYING
+ifneq ($(NOPERMS),1)
+ chown -R root:${cupsgroup} ${prefix}/share/cloudprint-cups/
endif
View
@@ -29,12 +29,12 @@ Follow configuration below.
CONFIGURATION
=============
-Run /usr/lib/cloudprint-cups/setupcloudprint.py ( or /usr/local/lib/cloudprint-cups/setupcloudprint.py ) and either allow it to add all
+Run /usr/share/cloudprint-cups/setupcloudprint.py ( or /usr/local/share/cloudprint-cups/setupcloudprint.py ) and either allow it to add all
Cloud Print printers at once, or say 'N', and add manually:
Add a new printer ( via http://127.0.0.1:631 or usual interface ) as a 'Google Cloud Print' network printer. Select the 'Make' as Google, and 'Model' as Cloud Print.
Supply the connection name as a simple URI pointing to the printer you want to setup, you can obtain a list of URIs from
-/usr/lib/cloudprint-cups/listcloudprinters.py ( or /usr/local/lib/cloudprint-cups/listcloudprinters.py ) :
+/usr/share/cloudprint-cups/listcloudprinters.py ( or /usr/local/share/cloudprint-cups/listcloudprinters.py ) :
Print a test page, to confirm it is working.
View
@@ -20,7 +20,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140105 180859"
+ CCPVersion = "20140111 152045"
print "CUPS Cloud Print CUPS Backend Version " + CCPVersion
sys.exit(0)
@@ -66,9 +66,9 @@ def getBackendDescription ( ) :
print getBackendDescription()
try:
- libpath = "/usr/local/lib/cloudprint-cups/"
+ libpath = "/usr/local/share/cloudprint-cups/"
if not os.path.exists( libpath ):
- libpath = "/usr/lib/cloudprint-cups"
+ libpath = "/usr/share/cloudprint-cups"
sys.path.insert(0, libpath)
from auth import Auth
from printer import Printer
@@ -148,9 +148,9 @@ def getBackendDescription ( ) :
ps2PdfName = "pstopdf"
convertToPDFParams = [ps2PdfName, printFile, pdfFile]
- submitjobpath = "/usr/lib/cloudprint-cups/" + "submitjob.py"
+ submitjobpath = "/usr/share/cloudprint-cups/" + "submitjob.py"
if not os.path.exists( submitjobpath ):
- submitjobpath = "/usr/local/lib/cloudprint-cups/" + "submitjob.py"
+ submitjobpath = "/usr/local/share/cloudprint-cups/" + "submitjob.py"
if not fileIsPDF( printFile ):
sys.stderr.write( "INFO: Converting print job to PDF\n")
View
@@ -21,7 +21,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140105 180859"
+ CCPVersion = "20140111 152045"
print "CUPS Cloud Print Delete Account Script Version " + CCPVersion
sys.exit(0)
View
@@ -19,13 +19,13 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140105 180859"
+ CCPVersion = "20140111 152045"
print "CUPS Cloud Print Dynamic PPD Generator Version " + CCPVersion
sys.exit(0)
-libpath = "/usr/local/lib/cloudprint-cups/"
+libpath = "/usr/local/share/cloudprint-cups/"
if not os.path.exists( libpath ):
- libpath = "/usr/lib/cloudprint-cups"
+ libpath = "/usr/share/cloudprint-cups"
sys.path.insert(0, libpath)
from auth import Auth
View
@@ -30,6 +30,12 @@ if [[ "`whoami`" == "root" ]]; then
hash start && ( start cups || cupsd )
fi
+if [[ "`whoami`" == "root" ]]; then
+ python -m compileall .
+else
+ sudo python -m compileall .
+fi
+
py.test2 || py.test
printers="`./dynamicppd.py list | cut -d'"' -f2`"
@@ -44,3 +50,5 @@ for printer in $printers; do
cupstestppd /tmp/test.ppd
done
done
+
+tail /var/log/cups/cloudprint_log
View
@@ -21,7 +21,7 @@
if len(sys.argv) == 2 and sys.argv[1] == 'version':
# line below is replaced on commit
- CCPVersion = "20140105 180859"
+ CCPVersion = "20140111 152045"
print "CUPS Cloud Print Printer Lister Version " + CCPVersion
sys.exit(0)
View
@@ -1,4 +0,0 @@
-post_upgrade() {
- chgrp lp /etc/cloudprint.conf
- /usr/lib/cloudprint-cups/upgrade.py
-}
View
@@ -1,15 +1,15 @@
# Maintainer: Simon Cadman <src@niftiestsoftware.com>
pkgname=cupscloudprint
-pkgver=20131013
+pkgver=20140107
pkgrel=1
pkgdesc="Print via Google Cloud print using CUPS"
arch=('any')
url="http://ccp.niftiestsoftware.com"
license=('GPL3')
depends=('cups' 'pycups' 'python2' 'ghostscript' 'python2-httplib2' 'imagemagick')
makedepends=('git')
-changelog=ChangeLog
-install=INSTALL
+changelog=changelog
+install=install
source=()
md5sums=()
_gitroot="git://github.com/simoncadman/CUPS-Cloud-Print.git"
File renamed without changes.
View
@@ -0,0 +1,9 @@
+post_upgrade() {
+ echo "Running post upgrade"
+ /usr/share/cloudprint-cups/upgrade.py
+}
+
+post_install() {
+ echo "Running post install"
+ /usr/share/cloudprint-cups/upgrade.py
+}
@@ -2,7 +2,7 @@ cupscloudprint for Debian
-------------------------
After installation, run:
- sudo /usr/lib/cloudprint-cups/setupcloudprint.py
+ sudo /usr/share/cloudprint-cups/setupcloudprint.py
To setup your printers.
-- simon cadman <src@niftiestsoftware.com> Wed, 14 Mar 2012 14:26:15 +0000
@@ -1,14 +1,15 @@
+INTRODUCTION
+============
+Google Cloud Print driver for CUPS, allows printing to printers hosted on Google Cloud Print ( see http://www.google.com/cloudprint for more information ).
+
INSTALLATION
============
-RPM/DEB/Ebuild INSTALL ( Recommended )
+PACKAGE INSTALL ( Recommended )
================================
-Download and install the package for your distro from https://github.com/simoncadman/CUPS-Cloud-Print/downloads .
-
-Refer to your own specific distribution instructions for how to install the package.
-
-Follow configuration below.
+The recommended way to install CUPS Cloud Print is using your package manager, please see http://ccp.niftiestsoftware.com/ for installation
+instructions.
SOURCE INSTALL
==============
@@ -26,17 +27,23 @@ Follow configuration below.
CONFIGURATION
=============
-Run /usr/lib/cloudprint-cups/setupcloudprint.py ( or /usr/local/lib/cloudprint-cups/setupcloudprint.py ) and either allow it to add all
+Run /usr/share/cloudprint-cups/setupcloudprint.py ( or /usr/local/share/cloudprint-cups/setupcloudprint.py ) and either allow it to add all
Cloud Print printers at once, or say 'N', and add manually:
Add a new printer ( via http://127.0.0.1:631 or usual interface ) as a 'Google Cloud Print' network printer. Select the 'Make' as Google, and 'Model' as Cloud Print.
Supply the connection name as a simple URI pointing to the printer you want to setup, you can obtain a list of URIs from
-/usr/lib/cloudprint-cups/listcloudprinters.py ( or /usr/local/lib/cloudprint-cups/listcloudprinters.py ) :
+/usr/share/cloudprint-cups/listcloudprinters.py ( or /usr/local/share/cloudprint-cups/listcloudprinters.py ) :
Print a test page, to confirm it is working.
Assuming the test page prints correctly, installation is complete.
+DEVELOPING
+==========
+
+Before commiting to the git repository you should set up the pre-commit hook, this ensures the version numbers in the scripts are updated:
+
+ln -s ../../pre-commit.py .git/hooks/pre-commit
Copyright and Trademark Information
===================================
View
@@ -24,7 +24,7 @@ if [[ ! -f /usr/bin/python2 ]]; then
fi
if [[ $pyversion != "" ]]; then
- sed -i "1 s/\/usr\/bin\/env python2$/\/usr\/bin\/env $pyversion/" /usr/lib/cloudprint-cups/{backend.py,deleteaccount.py,dynamicppd.py,listcloudprinters.py,reportissues.py,setupcloudprint.py,submitjob.py,upgrade.py}
+ sed -i "1 s/\/usr\/bin\/env python2$/\/usr\/bin\/env $pyversion/" /usr/share/cloudprint-cups/{backend.py,deleteaccount.py,dynamicppd.py,listcloudprinters.py,reportissues.py,setupcloudprint.py,submitjob.py,upgrade.py}
sed -i "1 s/\/usr\/bin\/env python2$/\/usr\/bin\/env $pyversion/" /usr/lib/cups/backend/cloudprint
sed -i "1 s/\/usr\/bin\/env python2$/\/usr\/bin\/env $pyversion/" /usr/lib/cups/driver/cupscloudprint
fi
@@ -40,7 +40,7 @@ chmod 750 /usr/lib/cups/driver/cupscloudprint
if [[ -e /etc/cloudprint.conf ]]; then
chgrp lp /etc/cloudprint.conf
fi
-chgrp lp /usr/lib/cloudprint-cups/auth.py
-/usr/lib/cloudprint-cups/upgrade.py
+chgrp lp /usr/share/cloudprint-cups/auth.py
+/usr/share/cloudprint-cups/upgrade.py
#DEBHELPER#
@@ -26,6 +26,6 @@ USE_GMAKE= yes
post-install:
chgrp cups /etc/cloudprint.conf
- /usr/local/lib/cloudprint-cups/upgrade.py
+ /usr/local/share/cloudprint-cups/upgrade.py
.include <bsd.port.mk>
@@ -27,5 +27,5 @@ src_install() {
pkg_postinst() {
chgrp lp /etc/cloudprint.conf
- /usr/lib/cloudprint-cups/upgrade.py
+ /usr/share/cloudprint-cups/upgrade.py
}
@@ -1,17 +1,20 @@
Name: cupscloudprint
Version: %{_version}
Release: 1
-Summary: Google Cloud Print driver for CUPS, allows printing to printers hosted on Google Cloud Print
+Summary: Print via Google Cloud print using CUPS
License: GPLv3+
URL: http://ccp.niftiestsoftware.com
Source0: http://ccp.niftiestsoftware.com/cupscloudprint-%{_version}.tar.bz2
-BuildRequires: cups-devel,cups,make,python-httplib2
-Requires: cups,ghostscript,system-config-printer-libs,python-httplib2,ImageMagick
+BuildArch: noarch
+BuildRequires: python2-devel,cups-devel,cups,make
+Requires: cups,system-config-printer-libs,python-httplib2,ghostscript,ImageMagick
%description
-Google Cloud Print driver for CUPS, allows printing to printers hosted on Google Cloud Print.
+Google Cloud Print driver for UNIX-like operating systems.
+It allows any application which prints via CUPS to print to Google Cloud
+Print directly.
%prep
%setup -q
@@ -21,22 +24,51 @@ Google Cloud Print driver for CUPS, allows printing to printers hosted on Google
%configure
make %{?_smp_mflags}
-
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT NOPERMS=1
%post
-chown root:lp /var/log/cups/cloudprint_log
-chown -R root:lp /usr/lib/cloudprint-cups/
-chmod 660 /var/log/cups/cloudprint_log
-chgrp lp /etc/cloudprint.conf
-/usr/lib/cloudprint-cups/upgrade.py
+%{_usr}/share/cloudprint-cups/upgrade.py
%files
-/usr/lib/cloudprint-cups
-/usr/lib/cups/backend/cloudprint
-/usr/lib/cups/driver/cupscloudprint
-%{_localstatedir}/log/cups/cloudprint_log
+%{_usr}/%{_lib}/cups/backend/cloudprint
+%{_usr}/%{_lib}/cups/driver/cupscloudprint
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/auth.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/cloudprintrequestor.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/printer.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/test_auth.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/test_backend.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/test_cloudprintrequestor.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/test_mockrequestor.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/test_printer.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/test_syntax.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/oauth2client/__init__.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/oauth2client/anyjson.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/oauth2client/client.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/oauth2client/clientsecrets.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/oauth2client/crypt.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/oauth2client/locked_file.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/oauth2client/multistore_file.py
+%attr(755, root, lp) %{_usr}/share/cloudprint-cups/backend.py
+%attr(755, root, lp) %{_usr}/share/cloudprint-cups/deleteaccount.py
+%attr(755, root, lp) %{_usr}/share/cloudprint-cups/dynamicppd.py
+%attr(755, root, lp) %{_usr}/share/cloudprint-cups/listcloudprinters.py
+%attr(755, root, lp) %{_usr}/share/cloudprint-cups/full-test.sh
+%attr(755, root, lp) %{_usr}/share/cloudprint-cups/reportissues.py
+%attr(755, root, lp) %{_usr}/share/cloudprint-cups/setupcloudprint.py
+%attr(755, root, lp) %{_usr}/share/cloudprint-cups/submitjob.py
+%attr(755, root, lp) %{_usr}/share/cloudprint-cups/upgrade.py
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/oauth2client/*.pyc
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/oauth2client/*.pyo
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/*.pyc
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/*.pyo
+%attr(644, root, lp) %{_usr}/share/cloudprint-cups/testfiles/*
+
+%doc %{_usr}/share/cloudprint-cups/COPYING
+%doc %{_usr}/share/cloudprint-cups/README.md
+%docdir %{_usr}/share/cloudprint-cups/testfiles
%changelog
+* Tue Jan 07 2014 <src@niftiestsoftware.com> 20140107-1
+- Package fixes for rpmlint
Oops, something went wrong.

0 comments on commit def17bc

Please sign in to comment.