Mercurial > vanilla
annotate print/cups/cups.sh @ 993:2cdbc5f913f0
kde/kactivities: initial import, closes #1786
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 28 Aug 2019 20:48:00 +0200 |
parents | a133976e0783 |
children | ddab65a5b3f5 |
rev | line source |
---|---|
700
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
1 #!/bin/sh |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
2 # |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr> |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
4 # |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
5 # Permission to use, copy, modify, and/or distribute this software for any |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
6 # purpose with or without fee is hereby granted, provided that the above |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
7 # copyright notice and this permission notice appear in all copies. |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
8 # |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
16 # |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
17 |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
18 # TODO: add AVAHI option |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
19 |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
20 PKGNAME=cups |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
21 PKGVERSION=2.2.11 |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
22 PKGREVISION=1 |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
23 PKGLICENSE="GPLv2" |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
24 PKGSUMMARY="the CUPS printing system" |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
25 PKGDOWNLOAD="https://github.com/apple/cups/releases/download/v$PKGVERSION/$PKGNAME-$PKGVERSION-source.tar.gz" |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
26 PKGOPTIONS="ACL DBUS PAM" |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
27 PKGPROTECT="etc/cups/cups-files.conf |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
28 etc/cups/cupsd.conf |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
29 etc/cups/snmp.conf |
823
fdac78a6d06e
print/cups: use a custom PAM file as recommended per LFS
David Demelier <markand@malikania.fr>
parents:
745
diff
changeset
|
30 etc/pam.d/cups |
700
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
31 etc/rc.d/cupsd" |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
32 |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
33 : ${CHOST:=$(uname -m)-linux-musl} |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
34 : ${CBUILD:=$(uname -m)-linux-musl} |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
35 : ${CC:=clang} |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
36 : ${CFLAGS:=-O2} |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
37 : ${CXX:=clang++} |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
38 : ${CXXFLAGS:=-O2} |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
39 : ${LDFLAGS:=} |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
40 : ${LIBS:=} |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
41 : ${ACL:=no} |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
42 : ${DBUS:=yes} |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
43 : ${PAM:=yes} |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
44 |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
45 if [ "$ACL" = "yes" ]; then |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
46 with_acl="--enable-acl" |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
47 else |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
48 with_acl="--disable-acl" |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
49 fi |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
50 |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
51 if [ "$DBUS" = "yes" ]; then |
902
a133976e0783
vanilla: remove all origins, closes #2203
David Demelier <markand@malikania.fr>
parents:
823
diff
changeset
|
52 PKGDEPENDS="dbus $PKGDEPENDS" |
700
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
53 with_dbus="--enable-dbus" |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
54 else |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
55 with_dbus="--disable-bus" |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
56 fi |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
57 |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
58 if [ "$PAM" = "yes" ]; then |
902
a133976e0783
vanilla: remove all origins, closes #2203
David Demelier <markand@malikania.fr>
parents:
823
diff
changeset
|
59 PKGDEPENDS="linux-pam $PKGDEPENDS" |
700
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
60 with_pam="--enable-pam" |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
61 else |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
62 with_pam="--disable-pam" |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
63 fi |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
64 |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
65 build() |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
66 { |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
67 rm -rf $PKGNAME-$PKGVERSION |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
68 tar xvf $PKGNAME-$PKGVERSION-source.tar.gz |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
69 cd $PKGNAME-$PKGVERSION |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
70 |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
71 # --without-rcdir: do not install custom init scripts. |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
72 CC="$CC" \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
73 CFLAGS="$CFLAGS" \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
74 CXX="$CXX" \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
75 CXXFLAGS="$CXXFLAGS" \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
76 LDFLAGS="$LDFLAGS" \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
77 LIBS="$LIBS" \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
78 ./configure \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
79 --build=$CBUILD \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
80 --host=$CHOST \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
81 --prefix= \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
82 --sbindir=/bin \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
83 --disable-systemd \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
84 --enable-shared \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
85 --without-rcdir \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
86 --with-cups-user=lp \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
87 --with-cups-group=lp \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
88 --with-system-groups=wheel \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
89 --with-icondir=/share/icons \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
90 --with-menudir=/share/applications \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
91 $with_acl \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
92 $with_dbus \ |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
93 $with_pam |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
94 make |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
95 make install BUILDROOT=$DESTDIR |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
96 install -Dm0644 ../cupsd $DESTDIR/etc/rc.d/cupsd |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
97 |
823
fdac78a6d06e
print/cups: use a custom PAM file as recommended per LFS
David Demelier <markand@malikania.fr>
parents:
745
diff
changeset
|
98 if [ "$PAM" = "yes" ]; then |
fdac78a6d06e
print/cups: use a custom PAM file as recommended per LFS
David Demelier <markand@malikania.fr>
parents:
745
diff
changeset
|
99 install -Dm0644 ../cups $DESTDIR/etc/pam.d/cups |
fdac78a6d06e
print/cups: use a custom PAM file as recommended per LFS
David Demelier <markand@malikania.fr>
parents:
745
diff
changeset
|
100 fi |
fdac78a6d06e
print/cups: use a custom PAM file as recommended per LFS
David Demelier <markand@malikania.fr>
parents:
745
diff
changeset
|
101 |
700
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
102 cd .. |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
103 rm -rf $PKGNAME-$PKGVERSION |
98351d3f57eb
print/cups: initial import, closes #1232
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
104 } |