From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- media-video/ushare/Manifest | 18 +++ .../ushare/files/01_all_ushare_build_system.patch | 170 +++++++++++++++++++++ .../files/02_all_ushare_build_warnings.patch | 35 +++++ .../files/03_all_ushare_mp4_video_mime.patch | 20 +++ .../files/04_all_ushare_upnp_build_fix.patch | 156 +++++++++++++++++++ .../ushare/files/05_all_missing_headers.patch | 59 +++++++ .../files/06_all_ushare_disable_sysconf.patch | 20 +++ .../ushare/files/07_all_drop_optimizations.patch | 20 +++ media-video/ushare/files/08_all_gcc5.patch | 45 ++++++ media-video/ushare/files/ushare.conf.d | 37 +++++ media-video/ushare/files/ushare.init.d | 78 ++++++++++ media-video/ushare/files/ushare.init.d.ng | 35 +++++ media-video/ushare/files/ushare.service | 11 ++ media-video/ushare/metadata.xml | 8 + media-video/ushare/ushare-1.1a-r6.ebuild | 62 ++++++++ media-video/ushare/ushare-1.1a-r8.ebuild | 62 ++++++++ 16 files changed, 836 insertions(+) create mode 100644 media-video/ushare/Manifest create mode 100644 media-video/ushare/files/01_all_ushare_build_system.patch create mode 100644 media-video/ushare/files/02_all_ushare_build_warnings.patch create mode 100644 media-video/ushare/files/03_all_ushare_mp4_video_mime.patch create mode 100644 media-video/ushare/files/04_all_ushare_upnp_build_fix.patch create mode 100644 media-video/ushare/files/05_all_missing_headers.patch create mode 100644 media-video/ushare/files/06_all_ushare_disable_sysconf.patch create mode 100644 media-video/ushare/files/07_all_drop_optimizations.patch create mode 100644 media-video/ushare/files/08_all_gcc5.patch create mode 100644 media-video/ushare/files/ushare.conf.d create mode 100644 media-video/ushare/files/ushare.init.d create mode 100644 media-video/ushare/files/ushare.init.d.ng create mode 100644 media-video/ushare/files/ushare.service create mode 100644 media-video/ushare/metadata.xml create mode 100644 media-video/ushare/ushare-1.1a-r6.ebuild create mode 100644 media-video/ushare/ushare-1.1a-r8.ebuild (limited to 'media-video/ushare') diff --git a/media-video/ushare/Manifest b/media-video/ushare/Manifest new file mode 100644 index 000000000000..d650e51a8b1e --- /dev/null +++ b/media-video/ushare/Manifest @@ -0,0 +1,18 @@ +AUX 01_all_ushare_build_system.patch 4276 SHA256 6455181cd32b9962de2dddc0140201a56c0dc21e161f8a24bf9f037de012e3f9 SHA512 14029031996c030509d2850571bdd94a7bca951d0809c4a034bb2d021a76cc9c15ff3229452ab28322bda25e9e09814bc3dae5fff6cee4ac056eb7a76375a670 WHIRLPOOL 0fd353364a8021d5f75ee32d1dc81236b346f44d7327e300d20b10789c68c46b0c51660b4e7bca982c8bb2b6f285cd63047308f72c595b98f777e0e81fdfa3c7 +AUX 02_all_ushare_build_warnings.patch 989 SHA256 5c35ace53d189726459eb4d45f05430eeb854eec411bd0f46b0b3fcb4ad682ce SHA512 236beb2283762d17dc1efa994a8580c8606b1bca0059fd78643f062fa6cdc4df31281cd0b46c2df90b4d1c0cca9b6c4fff93d493084423e91c25809a52a1175d WHIRLPOOL e324c599aa140c11c3646f6c694f8fc296e92207bfacd71c5b988cfd77e8b7864f2073146203eaaeef54f669e00673bdba37540d92bb196138ea30671b1c10f5 +AUX 03_all_ushare_mp4_video_mime.patch 971 SHA256 b44ea6fdde6af5e978cc9c76945feed8ed0cdac76be9b1777e0849dae44fb0f0 SHA512 9eb4d34c7dcb2aaa9b97d74515933a1a31793d4f1630caab23b2243952a908ad257c9fc4304798ee9b5837049e367ae26344745bbcce1e58426c4704278c8d4a WHIRLPOOL 77f92096cbcc0bf3658aca9bbd30510ac9741801016b29238fbbf23feb8e53af5b859209b8b66612ae1c1e49639d6ef033f250e410220fa14af5829aad90841f +AUX 04_all_ushare_upnp_build_fix.patch 4617 SHA256 0ceb221da7bf28b9f84191c02bb45f6c034818c6dd57652b42bfc6efefe32ffa SHA512 87166b7bf3b371cfaed628dcca3e59a3f0e93efdb5e67bd78f3c3f5930b9fa7bdabbce8849163d3874befb2d248c28f214dc4c63d264673f83e279c077c158e4 WHIRLPOOL e3fa8a487a9cd4f5b52a6f8c37ff6aedd3c5caee8c9f639ba4f1539d1c06f05203960819804fa9d1f8cef6d2828c914c555eff3e0051672836f3ec49c2d8dc98 +AUX 05_all_missing_headers.patch 1801 SHA256 3465d4e9f42ea48454b5cc595da267b1471f308ce8783b570851597cfe77d1fa SHA512 0426664cf06e0f1ecf19523bc00c52bded8f4850934484dee0a1dbdd1f4e38a755095046ef155297bfac9938d3784df5e6cf04be95e936b6af38e6096575d87d WHIRLPOOL 94a2617a80e88aad8e220443315ef03070a12f02230046c0396ef6a9cc115b4fb23c2932ab50fad40e1b639b7666a3ae2eabf49a169916fe283a0c042a079f67 +AUX 06_all_ushare_disable_sysconf.patch 656 SHA256 16226297ea6148608c7bc12ae61069b72ef2907a5f0a580e431ae660b7549080 SHA512 9f2d5a107f42c6259530e1dd6ff06301c69c904974dc14632409c1cd18e7064de8663c56f0da2b5e4329217af36b564c75fa5f76c0191ca1c64db6e1ebdf12dd WHIRLPOOL 70b754c61c46c2635f6578ab50b3f03f78bb4bbab737e06f659b664abc60e2ef49d1d2c3d500e89e4bdbb7cc44d9035632cbac3df97c653e7be3db22b9b8c0e8 +AUX 07_all_drop_optimizations.patch 516 SHA256 a3871598281fdcd6a4e597d668b81ae1eee5dcc4a2b4a95415379a7a5b075bd4 SHA512 0b2fd04608fe74949d7a18d172c66596570c042a204f7665ceac09202d504138813ed700d1f327e1cb5b0601931f34bdb00efbac61979ff9f88735c54ae89770 WHIRLPOOL 9696145f5dea7bb2d33833a671a8274863bc0bc537ccf2bacc9fb158c1aff462600fbe33048adee1b0bb4dbd3ab85a05f1500302ec5304b2d52523abac3d1f9b +AUX 08_all_gcc5.patch 1244 SHA256 0bf336fd52a76926228eed42fce437fe6091adb32a2c8dc9aa87a3d9e958e1e2 SHA512 97439026ed47d5fbac93bb865091129c317805dcb0705eb1edf270c367cd0509bba7dcd56bdbaa757b6ff7cc03a0821511329dc087d83d28976c991edbd5158b WHIRLPOOL 5ee8a528e194e8c4aeafea3c8147a9a564d18374cf9c391a95d816a4a21c4576d9665d7e038f365a4e7227dad4defa024241088148226cc8b3b812dfe3ca3f01 +AUX ushare.conf.d 781 SHA256 49b767880868709ea10fae04f2bf1ebfbd38c29215ce427ebb6ebd515d52e4ff SHA512 86c7459952f5bfbad3daa960c2412f5dd32d4047db7714d0c990aad77f9aa9e68a49ddc46e8653276c3216f2834aa4334d4bc8c71770866b1a1c124848977dd0 WHIRLPOOL 0b281a86afed0641483212888464d3569cc87857504247d28557fdbd017c9c4b99993c2922d89dcfcc460fb9333723c05c08233da1d8a295c0ddeec7b1822fb0 +AUX ushare.init.d 2050 SHA256 878057a32ba6b5c6bd809ff36f93c156535b0c88b2b3529b2c61a76a607e902e SHA512 1bb8efbbb29cf468f90329b8dbed3dd6896734907ad90c1bb2bdb99b11b2d17148fafc971569b2c06d7fe86efb7ab289711cb73b1522a1fd207a38577e6f714b WHIRLPOOL 52e5243734fefedab93902586a4ed8a19c1865312a6b07884f95d1652abacec859a99cb641c6049c5ad0f62edab9a36a3d3d6c6266174d82f6f7d0ae4cd1c93e +AUX ushare.init.d.ng 954 SHA256 0024da77fd6b2f9a4d19c8acfe9fd8199779db6adcf04e1156e74633d5e66edf SHA512 c70e6f47f29a9d555821c3bc2000ebd6533778208b46a7bbe823454e4b26408ab9b6e31ce7449dc84ae32fcc6754c3ca2a5afa0a0393a59888bda294f0e78c98 WHIRLPOOL 74e2d8a41a280d41267e96c1fa147c309351d8dc8e85e8b520bb6381a2717bf423d993578ef1a10fc0beaa0b7ca6dcfb1ef21d031bb855aab721434b721aca57 +AUX ushare.service 189 SHA256 1967fd7ce1a8ce0018258dc743d951e2ff991d26597578f64f2d732c4d4606c9 SHA512 141b1f592220d3785af821f085f9c03811a2370e1a8c6bb5d2739b4ae74421323df437d2a6672d943ab8371b6d5ccfb395a4943a10eb5c1e8bc0ff16a3177b15 WHIRLPOOL 8c40cad1cf41605548852202946adf70bc5bd8937555dd0b427c57c5a5e80f0921e5e7d7b5f92b3ddeb7523a6001f84af8a1e56554e7438a86c0b9a575c797f4 +DIST ushare-1.1a.tar.bz2 65864 SHA256 7b9b85c79968d4f4560f02a99e33c6a33ff58f9d41d8faea79e31cce2ee78665 SHA512 2144ef96e58960d4d11bcefcd857c7eb7adab8df4ff815772d3b9d668f9f9daa1312707eb00a770c461b2a316e094e6697a004723ea02e86ee872fbe60b4797c WHIRLPOOL de9043c34edfd9ff3a1220968496e2ce42fae43cf1b190c40a14f11a6e4297689d2d800878e698a9f57edbe35dbb5c7ca82d81a67029df648a0d6e6c75966471 +EBUILD ushare-1.1a-r6.ebuild 1682 SHA256 c2fbef1f22aa128af4782fc527ac54f11b3bc396b9033a379511e00dc606abd2 SHA512 c93023e3d535c06f9f70a5d72a26773ef14d22bb035d805f22636e4d0e0be5a2dde96f269fdc4e5de7fde2ecb73270f6f1f45ef4ed89f0176922ab53d9c95da3 WHIRLPOOL c21e2f9ba803575873cd0270b6e7f476bd6a2fb9e968fecfa9a716c7822ecb74b06cc82f68611f5d48ec0517c352b2a6aa0b70316abb166792cac7ef9ac969f1 +EBUILD ushare-1.1a-r8.ebuild 1684 SHA256 530c0997b85fbc3ef90272f1d86938e09882f7f46682137111319ca83ba8d25e SHA512 d14fee0c9502a503d411c5435c1b9a758e0054e5e5c1abf0fec23b0981f3412a13a7e0e614a60ca966e0d2314bb3b5e7bdcbfa18a89f2cd6e33bd1622e508876 WHIRLPOOL 726323a9ac7175733b8f94a8b97ddcb25a0ab4a4ddf1984368f159a6dd85ba1371464619d0c64a0c02f62a648f5b82e5a18a3969e961a6733f9f01295dbfa03e +MISC ChangeLog 3952 SHA256 f0dd801f4ac211ffc12edc6441e1b0617e1cbe5bb4fa7724639c81fe33a1137e SHA512 61320d8afb455897c8d2b0ea71c603db7efbbf27505c62516d6c4f520f0cb44967311619dc57857f1d23dc16676597ff6636595cc9ddb4db4406ffaf58d58ea8 WHIRLPOOL 690a4e62df4f0c55b033f904bcfdc8b2a8e32ed4a3294f18afa7743102630a2770533674ade50ceb3ecd0e365dd21e6421eba96253ea2a92e46125169fdef106 +MISC ChangeLog-2015 4698 SHA256 6d589b0cfc2636533cd7e99f65a2b564bed3a5faf2c20c6fcd6ffda8a368aeec SHA512 137691c279c69b6423fa7ca4b4e478b607f5337b3f71699c4a1fe4fe8c5f35da37b387d435482d05bcd437973108003c802458cfe2ab608f12b36835a3feaf47 WHIRLPOOL 9d3ae7b28b7871f3cbfe968aaefcba3f227d23d6d967cfea73239ba186832447d2a878699e909cd49ce4b432a598d98c8bc2e95653c6b78a46049ce289c47ffd +MISC metadata.xml 246 SHA256 64ed482a33b3a866b5a4d2b8238b53182ae933373516d09f4823805425e44ad2 SHA512 ae23d702d83f56528c1f09a14f7f5643e28d91fe80a5af5cfa1126288bb1c66f1dc8262a06e4d539921d1564cc4ef33302d5d5db77bfad1bb0391f6bbab66653 WHIRLPOOL 84d307b97d9f7b16d134b722efbce4b8be4a22983d3ba5c09e003f7344d7141279aecae93347fc014a45d2b1a4aaad480fbd83e8d7bc424461e1bd058811f1a0 diff --git a/media-video/ushare/files/01_all_ushare_build_system.patch b/media-video/ushare/files/01_all_ushare_build_system.patch new file mode 100644 index 000000000000..c635bd7d52f4 --- /dev/null +++ b/media-video/ushare/files/01_all_ushare_build_system.patch @@ -0,0 +1,170 @@ +diff -uNr ushare-1.1a/configure ushare-1.1b/configure +--- ushare-1.1a/configure 2007-12-09 08:03:36.000000000 -0500 ++++ ushare-1.1b/configure 2012-03-25 17:35:07.000000000 -0400 +@@ -42,6 +42,9 @@ + echo " --with-libdlna-dir=DIR check for libdlna installed in DIR" + echo "" + echo "Advanced options (experts only):" ++ echo " --disable-sysconf disable installation of init files" ++ echo " --enable-developer enable developer options" ++ echo " --disable-developer disable developer options" + echo " --enable-debug enable debugging symbols" + echo " --disable-debug disable debugging symbols" + echo " --disable-strip disable stripping of executables at installation" +@@ -164,6 +167,11 @@ + echo "#define $1 \"$2\"" >> $CONFIG_H + } + ++check_cmd_exists(){ ++ log check_cmd_exists "$@" ++ which "$@" >>$logfile 2>&1 ++} ++ + check_cmd(){ + log "$@" + "$@" >>$logfile 2>&1 +@@ -300,13 +308,15 @@ + strip="strip" + cpu=`uname -m` + optimize="yes" ++sysconf="yes" ++developer="no" + debug="no" + dostrip="yes" + extralibs="" + installstrip="-s" + cross_compile="no" + INSTALL="/usr/bin/install -c" +-VERSION="1.1a" ++VERSION="1.2.0" + system_name=`uname -s 2>&1` + + ################################################# +@@ -420,6 +430,12 @@ + ;; + --disable-dlna) dlna="no" + ;; ++ --disable-sysconf) sysconf="no" ++ ;; ++ --enable-developer) developer="yes" ++ ;; ++ --disable-developer) developer="no" ++ ;; + --enable-debug) debug="yes" + ;; + --disable-debug) debug="no" +@@ -584,6 +600,25 @@ + linux && add_cflags -D_GNU_SOURCE + + ################################################# ++# check for developer options ++################################################# ++if enabled developer; then ++ add_cflags -Werror ++ add_cflags -DHAVE_DEVELOPER ++ ++ have_ctags='no' ++ if check_cmd_exists 'ctags'; then ++ have_ctags='yes' ++ fi ++ ++ have_etags='no' ++ if check_cmd_exists 'etags'; then ++ have_etags='yes' ++ fi ++ ++fi ++ ++################################################# + # check for debug symbols + ################################################# + if enabled debug; then +@@ -684,6 +719,8 @@ + echolog " STRIP $strip" + echolog " make $make" + echolog " CPU $cpu ($tune)" ++echolog " install sysconf $sysconf" ++echolog " developer options $developer" + echolog " debug symbols $debug" + echolog " strip symbols $dostrip" + echolog " optimize $optimize" +@@ -724,6 +761,10 @@ + append_config "LDFLAGS=$LDFLAGS" + append_config "INSTALL=$INSTALL" + ++append_config "INSTALL_SYSCONF=$sysconf" ++append_config "DEVELOPER=$developer" ++append_config "HAVE_CTAGS=$have_ctags" ++append_config "HAVE_ETAGS=$have_etags" + append_config "DEBUG=$debug" + + +diff -uNr ushare-1.1a/scripts/Makefile ushare-1.1b/scripts/Makefile +--- ushare-1.1a/scripts/Makefile 2007-12-09 08:03:36.000000000 -0500 ++++ ushare-1.1b/scripts/Makefile 2012-03-25 17:35:07.000000000 -0400 +@@ -3,6 +3,11 @@ + endif + include ../config.mak + ++INSTALL_RULES = ++ifeq ($(INSTALL_SYSCONF),yes) ++ INSTALL_RULES += install-sysconf ++endif ++ + CONF_FILE = "ushare.conf" + INITD_FILE = "ushare" + +@@ -14,7 +19,9 @@ + + distclean: + +-install: ++install: $(INSTALL_RULES) ++ ++install-sysconf: + $(INSTALL) -d $(sysconfdir) + $(INSTALL) -m 644 $(CONF_FILE) $(sysconfdir) + $(INSTALL) -d $(sysconfdir)/init.d +diff -uNr ushare-1.1a/src/Makefile ushare-1.1b/src/Makefile +--- ushare-1.1a/src/Makefile 2007-12-09 08:03:36.000000000 -0500 ++++ ushare-1.1b/src/Makefile 2012-03-25 17:35:07.000000000 -0400 +@@ -3,6 +3,15 @@ + endif + include ../config.mak + ++ifeq ($(DEVELOPER),yes) ++ ifeq ($(HAVE_ETAGS),yes) ++ BUILD_RULES += TAGS ++ endif ++ ifeq ($(HAVE_CTAGS),yes) ++ BUILD_RULES += tags ++ endif ++endif ++ + PROG = ushare + + EXTRADIST = ushare.1 \ +@@ -50,7 +59,7 @@ + + .SUFFIXES: .c .o + +-all: depend $(PROG) ++all: depend $(BUILD_RULES) $(PROG) + + .c.o: + $(CC) -c $(CFLAGS) $(OPTFLAGS) -o $@ $< +@@ -58,6 +67,14 @@ + $(PROG): $(OBJS) + $(CC) $(OBJS) $(LDFLAGS) $(EXTRALIBS) -o $@ + ++TAGS: ++ @rm -f $@; \ ++ ( find -name '*.[chS]' -print ) | xargs etags -a ++ ++tags: ++ @rm -f $@; \ ++ ( find -name '*.[chS]' -print ) | xargs ctags -a; ++ + clean: + -$(RM) -f *.o $(PROG) + -$(RM) -f .depend diff --git a/media-video/ushare/files/02_all_ushare_build_warnings.patch b/media-video/ushare/files/02_all_ushare_build_warnings.patch new file mode 100644 index 000000000000..f79e7890f8c0 --- /dev/null +++ b/media-video/ushare/files/02_all_ushare_build_warnings.patch @@ -0,0 +1,35 @@ +diff --git a/src/ctrl_telnet.c b/src/ctrl_telnet.c +index 0849d80..b3e9e8d 100644 +--- a/src/ctrl_telnet.c ++++ b/src/ctrl_telnet.c +@@ -202,6 +202,7 @@ ctrl_telnet_start (int port) + void + ctrl_telnet_stop (void) + { ++ ssize_t tmp; + pthread_mutex_lock (&startstop_lock); + + if (!started) +@@ -211,7 +212,7 @@ ctrl_telnet_stop (void) + } + + /* yes is int, which is bigger then char, so this should be safe */ +- write (ttd.killer[1], &yes, sizeof (char)); ++ tmp = write (ttd.killer[1], &yes, sizeof (char)); + + pthread_mutex_unlock (&startstop_lock); + pthread_join (ttd.thread, NULL); +diff --git a/src/mime.c b/src/mime.c +index 66c48ab..bf0121b 100644 +--- a/src/mime.c ++++ b/src/mime.c +@@ -144,7 +144,8 @@ char *mime_get_protocol (struct mime_type_t *mime) + if (!mime) + return NULL; + +- sprintf (protocol, mime->mime_protocol); ++ //sprintf (protocol, mime->mime_protocol); ++ strcpy (protocol, mime->mime_protocol); + strcat (protocol, "*"); + return strdup (protocol); + } diff --git a/media-video/ushare/files/03_all_ushare_mp4_video_mime.patch b/media-video/ushare/files/03_all_ushare_mp4_video_mime.patch new file mode 100644 index 000000000000..0edba22cba94 --- /dev/null +++ b/media-video/ushare/files/03_all_ushare_mp4_video_mime.patch @@ -0,0 +1,20 @@ +diff --git a/src/mime.c b/src/mime.c +index bf0121b..f38deca 100644 +--- a/src/mime.c ++++ b/src/mime.c +@@ -53,6 +53,7 @@ const struct mime_type_t MIME_Type_List[] = { + { "mpeg2", UPNP_VIDEO, "http-get:*:video/mpeg2:"}, + { "m4v", UPNP_VIDEO, "http-get:*:video/mp4:"}, + { "m4p", UPNP_VIDEO, "http-get:*:video/mp4:"}, ++ { "mp4", UPNP_VIDEO, "http-get:*:video/mp4:"}, + { "mp4ps", UPNP_VIDEO, "http-get:*:video/x-nerodigital-ps:"}, + { "ts", UPNP_VIDEO, "http-get:*:video/mpeg2:"}, + { "ogm", UPNP_VIDEO, "http-get:*:video/mpeg:"}, +@@ -79,7 +80,6 @@ const struct mime_type_t MIME_Type_List[] = { + { "mp1", UPNP_AUDIO, "http-get:*:audio/mp1:"}, + { "mp2", UPNP_AUDIO, "http-get:*:audio/mp2:"}, + { "mp3", UPNP_AUDIO, "http-get:*:audio/mpeg:"}, +- { "mp4", UPNP_AUDIO, "http-get:*:audio/mp4:"}, + { "m4a", UPNP_AUDIO, "http-get:*:audio/mp4:"}, + { "ogg", UPNP_AUDIO, "http-get:*:audio/x-ogg:"}, + { "wav", UPNP_AUDIO, "http-get:*:audio/wav:"}, diff --git a/media-video/ushare/files/04_all_ushare_upnp_build_fix.patch b/media-video/ushare/files/04_all_ushare_upnp_build_fix.patch new file mode 100644 index 000000000000..c3ec37a324c5 --- /dev/null +++ b/media-video/ushare/files/04_all_ushare_upnp_build_fix.patch @@ -0,0 +1,156 @@ +diff -wbBur ushare-1.1a/src/http.c ushare-1.1a.my/src/http.c +--- ushare-1.1a/src/http.c 2007-12-09 13:03:36.000000000 +0000 ++++ ushare-1.1a.my/src/http.c 2010-10-29 11:13:07.000000000 +0000 +@@ -77,8 +77,7 @@ + info->content_type = ixmlCloneDOMString (content_type); + } + +-static int +-http_get_info (const char *filename, struct File_Info *info) ++int http_get_info (const char *filename, struct File_Info *info) + { + extern struct ushare_t *ut; + struct upnp_entry_t *entry = NULL; +@@ -197,8 +196,7 @@ + return ((UpnpWebFileHandle) file); + } + +-static UpnpWebFileHandle +-http_open (const char *filename, enum UpnpOpenFileMode mode) ++UpnpWebFileHandle http_open (const char *filename, enum UpnpOpenFileMode mode) + { + extern struct ushare_t *ut; + struct upnp_entry_t *entry = NULL; +@@ -251,8 +249,7 @@ + return ((UpnpWebFileHandle) file); + } + +-static int +-http_read (UpnpWebFileHandle fh, char *buf, size_t buflen) ++int http_read (UpnpWebFileHandle fh, char *buf, size_t buflen) + { + struct web_file_t *file = (struct web_file_t *) fh; + ssize_t len = -1; +@@ -286,8 +283,7 @@ + return len; + } + +-static int +-http_write (UpnpWebFileHandle fh __attribute__((unused)), ++int http_write (UpnpWebFileHandle fh __attribute__((unused)), + char *buf __attribute__((unused)), + size_t buflen __attribute__((unused))) + { +@@ -296,8 +292,7 @@ + return 0; + } + +-static int +-http_seek (UpnpWebFileHandle fh, off_t offset, int origin) ++int http_seek (UpnpWebFileHandle fh, off_t offset, int origin) + { + struct web_file_t *file = (struct web_file_t *) fh; + off_t newpos = -1; +@@ -371,8 +366,7 @@ + return 0; + } + +-static int +-http_close (UpnpWebFileHandle fh) ++int http_close (UpnpWebFileHandle fh) + { + struct web_file_t *file = (struct web_file_t *) fh; + +@@ -402,13 +396,3 @@ + + return 0; + } +- +-struct UpnpVirtualDirCallbacks virtual_dir_callbacks = +- { +- http_get_info, +- http_open, +- http_read, +- http_write, +- http_seek, +- http_close +- }; +diff -wbBur ushare-1.1a/src/http.h ushare-1.1a.my/src/http.h +--- ushare-1.1a/src/http.h 2007-12-09 13:03:36.000000000 +0000 ++++ ushare-1.1a.my/src/http.h 2010-10-29 11:13:11.000000000 +0000 +@@ -25,6 +25,13 @@ + #include + #include + +-struct UpnpVirtualDirCallbacks virtual_dir_callbacks; ++int http_close (UpnpWebFileHandle fh); ++int http_write (UpnpWebFileHandle fh __attribute__((unused)), ++ char *buf __attribute__((unused)), ++ size_t buflen __attribute__((unused))); ++int http_seek (UpnpWebFileHandle fh, off_t offset, int origin); ++UpnpWebFileHandle http_open (const char *filename, enum UpnpOpenFileMode mode); ++int http_read (UpnpWebFileHandle fh, char *buf, size_t buflen); ++int http_get_info (const char *filename, struct File_Info *info); + + #endif /* _HTTP_H_ */ +diff -wbBur ushare-1.1a/src/ushare.c ushare-1.1a.my/src/ushare.c +--- ushare-1.1a/src/ushare.c 2007-12-09 13:03:36.000000000 +0000 ++++ ushare-1.1a.my/src/ushare.c 2010-10-29 11:17:45.000000000 +0000 +@@ -188,7 +188,7 @@ + if (strcmp (request->DevUDN + 5, ut->udn)) + return; + +- ip = request->CtrlPtIPAddr.s_addr; ++ ip = (*(struct sockaddr_in*)&request->CtrlPtIPAddr).sin_addr.s_addr; + ip = ntohl (ip); + sprintf (val, "%d.%d.%d.%d", + (ip >> 24) & 0xFF, (ip >> 16) & 0xFF, (ip >> 8) & 0xFF, ip & 0xFF); +@@ -348,7 +348,47 @@ + + UpnpEnableWebserver (TRUE); + +- res = UpnpSetVirtualDirCallbacks (&virtual_dir_callbacks); ++ res = UpnpVirtualDir_set_WriteCallback(http_write); ++ if (res != UPNP_E_SUCCESS) ++ { ++ log_error (_("Cannot set virtual directory callbacks\n")); ++ free (description); ++ return -1; ++ } ++ ++ res = UpnpVirtualDir_set_GetInfoCallback(http_get_info); ++ if (res != UPNP_E_SUCCESS) ++ { ++ log_error (_("Cannot set virtual directory callbacks\n")); ++ free (description); ++ return -1; ++ } ++ ++ res = UpnpVirtualDir_set_ReadCallback(http_read); ++ if (res != UPNP_E_SUCCESS) ++ { ++ log_error (_("Cannot set virtual directory callbacks\n")); ++ free (description); ++ return -1; ++ } ++ ++ res = UpnpVirtualDir_set_OpenCallback(http_open); ++ if (res != UPNP_E_SUCCESS) ++ { ++ log_error (_("Cannot set virtual directory callbacks\n")); ++ free (description); ++ return -1; ++ } ++ ++ res = UpnpVirtualDir_set_SeekCallback(http_seek); ++ if (res != UPNP_E_SUCCESS) ++ { ++ log_error (_("Cannot set virtual directory callbacks\n")); ++ free (description); ++ return -1; ++ } ++ ++ res = UpnpVirtualDir_set_CloseCallback(http_close); + if (res != UPNP_E_SUCCESS) + { + log_error (_("Cannot set virtual directory callbacks\n")); diff --git a/media-video/ushare/files/05_all_missing_headers.patch b/media-video/ushare/files/05_all_missing_headers.patch new file mode 100644 index 000000000000..0d2f0e8faff9 --- /dev/null +++ b/media-video/ushare/files/05_all_missing_headers.patch @@ -0,0 +1,59 @@ +diff -uNr ushare-1.1a.a/src/cds.c ushare-1.1a.b/src/cds.c +--- ushare-1.1a.a/src/cds.c 2007-12-09 08:03:36.000000000 -0500 ++++ ushare-1.1a.b/src/cds.c 2012-05-27 11:28:42.000000000 -0400 +@@ -19,7 +19,9 @@ + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + ++#include + #include ++#include + #include + #include + +diff -uNr ushare-1.1a.a/src/cms.c ushare-1.1a.b/src/cms.c +--- ushare-1.1a.a/src/cms.c 2007-12-09 08:03:36.000000000 -0500 ++++ ushare-1.1a.b/src/cms.c 2012-05-27 11:25:03.000000000 -0400 +@@ -20,6 +20,7 @@ + */ + + #include ++#include + #include + #include + +diff -uNr ushare-1.1a.a/src/http.c ushare-1.1a.b/src/http.c +--- ushare-1.1a.a/src/http.c 2012-05-27 11:23:32.000000000 -0400 ++++ ushare-1.1a.b/src/http.c 2012-05-27 11:25:13.000000000 -0400 +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + +diff -uNr ushare-1.1a.a/src/presentation.c ushare-1.1a.b/src/presentation.c +--- ushare-1.1a.a/src/presentation.c 2007-12-09 08:03:36.000000000 -0500 ++++ ushare-1.1a.b/src/presentation.c 2012-05-27 11:30:08.000000000 -0400 +@@ -18,7 +18,9 @@ + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + ++#include + #include ++#include + + #if HAVE_LANGINFO_CODESET + # include +diff -uNr ushare-1.1a.a/src/services.c ushare-1.1a.b/src/services.c +--- ushare-1.1a.a/src/services.c 2007-12-09 08:03:36.000000000 -0500 ++++ ushare-1.1a.b/src/services.c 2012-05-27 11:25:26.000000000 -0400 +@@ -20,6 +20,7 @@ + */ + + #include ++#include + #include + #include + diff --git a/media-video/ushare/files/06_all_ushare_disable_sysconf.patch b/media-video/ushare/files/06_all_ushare_disable_sysconf.patch new file mode 100644 index 000000000000..c3adf8e54287 --- /dev/null +++ b/media-video/ushare/files/06_all_ushare_disable_sysconf.patch @@ -0,0 +1,20 @@ +Do not try to parse the default configuration file as everyting +should be handled by the /etc/conf.d/ushare file in Gentoo +Index: ushare-1.1a/src/ushare.c +=================================================================== +--- ushare-1.1a.orig/src/ushare.c ++++ ushare-1.1a/src/ushare.c +@@ -813,13 +813,6 @@ main (int argc, char **argv) + return EXIT_SUCCESS; + } + +- if (parse_config_file (ut) < 0) +- { +- /* fprintf here, because syslog not yet ready */ +- fprintf (stderr, _("Warning: can't parse file \"%s\".\n"), +- ut->cfg_file ? ut->cfg_file : SYSCONFDIR "/" USHARE_CONFIG_FILE); +- } +- + if (ut->xbox360) + { + char *name; diff --git a/media-video/ushare/files/07_all_drop_optimizations.patch b/media-video/ushare/files/07_all_drop_optimizations.patch new file mode 100644 index 000000000000..7a5029f79519 --- /dev/null +++ b/media-video/ushare/files/07_all_drop_optimizations.patch @@ -0,0 +1,20 @@ +Index: ushare-1.1a/configure +=================================================================== +--- ushare-1.1a.orig/configure ++++ ushare-1.1a/configure +@@ -627,15 +627,6 @@ if enabled debug; then + dostrip=no + fi + +-if enabled optimize; then +- if test -n "`$cc -v 2>&1 | grep xlc`"; then +- add_cflags "-O5" +- add_ldflags "-O5" +- else +- add_cflags "-O3" +- fi +-fi +- + ################################################# + # check for locales (optional) + ################################################# diff --git a/media-video/ushare/files/08_all_gcc5.patch b/media-video/ushare/files/08_all_gcc5.patch new file mode 100644 index 000000000000..d76f8771f5d9 --- /dev/null +++ b/media-video/ushare/files/08_all_gcc5.patch @@ -0,0 +1,45 @@ +Various gcc-5 fixes + +https://gcc.gnu.org/gcc-5/porting_to.html + +Signed-off-by: Markos Chandras +Index: ushare-1.1a/src/trace.h +=================================================================== +--- ushare-1.1a.orig/src/trace.h ++++ ushare-1.1a/src/trace.h +@@ -29,7 +29,7 @@ typedef enum { + + void print_log (log_level level, const char *format, ...) + __attribute__ ((format (printf, 2, 3))); +-inline void start_log (void); ++extern inline void start_log (void); + + /* log_info + * Normal print, to replace printf +Index: ushare-1.1a/src/ushare.h +=================================================================== +--- ushare-1.1a.orig/src/ushare.h ++++ ushare-1.1a/src/ushare.h +@@ -127,6 +127,6 @@ struct action_event_t { + struct service_t *service; + }; + +-inline void display_headers (void); ++extern inline void display_headers (void); + + #endif /* _USHARE_H_ */ +Index: ushare-1.1a/src/ushare.c +=================================================================== +--- ushare-1.1a.orig/src/ushare.c ++++ ushare-1.1a/src/ushare.c +@@ -49,6 +49,10 @@ + #include + #endif + ++#ifdef HAVE_LOCALE_H ++#include ++#endif ++ + #if (defined(__unix__) || defined(unix)) && !defined(USG) + #include + #endif diff --git a/media-video/ushare/files/ushare.conf.d b/media-video/ushare/files/ushare.conf.d new file mode 100644 index 000000000000..e87d6a1763ba --- /dev/null +++ b/media-video/ushare/files/ushare.conf.d @@ -0,0 +1,37 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# User to run ushare daemon (if none, root will be used) +USHARE_USER="ushare" + +# UPNP Friendly Name: +USHARE_NAME="uShare" + +# The interface to bind to: +USHARE_IFACE="eth0" + +# Static ushare port: +USHARE_PORT="" + +# Enable/Disable telnet: +USHARE_TELNET="yes" + +# Choose different telnet port: +USHARE_TELNET_PORT="" + +# Enable/Disable web component: +USHARE_WEB="yes" + +# A List of directories to share, each precieded by '-c': +USHARE_DIRS="" + +# Enable/Disable XboX 360 compliant profile: +USHARE_XBOX="no" + +# Enable/Disable DLNA compliant profile (Playstation3 requires this): +USHARE_DLNA="no" + +# Misc. options: +USHARE_OPTS="" + +# Check ushare --help or man ushare for more options. diff --git a/media-video/ushare/files/ushare.init.d b/media-video/ushare/files/ushare.init.d new file mode 100644 index 000000000000..c1d94b6a9c98 --- /dev/null +++ b/media-video/ushare/files/ushare.init.d @@ -0,0 +1,78 @@ +#!/sbin/openrc-run +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + use net +} + +start() { + ebegin "Starting uShare" + + # Sanity check to avoid ushare failling on booting with no + # shared dirs + if [[ -z "${USHARE_DIRS}" ]] ; then + eerror "Please set shared dirs in /etc/conf.d/ushare" + return 1 + fi + + if [[ -z "${USHARE_PORT}" ]] ; then + einfo "${USHARE_NAME} runs on a dynamic port" + local ushare_port= + else + local ushare_port="--port ${USHARE_PORT}" + einfo "${USHARE_NAME} using port ${USHARE_PORT}" + fi + + if [[ "${USHARE_TELNET}" == "yes" ]] ; then + local ushare_telnet= + else + local ushare_telnet="--no-telnet" + fi + + if [[ -z "${ushare_telnet}" ]] ; then + if [[ -z "${USHARE_TELNET_PORT}" ]] ; then + local ushare_telnet_port= + einfo "${USHARE_NAME} runs telnet on the default port" + else + local ushare_telnet_port="--telnet-port ${USHARE_TELNET_PORT}" + einfo "${USHARE_NAME} runs telnet on port ${USHARE_TELNET_PORT}" + fi + else + local ushare_telnet_port= + fi + + if [[ "${USHARE_WEB}" == "yes" ]] ; then + local ushare_web= + else + local ushare_web="--no-web" + fi + + if [[ "${USHARE_XBOX}" == "yes" ]] ; then + local ushare_xbox="--xbox" + else + local ushare_xbox= + fi + + if [[ "${USHARE_DLNA}" == "yes" ]] ; then + local ushare_dlna="--dlna" + else + local ushare_dlna= + fi + + start-stop-daemon --start --quiet -u ${USHARE_USER:-root} \ + --exec /usr/bin/ushare -- -D -i ${USHARE_IFACE} \ + -n ${USHARE_NAME} ${USHARE_OPTS} ${USHARE_DIRS} \ + ${ushare_port} \ + ${ushare_telnet} ${ushare_telnet_port} \ + ${ushare_web} \ + ${ushare_xbox} \ + ${ushare_dlna} + eend $? +} + +stop() { + ebegin "Stopping uShare" + start-stop-daemon --stop --quiet --exec /usr/bin/ushare + eend $? +} diff --git a/media-video/ushare/files/ushare.init.d.ng b/media-video/ushare/files/ushare.init.d.ng new file mode 100644 index 000000000000..8bc21d01750b --- /dev/null +++ b/media-video/ushare/files/ushare.init.d.ng @@ -0,0 +1,35 @@ +#!/sbin/openrc-run +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + use net +} + +start() { + ebegin "Starting uShare" + + if [ ! -f /etc/ushare.conf -a -f /etc/conf.d/ushare ]; then + ewarn "Please migrate your settings from" + ewarn "/etc/conf.d/ushare to the new /etc/ushare.conf file" + ewarn "and then delete the /etc/conf.d/ushare file." + eerror "User migration steps are needed!" + fi + + if [ -f /etc/ushare.conf -a -f /etc/conf.d/ushare ]; then + ewarn "Old configuration file /etc/conf.d/ushare detected!" + ewarn "Please migrate your settings to the new /etc/ushare.conf file" + ewarn "and then delete the old one." + eerror "User migration steps are needed!" + fi + + start-stop-daemon --start --quiet -u ushare \ + --exec /usr/bin/ushare -- -D --cfg=/etc/ushare.conf + eend $? +} + +stop() { + ebegin "Stopping uShare" + start-stop-daemon --stop --quiet --exec /usr/bin/ushare + eend $? +} diff --git a/media-video/ushare/files/ushare.service b/media-video/ushare/files/ushare.service new file mode 100644 index 000000000000..a1ea1080fce6 --- /dev/null +++ b/media-video/ushare/files/ushare.service @@ -0,0 +1,11 @@ +[Unit] +Description=Ushare Media Server +Requires=network.target + +[Service] +Type=forking +User=ushare +ExecStart=/usr/bin/ushare -D --cfg=/etc/ushare.conf + +[Install] +WantedBy=multi-user.target diff --git a/media-video/ushare/metadata.xml b/media-video/ushare/metadata.xml new file mode 100644 index 000000000000..ccb32db02551 --- /dev/null +++ b/media-video/ushare/metadata.xml @@ -0,0 +1,8 @@ + + + + + hwoarang@gentoo.org + Markos Chandras + + diff --git a/media-video/ushare/ushare-1.1a-r6.ebuild b/media-video/ushare/ushare-1.1a-r6.ebuild new file mode 100644 index 000000000000..b49031658f23 --- /dev/null +++ b/media-video/ushare/ushare-1.1a-r6.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 +inherit eutils multilib readme.gentoo toolchain-funcs user systemd + +DESCRIPTION="uShare is a UPnP (TM) A/V & DLNA Media Server" +HOMEPAGE="http://ushare.geexbox.org/" +SRC_URI="http://ushare.geexbox.org/releases/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="nls" + +RDEPEND=">=net-libs/libupnp-1.6.14:0" +DEPEND="${RDEPEND} + virtual/pkgconfig" + +src_prepare() { + EPATCH_EXCLUDE="06_all_ushare_disable_sysconf.patch" + EPATCH_SOURCE="${FILESDIR}" EPATCH_SUFFIX="patch" \ + EPATCH_OPTS="-p1" epatch + + DOC_CONTENTS="Please edit /etc/ushare.conf to set the shared directories + and other important settings. Check system log if ushare is + not booting." +} + +src_configure() { + local myconf + myconf="--prefix=/usr --sysconfdir=/etc --disable-strip --disable-dlna" + # nls can only be disabled, on by default. + use nls || myconf="${myconf} --disable-nls" + + # I can't use econf + # --host is not implemented in ./configure file + tc-export CC CXX + + ./configure ${myconf} || die "./configure failed" +} + +src_install() { + emake DESTDIR="${D}" install + doman src/ushare.1 + newconfd "${FILESDIR}"/${PN}.conf.d ${PN} + newinitd "${FILESDIR}"/${PN}.init.d.ng ${PN} + dodoc NEWS README TODO THANKS AUTHORS + systemd_dounit "${FILESDIR}"/${PN}.service + readme.gentoo_create_doc +} + +pkg_postinst() { + enewuser ushare + readme.gentoo_print_elog + elog + elog "The config file has been moved to /etc/ushare.conf" + elog "Please migrate your settings from /etc/conf.d/ushare" + elog "to /etc/ushare.conf in order to use the ushare init script" + elog "and systemd unit service." + elog +} diff --git a/media-video/ushare/ushare-1.1a-r8.ebuild b/media-video/ushare/ushare-1.1a-r8.ebuild new file mode 100644 index 000000000000..9cc622f9ac63 --- /dev/null +++ b/media-video/ushare/ushare-1.1a-r8.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +inherit eutils multilib readme.gentoo toolchain-funcs user systemd + +DESCRIPTION="uShare is a UPnP (TM) A/V & DLNA Media Server" +HOMEPAGE="http://ushare.geexbox.org/" +SRC_URI="http://ushare.geexbox.org/releases/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="nls" + +RDEPEND=">=net-libs/libupnp-1.6.14:0" +DEPEND="${RDEPEND} + virtual/pkgconfig" + +src_prepare() { + EPATCH_EXCLUDE="06_all_ushare_disable_sysconf.patch" + EPATCH_SOURCE="${FILESDIR}" EPATCH_SUFFIX="patch" \ + EPATCH_OPTS="-p1" epatch + + DOC_CONTENTS="Please edit /etc/ushare.conf to set the shared directories + and other important settings. Check system log if ushare is + not booting." +} + +src_configure() { + local myconf + myconf="--prefix=/usr --sysconfdir=/etc --disable-strip --disable-dlna" + # nls can only be disabled, on by default. + use nls || myconf="${myconf} --disable-nls" + + # I can't use econf + # --host is not implemented in ./configure file + tc-export CC CXX + + ./configure ${myconf} || die "./configure failed" +} + +src_install() { + emake DESTDIR="${D}" install + doman src/ushare.1 + newconfd "${FILESDIR}"/${PN}.conf.d ${PN} + newinitd "${FILESDIR}"/${PN}.init.d.ng ${PN} + dodoc NEWS README TODO THANKS AUTHORS + systemd_dounit "${FILESDIR}"/${PN}.service + readme.gentoo_create_doc +} + +pkg_postinst() { + enewuser ushare + readme.gentoo_print_elog + elog + elog "The config file has been moved to /etc/ushare.conf" + elog "Please migrate your settings from /etc/conf.d/ushare" + elog "to /etc/ushare.conf in order to use the ushare init script" + elog "and systemd unit service." + elog +} -- cgit v1.2.3