summaryrefslogtreecommitdiff
path: root/sys-fs/udftools
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-fs/udftools
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-fs/udftools')
-rw-r--r--sys-fs/udftools/Manifest26
-rw-r--r--sys-fs/udftools/files/cdrwtool-linux2.6-fix-v2.patch22
-rw-r--r--sys-fs/udftools/files/pktcdvd.init61
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b-bigendian.patch28
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b-gcc4.patch15
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b-limits_h.patch23
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b-openflags.patch15
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch44
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch57
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch115
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch164
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch94
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch160
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch52
-rw-r--r--sys-fs/udftools/metadata.xml12
-rw-r--r--sys-fs/udftools/udftools-1.0.0b-r10.ebuild48
-rw-r--r--sys-fs/udftools/udftools-1.0.0b-r9.ebuild42
-rw-r--r--sys-fs/udftools/udftools-1.1.ebuild24
-rw-r--r--sys-fs/udftools/udftools-1.2.ebuild24
-rw-r--r--sys-fs/udftools/udftools-1.3.ebuild24
20 files changed, 1050 insertions, 0 deletions
diff --git a/sys-fs/udftools/Manifest b/sys-fs/udftools/Manifest
new file mode 100644
index 000000000000..822336abb8dd
--- /dev/null
+++ b/sys-fs/udftools/Manifest
@@ -0,0 +1,26 @@
+AUX cdrwtool-linux2.6-fix-v2.patch 876 SHA256 887200ca417f60ee87e57cafe583ed3555be59fbec7f6eb4fbee60ed41ee9467 SHA512 97a9c9bf655bb5b8996cca6b3011b8cb862aa07eb8adac027207d07e2f92dcf04ef637093d8239b04b083a2bf5fd6dede6fa34f85ffc46834253a75049baf74c WHIRLPOOL 1a15a7026e4b69681b3d8a8755f2559413fe24aa097737c7493b7878c1f20ac061ac90de2b24a51ccff40225b97d89ad44b5181dd908f411e0c46bc0cc414393
+AUX pktcdvd.init 1307 SHA256 58b00fcf967963c01d8e5c658aa0bc7327eff3146f6797c5131d7d927d310243 SHA512 6c5c7a8b39067924c5be31a951043a1c44ff53d951fa9307fde2393aaf9c2b5f8960a042aae238d71a09696a3077d72ed41acdf261739c2829ab25130f3b795b WHIRLPOOL fb3b4eae9092e7644e525e7bf07329e9f318476cc80273e7c40610dbff6cbece1454087d4729682a4398197b0627a6f4531bb5e89d76190e883ecc336ced099e
+AUX udftools-1.0.0b-bigendian.patch 985 SHA256 b0a6c15b2cce7f19b91cacf08e9c5c24b70c16bee2b2e36b635739a6fd76b4c3 SHA512 f16ce73f58b51291ad54fcf7e065df1f971a14033110627bab77f35ee95d4cbe772accca52d1db9e1897830bcc55f9358e99cebc0633c3be1ce37bfda1affa72 WHIRLPOOL 60b4b1f0ae56b6671990269f1e7bc890d28adf24be837fdd5955add571ad67af2edeeb2916bc87735463bd73d3f698abd4cabb2f3b99f6e407772a2a7989f31c
+AUX udftools-1.0.0b-gcc4.patch 354 SHA256 4359a9089eae2ea20cdf78696aefc8a7a8097512ff56b12c7b59ecad7e75f2bd SHA512 4c92997faf8e4e090bc2fd2297cf87328e26cb06d113a067a7ea90167e2c39af4183046cbc1f86c73bf0bc6bf6357e6627423739409d614d153d628123166233 WHIRLPOOL ddc924588962d16f919dd14ae11e7bf548dd67e8cfed03cb3675f2720d4f57949b450f15f7135051e9edcf4c9499eddcfe2cf50b398323647512fcb65c85ca61
+AUX udftools-1.0.0b-limits_h.patch 451 SHA256 0fceef5db815eb20cc70161dc2bdf9969f6124b52083209a571c835ac5e9a989 SHA512 b3bc5304a095428e69b39863823daf459c43b26172d3cc58a219c513f1c37265ed4fcf53d0fe2833196d043807cda1a73651bcaaa246cc2fcac52230ebdb9d41 WHIRLPOOL 0b52c72d53b37bd79de54988114a0c0744e55ece791adac5913e70b9e1123091862a6130ed43f4e5c91f3c4485db9eaf8f9bb12af00d569c682a6905106a5c58
+AUX udftools-1.0.0b-openflags.patch 432 SHA256 7c578dc4e448b9f1019afd12cd258931c187a540e0117d2293f47cbaff7b164d SHA512 c192ad5f83dc71fbda7564b877b861d86bb568cb9e82562c64ec7be7cd3e1bbe2ec371b1b36626a5bb196446ce68a18e07c7bfdc1e79528706cbe9577a6c9943 WHIRLPOOL f561014563b53eab5c5833117eca7bc673591d74d52097bf489137c1d74ec356eb5f0ee6e00d30d8e6eaa4503d4d7c1b7fb7dac05fc0d2c7488779d8f29dcaac
+AUX udftools-1.0.0b3-extsize.patch 1573 SHA256 74b31f683722f690f7003642f3dfa64e039364fc6363e9233cfc0778e73c9c08 SHA512 81093ef7c3fe8d1d357a5d315439ecf9314c7771749c2fa294fcee2526021137c4364ad21e6c16ec602709a2251d28374b84cff19929617e51d8a9151a35559a WHIRLPOOL fa96f5bd0a94b5b7126fb7af3a43515331faf65a0614ca351a90f34b4ba79bbb8706fd9591bc19fe09c3f4dc1d59f67faf45fd735a591c65a665336c13361088
+AUX udftools-1.0.0b3-man-missing-options.patch 1512 SHA256 add1307df17934d43bc11a06eabfeb21945055efcf77412b01af0253de49fa83 SHA512 caceabf810bb2cdf8c306b126edf19501326a4dbbe5b04028ec80029dc7becd44a27682970562327aa8e88b872e9e9cb7e3d4c3db217e1650629df1a19becac3 WHIRLPOOL 927da0a85b819965013f4e1e9429836dd173193e5944cdd22c208f5ddc8cb513aeb4b8390b043f47401ea17db2d0e7ee2b814f61026dd42585a37e871b928417
+AUX udftools-1.0.0b3-mkudffs-bigendian.patch 4480 SHA256 fadd407456ea43828d0969c61222c98bb3baca6a7d4c3d76b4d62c1c5e75c33a SHA512 8350c44749dfb10260d599f17b1a5a64c3d911410cd85802b3efeca2a3730e0da417ab41c6c4b5a74b58515969c8ec10bee48e2b0f5205e211203282ac21a180 WHIRLPOOL 40944ca5080e9756971c2c41df8ad14acc4f09c567fcfd2c7e667350aec4c4d15cca64cb9bffd79e1500ac8f4e1b8e43a75d3bd0ff5aab68072a9ba9e16f0afb
+AUX udftools-1.0.0b3-staticanal.patch 8035 SHA256 0bbe955153c191548cfe0431c52507e873d277ad6c208a4a6867fc73098233b0 SHA512 47d049f16ba607fdc2373ef7647e8409db5224172a3ddf5fa587649bae1804bc08b2480692a962576a4a748768aac99e27f35730d6ffba23dfd8cbe1c9a9aad6 WHIRLPOOL 28a9965658701035bd8d1afe10efbd37bf24ed7d6a64c74a1b5be647a5635110810596e6fe320f07230e7072db4e92bbc8d107cadec2ac92fcf43f2acede5aea
+AUX udftools-1.0.0b3-warningfixes.patch 4287 SHA256 2bc377072ecbd14e522b763c868576c9cd7292d73e43db23dee18089986286e1 SHA512 daefbeca08bfdb2435d36b5335aec8e4da4e547843bb6fe7d607949071844304b89e1051dc155733baa5854b52452868b0b4eb2a76111c24d58746ecab7e0802 WHIRLPOOL 6d703072f8f64ec331d7e8a4d532b9c4fbac41b1e93398fd264926890901fcc61947d0bc39028ac6386936bd1ecbccceb4c019deb60e04e8434e6b1ae56eb97a
+AUX udftools-1.0.0b3-warningfixes2.patch 5520 SHA256 221d5ee78df95e8ecaee52ad6248f3fb5b857a6a7c8bc3a602abab8e17c89901 SHA512 d050cfd745a36050f26f2aa8a86a6d60a3007c9d84c2e6f224816887c41c06d81d8404cc3c817e54815705ec3cbe5aa02786b3d2e9e8aa782aaafa7b7c14af18 WHIRLPOOL 562313d6bf467c92a6f67effc65c9d78ccfcd59b088c316cc2febebf3ef16fd48a2bfba29d86f7e64b85e799f64b89ed457a67f8f21c57368b627c625995597d
+AUX udftools-1.0.0b3-wrudf_help.patch 1241 SHA256 a863bca4e86221287b4405ae03e14c7dfcf9a44906d38af99a1f156f2ffe8c22 SHA512 9077691cb5aae00e777f4f3bd5d2d09c71e52b2584d60f2c975a64b1e5ecc9ff3675d2394d52d3f688f24894bfa84f3b7350a4d82eb421ec95a15929ea14fa61 WHIRLPOOL ac1fd4ef4313c7dc7b536ebfac8c9c52e4cbb96e99c0a7b414adae6a6e4a12feaed29b184ebeb484acefdf801887362fcd83cb3c3e0c32f453127afbfd7933de
+DIST udftools-1.0.0b3.patch.bz2 3372 SHA256 4c35eb06da92677203137ee407ba29bdf0bec574550567cc6cecb63158099dbb SHA512 2b30741ffb7bab0139f6a3fb55911517c7f0489b76bc3453c3e0c519356689a8a9ad9c2b7e954267e8e14a6840498cd3c93641c5eb69f373f7bb19d35ffe9f19 WHIRLPOOL 43d096e0959da24f2b272ee60ba753c45346c12139627c5a6721b6db71f4dd85ca62d97799c79fca5b6d3e2222ff86262bb3ac62c9a3f3fe1f1fbd387bcc34c9
+DIST udftools-1.0.0b3.tar.gz 293257 SHA256 c5079e878d4d8e03de0fd75bfecf485a299689b8289a5288f18b2e793e0904a0 SHA512 4b45ff2e389ce93c3ac372f74daa3e2a43e02434c1e3d9df8cf050e137799491ac88d7aedd2b61c6d79a7ab8878042689c948c0b2aeb4be0a172c64844f07068 WHIRLPOOL 157ff4b18ef7497067b8398e0d57a25e6549c3c8637633fe3648c42d446562cd9c2f2533a25895cf628343223eb1ccbb59511df40606525486c6e4e58c0dc0d3
+DIST udftools-1.1.tar.gz 656865 SHA256 e16103fd0d4ec7c233df3375c8bec5e32802fd81e9f135dc73b80550373205ed SHA512 9c415d1cae1d79d49b4f9e3e6881f0b44b31d59f6d722571badd78ee68c422899ee8b95caed0ac50e76c13d8ed118f58f79efe5cbf775438a163d68160a30742 WHIRLPOOL c6d297fab980725590e45807da8d05d4eafd0336fba646a56239001af850b7efb3e1e89f6d413f3f4b7116434362e00b2555a760e7918df2c7c64da746ca63e2
+DIST udftools-1.2.tar.gz 657310 SHA256 444c646cc4e3db93a4abffbfc9d5e3da8da3e891012cb8bc2ce53c3d33596851 SHA512 b36e08b7adc0246f2a8024f6ee95117f5cba03566103a501acd1fb1ab31152da6345584ad36156a94ce5a29818e38333d81e3307ba73cef08355c300b79af199 WHIRLPOOL 259c1b2ad8cfd8254fd88fa0ad019d698c78eb6a15eb05209d0229add206243cacbf00e1ddc3b2a3ecb424d8808c98f046d2bdbf4193e06910714ffbbb3ebb79
+DIST udftools-1.3.tar.gz 447063 SHA256 00562a440de7b855df8127f8f798df657d53f20d9a205a7041fed37c8a07d4cb SHA512 d67f74640cc600fbdf3d7a67caee1342c15507357e155c5e1066aa6f6b3e2667483107edd663eaed5ebb690c13337598a75c1955e69cbc782bd481af783837e7 WHIRLPOOL 6f8fd7f5d21b590a0cd314e014d4c1f7bb11dae0b54f92495348621ab529b555c59cf216365a518df8566bd3cf5ac3092e7fefd17ec5cb0475efce30cf683f82
+EBUILD udftools-1.0.0b-r10.ebuild 1481 SHA256 482a093e9603e0b5e9bf45d73721a8e727099f3ed4809ea6c879a6eb25f56747 SHA512 6d503c710f96cbf4dc087604361137025cf7e3029d0a43777151528bc448c0b46d9edf5265cded42c4c747b084eb0bbfb8defb3685467abc933d815aacf943a1 WHIRLPOOL a262562c3a4dd5775d1d02b75c6fb2909f8c5a6dabdedf19da6535a25f5ec5781e7dff01e36a460e81c29539a47b8f991c76d1758c023815acbeaa824018cf63
+EBUILD udftools-1.0.0b-r9.ebuild 1190 SHA256 2e958003a2b8a6883c5eea57f7c2b73d0e293fb0988bc19d2f12765ca09165b9 SHA512 c3122ea4c0554713bd94bacb7eafe24bfc1edbcd92181a79926e05d4d956214e3e4bd28ada2f2696552b8cd0b8c9572cb4545c4271f5c82529e5068bc8ed331e WHIRLPOOL 4b56c430f92f50df95e8fd62ca41254a7734e42b0a585d0d38f131337f8d169e42bbcbadb8a0c671e628c789576aac526f05c1189cde44f73b9e2bf59ad69e47
+EBUILD udftools-1.1.ebuild 664 SHA256 692ffa1341081a653429c7fc5290d94eadfe544a4cb074f499a96e5880c4d802 SHA512 829b847f094d1c8146c76312febedf72abca1a29def30410c00d509bae9b4da16ff6b9afbafe62ba54f6c97f174b51ff76b455a35f4ce19498f76e1f8fd974c4 WHIRLPOOL fc3bd0cab842c7b265058e97a8c97e1f8b5b9c515f9b59f293932636c4711e04d9e4d32be4e587f21b0a54fdc764458d9e7b2b4373792796117df8ff3581c52d
+EBUILD udftools-1.2.ebuild 668 SHA256 f2c008801219c27c9aac26ecaaa05a9239cbac6137c55a36a2135e74661c4acf SHA512 f3a6c5f4567f166e4d65639f3393f414c3879c3b9a968c73e93a4d2a4aab16f985d341bcef3319701126a5e656f95e4cafac89b58bec76f0aa27ab8c4f2fc07a WHIRLPOOL 353b4cdd720cf2777835df87235cca1875cc32beab84c0022adc417c7a8fe06dee27bdfa7b9444d14e4818ee2d16c98257b04eafb32aec243f86222cfaeec511
+EBUILD udftools-1.3.ebuild 668 SHA256 60a762ce1fd6493f3ab16529088ec602ff647c0ab0da66a8ab25a03e8fb44759 SHA512 c7358d1dfb3e6fd253543d07798ceb43ada57f5917f674f471d38c6bc7d9251f4547a98b260e6d73766eca109b5e2ed8fa0d83dba6b05cae217969cce84eae4b WHIRLPOOL 7abfc7913707093d7de034f087be219be37e3a34d76e6347503988cb27f5978cb90a5fedd67e0e25b99cc16a066dbc86cdae86baba4a078a4a3757c425d0c627
+MISC ChangeLog 4853 SHA256 aded0c4aad0887fa2c27c99531569eb8e8075c4ced73e138f0cd149028255520 SHA512 63cab6de03c4c71c4b3c071b0c0c326a6cc39641cd9eea14bab120a784fe511c9cf43f90dc465f0ae80e463f5ddb10087e94793cb32138f078043e09357725b0 WHIRLPOOL bdecff35ac6befa910fdb9cb7d802043dd6967fcfa252d31059d9bbf468c5073de88f7954b9d7d55cf2b013292bb1e37c1fbd13ebfd7082cd8eac18609837270
+MISC ChangeLog-2015 5913 SHA256 0194f7df70b133dabbd45c35b434735caf674eb102af99043dd2ce3dfb4bee4b SHA512 d93f92b3b81b7083ccc7c6bf1320ccd08b189954f6fbf0b7a18ccdfbda8828eb9a9a274bf92f5d9d94767c1f2e76ef4061fef2af1badec1280f2e358ad74df05 WHIRLPOOL 8c3561e26594294eb9be6da75b63e89de0345aa4f4cb6164fa1457ab8d6f95d594915c5e8ce8dd0c117db3abd59ba564922b3833fb6a617058030059ad1176b6
+MISC metadata.xml 389 SHA256 9e06a77740b2f30dd6c076bf1a8b5db31c10829cda13c872e3e13a448f1ef3bb SHA512 049fe016aafa25e50396b166ac9931ea7c293aa581467fb587e0d79c0bc4e79621bc3d5bf295c2e9e589a517a4c1fcfbb863fb71175fe5061f99e45a26c7c61f WHIRLPOOL 0f59d57be3677450df326e495d41901b8e0cdf9f3aebcca32de35b0633a45747821f84b9715064c9a0d1d93287c89d85aee2be59ac2f71fe4378bdb94d1584f2
diff --git a/sys-fs/udftools/files/cdrwtool-linux2.6-fix-v2.patch b/sys-fs/udftools/files/cdrwtool-linux2.6-fix-v2.patch
new file mode 100644
index 000000000000..602c808a1b0b
--- /dev/null
+++ b/sys-fs/udftools/files/cdrwtool-linux2.6-fix-v2.patch
@@ -0,0 +1,22 @@
+Fix CD blanking for kernels 2.6.8 and newer
+(write access is required to perform blanking commands)
+
+The original version broke support on Linux 2.4, thanks to Ben Peddell for pointing
+this out to me, and for the updated patch.
+
+ - Daniel Drake <dsd@gentoo.org>
+ - Ben Peddell <klightspeed@klightspeed.is-a-geek.net>
+
+--- udftools-1.0.0b3/cdrwtool/main.c.orig 2004-12-30 22:53:52.000000000 +0000
++++ udftools-1.0.0b3/cdrwtool/main.c 2004-12-30 22:54:36.000000000 +0000
+@@ -242,7 +242,9 @@ int main(int argc, char *argv[])
+ udf_init_disc(&disc.udf_disc);
+ strcpy(filename, CDROM_DEVICE);
+ parse_args(argc, argv, &disc, filename);
+- if ((fd = open(filename, O_RDONLY | O_NONBLOCK)) < 0)
++ if (((fd = open(filename, O_RDWR | O_NONBLOCK)) < 0) &&
++ ((errno != EROFS) ||
++ ((fd = open(filename, O_RDONLY | O_NONBLOCK)) < 0)))
+ {
+ perror("open cdrom device");
+ return fd;
diff --git a/sys-fs/udftools/files/pktcdvd.init b/sys-fs/udftools/files/pktcdvd.init
new file mode 100644
index 000000000000..97375411e0e2
--- /dev/null
+++ b/sys-fs/udftools/files/pktcdvd.init
@@ -0,0 +1,61 @@
+#!/sbin/openrc-run
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+
+depend() {
+ need localmount modules
+}
+
+checkconfig() {
+ if ! [ -e /dev/pktcdvd/control ]; then
+ eerror "Could not find packet-writing control device at /dev/pktcdvd/control"
+ eerror "Please ensure that your kernel includes packet writing support,"
+ eerror "and if modular, ensure that the module is loaded."
+ return 1
+ fi
+}
+
+get_rw_devices() {
+ devices_raw=$(sed -re '/^drive name:/I!d; s/.*:\s+//' /proc/sys/dev/cdrom/info)
+ count=0
+ for i in $devices_raw; do
+ eval "devices_$count=\"\$i\""
+ count=$(( $count + 1 ))
+ done
+ devs=""
+
+ cdrw_caps=$(sed -re '/^Can write CD-RW:/I!d; s/.*:\s+//' /proc/sys/dev/cdrom/info)
+
+ count=0
+ for i in $cdrw_caps; do
+ [ "$i" -eq 1 ] && eval "devs=\"\$devs \$devices_$count\""
+ count=$(( $count + 1 ))
+ done
+
+ echo ${devs}
+}
+
+start() {
+ checkconfig || return 1
+
+ for i in $(get_rw_devices)
+ do
+ devnode="/dev/${i}"
+ [ -e "${devnode}" ] || continue
+
+ /usr/bin/pktsetup "${i}" "${devnode}" > /dev/null
+ [ -e "/dev/pktcdvd/${i}" ] || continue
+ chmod 660 "/dev/pktcdvd/${i}"
+ chgrp cdrw "/dev/pktcdvd/${i}"
+ done
+}
+
+stop() {
+ checkconfig || return 1
+
+ for i in $(get_rw_devices)
+ do
+ /usr/bin/pktsetup -d "${i}" > /dev/null
+ done
+}
+
diff --git a/sys-fs/udftools/files/udftools-1.0.0b-bigendian.patch b/sys-fs/udftools/files/udftools-1.0.0b-bigendian.patch
new file mode 100644
index 000000000000..d49b2561e4e9
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b-bigendian.patch
@@ -0,0 +1,28 @@
+http://bugs.gentoo.org/120245
+
+BE fix
+
+===================================================================
+RCS file: /cvsroot/linux-udf/udftools/mkudffs/mkudffs.c,v
+retrieving revision 1.3
+retrieving revision 1.4
+diff -u -r1.3 -r1.4
+--- linux-udf/udftools/mkudffs/mkudffs.c 2004/02/23 03:35:33 1.3
++++ linux-udf/udftools/mkudffs/mkudffs.c 2004/03/02 02:09:39 1.4
+@@ -250,14 +250,14 @@
+ if (size % offsets[PSPACE_SIZE])
+ size -= (size % offsets[PSPACE_SIZE]);
+ set_extent(disc, PSPACE, start, size);
+- for (i=0; i<disc->udf_lvd[0]->numPartitionMaps; i++)
++ for (i=0; i<le32_to_cpu(disc->udf_lvd[0]->numPartitionMaps); i++)
+ {
+ if (i == 1)
+ disc->udf_lvid->freeSpaceTable[i] = cpu_to_le32(0xFFFFFFFF);
+ else
+ disc->udf_lvid->freeSpaceTable[i] = cpu_to_le32(size);
+ }
+- for (j=0; j<disc->udf_lvd[0]->numPartitionMaps; j++)
++ for (j=0; j<le32_to_cpu(disc->udf_lvd[0]->numPartitionMaps); j++)
+ {
+ if (j == 1)
+ disc->udf_lvid->sizeTable[i+j] = cpu_to_le32(0xFFFFFFFF);
diff --git a/sys-fs/udftools/files/udftools-1.0.0b-gcc4.patch b/sys-fs/udftools/files/udftools-1.0.0b-gcc4.patch
new file mode 100644
index 000000000000..3b58f20f0173
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b-gcc4.patch
@@ -0,0 +1,15 @@
+http://bugs.gentoo.org/112122
+
+gcc4 compat
+
+--- a/wrudf/wrudf.c
++++ b/wrudf/wrudf.c
+@@ -245,7 +245,7 @@
+ } else if( strncmp( spm->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL)) == 0 )
+ virtualPartitionNum = i;
+ }
+- (char*)spm += spm->partitionMapLength;
++ spm = (char*)spm + spm->partitionMapLength;
+ }
+
+ if( medium == CDR ) {
diff --git a/sys-fs/udftools/files/udftools-1.0.0b-limits_h.patch b/sys-fs/udftools/files/udftools-1.0.0b-limits_h.patch
new file mode 100644
index 000000000000..74dddf9e012c
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b-limits_h.patch
@@ -0,0 +1,23 @@
+http://bugs.gentoo.org/335511
+
+--- cdrwtool/cdrwtool.c
++++ cdrwtool/cdrwtool.c
+@@ -31,6 +31,7 @@
+ #include <sys/ioctl.h>
+ #include <asm/param.h>
+
++#include <limits.h> /* INT_MAX */
+ #include <linux/cdrom.h>
+
+ #include "cdrwtool.h"
+--- pktsetup/pktsetup.c
++++ pktsetup/pktsetup.c
+@@ -26,6 +26,8 @@
+ #include <bits/types.h>
+ #include <sys/types.h>
+
++#include <limits.h> /* INT_MAX */
++#include <stdlib.h> /* system */
+ #include <linux/cdrom.h>
+
+ /*
diff --git a/sys-fs/udftools/files/udftools-1.0.0b-openflags.patch b/sys-fs/udftools/files/udftools-1.0.0b-openflags.patch
new file mode 100644
index 000000000000..88803e43d6fb
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b-openflags.patch
@@ -0,0 +1,15 @@
+From: Magnus Granberg <zorry@ume.nu>
+https://bugs.gentoo.org/232100
+Remove nonsense O_CREAT flag
+
+--- pktsetup/pktsetup.c 2008-06-19 00:27:08.000000000 +0200
++++ pktsetup/pktsetup.c 2008-06-19 00:20:31.000000000 +0200
+@@ -85,7 +85,7 @@
+ {
+ int pkt_fd, dev_fd, cmd;
+
+- if ((pkt_fd = open(pkt_device, O_RDONLY | O_CREAT)) == -1) {
++ if ((pkt_fd = open(pkt_device, O_RDONLY)) == -1) {
+ perror("open packet device");
+ return;
+ }
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch b/sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch
new file mode 100644
index 000000000000..8e7e0d13a7f2
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch
@@ -0,0 +1,44 @@
+taken from Fedora, but with minor return type fixes: changed NULL to 0
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-extsize.patch?h=f22
+
+diff -up udftools-1.0.0b3/libudffs/extent.c.extsize udftools-1.0.0b3/libudffs/extent.c
+--- udftools-1.0.0b3/libudffs/extent.c.extsize 2012-01-26 09:45:22.217856499 +0100
++++ udftools-1.0.0b3/libudffs/extent.c 2012-01-26 09:45:43.142855067 +0100
+@@ -50,7 +50,7 @@ cont:
+ while (start_ext != NULL && start_ext->blocks < blocks)
+ start_ext = next_extent(start_ext->next, type);
+
+- if (start_ext->start % offset)
++ if (start_ext != NULL && start_ext->start % offset)
+ {
+ inc = offset - (start_ext->start % offset);
+ if (start_ext->blocks - inc < blocks)
+@@ -62,7 +62,7 @@ cont:
+ else
+ inc = 0;
+
+- return start_ext->start + inc;
++ return start_ext ? start_ext->start + inc : 0;
+ }
+
+ struct udf_extent *prev_extent(struct udf_extent *start_ext, enum udf_space_type type)
+@@ -81,7 +81,7 @@ cont:
+ while (start_ext != NULL && start_ext->blocks < blocks)
+ start_ext = prev_extent(start_ext->prev, type);
+
+- if ((start_ext->start + start_ext->blocks) % offset)
++ if (start_ext != NULL && (start_ext->start + start_ext->blocks) % offset)
+ {
+ dec = (start_ext->start + start_ext->blocks) % offset;
+ if (start_ext->blocks - dec < blocks)
+@@ -93,7 +93,7 @@ cont:
+ else
+ dec = 0;
+
+- return start_ext->start + start_ext->blocks - dec - blocks;
++ return start_ext ? start_ext->start + start_ext->blocks - dec - blocks : 0;
+ }
+
+ struct udf_extent *find_extent(struct udf_disc *disc, uint32_t start)
+
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch b/sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch
new file mode 100644
index 000000000000..afda3bd00d3a
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch
@@ -0,0 +1,57 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-man-missing-options.patch?h=f22
+
+diff -up wrk/doc/cdrwtool.1.wrk wrk/doc/cdrwtool.1
+--- wrk/doc/cdrwtool.1.wrk 2014-01-29 15:23:18.623940293 +0100
++++ wrk/doc/cdrwtool.1 2014-01-29 15:24:27.027471222 +0100
+@@ -97,6 +97,10 @@ Close track.
+ .IP "\fB\-r \fItrack\fP"
+ Reserve track.
+
++.IP "\fB\-z \fIlength\fP"
++Fixed packet length.
++
++
+ .IP \fB\-s\fP
+ Set write parameters determined by
+ .BR "\-l" , " \-w" ", and" " \-p"
+diff -up wrk/doc/mkudffs.8.wrk wrk/doc/mkudffs.8
+--- wrk/doc/mkudffs.8.wrk 2014-01-29 15:47:54.095408327 +0100
++++ wrk/doc/mkudffs.8 2014-01-29 15:51:18.115200882 +0100
+@@ -151,6 +151,13 @@ Use 16-bit unicode for file names
+ .TP
+ .B \-\-utf8
+ Use UTF-8 for file names
++.TP
++.B \-\-closed
++.TP
++.B \-\-bridge
++.TP
++.BI \-\-packetlen= " length "
++
+
+ .SH "EXIT STATUS"
+ .B mkudffs
+diff -up wrk/doc/pktsetup.8.wrk wrk/doc/pktsetup.8
+--- wrk/doc/pktsetup.8.wrk 2002-11-26 08:18:51.000000000 +0100
++++ wrk/doc/pktsetup.8 2014-01-29 15:36:29.509665177 +0100
+@@ -37,6 +37,9 @@ pktsetup \- set up and tear down packet
+ .B pktsetup
+ .B \-d
+ .I packet_device
++.br
++.B pktsetup
++.B \-s
+ .ad b
+ .SH DESCRIPTION
+ .B Pktsetup
+@@ -58,6 +61,8 @@ returns 0 on success, nonzero on failure
+ .IP "\fB\-d \fIpacket-device\fP"
+ Delete the association between the specified \fIpacket-device\fP
+ and its block device.
++.IP "\fB\-s"
++Show device mappings.
+
+ .SH EXAMPLE
+ The following commands provide an example of using the
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch b/sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch
new file mode 100644
index 000000000000..68c637cd89f4
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch
@@ -0,0 +1,115 @@
+taken from Fedora, but parts removed due to conflicts w/udftools-1.0.0b-bigendian.patch
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-mkudffs-bigendian.patch?h=f22
+
+diff -up udftools-1.0.0b3/mkudffs/defaults.c.mkudffs-bigendian udftools-1.0.0b3/mkudffs/defaults.c
+--- udftools-1.0.0b3/mkudffs/defaults.c.mkudffs-bigendian 2007-08-23 13:41:29.000000000 +0200
++++ udftools-1.0.0b3/mkudffs/defaults.c 2007-08-23 13:42:16.000000000 +0200
+@@ -69,7 +69,7 @@ struct primaryVolDesc default_pvd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_PVD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct primaryVolDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(1),
+@@ -119,7 +119,7 @@ struct logicalVolDesc default_lvd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct logicalVolDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(2),
+@@ -157,7 +157,7 @@ struct volDescPtr default_vdp =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_VDP),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct volDescPtr) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(3),
+@@ -192,7 +192,7 @@ struct impUseVolDesc default_iuvd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_IUVD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct impUseVolDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(4),
+@@ -215,7 +215,7 @@ struct partitionDesc default_pd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_PD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct partitionDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(5),
+@@ -242,7 +242,7 @@ struct unallocSpaceDesc default_usd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_USD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct unallocSpaceDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(6),
+@@ -254,7 +254,7 @@ struct terminatingDesc default_td =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_TD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct terminatingDesc) - sizeof(tag)),
+ },
+ };
+@@ -265,7 +265,7 @@ struct logicalVolIntegrityDesc default_l
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVID),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct logicalVolIntegrityDesc) - sizeof(tag)),
+ },
+ integrityType : constant_cpu_to_le32(LVID_INTEGRITY_TYPE_CLOSE),
+@@ -295,7 +295,7 @@ struct sparingTable default_stable =
+ {
+ tagIdent : constant_cpu_to_le16(0),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct sparingTable) - sizeof(tag)),
+ },
+ sparingIdent :
+@@ -387,7 +387,7 @@ struct fileSetDesc default_fsd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_FSD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct fileSetDesc) - sizeof(tag)),
+ },
+ interchangeLvl : constant_cpu_to_le16(2),
+@@ -426,7 +426,7 @@ struct fileEntry default_fe =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVID),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct primaryVolDesc) - sizeof(tag)),
+ },
+ icbTag :
+@@ -458,7 +458,7 @@ struct extendedFileEntry default_efe =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVID),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct primaryVolDesc) - sizeof(tag)),
+ },
+ icbTag :
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch b/sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch
new file mode 100644
index 000000000000..9ff411b24528
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch
@@ -0,0 +1,164 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-staticanal.patch?h=f22
+
+Error: CONSTANT_EXPRESSION_RESULT:
+/builddir/build/BUILD/udftools-1.0.0b3/cdrwtool/cdrwtool.c:626: result_independent_of_operands: (ret == ioctl(fd, 21289, 1)) < 0 is always false regardless of the values of its operands. This occurs as the logical operand of if.
+
+Possible buffer overflow of static allocated variable "device".
+
+diff -up udftools-1.0.0b3/cdrwtool/cdrwtool.c.staticanal udftools-1.0.0b3/cdrwtool/cdrwtool.c
+--- udftools-1.0.0b3/cdrwtool/cdrwtool.c.staticanal 2012-01-26 16:20:44.518234366 +0100
++++ udftools-1.0.0b3/cdrwtool/cdrwtool.c 2012-01-26 16:20:44.537234366 +0100
+@@ -623,7 +623,7 @@ int cdrom_open_check(int fd)
+ if ((ret = ioctl(fd, CDROM_CLEAR_OPTIONS, CDO_LOCK)) < 0)
+ return ret;
+
+- if ((ret == ioctl(fd, CDROM_LOCKDOOR, 1)) < 0) {
++ if ((ret = ioctl(fd, CDROM_LOCKDOOR, 1)) < 0) {
+ fprintf(stderr, "CD-ROM appears to already be opened\n");
+ return 1;
+ }
+diff -up udftools-1.0.0b3/cdrwtool/options.c.staticanal udftools-1.0.0b3/cdrwtool/options.c
+--- udftools-1.0.0b3/cdrwtool/options.c.staticanal 2012-01-26 16:26:11.288212023 +0100
++++ udftools-1.0.0b3/cdrwtool/options.c 2012-01-26 16:27:24.125207040 +0100
+@@ -135,7 +135,8 @@ void parse_args(int argc, char *argv[],
+ }
+ case 'd':
+ {
+- strcpy(device, optarg);
++ strncpy(device, optarg, NAME_MAX-1);
++ device[NAME_MAX-1] = '\0';
+ printf("using device %s\n", device);
+ break;
+ }
+
+
+==========================================================================
+Error: NEGATIVE_RETURNS:
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:161: negative_return_fn: Function "open64(filename, 66, 432)" returns a negative number.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:161: var_assign: Assigning: signed variable "fd" = "open64".
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:165: negative_returns: "fd" is passed to a parameter that cannot be negative.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:85: neg_sink_parm_call: Passing "fd" to "valid_offset", which cannot accept a negative.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:55: neg_sink_parm_call: Passing "fd" to "udf_lseek64", which cannot accept a negative.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:43: neg_sink_parm_call: Passing "fd" to "lseek64", which cannot accept a negative.
+
+diff -up udftools-1.0.0b3/mkudffs/main.c.staticanal udftools-1.0.0b3/mkudffs/main.c
+--- udftools-1.0.0b3/mkudffs/main.c.staticanal 2004-02-23 04:33:11.000000000 +0100
++++ udftools-1.0.0b3/mkudffs/main.c 2012-01-26 16:29:17.605199282 +0100
+@@ -162,6 +162,10 @@ int main(int argc, char *argv[])
+ #else
+ fd = open(filename, O_RDWR | O_CREAT | O_LARGEFILE, 0660);
+ #endif
++ if (fd == NULL) {
++ fprintf(stderr, "mkudffs: cannot open '%s' for writing\n", filename);
++ exit(1);
++ }
+ disc.head->blocks = get_blocks(fd, disc.blocksize, disc.head->blocks);
+ disc.write = write_func;
+ disc.write_data = &fd;
+
+
+==========================================================================
+Error: BAD_SIZEOF:
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/mkudffs.c:45: bad_sizeof: Taking the size of pointer parameter "disc" is suspicious.
+
+Possible buffer overflow of static allocated variable "device".
+
+diff -up udftools-1.0.0b3/mkudffs/mkudffs.c.staticanal udftools-1.0.0b3/mkudffs/mkudffs.c
+--- udftools-1.0.0b3/mkudffs/mkudffs.c.staticanal 2012-01-26 16:20:44.526234367 +0100
++++ udftools-1.0.0b3/mkudffs/mkudffs.c 2012-01-26 16:20:44.539234366 +0100
+@@ -42,7 +42,7 @@ void udf_init_disc(struct udf_disc *disc
+ struct tm *tm;
+ int altzone;
+
+- memset(disc, 0x00, sizeof(disc));
++ memset(disc, 0x00, sizeof(*disc));
+
+ disc->blocksize = 2048;
+ disc->blocksize_bits = 11;
+diff -up udftools-1.0.0b3/mkudffs/options.c.staticanal udftools-1.0.0b3/mkudffs/options.c
+--- udftools-1.0.0b3/mkudffs/options.c.staticanal 2012-01-26 16:24:14.082220036 +0100
++++ udftools-1.0.0b3/mkudffs/options.c 2012-01-26 16:27:29.086206703 +0100
+@@ -320,7 +320,8 @@ void parse_args(int argc, char *argv[],
+ }
+ if (optind == argc)
+ usage();
+- strcpy(device, argv[optind]);
++ strncpy(device, argv[optind], NAME_MAX-1);
++ device[NAME_MAX-1] = '\0';
+ optind ++;
+ if (optind < argc)
+ disc->head->blocks = strtoul(argv[optind++], NULL, 0);
+
+
+==========================================================================
+Error: OVERRUN_STATIC:
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:378: overrun-local: Overrunning static array "spm->locSparingTable", with 4 elements, at position 4 with index variable "i".
+
+Error: NEGATIVE_RETURNS:
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:769: negative_return_fn: Function "open(filename, 2)" returns a negative number.
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:769: var_assign: Assigning: signed variable "device" = "open".
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:773: negative_returns: "device" is passed to a parameter that cannot be negative.
+
+diff -up udftools-1.0.0b3/wrudf/wrudf-cdrw.c.staticanal udftools-1.0.0b3/wrudf/wrudf-cdrw.c
+--- udftools-1.0.0b3/wrudf/wrudf-cdrw.c.staticanal 2012-01-26 16:20:44.529234367 +0100
++++ udftools-1.0.0b3/wrudf/wrudf-cdrw.c 2012-01-26 16:35:29.729173836 +0100
+@@ -374,7 +374,7 @@ void updateSparingTable() {
+ struct packetbuf *pb;
+ struct sparablePartitionMap *spm = (struct sparablePartitionMap*)lvd->partitionMaps;
+
+- for( i = 0; i <= 4; i++ ) {
++ for( i = 0; i < sizeof(spm->locSparingTable); i++ ) {
+ pbn = spm->locSparingTable[i];
+ if( pbn == 0 )
+ return;
+@@ -682,6 +682,8 @@ readExtents(char* dest, int usesShort, v
+ dest += 2048;
+ if( len < 2048 )
+ break;
++ /* dead code, len couldn't be 0 at this point
++ (break was called in this case) */
+ if( len == 0 ) {
+ if( usesShort ) {
+ sh++;
+@@ -766,8 +768,10 @@ initIO(char *filename)
+
+ if( S_ISREG(filestat.st_mode) ) { /* disk image of a UDF volume */
+ devicetype = DISK_IMAGE;
+- if( !(device = open(filename, O_RDWR)) )
++ if( !(device = open(filename, O_RDWR)) ) {
+ fail("initIO: open %s failed\n", filename);
++ return 0;
++ }
+
+ /* heuristically determine medium imitated on disk image based on VAT FileEntry in block 512 */
+ rv = lseek(device, 2048 * 512, SEEK_SET);
+
+==========================================================================
+Error: CONSTANT_EXPRESSION_RESULT:
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cmnd.c:699: missing_parentheses: !(*fid)->fileCharacteristics & 2 is always 0 regardless of the values of its operands. This occurs as the logical operand of if. Did you intend to apply '&' to (*fid)->fileCharacteristics and 2? If so, parentheses would be required to force this interpretation.
+
+diff -up udftools-1.0.0b3/wrudf/wrudf-cmnd.c.staticanal udftools-1.0.0b3/wrudf/wrudf-cmnd.c
+--- udftools-1.0.0b3/wrudf/wrudf-cmnd.c.staticanal 2012-01-26 16:20:44.530234366 +0100
++++ udftools-1.0.0b3/wrudf/wrudf-cmnd.c 2012-01-26 16:20:44.543234366 +0100
+@@ -696,7 +696,7 @@ analyzeDest(char* arg, struct fileIdentD
+ *fid = findFileIdentDesc(curDir, comp);
+ if( *fid == NULL )
+ return DIR_INVALID;
+- if( ! (*fid)->fileCharacteristics & FID_FILE_CHAR_DIRECTORY )
++ if( ! ((*fid)->fileCharacteristics & FID_FILE_CHAR_DIRECTORY ))
+ return DIR_INVALID;
+ if( (*fid)->fileCharacteristics & FID_FILE_CHAR_DELETED )
+ return DIR_INVALID;
+diff -up udftools-1.0.0b3/wrudf/wrudf.c.staticanal udftools-1.0.0b3/wrudf/wrudf.c
+--- udftools-1.0.0b3/wrudf/wrudf.c.staticanal 2012-01-26 16:20:44.528234367 +0100
++++ udftools-1.0.0b3/wrudf/wrudf.c 2012-01-26 16:20:44.545234365 +0100
+@@ -158,6 +158,7 @@ initialise(char *devicename)
+
+ if( (p = readTaggedBlock(blkno, ABSOLUTE)) == NULL ) {
+ if( !inMainSeq )
++ /* dead code - the condition "inMainSeq" cannot be false */
+ fail("Volume Descriptor Sequences read failure\n");
+ blkno = extentRsrvVolDescSeq.extLocation;
+ len = extentRsrvVolDescSeq.extLength;
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch
new file mode 100644
index 000000000000..5b530c6041e1
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch
@@ -0,0 +1,94 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-warningfixes.patch?h=f22
+
+diff -Naupr udftools-1.0.0b3.orig/cdrwtool/cdrwtool.h udftools-1.0.0b3/cdrwtool/cdrwtool.h
+--- udftools-1.0.0b3.orig/cdrwtool/cdrwtool.h 2002-11-26 08:18:50.000000000 +0100
++++ udftools-1.0.0b3/cdrwtool/cdrwtool.h 2006-07-27 14:16:06.000000000 +0200
+@@ -226,6 +226,7 @@ int read_disc_info(int, disc_info_t *);
+ int read_track_info(int, track_info_t *, int);
+ int reserve_track(int, struct cdrw_disc *);
+ int close_track(int, unsigned int);
++int close_session(int, unsigned int);
+ int read_buffer_cap(int, struct cdrw_disc *);
+ int set_cd_speed(int, int);
+ void cdrom_close(int);
+@@ -236,5 +237,6 @@ int print_disc_track_info(int);
+ void make_write_page(write_params_t *, struct cdrw_disc *);
+ void print_params(write_params_t *);
+ void cdrw_init_disc(struct cdrw_disc *);
++int udf_set_version(struct udf_disc *, int);
+
+ #endif /* _CDRWTOOL_H */
+diff -Naupr udftools-1.0.0b3.orig/include/udf_endian.h udftools-1.0.0b3/include/udf_endian.h
+--- udftools-1.0.0b3.orig/include/udf_endian.h 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/include/udf_endian.h 2006-07-27 14:09:30.000000000 +0200
+@@ -23,6 +23,8 @@
+ #ifndef __UDF_ENDIAN_H
+ #define __UDF_ENDIAN_H
+
++#include <string.h>
++
+ #include "bswap.h"
+
+ static inline lb_addr lelb_to_cpu(lb_addr in)
+diff -Naupr udftools-1.0.0b3.orig/libudffs/unicode.c udftools-1.0.0b3/libudffs/unicode.c
+--- udftools-1.0.0b3.orig/libudffs/unicode.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/libudffs/unicode.c 2006-07-27 14:11:17.000000000 +0200
+@@ -169,8 +169,6 @@ error_out:
+
+ int decode_string(struct udf_disc *disc, char *in, char *out, int inlen)
+ {
+- int i;
+-
+ if (disc->flags & FLAG_UTF8)
+ return decode_utf8(in, out, inlen);
+ else if (disc->flags & (FLAG_UNICODE8 | FLAG_UNICODE16))
+diff -Naupr udftools-1.0.0b3.orig/pktsetup/pktsetup.c udftools-1.0.0b3/pktsetup/pktsetup.c
+--- udftools-1.0.0b3.orig/pktsetup/pktsetup.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/pktsetup/pktsetup.c 2006-07-27 14:18:24.000000000 +0200
+@@ -23,6 +23,7 @@
+ #include <getopt.h>
+ #include <bits/types.h>
+ #include <sys/types.h>
++#include <string.h>
+
+ #include <linux/cdrom.h>
+
+diff -Naupr udftools-1.0.0b3.orig/wrudf/Makefile.am udftools-1.0.0b3/wrudf/Makefile.am
+--- udftools-1.0.0b3.orig/wrudf/Makefile.am 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/wrudf/Makefile.am 2006-07-27 14:21:24.000000000 +0200
+@@ -1,5 +1,5 @@
+ bin_PROGRAMS = wrudf
+ wrudf_LDADD = $(top_builddir)/libudffs/libudffs.la -lreadline -lncurses
+-wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h
++wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h ../include/libudffs.h
+
+ AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DDEBUG
+diff -Naupr udftools-1.0.0b3.orig/wrudf/Makefile.in udftools-1.0.0b3/wrudf/Makefile.in
+--- udftools-1.0.0b3.orig/wrudf/Makefile.in 2004-02-23 10:33:48.000000000 +0100
++++ udftools-1.0.0b3/wrudf/Makefile.in 2006-07-27 14:21:44.000000000 +0200
+@@ -85,7 +85,7 @@ am__quote = @am__quote@
+ install_sh = @install_sh@
+ bin_PROGRAMS = wrudf
+ wrudf_LDADD = $(top_builddir)/libudffs/libudffs.la -lreadline -lncurses
+-wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h
++wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h ../include/libudffs.h
+
+ AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DDEBUG
+ subdir = wrudf
+diff -Naupr udftools-1.0.0b3.orig/wrudf/wrudf.h udftools-1.0.0b3/wrudf/wrudf.h
+--- udftools-1.0.0b3.orig/wrudf/wrudf.h 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/wrudf/wrudf.h 2006-07-27 14:22:33.000000000 +0200
+@@ -23,9 +23,11 @@
+ #include <sys/time.h>
+ #include <time.h>
+ #include <stdint.h>
++#include <string.h>
+
+ #include "ecma_167.h"
+ #include "osta_udf.h"
++#include "libudffs.h"
+
+ struct generic_desc
+ {
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch
new file mode 100644
index 000000000000..1593eb600fae
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch
@@ -0,0 +1,160 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-warningfixes2.patch?h=f22
+
+diff -ur udftools-1.0.0b3/libudffs/file.c udftools-1.0.0b3-new/libudffs/file.c
+--- udftools-1.0.0b3/libudffs/file.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/libudffs/file.c 2007-08-23 14:02:07.000000000 +0200
+@@ -576,7 +576,7 @@
+ tmp = leBPL_to_cpup(p);
+ found_first:
+ tmp |= (~0UL << size);
+- if (tmp == ~0UL) /* Are any bits zero? */
++ if (tmp == (uintBPL)~0UL) /* Are any bits zero? */
+ return result + size; /* Nope. */
+ found_middle:
+ return result + ffz(tmp);
+diff -ur udftools-1.0.0b3/mkudffs/mkudffs.c udftools-1.0.0b3-new/mkudffs/mkudffs.c
+--- udftools-1.0.0b3/mkudffs/mkudffs.c 2007-08-23 14:32:38.000000000 +0200
++++ udftools-1.0.0b3-new/mkudffs/mkudffs.c 2007-08-23 14:14:42.000000000 +0200
+@@ -72,7 +72,7 @@
+ disc->udf_pvd[0] = malloc(sizeof(struct primaryVolDesc));
+ memcpy(disc->udf_pvd[0], &default_pvd, sizeof(struct primaryVolDesc));
+ memcpy(&disc->udf_pvd[0]->recordingDateAndTime, &ts, sizeof(timestamp));
+- sprintf(&disc->udf_pvd[0]->volSetIdent[1], "%08lx%s",
++ sprintf((char *)&disc->udf_pvd[0]->volSetIdent[1], "%08lx%s",
+ mktime(tm), &disc->udf_pvd[0]->volSetIdent[9]);
+ disc->udf_pvd[0]->volIdent[31] = strlen(disc->udf_pvd[0]->volIdent);
+ disc->udf_pvd[0]->volSetIdent[127] = strlen(disc->udf_pvd[0]->volSetIdent);
+@@ -289,7 +289,7 @@
+ int write_disc(struct udf_disc *disc)
+ {
+ struct udf_extent *start_ext;
+- int ret;
++ int ret=0;
+
+ start_ext = disc->head;
+
+@@ -299,6 +299,7 @@
+ return ret;
+ start_ext = start_ext->next;
+ }
++ return ret;
+ }
+
+ void setup_vrs(struct udf_disc *disc)
+@@ -450,7 +451,7 @@
+ struct unallocSpaceEntry *use;
+ short_ad *sad;
+ int max = (0x3FFFFFFF / disc->blocksize) * disc->blocksize;
+- int pos;
++ int pos=0;
+ long long rem;
+
+ if (disc->flags & FLAG_STRATEGY4096)
+diff -ur udftools-1.0.0b3/wrudf/ide-pc.c udftools-1.0.0b3-new/wrudf/ide-pc.c
+--- udftools-1.0.0b3/wrudf/ide-pc.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/wrudf/ide-pc.c 2007-08-23 14:32:09.000000000 +0200
+@@ -31,6 +31,7 @@
+ #include <sys/types.h> /* for u_char etc. */
+ #include <linux/cdrom.h>
+ #include <unistd.h> /* sleep() */
++#include <stdlib.h>
+
+ #include "bswap.h"
+ #include "ide-pc.h"
+diff -ur udftools-1.0.0b3/wrudf/wrudf.c udftools-1.0.0b3-new/wrudf/wrudf.c
+--- udftools-1.0.0b3/wrudf/wrudf.c 2007-08-23 14:32:38.000000000 +0200
++++ udftools-1.0.0b3-new/wrudf/wrudf.c 2007-08-23 14:26:41.000000000 +0200
+@@ -245,7 +245,7 @@
+ } else if( strncmp( spm->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL)) == 0 )
+ virtualPartitionNum = i;
+ }
+- spm = (char*)spm + spm->partitionMapLength;
++ spm = (struct sparablePartitionMap*)((char*)spm + spm->partitionMapLength);
+ }
+
+ if( medium == CDR ) {
+@@ -300,7 +300,7 @@
+ fail("SpaceBitmap not found\n");
+ }
+
+- if (fsdLen = decode_utf8(fsd->fileSetIdent, fsdOut, fsd->fileSetIdent[31]))
++ if ((fsdLen = decode_utf8(fsd->fileSetIdent, fsdOut, fsd->fileSetIdent[31]))>=0)
+ fsdOut[fsdLen] = '\0';
+
+ printf("You are going to update fileset '%s'\nProceed (y/N) : ", &fsdOut[1]);
+@@ -605,7 +605,7 @@
+ int
+ main(int argc, char** argv)
+ {
+- int rv;
++ int rv=0;
+ int cmnd;
+ char prompt[256];
+ Directory *d;
+diff -ur udftools-1.0.0b3/wrudf/wrudf-cdrw.c udftools-1.0.0b3-new/wrudf/wrudf-cdrw.c
+--- udftools-1.0.0b3/wrudf/wrudf-cdrw.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/wrudf/wrudf-cdrw.c 2007-08-23 14:30:14.000000000 +0200
+@@ -614,7 +614,6 @@
+ readTaggedBlock(uint32_t lbn, uint16_t partition)
+ {
+ int i;
+- uint32_t blkno;
+ uint8_t sum, *p;
+ struct generic_desc *block;
+
+@@ -634,7 +633,7 @@
+ if( strncmp(((struct sparingTable*)block)->sparingIdent.ident, UDF_ID_SPARING, strlen(UDF_ID_SPARING)) != 0 ) {
+ for( i = 0; i < 2048; i++ ) {
+ if( ((uint8_t*)block)[i] != 0 ) {
+- printf("readTaggedBlock: Empty block %d not all zeroes\n", blkno);
++ printf("readTaggedBlock: Empty block %d not all zeroes\n", lbn);
+ break;
+ }
+ }
+@@ -647,10 +646,10 @@
+ sum += *(p + i);
+
+ if( block->descTag.tagChecksum != sum )
+- fail("readTagged: Checksum error in block %d\n", blkno);
++ fail("readTagged: Checksum error in block %d\n", lbn);
+
+ if( block->descTag.descCRC != udf_crc((uint8_t*)block + sizeof(tag), ((tag*)block)->descCRCLength, 0) )
+- fail("readTagged: CRC error in block %d\n", blkno);
++ fail("readTagged: CRC error in block %d\n", lbn);
+
+ return block;
+ }
+@@ -709,8 +708,8 @@
+ writeExtents(char* src, int usesShort, void* extents)
+ {
+ uint len, blkno, partitionNumber;
+- long_ad *lo;
+- short_ad *sh;
++ long_ad *lo=NULL;
++ short_ad *sh=NULL;
+
+ if( usesShort ) {
+ sh = (short_ad*) extents;
+diff -ur udftools-1.0.0b3/wrudf/wrudf-cmnd.c udftools-1.0.0b3-new/wrudf/wrudf-cmnd.c
+--- udftools-1.0.0b3/wrudf/wrudf-cmnd.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/wrudf/wrudf-cmnd.c 2007-08-23 14:22:41.000000000 +0200
+@@ -45,7 +45,7 @@
+ int
+ copyFile(Directory *dir, char* inName, char*newName, struct stat *fileStat)
+ {
+- int fd, i, blkno;
++ int fd, i=0, blkno;
+ uint32_t nBytes, blkInPkt;
+ uint32_t maxVarPktSize; // in bytes
+ struct fileIdentDesc *fid;
+@@ -54,7 +54,7 @@
+
+ fd = open(inName, O_RDONLY);
+ if( fd == 0 ) {
+- printf("'%s' does not exist\n", cmndv[i]);
++ printf("'%s' does not exist\n", inName);
+ return CMND_FAILED;
+ }
+
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch b/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch
new file mode 100644
index 000000000000..06d9c3f616f4
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch
@@ -0,0 +1,52 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-wrudf_help.patch?h=f22
+
+diff -up wrk/wrudf/wrudf.c.wrk wrk/wrudf/wrudf.c
+--- wrk/wrudf/wrudf.c.wrk 2013-04-15 15:32:03.395528452 +0200
++++ wrk/wrudf/wrudf.c 2013-04-15 16:06:37.535546730 +0200
+@@ -603,6 +603,28 @@ parseCmnd(char* line)
+ return cmnd;
+ }
+
++int show_help()
++{
++ char *msg =
++ "Interactive tool to maintain an UDF filesystem.\n"
++ "Usage:\n"
++ "\twrudf [device]\n"
++ "Available commands:\n"
++ "\tcp\n"
++ "\trm\n"
++ "\tmkdir\n"
++ "\trmdir\n"
++ "\tlsc\n"
++ "\tlsh\n"
++ "\tcdc\n"
++ "\tcdh\n"
++ "Specify cdh/lsh or cdc/lsc to do cd or ls for Harddisk or CompactDisc.\n"
++ "\tquit\n"
++ "\texit\n";
++ printf("%s", msg);
++ return 0;
++}
++
+ int
+ main(int argc, char** argv)
+ {
+@@ -614,8 +636,14 @@ main(int argc, char** argv)
+ printf("wrudf " WRUDF_VERSION "\n");
+ devicename= "/dev/cdrom";
+
+- if(argc > 1 )
++ if(argc > 1 ) {
++ if (strcmp(argv[1], "-h")==0 || strcmp(argv[1], "-help")==0 || strcmp(argv[1], "--help")==0) {
++ return show_help();
++ }
++ }
++ else {
+ devicename = argv[1]; /* can specify disk image filename */
++ }
+
+ if( setpriority(PRIO_PROCESS, 0, -10) ) {
+ printf("setpriority(): %m\n");
diff --git a/sys-fs/udftools/metadata.xml b/sys-fs/udftools/metadata.xml
new file mode 100644
index 000000000000..67407dddd9c6
--- /dev/null
+++ b/sys-fs/udftools/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">linux-udf</remote-id>
+ <remote-id type="github">pali/udftools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/udftools/udftools-1.0.0b-r10.ebuild b/sys-fs/udftools/udftools-1.0.0b-r10.ebuild
new file mode 100644
index 000000000000..871fc46344f9
--- /dev/null
+++ b/sys-fs/udftools/udftools-1.0.0b-r10.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic
+
+MY_P=${P}3
+
+DESCRIPTION="Ben Fennema's tools for packet writing and the UDF filesystem"
+HOMEPAGE="https://sourceforge.net/projects/linux-udf/"
+SRC_URI="mirror://sourceforge/linux-udf/${MY_P}.tar.gz
+ http://w1.894.telia.com/~u89404340/patches/packet/${MY_P}.patch.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sys-libs/readline"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ # For new kernel packet writing driver
+ epatch "${WORKDIR}"/${MY_P}.patch
+ epatch "${FILESDIR}"/cdrwtool-linux2.6-fix-v2.patch
+ epatch "${FILESDIR}"/${P}-gcc4.patch #112122
+ epatch "${FILESDIR}"/${P}-bigendian.patch #120245
+ epatch "${FILESDIR}"/${P}-openflags.patch #232100
+ epatch "${FILESDIR}"/${P}-limits_h.patch
+ epatch "${FILESDIR}"/${P}3-extsize.patch
+ epatch "${FILESDIR}"/${P}3-man-missing-options.patch
+ epatch "${FILESDIR}"/${P}3-mkudffs-bigendian.patch
+ epatch "${FILESDIR}"/${P}3-staticanal.patch
+ epatch "${FILESDIR}"/${P}3-warningfixes.patch
+ epatch "${FILESDIR}"/${P}3-warningfixes2.patch
+ epatch "${FILESDIR}"/${P}3-wrudf_help.patch
+ # Force older C standard as the code relies on static inline behavior. #548324
+ append-flags -std=gnu89
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/pktcdvd.init pktcdvd
+ dosym /usr/bin/udffsck /usr/sbin/fsck.udf
+}
diff --git a/sys-fs/udftools/udftools-1.0.0b-r9.ebuild b/sys-fs/udftools/udftools-1.0.0b-r9.ebuild
new file mode 100644
index 000000000000..af812aa19e16
--- /dev/null
+++ b/sys-fs/udftools/udftools-1.0.0b-r9.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="2"
+
+inherit eutils flag-o-matic
+
+MY_P=${P}3
+
+DESCRIPTION="Ben Fennema's tools for packet writing and the UDF filesystem"
+HOMEPAGE="https://sourceforge.net/projects/linux-udf/"
+SRC_URI="mirror://sourceforge/linux-udf/${MY_P}.tar.gz
+ http://w1.894.telia.com/~u89404340/patches/packet/${MY_P}.patch.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sys-libs/readline"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ # For new kernel packet writing driver
+ epatch "${WORKDIR}"/${MY_P}.patch
+ epatch "${FILESDIR}"/cdrwtool-linux2.6-fix-v2.patch
+ epatch "${FILESDIR}"/${P}-gcc4.patch #112122
+ epatch "${FILESDIR}"/${P}-bigendian.patch #120245
+ epatch "${FILESDIR}"/${P}-openflags.patch #232100
+ epatch "${FILESDIR}"/${P}-limits_h.patch
+ # Force older C standard as the code relies on static inline behavior. #548324
+ append-flags -std=gnu89
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc ChangeLog
+ newinitd "${FILESDIR}"/pktcdvd.init pktcdvd
+ dosym /usr/bin/udffsck /usr/sbin/fsck.udf
+}
diff --git a/sys-fs/udftools/udftools-1.1.ebuild b/sys-fs/udftools/udftools-1.1.ebuild
new file mode 100644
index 000000000000..efaa1d7e62cc
--- /dev/null
+++ b/sys-fs/udftools/udftools-1.1.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="Ben Fennema's tools for packet writing and the UDF filesystem"
+HOMEPAGE="https://github.com/pali/udftools/ https://sourceforge.net/projects/linux-udf/"
+SRC_URI="https://github.com/pali/udftools/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sys-libs/readline:0="
+DEPEND="${RDEPEND}"
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/pktcdvd.init pktcdvd
+ dosym mkudffs.8 /usr/share/man/man8/mkfs.udf.8
+}
diff --git a/sys-fs/udftools/udftools-1.2.ebuild b/sys-fs/udftools/udftools-1.2.ebuild
new file mode 100644
index 000000000000..85ccd12101c5
--- /dev/null
+++ b/sys-fs/udftools/udftools-1.2.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="Ben Fennema's tools for packet writing and the UDF filesystem"
+HOMEPAGE="https://github.com/pali/udftools/ https://sourceforge.net/projects/linux-udf/"
+SRC_URI="https://github.com/pali/udftools/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sys-libs/readline:0="
+DEPEND="${RDEPEND}"
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/pktcdvd.init pktcdvd
+ dosym mkudffs.8 /usr/share/man/man8/mkfs.udf.8
+}
diff --git a/sys-fs/udftools/udftools-1.3.ebuild b/sys-fs/udftools/udftools-1.3.ebuild
new file mode 100644
index 000000000000..d2a858cd9b0a
--- /dev/null
+++ b/sys-fs/udftools/udftools-1.3.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="Ben Fennema's tools for packet writing and the UDF filesystem"
+HOMEPAGE="https://github.com/pali/udftools/ https://sourceforge.net/projects/linux-udf/"
+SRC_URI="https://github.com/pali/udftools/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sys-libs/readline:0="
+DEPEND="${RDEPEND}"
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/pktcdvd.init pktcdvd
+ dosym mkudffs.8 /usr/share/man/man8/mkfs.udf.8
+}