>From a previous discussion [1] on this subject, it seems to be that if this is
desirable, then source packages should be fixed rather than working around
this in setup.

Attached is a patch to cygport to do exactly that.

I was also going to prepare a patch for http://cygwin.com/setup.html to say
that the source should be installed into /usr/src/package-version-release/,
but that is what the first sentence under "Method One" already says, and I
don't see anything else to contradict that.

(As an aside, how would a patch to move "Method one" and "Method two" to an
archive page be received?  It seems to me that they are not relevant to nearly
all new packages)

[1] http://cygwin.com/ml/cygwin-apps/2011-12/msg00022.html
>From c1425a51197c3b658fbae32c1dfb57c5b68b1d0f Mon Sep 17 00:00:00 2001
From: Jon TURNEY <jon.tur...@dronecode.org.uk>
Date: Sat, 19 Apr 2014 14:29:41 +0100
Subject: [PATCH] Put source package contents in a ${PF}/ directory

This makes source packages which, when installed, will place all their files
into /usr/src/${PF}, rather than directly into /usr/src.

Signed-off-by: Jon TURNEY <jon.tur...@dronecode.org.uk>
---
 lib/pkg_pkg.cygpart | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 6a21a42..b3ae33b 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -439,45 +439,50 @@ __pkg_srcpkg() {
        echo;
        __step "Creating source patches";
 
+       local spkgsrcdir="${spkgdir}/${PF}";
+       mkdir -p ${spkgsrcdir};
+
        __pkg_diff;
 
        if [ -s ${patchdir}/${cygwin_patchfile} ]
        then
-               cp ${patchdir}/${cygwin_patchfile} ${spkgdir};
+               cp ${patchdir}/${cygwin_patchfile} ${spkgsrcdir};
        fi
 
        if [ -s ${patchdir}/${src_patchfile} ]
        then
-               cp ${patchdir}/${src_patchfile} ${spkgdir};
+               cp ${patchdir}/${src_patchfile} ${spkgsrcdir};
        fi
 
        __step "Creating source package";
 
-       cp ${top}/${cygportfile} ${spkgdir};
+       cp ${top}/${cygportfile} ${spkgsrcdir};
 
        for src in ${_src_orig_pkgs} ${_src_orig_patches}
        do
-               cp ${top}/${src} ${spkgdir};
+               cp ${top}/${src} ${spkgsrcdir};
        done
 
-       cd ${spkgdir};
+       cd ${spkgsrcdir};
 
        if __arg_bool SIG
        then
                if check_prog gpg
                then
-                       __gpg_sign ${spkgdir}/${cygportfile} "CYGPORT SCRIPT";
-                       __gpg_sign ${spkgdir}/${cygwin_patchfile} "CYGWIN 
PATCH";
+                       __gpg_sign ${spkgsrcdir}/${cygportfile} "CYGPORT 
SCRIPT";
+                       __gpg_sign ${spkgsrcdir}/${cygwin_patchfile} "CYGWIN 
PATCH";
 
-                       if [ -f ${spkgdir}/${src_patchfile} ]
+                       if [ -f ${spkgsrcdir}/${src_patchfile} ]
                        then
-                               __gpg_sign ${spkgdir}/${src_patchfile} "SOURCE 
PATCH";
+                               __gpg_sign ${spkgsrcdir}/${src_patchfile} 
"SOURCE PATCH";
                        fi
                else
                        inform "gnupg must be installed in order to make 
signatures.";
                fi
        fi
 
+       cd ${spkgdir};
+
        tar Jcvf ${distdir}/${PN}/${PF}-src.tar.xz * || error "Source package 
creation failed"
        echo;
 }
-- 
1.8.5.5

Reply via email to