Commit 9f81d4aa authored by Andreas Tille's avatar Andreas Tille
Browse files

Sometimes (for instance on Github) it is convenient to specify the homepage of...

Sometimes (for instance on Github) it is convenient to specify the homepage of the project and assume the last part is the future package name
parent af5501bc
Loading
Loading
Loading
Loading
+20 −7
Original line number Diff line number Diff line
#!/bin/sh
#!/bin/sh -e
# Replaces templates for developer name, source package and data for you

if [ "$DEBEMAIL" = "" ] ; then
@@ -13,20 +13,33 @@ fi

if [ $# -lt 1 ] ; then
  echo "usage: $0 <sourcepackagename>"
  echo "       $0 <homepage>"
  exit
fi

if ! mkdir $1 2>/dev/null ; then
  echo "Unable to create dir $1.  Is it just existing"
if echo "$1" | grep -q '^http.*://' ; then
  PHOMEPAGE="$1"
  PKG=$(echo "$1" | sed 's#^.*/\([^/]\+\)$#\1#' | tr '[:upper:]' '[:lower:]')
  echo PKG="$PKG"
else
  PHOMEPAGE=""
  PKG=$1
fi

if ! mkdir "$PKG" 2>/dev/null ; then
  echo "Unable to create dir $PKG.  Is it just existing"
  exit
fi

# FIXME: Check whether a package with this source name exists on salsa!

cd $1
cp -av `dirname $0`/debian .
cd "$PKG"
cp -av $(dirname "$0")/debian .
cd debian
sed -i "s/<your_ID>/${DEBFULLNAME} <${DEBEMAIL}>/" `find . -maxdepth 1 -type f`
sed -i "s/<pkg>/$1/" `find . -maxdepth 1 -type f`
sed -i "s/<your_ID>/${DEBFULLNAME} <${DEBEMAIL}>/" $(find . -maxdepth 1 -type f)
sed -i "s/<pkg>/$PKG/" $(find . -maxdepth 1 -type f)
CHDATE=$(date -R)
sed -i "s/<timestamp_as_per_date_-R>/${CHDATE}/" changelog
if [ "$PHOMEPAGE" != "" ] ; then
  sed -i "s#<homepage>#$PHOMEPAGE#" control
fi