~ubuntu-branches/ubuntu/natty/foo2zjs/natty

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2010-07-28 22:47:45 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100728224745-5gplbymqfr8588w7
Tags: 20100728-0ubuntu1
* New upstream release
   o Snapshot from Jul 28, 2010.
* debian/patches/91-wrapper-scripts-custom-pagesize-via-command-line.dpatch:
  Removed, fixed upstream.
* debian/patches/30-udev-rules.dpatch,
  debian/patches/60-getweb.in.dpatch: Updated to work with new foo2zjs
  source.
* debian/patches/60-getweb.in.dpatch, debian/patches/80-getweb.in.dpatch:
  merged 80-getweb.in.dpatch into 60-getweb.in.dpatch.
* debian/rules: Added "CUPS_SERVERBIN=..." to the "make install" command
  line.
* debian/foo2zjs.postinst: Migrate driver name "foo2zjs" to "foo2zjs-z1"
  and "foo2zjs-z2".

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
MANDIR=$(PREFIX)/share/man
35
35
DOCDIR=$(PREFIX)/share/doc/foo2zjs/
36
36
INSTALL=install
 
37
ROOT=root
37
38
 
38
39
# Pathnames for referenced packages...
39
40
FOODB=$(DESTDIR)/usr/share/foomatic/db/source
44
45
ifeq ($(UNAME),Darwin)
45
46
    LPuid=-oroot
46
47
    LPgid=-gwheel
 
48
    ROOT=sudo
47
49
endif
48
50
ifeq ($(UNAME),FreeBSD)
49
51
    LPuid=-oroot
79
81
    MODTIME= `ls -e $$1 | cut -c42-61`
80
82
endif
81
83
 
 
84
CUPS_SERVERBIN := $(shell cups-config --serverbin 2>/dev/null)
 
85
 
82
86
#
83
87
# Files for tarball
84
88
#
158
162
                slxdecode.c \
159
163
                slxdecode.1in \
160
164
                gipddecode.c \
 
165
                gipddecode.1in \
161
166
                foo2zjs-wrapper.in \
162
167
                foo2zjs-wrapper.1in \
163
168
                foo2hp2600-wrapper.in \
180
185
                foomatic-test \
181
186
                getweb.in \
182
187
                icc2ps/*.[ch] \
 
188
                icc2ps/*.1in \
183
189
                icc2ps/Makefile \
184
190
                icc2ps/AUTHORS \
185
191
                icc2ps/COPYING \
196
202
                usb_printerid.c \
197
203
                usb_printerid.1in \
198
204
                hplj1000 \
199
 
                hplj10xx.rules \
 
205
                hplj10xx.rules* \
200
206
                msexpand \
201
207
                oak.h \
202
208
                foo2oak.c \
220
226
                regress.txt \
221
227
                printer-profile.sh \
222
228
                printer-profile.1in \
 
229
                freebsd-install \
 
230
                hplj10xx.conf \
 
231
                modify-ppd \
 
232
                command2foo2lava-pjl.c \
223
233
                $(NULL)
224
234
 
225
235
# hpclj2600n-0.icm km2430_0.icm km2430_1.icm km2430_2.icm samclp300-0.icm
233
243
PROGS+=         foo2slx slxdecode
234
244
PROGS+=         foo2hiperc hipercdecode
235
245
PROGS+=         gipddecode
 
246
ifneq ($(CUPS_SERVERBIN),)
 
247
    PROGS+=     command2foo2lava-pjl
 
248
endif
236
249
SHELLS=         foo2zjs-wrapper foo2oak-wrapper foo2hp2600-wrapper \
237
250
                foo2xqx-wrapper foo2lava-wrapper foo2qpdl-wrapper \
238
251
                foo2slx-wrapper foo2hiperc-wrapper
246
259
MANPAGES+=      foo2qpdl-wrapper.1 foo2qpdl.1 qpdldecode.1
247
260
MANPAGES+=      foo2slx-wrapper.1 foo2slx.1 slxdecode.1
248
261
MANPAGES+=      foo2hiperc-wrapper.1 foo2hiperc.1 hipercdecode.1
 
262
MANPAGES+=      gipddecode.1
249
263
MANPAGES+=      foo2zjs-pstops.1 arm2hpdl.1 usb_printerid.1
250
264
MANPAGES+=      printer-profile.1
251
265
LIBJBG  =       jbig.o jbig_ar.o
503
517
gipddecode: gipddecode.o $(LIBJBG)
504
518
        $(CC) $(CFLAGS) gipddecode.o $(LIBJBG) -o $@
505
519
 
 
520
command2foo2lava-pjl: command2foo2lava-pjl.o
 
521
        $(CC) $(CFLAGS) -L/usr/local/lib command2foo2lava-pjl.o -lcups -o $@
 
522
 
 
523
command2foo2lava-pjl.o: command2foo2lava-pjl.c
 
524
        $(CC) $(CFLAGS) -I/usr/local/include -c command2foo2lava-pjl.c
 
525
 
506
526
#
507
527
# Installation rules
508
528
#
509
529
install: all install-test install-prog install-icc2ps install-extra \
510
530
            install-crd install-foo install-ppd \
511
 
            install-gui install-desktop \
 
531
            install-gui install-desktop install-filter \
512
532
            install-man install-doc
513
533
        #
514
534
        # If you use CUPS, then restart the spooler:
589
609
        #
590
610
        @if [ -d $(FOODB) ]; then \
591
611
            for dir in driver printer opt; do \
 
612
                echo install -d $(FOODB)/$$dir/; \
 
613
                $(INSTALL) -d $(FOODB)/$$dir/; \
592
614
                echo install -m 644 foomatic-db/$$dir/*.xml $(FOODB)/$$dir/; \
593
615
                $(INSTALL) -c -m 644 foomatic-db/$$dir/*.xml $(FOODB)/$$dir/; \
594
616
            done \
731
753
        #
732
754
        # Install PPD files for CUPS
733
755
        #
 
756
        export PATH=$$PATH:`pwd`:; \
734
757
        if [ -x /usr/sbin/ppdmgr -a -s $(VARPPD)/ppdcache ]; then \
735
758
            $(INSTALL) $(LPgid) -d $(VARPPD)/user; \
736
759
            cd PPD; \
737
760
            for ppd in *.ppd; do \
738
761
                manuf=`echo "$$ppd" | sed 's/-.*//'`; \
739
762
                $(INSTALL) $(LPgid) -d $(VARPPD)/user/$$manuf; \
740
 
                gzip < $$ppd > $(VARPPD)/user/$$manuf/$$ppd.gz; \
 
763
                modify-ppd <$$ppd | gzip > $(VARPPD)/user/$$manuf/$$ppd.gz; \
741
764
            done; \
742
765
            ppdmgr -u; \
743
766
        elif [ -d $(PPD) ]; then \
751
774
            [ -d $(PPD)/foo2zjs ] || mkdir $(PPD)/foo2zjs; \
752
775
            cd PPD; \
753
776
            for ppd in *.ppd; do \
754
 
                gzip < $$ppd > $(PPD)/foo2zjs/$$ppd.gz; \
 
777
                modify-ppd <$$ppd | gzip > $(PPD)/foo2zjs/$$ppd.gz; \
755
778
            done; \
756
779
        fi
 
780
        #
 
781
        export PATH=$$PATH:`pwd`:; \
757
782
        if [ -d $(MODEL) ]; then \
758
783
            rm -f $(MODEL)/KonicaMinolta*; \
759
784
            cd PPD; \
760
785
            for ppd in *.ppd; do \
761
 
                gzip < $$ppd > $(MODEL)/$$ppd.gz; \
 
786
                modify-ppd <$$ppd | gzip > $(MODEL)/$$ppd.gz; \
762
787
            done; \
763
788
        elif [ -d $(LOCALMODEL) ]; then \
764
789
            rm -f $(LOCALMODEL)/KonicaMinolta*; \
765
790
            cd PPD; \
766
791
            for ppd in *.ppd; do \
767
 
                gzip < $$ppd > $(LOCALMODEL)/$$ppd.gz; \
 
792
                modify-ppd <$$ppd | gzip > $(LOCALMODEL)/$$ppd.gz; \
768
793
            done; \
769
794
        fi
770
795
 
796
821
 
797
822
USBDIR=/etc/hotplug/usb
798
823
UDEVDIR=/etc/udev/rules.d
 
824
LIBUDEVDIR=/lib/udev/rules.d
799
825
RULES=hplj10xx.rules
 
826
UDEVD=/sbin/udevd
 
827
# For FreeBSD 8.0
 
828
DEVDDIR=/etc/devd
 
829
 
800
830
install-hotplug: install-hotplug-test install-hotplug-prog
801
831
 
802
832
install-hotplug-test:
811
841
            echo "      ***"; \
812
842
            exit 1; \
813
843
        fi
 
844
        @if test -r $(LIBUDEVDIR)/*-printers.rules; then \
 
845
            echo "      ***"; \
 
846
            echo "      *** Error: system-config-printer-udev is installed!"; \
 
847
            echo "      ***"; \
 
848
            echo "      *** Remove it with: (Fedora)"; \
 
849
            echo "      ***     # yum remove system-config-printer-udev"; \
 
850
            echo "      *** OR (Ubuntu, Debian)"; \
 
851
            echo "      ***     $$ sudo apt-get remove system-config-printer-udev"; \
 
852
            echo "      ***"; \
 
853
            exit 1; \
 
854
        fi
814
855
        # ... OK!
815
856
        #
816
857
 
817
858
install-hotplug-prog:
818
859
        if [ -d $(UDEVDIR) ]; then \
819
 
            $(INSTALL) -c -m 644 $(RULES) $(UDEVDIR)/11-$(RULES); \
 
860
            rm -f /lib/udev/rules.d/*-hplj10xx.rules; \
 
861
            version=`$(UDEVD) --version 2>/dev/null`; \
 
862
            if [ "$$version" = "" ]; then version=0; fi; \
 
863
            echo "*** udev version $$version"; \
 
864
            if [ "$$version" -lt 148 ]; then \
 
865
                $(INSTALL) -c -m 644 $(RULES).old $(UDEVDIR)/11-$(RULES); \
 
866
            else \
 
867
                $(INSTALL) -c -m 644 $(RULES) $(UDEVDIR)/11-$(RULES); \
 
868
            fi \
 
869
        fi
 
870
        if [ -d $(DEVDDIR) ]; then \
 
871
            $(INSTALL) -c -m 644 hplj10xx.conf $(DEVDDIR)/; \
820
872
        fi
821
873
        [ -d $(USBDIR) ] || $(INSTALL) -d -m 755 $(USBDIR)/
822
874
        $(INSTALL) -c -m 755 hplj1000 $(USBDIR)/
840
892
        # modprobe usblp
841
893
        $(USBDIR)/hplj1000 install-usblp
842
894
 
 
895
install-filter:
 
896
        if [ "$(CUPS_SERVERBIN)" != "" ]; then \
 
897
            ln -sf $(BIN)/command2foo2lava-pjl $(CUPS_SERVERBIN)/filter/; \
 
898
        fi
 
899
 
843
900
cups:   FRC
844
901
        if [ -x /etc/init.d/cups ]; then \
845
902
            /etc/init.d/cups restart; \
881
938
        -rm -f $(MANDIR)/man1/foo2xqx*.1 $(MANDIR)/man1/xqxdecode.1
882
939
        -rm -f $(MANDIR)/man1/opldecode.1 $(MANDIR)/man1/rodecode.1
883
940
        -rm -f $(MANDIR)/man1/foo2hiperc*.1 $(MANDIR)/man1/hipercdecode.1
 
941
        -rm -f $(MANDIR)/man1/gipddecode.1
884
942
        -rm -f $(MANDIR)/man1/arm2hpdl.1 $(MANDIR)/man1/usb_printerid.1
 
943
        -rm -f $(MANDIR)/man1/foo2zjs-icc2ps.1
885
944
        -rm -rf /usr/share/foo2zjs/
886
945
        -rm -rf /usr/share/foo2hp/
887
946
        -rm -rf /usr/share/foo2oak/
900
959
        -rm -f /usr/bin/foo2slx-wrapper /usr/bin/foo2slx /usr/bin/slxdecode
901
960
        -rm -f /usr/bin/foo2hiperc-wrapper /usr/bin/foo2hiperc
902
961
        -rm -f /usr/bin/hipercdecode
 
962
        -rm -f /usr/bin/gipddecode
903
963
        -rm -f /usr/bin/opldecode
904
964
        -rm -f /usr/bin/rodecode
905
965
        -rm -f /usr/bin/foo2zjs-icc2ps
906
966
        -rm -f /usr/bin/foo2zjs-pstops
 
967
        -rm -f /usr/bin/command2foo2lava-pjl
 
968
        -rm -f /usr/lib/cups/filter/command2foo2lava-pjl
907
969
        -rm -f /usr/share/applications/hplj1020.desktop
908
970
        -rm -f /usr/share/pixmaps/hplj1020_icon.png
909
971
        -cd foomatic-db; for i in `find driver opt printer -name "*.xml"`; do \
929
991
        -rm -f foo2slx.o slxdecode.o
930
992
        -rm -f foo2hiperc.o hipercdecode.o
931
993
        -rm -f opldecode.o gipddecode.o
 
994
        -rm -f command2foo2lava-pjl.o
932
995
        -rm -f foo2oak.html foo2zjs.html foo2hp.html foo2xqx.html foo2lava.html
933
996
        -rm -f foo2slx.html foo2qpdl.html foo2hiperc.html
934
997
        -rm -f index.html
962
1025
opldecode.o: jbig.h
963
1026
slxdecode.o: slx.h jbig.h
964
1027
xqxdecode.o: xqx.h jbig.h
 
1028
gipddecode.o: slx.h jbig.h
965
1029
 
966
1030
#
967
1031
# foo2* Regression tests
978
1042
# foo2zjs Regression tests
979
1043
#
980
1044
testzjs:        testpage.zm \
981
 
                testpage.zc10 testpage.zc1 testpage.zc2 testpage.zc3 \
 
1045
                testpage.zc10 \
982
1046
                lj1000.zm lj1020.zm
 
1047
# testpage.zc1 testpage.zc2 testpage.zc3 \
983
1048
 
984
1049
testpage.zm: testpage.ps foo2zjs-wrapper foo2zjs Makefile FRC
985
1050
        #
1024
1089
        #
1025
1090
        # Monochrome test page for HP LJ1020
1026
1091
        PATH=.:$$PATH time -p foo2zjs-wrapper -r600x600 -P -z1 \
1027
 
            testpage.ps >$@
 
1092
            testpage.ps | sed "/JOBATTR/d" >$@
1028
1093
        @got=`md5sum $@`; grep -q "$$got" regress.txt || \
1029
1094
            { echo "*** Test failure, got $$got"; ls -l $@; exit 1; }
1030
1095
 
1114
1179
 
1115
1180
#
1116
1181
#       PPD files
 
1182
#       
 
1183
#       Don't edit the PPD files.  Instead, change the
 
1184
#       foomatic/{device,printer,opt}/*.xml files or the "modify-ppd" script.
1117
1185
#
1118
1186
FOOPRINT=*.xml
1119
1187
ppd:
1127
1195
        for i in foomatic-db/printer/$(FOOPRINT); \
1128
1196
        do \
1129
1197
            printer=`basename $$i .xml`; \
1130
 
            echo $$printer; \
1131
1198
            case "$$printer" in \
1132
1199
            *M1005*|*M1120*)    driver=foo2xqx;; \
1133
1200
            *P1[05]0[5678]*)    driver=foo2xqx;; \
1134
1201
            *P2014*)            driver=foo2xqx;; \
1135
1202
            *1500*|*OAKT*)      driver=foo2oak;; \
1136
 
            *P2035*)            driver=foo2zjs;; \
 
1203
            *1018*|*102[02]*)   driver=foo2zjs-z1;; \
 
1204
            *P2035*)            driver=foo2zjs-z1;; \
 
1205
            *1319*)             driver=foo2zjs-z1;; \
 
1206
            *P110*)             driver=foo2zjs-z2;; \
 
1207
            *P156*)             driver=foo2zjs-z2;; \
 
1208
            *P160*)             driver=foo2zjs-z2;; \
1137
1209
            *1635*|*2035*)      driver=foo2oak-z1;; \
1138
1210
            *1600W|*16[89]0*)   driver=foo2lava;; \
1139
1211
            *4690*)             driver=foo2lava;; \
1140
1212
            *2530*|*24[89]0*)   driver=foo2lava;; \
1141
1213
            *6115*)             driver=foo2lava;; \
 
1214
            *C110*)             driver=foo2lava;; \
1142
1215
            *1600*|*2600*)      driver=foo2hp;; \
1143
1216
            *1215*)             driver=foo2hp;; \
1144
1217
            *C500*)             driver=foo2slx;; \
1145
1218
            *C3[1234]00*)        driver=foo2hiperc;; \
1146
1219
            *C3530*)            driver=foo2hiperc;; \
1147
 
            *C5[12568]00*)      driver=foo2hiperc;; \
 
1220
            *C5[12568][05]0*)   driver=foo2hiperc;; \
1148
1221
            *CLP*|*CLX*|*6110*) driver=foo2qpdl;; \
1149
1222
            *)                  driver=foo2zjs;; \
1150
1223
            esac; \
 
1224
            echo $$driver - $$printer; \
1151
1225
            ENGINE=../foomatic/foomatic-db-engine; \
1152
1226
            PERL5LIB=$$ENGINE/lib \
1153
1227
                FOOMATICDB=foomatic-db \
1164
1238
# Manpage generation.  No, I am not interested in "info" files or
1165
1239
# HTML documentation.
1166
1240
#
1167
 
man: $(MANPAGES)
 
1241
man: $(MANPAGES) man-icc2ps
1168
1242
 
1169
1243
$(MANPAGES): macros.man includer-man
1170
1244
 
 
1245
man-icc2ps:
 
1246
        cd icc2ps; $(MAKE) man
 
1247
 
1171
1248
.1in.1: 
1172
1249
        -rm -f $*.1
1173
1250
        modtime() { $(MODTIME); }; \
1216
1293
        $(INSTALL) -c -m 644 foo2hiperc.1 $(MANDIR)/man1/
1217
1294
        $(INSTALL) -c -m 644 foo2hiperc-wrapper.1 $(MANDIR)/man1/
1218
1295
        $(INSTALL) -c -m 644 hipercdecode.1 $(MANDIR)/man1/
 
1296
        $(INSTALL) -c -m 644 gipddecode.1 $(MANDIR)/man1/
1219
1297
        $(INSTALL) -c -m 644 foo2zjs-pstops.1 $(MANDIR)/man1/
1220
1298
        $(INSTALL) -c -m 644 arm2hpdl.1 $(MANDIR)/man1/
1221
1299
        $(INSTALL) -c -m 644 usb_printerid.1 $(MANDIR)/man1/
1222
1300
        $(INSTALL) -c -m 644 printer-profile.1 $(MANDIR)/man1/
 
1301
        cd icc2ps; $(MAKE) install-man
1223
1302
 
1224
1303
doc: README INSTALL manual.pdf
1225
1304
 
1237
1316
 
1238
1317
GROFF=/usr/local/test/bin/groff
1239
1318
GROFF=groff
1240
 
manual.pdf: $(MANPAGES)
1241
 
        -$(GROFF) -t -man $(MANPAGES) | ps2pdf - $@
 
1319
manual.pdf: $(MANPAGES) icc2ps/foo2zjs-icc2ps.1
 
1320
        -$(GROFF) -t -man \
 
1321
            `ls $(MANPAGES) icc2ps/foo2zjs-icc2ps.1 | sort` \
 
1322
            | ps2pdf - $@
1242
1323
 
1243
1324
README: README.in
1244
1325
        rm -f $@
1367
1448
        ln -sf foo2zjs.html index.html
1368
1449
        ncftpput -m -f $(FTPSITE) foo2zjs \
1369
1450
            index.html style.css archzjs.gif thermometer.gif \
1370
 
            flags.png INSTALL INSTALL.osx zjsfavicon.png \
 
1451
            images/flags.png INSTALL INSTALL.osx images/zjsfavicon.png \
1371
1452
            printer-photos/printers.jpg;
1372
1453
 
1373
1454
oakindex: foo2oak.html archoak.gif thermometer.gif webphotos
1374
1455
        ln -sf foo2oak.html index.html
1375
1456
        ncftpput -m -f $(FTPSITE) foo2oak \
1376
1457
            index.html style.css archoak.gif thermometer.gif \
1377
 
            flags.png INSTALL \
 
1458
            images/flags.png INSTALL \
1378
1459
            printer-photos/printers.jpg;
1379
1460
 
1380
1461
hpindex: foo2hp.html archhp.gif thermometer.gif webphotos
1381
1462
        ln -sf foo2hp.html index.html
1382
1463
        ncftpput -m -f $(FTPSITE) foo2hp \
1383
1464
            index.html style.css archhp.gif thermometer.gif \
1384
 
            flags.png INSTALL hpfavicon.png \
 
1465
            images/flags.png INSTALL images/hpfavicon.png \
1385
1466
            printer-photos/printers.jpg;
1386
1467
 
1387
1468
xqxindex: foo2xqx.html archxqx.gif thermometer.gif webphotos
1388
1469
        ln -sf foo2xqx.html index.html
1389
1470
        ncftpput -m -f $(FTPSITE) foo2xqx \
1390
1471
            index.html style.css archxqx.gif thermometer.gif \
1391
 
            flags.png INSTALL xqxfavicon.png \
 
1472
            images/flags.png INSTALL images/xqxfavicon.png \
1392
1473
            printer-photos/printers.jpg;
1393
1474
 
1394
1475
lavaindex: foo2lava.html archlava.gif thermometer.gif webphotos
1395
1476
        ln -sf foo2lava.html index.html
1396
1477
        ncftpput -m -f $(FTPSITE) foo2lava \
1397
1478
            index.html style.css archlava.gif thermometer.gif \
1398
 
            flags.png INSTALL lavafavicon.png \
 
1479
            images/flags.png INSTALL images/lavafavicon.png \
1399
1480
            printer-photos/printers.jpg;
1400
1481
 
1401
1482
qpdlindex: foo2qpdl.html archqpdl.gif thermometer.gif webphotos
1402
1483
        ln -sf foo2qpdl.html index.html
1403
1484
        ncftpput -m -f $(FTPSITE) foo2qpdl \
1404
1485
            index.html style.css archqpdl.gif thermometer.gif \
1405
 
            flags.png INSTALL qpdlfavicon.png \
 
1486
            images/flags.png INSTALL images/qpdlfavicon.png \
1406
1487
            printer-photos/printers.jpg;
1407
1488
 
1408
1489
slxindex: foo2slx.html archslx.gif thermometer.gif webphotos
1409
1490
        ln -sf foo2slx.html index.html
1410
1491
        ncftpput -m -f $(FTPSITE) foo2slx \
1411
1492
            index.html style.css archslx.gif thermometer.gif \
1412
 
            flags.png INSTALL slxfavicon.png \
 
1493
            images/flags.png INSTALL images/slxfavicon.png \
1413
1494
            printer-photos/printers.jpg;
1414
1495
 
1415
1496
hcindex: foo2hiperc.html archhiperc.gif thermometer.gif webphotos
1416
1497
        ln -sf foo2hiperc.html index.html
1417
1498
        ncftpput -m -f $(FTPSITE) foo2hiperc \
1418
1499
            index.html style.css archhiperc.gif thermometer.gif \
1419
 
            flags.png INSTALL hipercfavicon.png \
 
1500
            images/flags.png INSTALL images/hipercfavicon.png \
1420
1501
            printer-photos/printers.jpg;
1421
1502
 
1422
1503
foo2zjs.html: warning.html contribute.html resources.html unsupported.html
1533
1614
 
1534
1615
phorum-logo.gif: archhp.fig
1535
1616
        fig2dev -L gif -m.25 archhp.fig | giftrans -t "#ffffff" -o $@
 
1617
 
 
1618
w:      all
 
1619
        $(ROOT) $(MAKE) install install-hotplug