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