| 1 | #!/bin/bash |
| 2 | # |
| 3 | # Parameter #1: packagename |
| 4 | # |
| 5 | if [ -z "$1" ]; then |
| 6 | echo "Need package name as 1st parameter!" |
| 7 | exit 1 |
| 8 | fi |
| 9 | PRGNAM="$1" |
| 10 | |
| 11 | if [ -f "$PRGNAM" ]; then |
| 12 | echo "A slack-desc file with name '$PRGNAM' already exists, will not overwrite!" |
| 13 | exit 1 |
| 14 | fi |
| 15 | |
| 16 | HOMEPAGE=${HOMEPAGE:-"https://github.com/lxqt/lxqt"} |
| 17 | DESCR=${DESCR:-"short description here"} |
| 18 | MAXDESCR=$(( 70-3-${#PRGNAM} )) |
| 19 | if [ ${#DESCR} -gt $MAXDESCR ]; then |
| 20 | DESCR=${DESCR:0:$MAXDESCR} |
| 21 | fi |
| 22 | |
| 23 | SPCS=""; while [ ${#SPCS} -lt ${#PRGNAM} ]; do SPCS=" $SPCS";done |
| 24 | |
| 25 | cat <<EOT > "$PRGNAM" |
| 26 | # HOW TO EDIT THIS FILE: |
| 27 | # The "handy ruler" below makes it easier to edit a package description. Line |
| 28 | # up the first '|' above the ':' following the base package name, and the '|' |
| 29 | # on the right side marks the last column you can put a character in. You must |
| 30 | # make exactly 11 lines for the formatting to be correct. It's also |
| 31 | # customary to leave one space after the ':'. |
| 32 | |
| 33 | ${SPCS}|-----handy-ruler------------------------------------------------------| |
| 34 | ${PRGNAM}: ${PRGNAM} |
| 35 | ${PRGNAM}: ${DESCR} |
| 36 | ${PRGNAM}: |
| 37 | ${PRGNAM}: |
| 38 | ${PRGNAM}: |
| 39 | ${PRGNAM}: |
| 40 | ${PRGNAM}: This package is part of LXQT 0.16.0 |
| 41 | ${PRGNAM}: Mantainer: danix < danix@danix.xyz > |
| 42 | ${PRGNAM}: |
| 43 | ${PRGNAM}: Home page: ${HOMEPAGE} |
| 44 | ${PRGNAM}: |
| 45 | EOT |