* [PATCH cygport] Add srcpackage command
@ 2021-06-05 14:28 Jon Turney
0 siblings, 0 replies; only message in thread
From: Jon Turney @ 2021-06-05 14:28 UTC (permalink / raw)
To: cygwin-apps; +Cc: Jon Turney
Add srcpackage command, which only creates source package
Move src.hint generation from __pkg_dist to __pkg_srcpkg
Various tweaks to allow it to work when 'cygport prep' hasn't been run.
This is intended for use in automation, to build from the source
package, rather than a packaging repository, ensuring that all files
used by the build are properly present in the source package.
---
bin/cygport.in | 6 +++
data/cygport-bash-completion | 2 +-
lib/help.cygpart | 1 +
lib/pkg_pkg.cygpart | 81 +++++++++++++++++++-----------------
lib/syntax.cygpart | 1 +
5 files changed, 52 insertions(+), 39 deletions(-)
diff --git a/bin/cygport.in b/bin/cygport.in
index e9295be..81dd166 100755
--- a/bin/cygport.in
+++ b/bin/cygport.in
@@ -641,6 +641,12 @@ do
(__pkg_binpkg && __pkg_pkgcheck && __pkg_srcpkg && __pkg_dist ${_pkg_tag}) 2>&1 | tee -a ${pkglog};
_status=${PIPESTATUS[0]};
;;
+ srcpackage|srcpkg)
+ __stage Packaging Source;
+ __log_init ${pkglog};
+ (__pkg_srcpkg) 2>&1 | tee -a ${pkglog};
+ _status=${PIPESTATUS[0]};
+ ;;
diff|mkdiff|mkpatch)
__pkg_diff;
_status=$?;
diff --git a/data/cygport-bash-completion b/data/cygport-bash-completion
index 9085e19..a97416d 100644
--- a/data/cygport-bash-completion
+++ b/data/cygport-bash-completion
@@ -9,7 +9,7 @@ _cygport()
commands='download fetch wget get \
prep unpack oldpatch compile build make \
- check test inst install list dep depends \
+ check test inst install list dep depends srcpackage srcpkg \
package pkg package-test pkg-test diff mkdiff mkpatch \
upload stage announce almostall all all-test clean finish \
help info version homepage website vars'
diff --git a/lib/help.cygpart b/lib/help.cygpart
index dfb943d..ff630c2 100644
--- a/lib/help.cygpart
+++ b/lib/help.cygpart
@@ -45,6 +45,7 @@ __show_help() {
compile run all compilation steps
test run the package's test suite, if one exists
install install into a DESTDIR, and run post-installation steps
+ srcpackage create source package
package create binary and source packages
package-test create binary and source packages, marked as test
upload upload finished packages to cygwin.com
diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 91e8768..3110cf0 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -462,12 +462,16 @@ __gpg_sign() {
__pkg_srcpkg() {
local src;
+ mkdir -p ${spkgdir};
rm -fr ${spkgdir}/*;
- echo;
- __step "Creating source patches";
+ if [ -d ${patchdir} ]
+ then
+ echo;
+ __step "Creating source patches";
- __pkg_diff;
+ __pkg_diff;
+ fi
if [ -s ${patchdir}/${cygwin_patchfile} ]
then
@@ -519,8 +523,44 @@ __pkg_srcpkg() {
cd ${spkgdir%/*};
+ mkdir -p ${distdir}/${PN};
tar Jcvf ${distdir}/${PN}/${PF}-src.tar.xz ${spkgdir##*/}/ || error "Source package creation failed"
echo;
+
+ # source package hint
+ if [ ! -f ${distdir}/${PN}/${PN}-${PVR}-src.hint ]
+ then
+ pkg_category_var=${PN//[-+\.]/_}_CATEGORY;
+ pkg_summary_var=${PN//[-+\.]/_}_SUMMARY;
+ pkg_description_var=${PN//[-+\.]/_}_DESCRIPTION;
+
+ if [ -f ${C}/${PN}-src.hint ]
+ then
+ cp ${C}/${PN}-src.hint ${distdir}/${PN}/${PN}-${PVR}-src.hint
+ elif [ -f ${C}/setup.hint ]
+ then
+ cp ${C}/setup.hint ${distdir}/${PN}/${PN}-${PVR}-src.hint
+ elif [ -n "${!pkg_category_var:-${CATEGORY}}" \
+ -a -n "${!pkg_summary_var:-${SUMMARY}}${!pkg_description_var:-${DESCRIPTION}}" ]
+ then
+ cat > ${distdir}/${PN}/${PN}-${PVR}-src.hint <<-_EOF
+category: ${!pkg_category_var:-${CATEGORY}}
+build-depends: cygport ${BUILD_REQUIRES}
+sdesc: "${!pkg_summary_var:-${SUMMARY}}"
+ldesc: "${!pkg_description_var:-${DESCRIPTION:-${!pkg_summary_var:-${SUMMARY}}}}"
+skip:
+${pkg_tag}
+_EOF
+ if [ -n "${HOMEPAGE}" ]
+ then
+ cat >> ${distdir}/${PN}/${PN}-${PVR}-src.hint <<-_EOF
+homepage: ${HOMEPAGE}
+_EOF
+ fi
+ else
+ warning "${PN}-src.hint is missing";
+ fi
+ fi
}
__pkg_dist() {
@@ -896,41 +936,6 @@ ${pkg_tag}
_EOF
done
fi
-
- # source package hint
- if [ ! -f ${distdir}/${PN}/${PN}-${PVR}-src.hint ]
- then
- pkg_category_var=${PN//[-+\.]/_}_CATEGORY;
- pkg_summary_var=${PN//[-+\.]/_}_SUMMARY;
- pkg_description_var=${PN//[-+\.]/_}_DESCRIPTION;
-
- if [ -f ${C}/${PN}-src.hint ]
- then
- cp ${C}/${PN}-src.hint ${distdir}/${PN}/${PN}-${PVR}-src.hint
- elif [ -f ${C}/setup.hint ]
- then
- cp ${C}/setup.hint ${distdir}/${PN}/${PN}-${PVR}-src.hint
- elif [ -n "${!pkg_category_var:-${CATEGORY}}" \
- -a -n "${!pkg_summary_var:-${SUMMARY}}${!pkg_description_var:-${DESCRIPTION}}" ]
- then
- cat > ${distdir}/${PN}/${PN}-${PVR}-src.hint <<-_EOF
-category: ${!pkg_category_var:-${CATEGORY}}
-build-depends: cygport ${BUILD_REQUIRES}
-sdesc: "${!pkg_summary_var:-${SUMMARY}}"
-ldesc: "${!pkg_description_var:-${DESCRIPTION:-${!pkg_summary_var:-${SUMMARY}}}}"
-skip:
-${pkg_tag}
-_EOF
- if [ -n "${HOMEPAGE}" ]
- then
- cat >> ${distdir}/${PN}/${PN}-${PVR}-src.hint <<-_EOF
-homepage: ${HOMEPAGE}
-_EOF
- fi
- else
- warning "${PN}-src.hint is missing";
- fi
- fi
}
# protect functions
diff --git a/lib/syntax.cygpart b/lib/syntax.cygpart
index 4ff9973..9ec12f2 100644
--- a/lib/syntax.cygpart
+++ b/lib/syntax.cygpart
@@ -151,6 +151,7 @@ __step() {
__log_init() {
local log=${1}
+ mkdir -p ${logdir}
rm -f ${log}
echo -e cygport ${_cygport_version} '\n' >> ${log}
--
2.31.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-05 14:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-05 14:28 [PATCH cygport] Add srcpackage command Jon Turney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).