--- freem-mk-debian-package/mk-debian-package 2025/03/14 00:13:41 1.2
+++ freem-mk-debian-package/mk-debian-package 2025/04/03 03:52:38 1.5
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#
-# $Id: mk-debian-package,v 1.2 2025/03/14 00:13:41 snw Exp $
+# $Id: mk-debian-package,v 1.5 2025/04/03 03:52:38 snw Exp $
# Creates a Debian package for a specific FreeM version
#
#
@@ -26,6 +26,15 @@
# along with FreeM. If not, see .
#
# $Log: mk-debian-package,v $
+# Revision 1.5 2025/04/03 03:52:38 snw
+# Prepare Debian packaging infra for 0.63 series
+#
+# Revision 1.4 2025/03/14 00:58:44 snw
+# Remove dbgsym package from upload
+#
+# Revision 1.3 2025/03/14 00:28:10 snw
+# Support Debian-specific version number
+#
# Revision 1.2 2025/03/14 00:13:41 snw
# Add copyright file
#
@@ -40,22 +49,25 @@
PGM=$(basename $0)
function usage() {
- echo "usage: ${PGM} "
+ echo "usage: ${PGM} "
exit 1
}
-if [[ $# != 1 ]]
+if [[ $# != 3 ]]
then
usage
fi
FREEM_VERSION=$1
+FREEM_VERSION_MOD=$(echo "${FREEM_VERSION}" | sed 's/-/./g')
+FDPKG_VERSION=$2
+FDSSH=$3
SRCDIR=$(pwd)
TMPDIR=$(mktemp -d)
INFILE="freem-${FREEM_VERSION}.tar.gz"
-OUTFILE="${TMPDIR}/freem_${FREEM_VERSION}.orig.tar.gz"
-TARDIR="${TMPDIR}/freem-${FREEM_VERSION}"
+OUTFILE="${TMPDIR}/freem_${FREEM_VERSION_MOD}.orig.tar.gz"
+TARDIR="${TMPDIR}/freem-${FREEM_VERSION_MOD}"
URL="https://freem.coherent-logic.com/downloads/freem-${FREEM_VERSION}.tar.gz"
echo -n "${PGM}: downloading ${URL} to ${OUTFILE}..."
@@ -70,6 +82,7 @@ fi
echo -n "${PGM}: extracting ${OUTFILE} to ${TARDIR}..."
tar zxf "${OUTFILE}" -C "${TMPDIR}"
+mv "${TMPDIR}/freem-${FREEM_VERSION}" "${TMPDIR}/freem-${FREEM_VERSION_MOD}"
if [[ $? == 0 ]]
then
echo "[OK]"
@@ -78,8 +91,6 @@ else
exit 1
fi
-sed -i "s/FREEM_VERSION/${FREEM_VERSION}/g" debian/changelog
-
echo -n "${PGM}: copying Debian packaging control info to ${TARDIR}..."
cp -r debian "${TARDIR}/"
if [[ $? == 0 ]]
@@ -90,7 +101,15 @@ else
exit 1
fi
+sed -i "s/FREEM_VERSION/${FREEM_VERSION_MOD}-${FDPKG_VERSION}/g" "${TARDIR}/debian/changelog"
+sed -i "s/FREEM_VERSION/${FREEM_VERSION}-${FDPKG_VERSION}/g" "${TARDIR}/debian/control"
+
echo "${PGM}: building the package..."
cd "${TARDIR}"
export DEB_BUILD_MAINT_OPTIONS=hardening=-fortify,-format,-stackprotector,-stackprotectorstrong
debuild -us -uc
+
+echo "${PGM}: the package is in ${TMPDIR}"
+
+rm -f ${TMPDIR}/*dbgsym*
+scp ${TMPDIR}/*.deb "${FDSSH}://var/www/freem.coherent-logic.com/downloads/binaries/debian/"