/[gentoo-x86]/www-apps/webdavcgi/webdavcgi-0.8.4.ebuild
Gentoo

Contents of /www-apps/webdavcgi/webdavcgi-0.8.4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sat Jun 13 17:22:20 2015 UTC (5 years ago) by dilfridge
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +3 -3 lines
The CGI module is no longer part of core Perl and has been moved to dev-perl

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0B08240A96F66571)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/www-apps/webdavcgi/webdavcgi-0.8.4.ebuild,v 1.3 2014/08/10 20:15:51 slyfox Exp $
4
5 EAPI=5
6
7 inherit eutils toolchain-funcs versionator
8
9 DESCRIPTION="A Perl CGI for accessing and sharing files, or calendar/addressbooks via WebDAV"
10 HOMEPAGE="http://webdavcgi.sourceforge.net/"
11 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
12
13 LICENSE="GPL-3"
14
15 # Provide slotting on minor versions. WebDAV CGI is a web application which
16 # can be shared by multiple instances and thus major updates shouldn't be
17 # enforced to all users/instances at the same time.
18 SLOT="$(get_version_component_range 1-2)"
19
20 KEYWORDS="~amd64"
21 IUSE="afs kerberos mysql postgres rcs samba +sqlite +suid"
22
23 DEPEND=""
24 RDEPEND="!www-apps/webdavcgi:0
25 afs? ( net-fs/openafs )
26 dev-lang/perl
27 dev-perl/Archive-Zip
28 dev-perl/File-Copy-Link
29 dev-perl/PerlIO-gzip
30 dev-perl/Quota
31 dev-perl/TimeDate
32 dev-perl/URI
33 dev-perl/UUID-Tiny
34 dev-perl/XML-Simple
35 kerberos? ( virtual/krb5 )
36 media-gfx/graphicsmagick[perl]
37 mysql? ( dev-perl/DBD-mysql )
38 virtual/perl-Module-Load
39 postgres? ( dev-perl/DBD-Pg )
40 rcs? ( dev-perl/Rcs )
41 samba? ( dev-perl/Filesys-SmbClient )
42 sqlite? ( dev-perl/DBD-SQLite )
43 dev-perl/CGI
44 virtual/perl-File-Spec
45 || ( virtual/httpd-cgi virtual/httpd-fastcgi )"
46
47 REQUIRED_USE="|| ( mysql postgres sqlite )"
48
49 CGIBINDIR="cgi-bin"
50
51 src_compile() {
52 if use suid; then
53 WEBDAVWRAPPERS="webdavwrapper" # Standard UID/GID wrapper
54
55 use afs && WEBDAVWRAPPERS+=" webdavwrapper-afs"
56 use kerberos && WEBDAVWRAPPERS+=" webdavwrapper-krb"
57
58 export WEBDAVWRAPPERS
59
60 local wrapper
61 for wrapper in ${WEBDAVWRAPPERS}; do
62 $(tc-getCC) ${LDFLAGS} ${CFLAGS} \
63 -o "${CGIBINDIR}/${wrapper}" \
64 "helper/${wrapper}.c" || die "compile ${wrapper} failed"
65 done
66 fi
67 }
68
69 src_install() {
70 exeinto "/usr/libexec/${PN}-${SLOT}/${CGIBINDIR}"
71 newexe "${CGIBINDIR}/logout-dist" "logout"
72 doexe "${CGIBINDIR}/webdav.pl"
73
74 use afs && doexe "${CGIBINDIR}/afswrapper"
75 use samba && doexe "${CGIBINDIR}/smbwrapper"
76
77 if use suid; then
78 # In order to change the user and group ID at runtime, the webdavwrapper
79 # needs to be run as root (set-user-ID and set-group-ID bit)
80 exeopts -o root -g root -m 6755
81
82 local wrapper
83 for wrapper in ${WEBDAVWRAPPERS}; do
84 einfo "Installing UID/GID wrapper ${wrapper}"
85 doexe "${CGIBINDIR}/${wrapper}"
86 done
87
88 # reset install opts
89 exeopts
90 else
91 ewarn "You have the 'suid' USE flag disabled"
92 ewarn "WebDAV CGI won't be able to switch user ids"
93 fi
94
95 local confDir='etc'
96 local webdavConfDir="/etc/${PN}-${SLOT}/default"
97
98 export WEBDAVCONFIG="${webdavConfDir}/webdav.conf"
99
100 insinto "${webdavConfDir}"
101 doins "${confDir}/mime.types"
102 newins "${FILESDIR}/webdav-${SLOT}.conf" "webdav.conf"
103
104 local installBaseDir="/usr/share/${PN}-${SLOT}"
105 local currentDir
106 for currentDir in htdocs lib locale; do
107 insinto "${installBaseDir}/${currentDir}"
108 doins -r "${currentDir}"/*
109 done
110
111 if use mysql || use postgres; then
112 local sqlDir='sql'
113 insinto "${installBaseDir}/${sqlDir}"
114 use mysql && "${sqlDir}/mysql.sql"
115 use postgres && "${sqlDir}/postgresql.sql"
116 fi
117
118 if use sqlite; then
119 # Directory where the SQLite database resides
120 local sqliteRootDir="/var/lib/${PN}/${SLOT}"
121 keepdir "${sqliteRootDir}"
122
123 # Default database directory where all users are able to create and
124 # share the databases, this can be changed within the config file and
125 # restricted to user/group only access if required.
126 export SQLITEDIR="${sqliteRootDir}/default"
127 keepdir "${SQLITEDIR}"
128 fperms 1777 "${SQLITEDIR}"
129 fi
130
131 # Default thumbnail directory, writable by all users
132 export THUMBNAILDIR="/var/cache/${PN}/${SLOT}/default/thumbnails"
133 keepdir "${THUMBNAILDIR}"
134 fperms 1777 "${THUMBNAILDIR}"
135
136 export APACHEEXAMPLECONFIG="apache-webdavcgi-${SLOT}-example.conf"
137 dodoc CHANGELOG TODO
138 dodoc "${FILESDIR}/${APACHEEXAMPLECONFIG}"
139 dohtml -r doc/*
140 }
141
142 pkg_postinst() {
143 ewarn "In order to allow different users to create and share files,"
144 ewarn "some directories were installed with world write access by default."
145 ewarn "To set restrictive permissions, add all WebDAV CGI users to a"
146 ewarn "common group, and allow access to the following directories by this"
147 ewarn "group only."
148 ewarn "Thumbnail directory: ${THUMBNAILDIR}"
149 use sqlite && ewarn "SQLite directory: ${SQLITEDIR}"
150
151 ewarn
152 ewarn "Until bug #456180 is fixed, you probably have to re-emerge"
153 ewarn "media-gfx/graphicsmagick"
154
155 elog
156 elog "The WebDAV CGI config is located at ${WEBDAVCONFIG}."
157 elog
158 elog "An example Apache HTTP server configuration snippet is available in"
159 elog "/usr/share/doc/${PF} in the file ${APACHEEXAMPLECONFIG}"
160
161 einfo
162 einfo "Detailed installation and configuration instructions can be found at"
163 einfo "http://webdavcgi.sourceforge.net/"
164 }

  ViewVC Help
Powered by ViewVC 1.1.20