Skip to content

Commit b1b6c0d

Browse files
committed
Fixed deb creator script: added changelog, man page, copyright
1 parent 31ba583 commit b1b6c0d

1 file changed

Lines changed: 30 additions & 5 deletions

File tree

utils/wp-cli-updatedeb.sh

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ die() {
2424
}
2525

2626
dump_control() {
27-
cat > DEBIAN/control <<CTRL
27+
cat > DEBIAN/control <<EOF
2828
Package: php-wpcli
2929
Version: 0.0.0
3030
Architecture: all
@@ -37,7 +37,7 @@ Description: wp-cli is a set of command-line tools for managing
3737
WordPress installations. You can update plugins, set up multisite
3838
installs and much more, without using a web browser.
3939
40-
CTRL
40+
EOF
4141
}
4242

4343
# deb's dir
@@ -53,6 +53,31 @@ if ! [ -r DEBIAN/control ]; then
5353
dump_control
5454
fi
5555

56+
# copyright
57+
if ! [ -r usr/share/doc/php-wpcli/copyright ];then
58+
mkdir -p usr/share/doc/php-wpcli &> /dev/null
59+
wget -nv -O usr/share/doc/php-wpcli/copyright https://github.com/wp-cli/wp-cli/raw/master/LICENSE.txt
60+
fi
61+
62+
# changelog
63+
if ! [ -r usr/share/doc/php-wpcli/changelog.gz ];then
64+
mkdir -p usr/share/doc/php-wpcli &> /dev/null
65+
echo "Changelog can be found in the blog: http://wp-cli.org/blog/" \
66+
| gzip -9 > usr/share/doc/php-wpcli/changelog.gz
67+
fi
68+
69+
# minimal man page
70+
if ! [ -r usr/share/man/man1/wp.1.gz ];then
71+
mkdir -p usr/share/man/man1 &> /dev/null
72+
{
73+
echo '.TH "WP" "1"'
74+
wp --help
75+
} \
76+
| sed 's/^\([A-Z ]\+\)$/.SH "\1"/' \
77+
| sed 's/^ wp$/wp \\- A command line interface for WordPress/' \
78+
| gzip -9 > usr/share/man/man1/wp.1.gz
79+
fi
80+
5681
# content dirs
5782
[ -d usr/bin ] || mkdir -p usr/bin
5883

@@ -78,6 +103,6 @@ WPCLI_PKG="${PWD}/php-wpcli_${WPCLI_VER}_all.deb"
78103
fakeroot dpkg-deb --build "$DIR" "$WPCLI_PKG" || die 8 "Packaging failed"
79104

80105
# optional steps
81-
echo "sign it: dpkg-sig -k <YOUR-KEY> -s builder \"$WPCLI_PKG\""
82-
echo "include in your repo: pushd /var/www/<REPO-DIR>"
83-
echo "reprepro includedeb wheezy \"$WPCLI_PKG\" && popd"
106+
echo "sign it: dpkg-sig -k YOUR-KEY -s builder \"${WPCLI_PKG}\""
107+
echo "include in your repo: pushd /var/www/REPO-DIR"
108+
echo " reprepro includedeb jessie \"${WPCLI_PKG}\" && popd"

0 commit comments

Comments
 (0)