diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /www-apps/webdavcgi |
reinit the tree, so we can have metadata
Diffstat (limited to 'www-apps/webdavcgi')
-rw-r--r-- | www-apps/webdavcgi/Manifest | 18 | ||||
-rw-r--r-- | www-apps/webdavcgi/files/0.8.3-logout-var-expansion.patch | 21 | ||||
-rw-r--r-- | www-apps/webdavcgi/files/apache-webdavcgi-0.8-example.conf | 59 | ||||
-rw-r--r-- | www-apps/webdavcgi/files/apache-webdavcgi-1.1-example.conf | 63 | ||||
-rw-r--r-- | www-apps/webdavcgi/files/postinstall-en.txt | 29 | ||||
-rw-r--r-- | www-apps/webdavcgi/files/postinstall-webdavwrapper-en.txt | 32 | ||||
-rw-r--r-- | www-apps/webdavcgi/files/reconfig | 32 | ||||
-rw-r--r-- | www-apps/webdavcgi/files/reconfig-suid | 26 | ||||
-rw-r--r-- | www-apps/webdavcgi/files/webdav-0.8.conf | 88 | ||||
-rw-r--r-- | www-apps/webdavcgi/files/webdav-1.1.conf | 125 | ||||
-rw-r--r-- | www-apps/webdavcgi/metadata.xml | 31 | ||||
-rw-r--r-- | www-apps/webdavcgi/webdavcgi-0.8.3.ebuild | 107 | ||||
-rw-r--r-- | www-apps/webdavcgi/webdavcgi-0.8.4.ebuild | 163 | ||||
-rw-r--r-- | www-apps/webdavcgi/webdavcgi-1.1.1.ebuild | 184 |
14 files changed, 978 insertions, 0 deletions
diff --git a/www-apps/webdavcgi/Manifest b/www-apps/webdavcgi/Manifest new file mode 100644 index 000000000000..6ca2a95d7938 --- /dev/null +++ b/www-apps/webdavcgi/Manifest @@ -0,0 +1,18 @@ +AUX 0.8.3-logout-var-expansion.patch 612 SHA256 606e3b10563b11069dfd5c3ece18cb3e5ace6c3f64271616769e06f0da42307d SHA512 8089e9f3614739c98b710da3c873f6667a012b16bbcfc13cb04707cdf9603677294d45a76d82a0c1e194dc15d4d8b09709448187f010181d86fcc68aae104943 WHIRLPOOL 9d1fec10272bea5e5cc657a803051e20fb98f63db6fbb5ecc312542a975355603ddc398b3e40d406a48217445826ae752e7227f2607232f8fe3e5d240dae64fb +AUX apache-webdavcgi-0.8-example.conf 2406 SHA256 0500c09343b5e0795e3287415940b67a96a8e86f6810f4e999bbac4eaa1cf267 SHA512 9d7f521e00056836b54f3d664b837a1048b3e5dce027cd079a4b1ae2d0cdff0fe6387180f3d54ccd53c36b1c19298a27375ebd9ab4bb00bd7d0194800c0994a0 WHIRLPOOL 98ad7b11e6aee4c2d90270463b4784491e448b9aa468a8a56656244f4dfc417a22249d4f847bf0b3cbf1fcee44f58f8f58cd850e5bb61814161e026ff92a6ed4 +AUX apache-webdavcgi-1.1-example.conf 2621 SHA256 356764698bdc572d2df41f5c18a050e3f9f6f0df18fb82c59c2c2cca8ed7cc6e SHA512 36e440c8274a46c3e415291f08eb1263694bcb512c9c5bfe6b58f8c24b4d665672788500fc31d87b104c4a654458572798a2e92ab913bd4a438e39b4e90e6ac8 WHIRLPOOL 0e3c51a0e844471214faa67fc11f117017b5f299cc020c87bcda549213fe8944c53e2e85e5d36cccf550f15670f218ced8a38178a5248bb8a5ecdb43b986be7f +AUX postinstall-en.txt 1133 SHA256 0c749d3de883357c4bd7beee1dfbe9ce1410a56726079c0286a35f5dc84b009e SHA512 207132fd11a1df46e2198fe7134da5db7a15de9b0778481059b088c41d5d8c7bcf2b39d4675cd8a9e65cd546f85693b1ab4ae9b64737985180eb3ff18d292c96 WHIRLPOOL 9f231bce94dfc2effa5cc254eb7e2bebc758b9b502fd1bdced07830b95c3e579234d36a4346771dd8924f3207e5cae7ebcdbb1922754e1d68a97ecda2158233b +AUX postinstall-webdavwrapper-en.txt 1279 SHA256 d3aafde60e52fe3506cc5c6d3fdc5d4b1b20d1a26b054cdaaaffe29b88b42ea3 SHA512 b670dba1bbd11e764bf7244c0b2194de475c16228ec7c7b0864b0131c0a9a10c2a2980df9caecabfa7252a4024c6976ee7060ef94bb2d5b6e3f985d3fa9ab031 WHIRLPOOL b589e1bc128ab2bb9735a837b5ea15e525f63ce93088e43d84961a10fe56b495101361b5257569456c8c4564474d2ec9afac62592d5a15b3869af277746627a1 +AUX reconfig 784 SHA256 4a5a7689b82e55fd9abf25f2abd52e26d3396b67c15360923695ed4791fee854 SHA512 415c692c26693296fc23161d70521d233543f37aeadfc12992cf4b36ee0f25c7c2eed354831767ccf2a386d4479c53534c23800c756cc7b678ef1f5ed60e32f4 WHIRLPOOL 2786c586fd1931c57548c60146c29c3acf35b781e6ec80f69e004a92cdf60ded6e9db78e0079f29fbb5e2ce6bedd981b6fc5b514eaa794910c46c1f75d3a8485 +AUX reconfig-suid 602 SHA256 dcb3e341cfd4bffe52adfa687b603043d73c989724a3a25b9abcd72166372759 SHA512 aa1563edce254668fb43110dc7d24293e926a6d5083da4a3879bcd5b4d205f1f9feae7bd6e0e00bda5303143346f6951e65318276720013ed7744a6d2c609eb2 WHIRLPOOL e09f6845fd0550a781845d5b0a5d8280e647531fa5c61c7184a1c4dd01734c999bcca9d175342559a50eaa3eb47f2325775eef85114ceb4394a83b4b37385eee +AUX webdav-0.8.conf 2872 SHA256 abc1831ad50a8ee44ee324b428aaf6ec1ede9353d631999dbb39ee0c1c6d4841 SHA512 1b1d8c1eb53689e02180fb0e59b0ec992da4f6656d0f9965ebeb483bf4f829da6971273d368b0a1cf8bf9df65089720bc57db76f7f8a8b85e0cf645662a2b869 WHIRLPOOL 9b8308ad7911a9da2a0fc124cbb12ce9194bb8545fbb3bb08a914b4bbafe37f43619eb748f9300e78fd1e5efb3057e9490b9e43e3e50b1a992b6cf40b1d54dcd +AUX webdav-1.1.conf 4450 SHA256 6a05f9197579ce757847db4ae565c88ece7e2782e4718afb1b5e555f71613dbd SHA512 4e867f9d8de4eb3f864ddc0671bf048d1a8daa9e01c830045a7adb5ac712c46925f0ed60d5aeba9acb3f9c3fd259411af23c41476f06d38f3d8f3cb2027c51c8 WHIRLPOOL 11ef850d122316c6d5c32068523cde8a8b5bb8fea7f6433e0922fc3289e18090fc6bd847c44705bb2de5f457c768d7bf7f0f8b01d927f2e4fc8e4b0c51b15887 +DIST webdavcgi-0.8.3.tar.bz2 1190975 SHA256 d8ca7feb1f25f6acce67a5ea769a089edd404660c85633dfbd6303696f1cd294 SHA512 f50e6bb1e78a88ab6bc6452c04f2e5d0cec86f6641d1813556ae3b06c33e2c9250e623926bf1a71ea10f6ca3912e708cb54cd0956b344329de1499887e48e784 WHIRLPOOL e05d0b2e5d6905d3c86e807c1f6b7544c1fa9629f310496648088c2a1a5bb491e507e492b80fa4beb6ab43f9f1d1bbfd095d1b670e3ca88e89b3605f5d790743 +DIST webdavcgi-0.8.4.tar.bz2 1195935 SHA256 d04438a515a770502117b4219ebb5406ed1ab949420802d0ce623fe3f61038ef SHA512 17d9dcfe68012820bf809bc3bd54a881fc9e66a9ddfd87d9381ec0cb08abe3f81638afba4d28ab3079ed56cf1e263b4a764b8348691f17a06743bb1ddf3a2a4e WHIRLPOOL 86d65aad94cd6461f72c39d39f1beb0c24b049a50072ef3b4e16629b388ec562136ee0cb2f93674eaf9342feac077540e98f78b22ad186cf4592cf8d53cbc530 +DIST webdavcgi-1.1.1.tar.bz2 11623234 SHA256 0806ac2c80ad1aba9e8bf9a562ee7884601ece7a59728a91dd83ca542255f0b8 SHA512 660b3e54d72c5b96c1fb329d8e0838b1dbf68e1671af3880f7e096bfdfe559909cf3e1e3069fe4877e0ffbd67d24dc4a38c3db8baaae6d62db05bde31cea789f WHIRLPOOL 952a98c2a15db429ecc3f01f526212d8f4940149ce8585bfb2aa43c0378a8036700c46cd3e1d43a1af9763a665f49e8effbe5e9472a673b8a3e1acdd0ce4220d +EBUILD webdavcgi-0.8.3.ebuild 2766 SHA256 f6bf4a4c2a4dbc46665d81ae79732542ce15b67b50056706550a46a09482439e SHA512 500f6552ca5daaf7595ff3c18ed361015bb191a48705212ab5b74c9b289c15b50a24a604322b3d1b8faa5438c381815b6e9ac5a56f1ccd5dbb2e9805763a8542 WHIRLPOOL 4f18a44398083fd258dccc5eaf7c838e147e5eb860708e77440046ec843a5f652f6f21aae0c5741538bf4b8009b6b7bf9ecb7c38bdb4b27423f38c0d8e4770fb +EBUILD webdavcgi-0.8.4.ebuild 4781 SHA256 37f2015efc4091efa21ee9fee88135a7e6ed3293df13b15723f5a7ea7496f790 SHA512 4a5ca82beca219929bd9190d18eb92a648e8eb68fc2dc91f514f2fb598b7eaeee29cf97a8f233425f7bd0662699a533b19f6f70cd6d0ccd6afa957d05bb86d9d WHIRLPOOL d8c1d0d45ce524b211ebc17e525227e804aa6b985329cbc868c2341e8939f580830a7939f7eafb0a56a1e8c47710246b0486eb60f422970379370938903ad5d4 +EBUILD webdavcgi-1.1.1.ebuild 5736 SHA256 99dd508177bd32d433efeaf91edd1cb73dd28c49dde80ff18b68c7e58ab597f5 SHA512 e4fb54e0f2fee21772eae95816a4b9fca5179a5231606f904db5f61d50ecab7d1ad6922dc87d022dc199b8af5ff7b642148cc662c1413c73ae378648cc94ac8e WHIRLPOOL 7168d93a21091e2b0c8308b634546d7b143d44760530f91d300ea6a99629af128a06f2c23964af19018abaf85b10b72554740dca1f5703b2abd3ec5fb5ae1d60 +MISC ChangeLog 3742 SHA256 d95e2c6afe62e48d3fedf9e7574c2248792e3f0ab57949e01b0356ae271e2b4b SHA512 318817d95cd0d3e136e9335cd539493b17724557ae1f9aebc63758abb81cf61ae43f6482ab55dad888ec0212cf4cb46d71486952b4fa8a966e612493d0c2d814 WHIRLPOOL 4cb3f81017608ac2c6fcec4728b9d87dfee67f5803c0bc04bb4bd510900e767b66648362089fa4ad263c91d66d7e849def60accce7bd0477d76fbb6855b9b1f7 +MISC ChangeLog-2015 1978 SHA256 e2a39719fcf914428621008401a76bc5e12cc77c4688f606251abc29a08759d0 SHA512 2354fd7fbad9f75c8414b879f435d83f04536beca1241cec686c06780f7140e605268bf5dcedc7dbe2257f905f7c50d447ab52ee9685843b3722d2f856e1c528 WHIRLPOOL e57e1bacc674ba6d32cd316b23e9ef4084475b94fbca6a80ec6bc43fa4000b7f819f69434ebb9b2b423d6267e9899168ab5744334bf103bf1ba73e6983093f72 +MISC metadata.xml 1206 SHA256 debe05964cd06d79fabb0c6ba9f95c93cb4d71bc37473f313c6e91e04b58b878 SHA512 054f61a47b0aab4430620fe1a218d701c0fce3b510eb2759b36f01e65abaf3626983a68addc0429df74d1975e6961331df1d686a6512932b232ccae6c51d692c WHIRLPOOL 4815a015530d64764bd9e9e6c29752676562927fb40c2fdb20840c58d501adbdd0d46a1fdea538751b3d47df54eb532a6fdf61275a48e4beb0248411d5ad15a2 diff --git a/www-apps/webdavcgi/files/0.8.3-logout-var-expansion.patch b/www-apps/webdavcgi/files/0.8.3-logout-var-expansion.patch new file mode 100644 index 000000000000..739ff7f4c79b --- /dev/null +++ b/www-apps/webdavcgi/files/0.8.3-logout-var-expansion.patch @@ -0,0 +1,21 @@ +diff -ru cgi-bin.orig/logout-dist cgi-bin/logout-dist +--- cgi-bin.orig/logout-dist 2011-03-22 17:25:52.000000000 +0100 ++++ cgi-bin/logout-dist 2012-10-03 21:44:35.057437306 +0200 +@@ -34,13 +34,13 @@ + # ----- + ### REALM: the basic authentication realm + ### (must be equal to your AuthName value for Apache) +-REALM="Change Me" ++REALM="${REALM:=Change Me}" + + ### HOMEURL: the home URL +-HOMEURL="/changemyhomeurl" ++HOMEURL="${HOMEURL:=/changemyhomeurl}" + +-### TIMEOUT: the refresh timeout for the logut page +-TIMEOUT=0 ++### TIMEOUT: the refresh timeout for the logout page ++TIMEOUT=${TIMEOUT:=0} + + # SETUP END + diff --git a/www-apps/webdavcgi/files/apache-webdavcgi-0.8-example.conf b/www-apps/webdavcgi/files/apache-webdavcgi-0.8-example.conf new file mode 100644 index 000000000000..cf1d4d4dafe0 --- /dev/null +++ b/www-apps/webdavcgi/files/apache-webdavcgi-0.8-example.conf @@ -0,0 +1,59 @@ +# Example Apache HTTP server configuration snippet for WebDAV CGI +# +# Add the following lines to the Apache HTTP virtual host which should run +# WebDAV CGI. +# +# WebDAV CGI will be accessible via http://www.example.com/webdav/ and uses +# basic HTTP authentication (by default). For this to work, you need to add all +# valid users to the AuthUserFile with the help of the htpasswd command: +# +# htpasswd -c /etc/webdavcgi-0.8/default/users.htpasswd user1 +# htpasswd /etc/webdavcgi-0.8/default/users.htpasswd user2 +# +# Note, that if you have the UID/GID wrapper enabled (USE=suid), WebDAV CGI will +# switch to the login user after a successful login, thus the users within the +# AuthType need to present on the system as well. +# +# You probably want to review and change the following settings: +# - /webdavcgi should point to your desired webdavwrapper, which is either +# webdavwrapper, webdavwrapper-afs, webdavwrapper-krb or in case you disabled +# the UID/GID wrapper (USE=-suid), webdav.pl +# +# - The /webdav location +# If you change this location, make sure to reflect the new path within the +# WebDAV CGI configuration (WEBDAVCONF -> $VIRTUAL_BASE) as well. +# +# - The authentication provider and/or AuthUserFile +# +# - The HOMEURL environment variable. After a user logs out, the browser will +# be redirected to this URL. +# +# - The WEBDAVCONF environment variable has to point to your configuration +# +# For further informations and other configuration possibilities consult the +# WebDAV CGI documentation which is located at http://webdavcgi.sourceforge.net +# and the Apache HTTP server documentation at https://httpd.apache.org/docs/ +# + ScriptAlias /webdavcgi "/usr/libexec/webdavcgi-0.8/cgi-bin/webdavwrapper" + ScriptAlias /webdav/logout "/usr/libexec/webdavcgi-0.8/cgi-bin/logout" + + <Location /webdav> + Order Allow,Deny + Allow from all + </Location> + + <Location /webdavcgi> + AuthType Basic + AuthName "WebDAV-CGI" + AuthUserFile /etc/webdavcgi-0.8/default/users.htpasswd + Require valid-user + Order Allow,Deny + Allow from all + </Location> + + + RewriteEngine On + + RewriteRule ^/webdav/logout - [L,E=REALM:WebDAV-CGI,E=HOMEURL:/webdav,E=TIMEOUT:5] + + RewriteRule ^/webdav /webdavcgi [PT,L,E=WEBDAVCONF:/etc/webdavcgi-0.8/default/webdav.conf,E=PERLLIB:/usr/share/webdavcgi-0.8/lib/perl,E=LOGOUTURL:/webdav/logout] diff --git a/www-apps/webdavcgi/files/apache-webdavcgi-1.1-example.conf b/www-apps/webdavcgi/files/apache-webdavcgi-1.1-example.conf new file mode 100644 index 000000000000..4ee926fbd7c7 --- /dev/null +++ b/www-apps/webdavcgi/files/apache-webdavcgi-1.1-example.conf @@ -0,0 +1,63 @@ +# Example Apache HTTP server configuration snippet for WebDAV CGI +# +# Add the following lines to the Apache HTTP virtual host which should run +# WebDAV CGI. +# +# WebDAV CGI will be accessible via http://www.example.com/webdav/ and uses +# basic HTTP authentication (by default). For this to work, you need to add all +# valid users to the AuthUserFile with the help of the htpasswd command: +# +# htpasswd -c /etc/webdavcgi-1.1/default/users.htpasswd user1 +# htpasswd /etc/webdavcgi-1.1/default/users.htpasswd user2 +# +# Note, that if you have the UID/GID wrapper enabled (USE=suid), WebDAV CGI will +# switch to the login user after a successful login, thus the users within the +# AuthType need to be present on the system as well. +# +# You probably want to review and change the following settings: +# - /webdavcgi should point to your desired webdavwrapper, which is either +# webdavwrapper, webdavwrapper-afs, webdavwrapper-krb or in case you disabled +# the UID/GID wrapper (USE=-suid), webdav.pl +# +# - The /webdav location +# If you change this location, make sure to reflect the new path within the +# WebDAV CGI configuration (WEBDAVCONF -> $VIRTUAL_BASE) as well. +# +# - The authentication provider and/or AuthUserFile +# +# - The HOMEURL environment variable. After a user logs out, the browser will +# be redirected to this URL. +# +# - The WEBDAVCONF environment variable has to point to your configuration +# +# For further informations and other configuration possibilities consult the +# WebDAV CGI documentation which is located at http://webdavcgi.sourceforge.net +# and the Apache HTTP server documentation at https://httpd.apache.org/docs/ +# + ScriptAlias /webdavcgi "/usr/libexec/webdavcgi-1.1/cgi-bin/webdavwrapper" + ScriptAlias /webdav/logout "/usr/libexec/webdavcgi-1.1/cgi-bin/logout" + + <Location /webdav> + Require all granted + # Disable the line above and enable the two lines below + # if you're still on Apache 2.2 + #Order Allow,Deny + #Allow from all + </Location> + + <Location /webdavcgi> + AuthType Basic + AuthName "WebDAV-CGI" + AuthUserFile /etc/webdavcgi-1.1/default/users.htpasswd + Require valid-user + # Also enable the following two lines if you're still on Apache 2.2 + #Order Allow,Deny + #Allow from all + </Location> + + + RewriteEngine On + + RewriteRule ^/webdav/logout - [L,E=REALM:WebDAV-CGI,E=HOMEURL:/webdav,E=TIMEOUT:5] + + RewriteRule ^/webdav /webdavcgi [PT,L,E=WEBDAVCONF:/etc/webdavcgi-1.1/default/webdav.conf,E=PERLLIB:/usr/share/webdavcgi-1.1/lib/perl,E=LOGOUTURL:/webdav/logout] diff --git a/www-apps/webdavcgi/files/postinstall-en.txt b/www-apps/webdavcgi/files/postinstall-en.txt new file mode 100644 index 000000000000..8aa6f95d87a2 --- /dev/null +++ b/www-apps/webdavcgi/files/postinstall-en.txt @@ -0,0 +1,29 @@ +Before you can run WebDAV CGI you need to configure your web server and WebDAV +CGI itself. + +The following configuration snippet serves as an example for the Apache HTTPD +web server. You will have to adapt it to suite your own server and configuration +needs. + + ScriptAlias /cgi-bin/ "${VHOST_CGIBINDIR}/" + + <Location /${VHOST_CGIBINDIR##*/}/> + AuthType Basic + AuthName "WebDAV-CGI" + AuthUserFile ${VHOST_ROOT}/etc/users.htpasswd + Require valid-user + Order Allow,Deny + Allow from all + </Location> + + RewriteEngine On + RewriteRule ^/${VHOST_APPDIR}/logout /${VHOST_CGIBINDIR##*/}/logout [PT,E=REALM:WebDAV-CGI,E=HOMEURL:/${VHOST_APPDIR},L] + RewriteRule ^/${VHOST_APPDIR} /${VHOST_CGIBINDIR##*/}/webdav.pl [PT,E=WEBDAVCONF:${VHOST_ROOT}/etc/webdav.conf,E=PERLLIB:${VHOST_ROOT}/lib/perl,L] + + +Afterwards you need to copy the default configuration file and edit it: +cp -p ${VHOST_ROOT}/etc/{webdav.conf-dist,webdav.conf} +\$EDITOR ${VHOST_ROOT}/etc/webdav.conf + +For further informations study the online documentation which is located at: +http://webdavcgi.sourceforge.net/doc.html diff --git a/www-apps/webdavcgi/files/postinstall-webdavwrapper-en.txt b/www-apps/webdavcgi/files/postinstall-webdavwrapper-en.txt new file mode 100644 index 000000000000..5f30d81be7b6 --- /dev/null +++ b/www-apps/webdavcgi/files/postinstall-webdavwrapper-en.txt @@ -0,0 +1,32 @@ +Before you can run WebDAV CGI you need to configure your web server and WebDAV +CGI itself. + +The following configuration snippet serves as an example for the Apache HTTPD +web server. You will have to adapt it to suite your own server and configuration +needs. + + ScriptAlias /cgi-bin/ "${VHOST_CGIBINDIR}/" + + <Location /${VHOST_CGIBINDIR##*/}/> + AuthType Basic + AuthName "WebDAV-CGI" + AuthUserFile ${VHOST_ROOT}/etc/users.htpasswd + Require valid-user + Order Allow,Deny + Allow from all + </Location> + + RewriteEngine On + RewriteRule ^/${VHOST_APPDIR}/logout /${VHOST_CGIBINDIR##*/}/logout [PT,E=REALM:WebDAV-CGI,E=HOMEURL:/${VHOST_APPDIR},L] + RewriteRule ^/${VHOST_APPDIR} /${VHOST_CGIBINDIR##*/}/webdavwrapper [PT,E=WEBDAVCONF:${VHOST_ROOT}/etc/webdav.conf,E=PERLLIB:${VHOST_ROOT}/lib/perl,L] + + +Afterwards you need to copy the default configuration file and edit it: +cp -p ${VHOST_ROOT}/etc/{webdav.conf-dist,webdav.conf} +\$EDITOR ${VHOST_ROOT}/etc/webdav.conf + +Also make sure that all system users which should be able to login to WebDAV CGI +are able to access the installed files below ${VHOST_ROOT}. + +For further informations study the online documentation which is located at: +http://webdavcgi.sourceforge.net/doc.html diff --git a/www-apps/webdavcgi/files/reconfig b/www-apps/webdavcgi/files/reconfig new file mode 100644 index 000000000000..07710dd7c3e9 --- /dev/null +++ b/www-apps/webdavcgi/files/reconfig @@ -0,0 +1,32 @@ +#!/bin/bash + +confDir="etc" +distConfFile="webdav.conf-dist" + +sedCmd="/bin/sed" + + +function die () +{ + echo "reconfig error: $1" >&2 + exit 1 +} + + +if [ $1 != "install" ]; then + # nothing to be done, exit + exit 0 +fi + +# Set the correct path within the config file +distConfFilePath="${VHOST_ROOT}/${confDir}/${distConfFile}" +if ! ${sedCmd} -i -e "s|^\(\$INSTALL_BASE\)=.*|\1='${VHOST_ROOT}/';|" \ + ${distConfFilePath} +then + die "Setting INSTALL_BASE path in ${distConfFilePath} failed" +fi + + +# Adding logout support +# see: http://webdavcgi.sourceforge.net/doc.html#logout +echo "\$HEADER = '<div class=\"header\">WebDAV CGI - Web interface: You are logged in as <span title="'.`id -a`.'">' .\$ENV{REMOTE_USER}.'</span> (<a href="/logout">Logout</a>).</div>';" >> ${distConfFilePath} diff --git a/www-apps/webdavcgi/files/reconfig-suid b/www-apps/webdavcgi/files/reconfig-suid new file mode 100644 index 000000000000..d7fb87722614 --- /dev/null +++ b/www-apps/webdavcgi/files/reconfig-suid @@ -0,0 +1,26 @@ +#!/bin/bash + +webDavWrapper="webdavwrapper" +webDavWrapperPath="${VHOST_CGIBINDIR}/${webDavWrapper}" + +chmodCmd="/bin/chmod" +chownCmd="/bin/chown" + + +function die () +{ + echo "reconfig error: $1" >&2 + exit 1 +} + +if [ $1 = "install" ]; then + # In order to change the user and group ID at runtime, the webdavwrapper + # needs to be run as root (set-user-ID and set-group-ID bit) + if ! ${chownCmd} root:root ${webDavWrapperPath}; then + die "Chown for ${webDavWrapperPath} failed" + fi + + if ! ${chmodCmd} 6755 ${webDavWrapperPath}; then + die "Setting SUID and SGID bit on ${webDavWrapperPath} failed" + fi +fi diff --git a/www-apps/webdavcgi/files/webdav-0.8.conf b/www-apps/webdavcgi/files/webdav-0.8.conf new file mode 100644 index 000000000000..8563df7ad617 --- /dev/null +++ b/www-apps/webdavcgi/files/webdav-0.8.conf @@ -0,0 +1,88 @@ +## -- INSTALL_BASE +## folder path to the webdav.conf, .css, .js, and. msg files for the Web +## interface +## (don't forget the trailing slash) +$INSTALL_BASE='/usr/share/webdavcgi-0.8/'; + +## -- VIRTUAL_BASE +## only neccassary if you use redirects or rewrites from a VIRTUAL_BASE to +## the DOCUMENT_ROOT; +## regular expressions are allowed +## EXAMPLE: $VIRTUAL_BASE = '/'; +$VIRTUAL_BASE = '/webdav'; + +## -- DOCUMENT_ROOT +## by default the server document root +## (don't forget a trailing slash '/'): +$DOCUMENT_ROOT = '/home/'; + +## -- UMASK +## mask for file/folder creation +## (it does not change permission of existing files/folders): +$UMASK = 0007; + +## -- ENABLE_DAVMOUNT +## enables DAV mount button in the folder navigation of the Web interface +$ENABLE_DAVMOUNT = 1; + +## -- ENABLE_COMPRESSION +## enables/disables gzip content encoding for the Web interface +$ENABLE_COMPRESSION = 0; + +## -- PAGE_LIMIT +## limits number of files/folders shown in the Web interface +$PAGE_LIMIT=100; + +## -- PAGE_LIMITS +## allowed selectable limits (-1 = show all) +@PAGE_LIMITS = ( 5, 10, 15, 20, 30, 50, 100, -1); + +## -- DBI_(SRC/USER/PASS) +## database setup for LOCK/UNLOCK/PROPPATCH/PROPFIND data +## +## SQLite config +## If users share the same folder they should use the same database +## in this case you have to use a single file writeable for all users. +#$DBI_SRC='dbi:SQLite:dbname=/var/lib/webdavcgi/0.8/default/webdav.db'; +#$DBI_USER=''; +#$DBI_PASS=''; +#$CREATE_DB = !-e '/var/lib/webdavcgi/0.8/default/webdav.db'; + +## MySQL config +#$DBI_SRC='DBI:mysql:database=webdavcgi;host=localhost;port=3306'; +#$DBI_USER='mysqluser'; +#$DBI_PASS='changeme'; +#$CREATE_DB=0; + +## PostgreSQL config +#$DBI_SRC='dbi:Pg:dbname=webdavcgi;host=localhost;port=5432'; +#$DBI_USER='pguser'; +#$DBI_PASS='changeme'; +#$CREATE_DB = 0; + +## -- HEADER +## content after body tag in the Web interface +$HEADER = '<div class="header">WebDAV CGI - Web interface: You are logged in as <span title=.`id -a`.>' .$ENV{REMOTE_USER}.'</span> (<a href="'.$ENV{LOGOUTURL}.'">Logout</a>).</div>'; + +## -- ENABLE_CALDAV +## Disable CalDAV support for Lightning/Sunbird/iCal/iPhone calender/task +## support +$ENABLE_CALDAV = 0; + +## -- ENABLE_GROUPDAV +## Disables GroupDAV (http://groupdav.org/draft-hess-groupdav-01.txt) +$ENABLE_GROUPDAV = 0; + +## -- ENABLE_THUMBNAIL +## Disable image thumbnail support and media rss feed for folder listings of the +## Web interface. +## If enabled the default icons for images will be replaced by thumbnails +## and if the mouse is over a icon the icon will be zoomed to the size of +## $THUMBNAIL_WIDTH. +$ENABLE_THUMBNAIL = 0; + +## -- THUMBNAIL_CACHEDIR +## defines the path to a cache directory for image thumbnails +## this is neccessary if you enable the thumbnail cache ($ENABLE_THUMBNAIL_CACHE) +## EXAMPLE: $THUMBNAIL_CACHEDIR=".thumbs"; +$THUMBNAIL_CACHEDIR="/var/cache/webdavcgi/0.8/default/thumbnails"; diff --git a/www-apps/webdavcgi/files/webdav-1.1.conf b/www-apps/webdavcgi/files/webdav-1.1.conf new file mode 100644 index 000000000000..60a08c819226 --- /dev/null +++ b/www-apps/webdavcgi/files/webdav-1.1.conf @@ -0,0 +1,125 @@ +######################################################################### +############ S E T U P ################################################# + +## -- INSTALL_BASE +## folder path to the webdav.conf, .css, .js, and. msg files for the Web interface +## (don't forget the trailing slash) +## DEFAULT: $INSTALL_BASE=q{} # use webdav.pl script path +$INSTALL_BASE = '/usr/share/webdavcgi-1.1/'; + +## -- VIRTUAL_BASE +## only neccassary if you use redirects or rewrites from a VIRTUAL_BASE to the DOCUMENT_ROOT; +## regular expressions are allowed +## EXAMPLE: $VIRTUAL_BASE = qr{/}xms +$VIRTUAL_BASE = '/webdav'; + +## -- DOCUMENT_ROOT +## by default the server document root +## (don't forget a trailing slash q{/}): +$DOCUMENT_ROOT = '/home/'; + +## -- UMASK +## mask for file/folder creation +## (it does not change permission of existing files/folders): +## DEFAULT: $UMASK = oct 2; # read/write/execute for users and groups, others get read/execute permissions +$UMASK = 0007; + +## -- MIMEFILE +## path to your MIME types file +## EXAMPLE: $MIMEFILE = '/etc/mime.types'; +$MIMEFILE = '/etc/webdavcgi-1.1/default/mime.types'; + +## -- ENABLE_COMPRESSION +## enables/disables gzip content encoding for the Web interface +## EXAMPLE: $ENABLE_COMPRESSION = 1; +$ENABLE_COMPRESSION = 0; + +## -- ENABLE_DAVMOUNT +## enables DAV mount button in the folder navigation of the Web interface +## DEFAULT: $ENABLE_DAVMOUNT = 0; +$ENABLE_DAVMOUNT = 1; + + +## -- HEADER +## content after body tag in the Web interface +$HEADER = +q{<div class="header">WebDAV CGI - Web interface: You are logged in as ${USER} (<a href="$ENV{LOGOUTURL}" style="color:inherit;">Logout</a>) <div style="float:right;font-size:0.8em;">$NOW</div></div>.}; + +## -- DBI_(SRC/USER/PASS) +## database setup for LOCK/UNLOCK/PROPPATCH/PROPFIND data +## +## SQLite config +## If users share the same folder they should use the same database +## in this case you have to use a single file writeable for all users. +#$DBI_SRC='dbi:SQLite:dbname=/var/lib/webdavcgi/1.1/default/webdav.db'; +#$DBI_USER=''; +#$DBI_PASS=''; +#$CREATE_DB = !-e '/var/lib/webdavcgi/1.1/default/webdav.db'; + +## MySQL config +#$DBI_SRC='DBI:mysql:database=webdavcgi;host=localhost;port=3306'; +#$DBI_USER='mysqluser'; +#$DBI_PASS='changeme'; +#$CREATE_DB=0; + +## PostgreSQL config +#$DBI_SRC='dbi:Pg:dbname=webdavcgi;host=localhost;port=5432'; +#$DBI_USER='pguser'; +#$DBI_PASS='changeme'; +#$CREATE_DB = 0; + +## -- ENABLE_CALDAV +## enable CalDAV support for Lightning/Sunbird/iCal/iPhone calender/task support +$ENABLE_CALDAV = 0; + +## -- ENABLE_CARDDAV +## enable CardDAV support for Apple's Addressbook +$ENABLE_CARDDAV = 0; + +## -- ENABLE_TRASH +## enables the server-side trash can (don't forget to setup $TRASH_FOLDER) +$ENABLE_TRASH = 0; + +## -- TRASH_FOLDER +## neccessary if you enable trash +## it should be writable by your users (chmod a+rwxt <trash folder>) +## EXAMPLE: $TRASH_FOLDER = '/tmp/trash'; +$TRASH_FOLDER = '/var/tmp/webdavcgi/1.1/default/trash'; + +## -- ENABLE_GROUPDAV +## enables GroupDAV (http://groupdav.org/draft-hess-groupdav-01.txt) +## EXAMPLE: $ENABLE_GROUPDAV = 0; +$ENABLE_GROUPDAV = 0; + +## -- ENABLE_THUMBNAIL +## enables image thumbnail support and media rss feed for folder listings of the Web interface. +## If enabled the default icons for images will be replaced by thumbnails +## and if the mouse is over a icon the icon will be zoomed to the size of $THUMBNAIL_WIDTH. +## DEFAULT: $ENABLE_THUMBNAIL = 0; +$ENABLE_THUMBNAIL = 0; + +## -- THUMBNAIL_CACHEDIR +## defines the path to a cache directory for image thumbnails +## this is neccessary if you enable the thumbnail cache ($ENABLE_THUMBNAIL_CACHE) +## EXAMPLE: $THUMBNAIL_CACHEDIR=".thumbs"; +$THUMBNAIL_CACHEDIR = '/var/tmp/webdavcgi/1.1/default/thumbnails'; + +## -- OPTIMIZERTMP +### defines absolute path to a cache directory +$OPTIMIZERTMP = '/var/tmp/webdavcgi/1.1/default/optimized'; + +## -- BACKEND +## defines the WebDAV/Web interface backend (see $INSTALL_BASE/lib/perl/Backend/<BACKEND> for supported backends) +$BACKEND = 'FS'; + +## -- BACKEND_CONFIG +## allowes backend specific configurations (see doc/doc.html) +## EXAMPLE: $BACKEND_CONFIG{FS}={ fsvlink=> { '/home/testuser/' => {'testlink' => '/home/testuser/testlinkdest' } }} + +## -- DEBUG +## enables/disables debug output +## you can find the debug output in your web server error log +$DEBUG = 0; + +############ S E T U P - END ########################################### +######################################################################### diff --git a/www-apps/webdavcgi/metadata.xml b/www-apps/webdavcgi/metadata.xml new file mode 100644 index 000000000000..a439d73731fd --- /dev/null +++ b/www-apps/webdavcgi/metadata.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>c.affolter@purplehaze.ch</email> + <description>Maintainer</description> + </maintainer> + <maintainer type="person"> + <email>dev-zero@gentoo.org</email> + <description>Proxy maintainer</description> + </maintainer> + <maintainer type="project"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <longdescription> + WebDAV CGI is a Perl CGI script that enables the WebDAV protocol + (class 1,2,3) for Web server to manage Web sites or to use a Web server + as a Web drive for files, or for calendar/addressbook sharing. If you + need correct permissions for files and folders you can install this + WebDAV CGI script and a UID/GID wrapper. The Apache module mod_dav does + not support UID/GID wrapping, so this implementation fills up this gap + as a complete replacement. + </longdescription> + <use> + <flag name="rcs">Adds support for a revision controlled backend with RCS (<pkg>dev-vcs/rcs</pkg>)</flag> + </use> + <upstream> + <remote-id type="sourceforge">webdavcgi</remote-id> + </upstream> +</pkgmetadata> diff --git a/www-apps/webdavcgi/webdavcgi-0.8.3.ebuild b/www-apps/webdavcgi/webdavcgi-0.8.3.ebuild new file mode 100644 index 000000000000..b2e189821039 --- /dev/null +++ b/www-apps/webdavcgi/webdavcgi-0.8.3.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 + +inherit eutils toolchain-funcs webapp + +DESCRIPTION="A Perl CGI for accessing and sharing files, or calendar/addressbooks via WebDAV" +HOMEPAGE="http://webdavcgi.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" + +LICENSE="GPL-3" +SLOT="0" +WEBAPP_MANUAL_SLOT="yes" +KEYWORDS="~amd64" +IUSE="mysql postgres rcs samba +sqlite +suid" + +DEPEND="" +RDEPEND="dev-perl/Archive-Zip + dev-perl/File-Copy-Link + dev-perl/PerlIO-gzip + dev-perl/Quota + dev-perl/TimeDate + dev-perl/URI + dev-perl/UUID-Tiny + dev-perl/XML-Simple + media-gfx/graphicsmagick[perl] + mysql? ( dev-perl/DBD-mysql ) + virtual/perl-Module-Load + postgres? ( dev-perl/DBD-Pg ) + rcs? ( dev-perl/Rcs ) + samba? ( dev-perl/Filesys-SmbClient ) + sqlite? ( dev-perl/DBD-SQLite ) + dev-perl/CGI + virtual/perl-File-Spec" + +need_httpd_cgi + +REQUIRED_USE="|| ( mysql postgres sqlite )" + +CGIBINDIR="cgi-bin" + +src_prepare() { + epatch "${FILESDIR}/${PV}-logout-var-expansion.patch" +} + +src_compile() { + if use suid; then + # There are several webdavwrappers, TODO: make it configureable + export WEBDAVWRAPPER="webdavwrapper" + + $(tc-getCC) ${LDFLAGS} ${CFLAGS} \ + -o "${CGIBINDIR}/${WEBDAVWRAPPER}" \ + helper/webdavwrapper.c || die "compile ${WEBDAVWRAPPER} failed" + fi +} + +src_install() { + webapp_src_preinst + + local htdocsDir='htdocs' + local confDir='etc' + + local installDirs="$confDir lib locale" + + insinto "${MY_HTDOCSDIR}" + doins -r "${htdocsDir}"/* + + exeinto "${MY_CGIBINDIR}" + newexe "${CGIBINDIR}/logout-dist" logout + + doexe "${CGIBINDIR}/webdav.pl" + use suid && doexe "${CGIBINDIR}/${WEBDAVWRAPPER}" + + local currentDir + for currentDir in ${installDirs}; do + dodir "${MY_HOSTROOTDIR}/${currentDir}" + insinto "${MY_HOSTROOTDIR}/${currentDir}" + doins -r "${currentDir}"/* + done + + webapp_configfile "${MY_HOSTROOTDIR}/${confDir}"/{webdav.conf-dist,mime.types} + + use mysql && webapp_sqlscript mysql sql/mysql.sql + use postgres && webapp_sqlscript postgres sql/postgresql.sql + + dodoc CHANGELOG TODO + dohtml -r doc/* + + webapp_hook_script "${FILESDIR}/reconfig" + + webapp_src_install + + # In order to change the user and group ID at runtime, the webdavwrapper + # needs to be run as root (set-user-ID and set-group-ID bit) + if use suid; then + einfo "Setting SUID and SGID bit for ${WEBDAVWRAPPER}" + fowners root:root "${MY_CGIBINDIR}/${WEBDAVWRAPPER}" + fperms 6755 "${MY_CGIBINDIR}/${WEBDAVWRAPPER}" + webapp_postinst_txt en "${FILESDIR}/postinstall-${WEBDAVWRAPPER}-en.txt" + webapp_hook_script "${FILESDIR}/reconfig-suid" + else + ewarn "You have the 'suid' USE flag disabled" + ewarn "WebDAV CGI won't be able to switch user ids" + webapp_postinst_txt en "${FILESDIR}/postinstall-en.txt" + fi +} diff --git a/www-apps/webdavcgi/webdavcgi-0.8.4.ebuild b/www-apps/webdavcgi/webdavcgi-0.8.4.ebuild new file mode 100644 index 000000000000..45fbb4226ce9 --- /dev/null +++ b/www-apps/webdavcgi/webdavcgi-0.8.4.ebuild @@ -0,0 +1,163 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit eutils toolchain-funcs versionator + +DESCRIPTION="A Perl CGI for accessing and sharing files, or calendar/addressbooks via WebDAV" +HOMEPAGE="http://webdavcgi.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" + +LICENSE="GPL-3" + +# Provide slotting on minor versions. WebDAV CGI is a web application which +# can be shared by multiple instances and thus major updates shouldn't be +# enforced to all users/instances at the same time. +SLOT="$(get_version_component_range 1-2)" + +KEYWORDS="~amd64" +IUSE="afs kerberos mysql postgres rcs samba +sqlite +suid" + +DEPEND="" +RDEPEND="!www-apps/webdavcgi:0 + afs? ( net-fs/openafs ) + dev-lang/perl + dev-perl/Archive-Zip + dev-perl/File-Copy-Link + dev-perl/PerlIO-gzip + dev-perl/Quota + dev-perl/TimeDate + dev-perl/URI + dev-perl/UUID-Tiny + dev-perl/XML-Simple + kerberos? ( virtual/krb5 ) + media-gfx/graphicsmagick[perl] + mysql? ( dev-perl/DBD-mysql ) + virtual/perl-Module-Load + postgres? ( dev-perl/DBD-Pg ) + rcs? ( dev-perl/Rcs ) + samba? ( dev-perl/Filesys-SmbClient ) + sqlite? ( dev-perl/DBD-SQLite ) + dev-perl/CGI + virtual/perl-File-Spec + || ( virtual/httpd-cgi virtual/httpd-fastcgi )" + +REQUIRED_USE="|| ( mysql postgres sqlite )" + +CGIBINDIR="cgi-bin" + +src_compile() { + if use suid; then + WEBDAVWRAPPERS="webdavwrapper" # Standard UID/GID wrapper + + use afs && WEBDAVWRAPPERS+=" webdavwrapper-afs" + use kerberos && WEBDAVWRAPPERS+=" webdavwrapper-krb" + + export WEBDAVWRAPPERS + + local wrapper + for wrapper in ${WEBDAVWRAPPERS}; do + $(tc-getCC) ${LDFLAGS} ${CFLAGS} \ + -o "${CGIBINDIR}/${wrapper}" \ + "helper/${wrapper}.c" || die "compile ${wrapper} failed" + done + fi +} + +src_install() { + exeinto "/usr/libexec/${PN}-${SLOT}/${CGIBINDIR}" + newexe "${CGIBINDIR}/logout-dist" "logout" + doexe "${CGIBINDIR}/webdav.pl" + + use afs && doexe "${CGIBINDIR}/afswrapper" + use samba && doexe "${CGIBINDIR}/smbwrapper" + + if use suid; then + # In order to change the user and group ID at runtime, the webdavwrapper + # needs to be run as root (set-user-ID and set-group-ID bit) + exeopts -o root -g root -m 6755 + + local wrapper + for wrapper in ${WEBDAVWRAPPERS}; do + einfo "Installing UID/GID wrapper ${wrapper}" + doexe "${CGIBINDIR}/${wrapper}" + done + + # reset install opts + exeopts + else + ewarn "You have the 'suid' USE flag disabled" + ewarn "WebDAV CGI won't be able to switch user ids" + fi + + local confDir='etc' + local webdavConfDir="/etc/${PN}-${SLOT}/default" + + export WEBDAVCONFIG="${webdavConfDir}/webdav.conf" + + insinto "${webdavConfDir}" + doins "${confDir}/mime.types" + newins "${FILESDIR}/webdav-${SLOT}.conf" "webdav.conf" + + local installBaseDir="/usr/share/${PN}-${SLOT}" + local currentDir + for currentDir in htdocs lib locale; do + insinto "${installBaseDir}/${currentDir}" + doins -r "${currentDir}"/* + done + + if use mysql || use postgres; then + local sqlDir='sql' + insinto "${installBaseDir}/${sqlDir}" + use mysql && "${sqlDir}/mysql.sql" + use postgres && "${sqlDir}/postgresql.sql" + fi + + if use sqlite; then + # Directory where the SQLite database resides + local sqliteRootDir="/var/lib/${PN}/${SLOT}" + keepdir "${sqliteRootDir}" + + # Default database directory where all users are able to create and + # share the databases, this can be changed within the config file and + # restricted to user/group only access if required. + export SQLITEDIR="${sqliteRootDir}/default" + keepdir "${SQLITEDIR}" + fperms 1777 "${SQLITEDIR}" + fi + + # Default thumbnail directory, writable by all users + export THUMBNAILDIR="/var/cache/${PN}/${SLOT}/default/thumbnails" + keepdir "${THUMBNAILDIR}" + fperms 1777 "${THUMBNAILDIR}" + + export APACHEEXAMPLECONFIG="apache-webdavcgi-${SLOT}-example.conf" + dodoc CHANGELOG TODO + dodoc "${FILESDIR}/${APACHEEXAMPLECONFIG}" + dohtml -r doc/* +} + +pkg_postinst() { + ewarn "In order to allow different users to create and share files," + ewarn "some directories were installed with world write access by default." + ewarn "To set restrictive permissions, add all WebDAV CGI users to a" + ewarn "common group, and allow access to the following directories by this" + ewarn "group only." + ewarn "Thumbnail directory: ${THUMBNAILDIR}" + use sqlite && ewarn "SQLite directory: ${SQLITEDIR}" + + ewarn + ewarn "Until bug #456180 is fixed, you probably have to re-emerge" + ewarn "media-gfx/graphicsmagick" + + elog + elog "The WebDAV CGI config is located at ${WEBDAVCONFIG}." + elog + elog "An example Apache HTTP server configuration snippet is available in" + elog "/usr/share/doc/${PF} in the file ${APACHEEXAMPLECONFIG}" + + einfo + einfo "Detailed installation and configuration instructions can be found at" + einfo "http://webdavcgi.sourceforge.net/" +} diff --git a/www-apps/webdavcgi/webdavcgi-1.1.1.ebuild b/www-apps/webdavcgi/webdavcgi-1.1.1.ebuild new file mode 100644 index 000000000000..54da3b6b4416 --- /dev/null +++ b/www-apps/webdavcgi/webdavcgi-1.1.1.ebuild @@ -0,0 +1,184 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils toolchain-funcs versionator + +DESCRIPTION="A Perl CGI for accessing and sharing files, or calendar/addressbooks via WebDAV." +HOMEPAGE="http://webdavcgi.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" + +LICENSE="GPL-3+" + +# Provide slotting on minor versions. WebDAV CGI is a web application which +# can be shared by multiple instances and thus major updates shouldn't be +# enforced to all users/instances at the same time. +SLOT="$(get_version_component_range 1-2)" + +KEYWORDS="~amd64" +IUSE="afs git kerberos ldap mysql pdf postgres rcs samba +sqlite +suid" + +DEPEND="" +RDEPEND="afs? ( net-fs/openafs ) + dev-lang/perl + dev-perl/Archive-Zip + dev-perl/CGI + dev-perl/DateTime + dev-perl/DateTime-Format-Human-Duration + dev-perl/File-Copy-Link + dev-perl/JSON + dev-perl/List-MoreUtils + dev-perl/MIME-tools + dev-perl/PerlIO-gzip + dev-perl/Quota + dev-perl/TimeDate + dev-perl/URI + dev-perl/UUID-Tiny + dev-perl/XML-Simple + git? ( dev-vcs/git ) + kerberos? ( virtual/krb5 ) + ldap? ( dev-perl/perl-ldap ) + media-gfx/graphicsmagick[perl] + media-libs/exiftool + mysql? ( dev-perl/DBD-mysql ) + pdf? ( app-text/ghostscript-gpl ) + postgres? ( dev-perl/DBD-Pg ) + rcs? ( dev-perl/Rcs ) + samba? ( net-fs/cifs-utils dev-perl/Filesys-SmbClient ) + sqlite? ( dev-perl/DBD-SQLite ) + virtual/perl-File-Spec + virtual/perl-Module-Load + || ( virtual/httpd-cgi virtual/httpd-fastcgi )" + +REQUIRED_USE="|| ( mysql postgres sqlite )" + +CGIBINDIR="cgi-bin" + +src_compile() { + if use suid; then + WEBDAVWRAPPERS="webdavwrapper" # Standard UID/GID wrapper + + use afs && WEBDAVWRAPPERS+=" webdavwrapper-afs" + use kerberos && WEBDAVWRAPPERS+=" webdavwrapper-krb" + + export WEBDAVWRAPPERS + + local wrapper + for wrapper in ${WEBDAVWRAPPERS}; do + $(tc-getCC) ${LDFLAGS} ${CFLAGS} \ + -o "${CGIBINDIR}/${wrapper}" \ + "helper/${wrapper}.c" || die "compile ${wrapper} failed" + done + fi +} + +src_install() { + exeinto "/usr/libexec/${PN}-${SLOT}/${CGIBINDIR}" + newexe "${CGIBINDIR}/logout-dist" "logout" + doexe "${CGIBINDIR}/webdav.pl" + + use afs && doexe "${CGIBINDIR}/afswrapper" + use samba && doexe "${CGIBINDIR}/smbwrapper" + + if use suid; then + # In order to change the user and group ID at runtime, the webdavwrapper + # needs to be run as root (set-user-ID and set-group-ID bit) + exeopts -o root -g root -m 6755 + + local wrapper + for wrapper in ${WEBDAVWRAPPERS}; do + einfo "Installing UID/GID wrapper ${wrapper}" + doexe "${CGIBINDIR}/${wrapper}" + done + + # reset install opts + exeopts + else + ewarn "You have the 'suid' USE flag disabled" + ewarn "WebDAV CGI won't be able to switch user ids" + fi + + local confDir='etc' + local webdavConfDir="/etc/${PN}-${SLOT}/default" + + export WEBDAVCONFIG="${webdavConfDir}/webdav.conf" + + insinto "${webdavConfDir}" + doins "${confDir}/mime.types" + newins "${FILESDIR}/webdav-${SLOT}.conf" "webdav.conf" + + local installBaseDir="/usr/share/${PN}-${SLOT}" + local currentDir + for currentDir in htdocs lib locale templates; do + insinto "${installBaseDir}/${currentDir}" + doins -r "${currentDir}"/* + done + + if use mysql || use postgres; then + local sqlDir='sql' + insinto "${installBaseDir}/${sqlDir}" + use mysql && doins "${sqlDir}/mysql.sql" + use postgres && doins "${sqlDir}/postgresql.sql" + fi + + if use sqlite; then + # Directory where the SQLite database resides + local sqliteRootDir="/var/lib/${PN}/${SLOT}" + keepdir "${sqliteRootDir}" + + # Default database directory where all users are able to create and + # share the databases, this can be changed within the config file and + # restricted to user/group only access if required. + export SQLITEDIR="${sqliteRootDir}/default" + keepdir "${SQLITEDIR}" + fperms 1777 "${SQLITEDIR}" + fi + + # Create default temporary directories, writable by all users + export TMPDIRS="trash thumbnails optimized" + for tmpDir in ${TMPDIRS}; do + keepdir "/var/tmp/${PN}/${SLOT}/default/${tmpDir}" + fperms 1777 "/var/tmp/${PN}/${SLOT}/default/${tmpDir}" + done + + export APACHEEXAMPLECONFIG="apache-webdavcgi-${SLOT}-example.conf" + dodoc CHANGELOG + dodoc etc/webdav.conf.complete + dodoc "${FILESDIR}/${APACHEEXAMPLECONFIG}" + dodoc -r "doc/" +} + +pkg_postinst() { + ewarn "In order to allow different users to create and share files," + ewarn "some directories were installed with world write access by default." + ewarn "To set restrictive permissions, add all WebDAV CGI users to a" + ewarn "common group, and allow access to the following directories by this" + ewarn "group only." + ewarn "Temp directories: /var/tmp/${PN}/${SLOT}/default/*" + use sqlite && ewarn "SQLite directory: ${SQLITEDIR}" + + elog + elog "The WebDAV CGI config is located at ${WEBDAVCONFIG}." + elog + elog "An example Apache HTTP server configuration snippet is available in" + elog "${ROOT%/}/usr/share/doc/${PF} in the file ${APACHEEXAMPLECONFIG}" + elog + elog "An important note to systemd user's running the Apache HTTP server:" + elog "The default apache2.service will be started with private file system" + elog "namespaces for /var/tmp and /tmp enabled (PrivateTmp=true)." + elog "This means that you either need to disable PrivateTmp, relocate the" + elog "directories starting with /var/tmp within ${WEBDAVCONFIG}" + elog "or pre-create the directory structure with a user defined systemd" + elog "companion unit using the JoinsNamespaceOf directive." + elog + elog "To disable the private file system namespace, override the existing" + elog "service:" + elog "systemctl edit apache2.service" + elog "[Service]" + elog "PrivateTmp=false" + + einfo + einfo "Detailed installation and configuration instructions can be found at" + einfo "http://webdavcgi.sourceforge.net/" +} |