diff --git a/contrib/DEBIAN/control b/contrib/DEBIAN/control index 096ee5c24..260b4cd99 100644 --- a/contrib/DEBIAN/control +++ b/contrib/DEBIAN/control @@ -7,13 +7,13 @@ Build-Depends: autoconf, automake, bsdmainutils, build-essential git, g++-multilib, libc6-dev, libtool m4, ncurses-dev, pkg-config, python unzip, wget, zlib1g-dev -Vcs-Git: git@github.com:zcash/zcash.git +Vcs-Git: https://github.com/zcash/zcash.git Vcs-Browser: https://github.com/zcash/zcash Package: zcash Version: 1.0.0-rc4 Architecture: amd64 Depends: libgomp1 -Description: Zcash is an implementation of the "Zerocash" protocol. +Description: An implementation of the "Zerocash" protocol. Based on Bitcoin's code, it intends to offer a far higher standard of privacy and anonymity through a sophisticiated zero-knowledge proving scheme which preserves confidentiality of transaction metadata. diff --git a/contrib/DEBIAN/postinst b/contrib/DEBIAN/postinst index 43294f711..2e6ff8a8d 100755 --- a/contrib/DEBIAN/postinst +++ b/contrib/DEBIAN/postinst @@ -2,8 +2,9 @@ # postinst script for zcash # # see: dh_installdeb(1) + set -e -set -x + # summary of how this script can be called: # * `configure' # * `abort-upgrade' @@ -13,9 +14,10 @@ set -x # * `abort-deconfigure' `in-favour' # `removing' # -# for details, see http://www.debian.org/doc/debian-policy/ or +# for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package + case "$1" in configure) ;; diff --git a/contrib/DEBIAN/postrm b/contrib/DEBIAN/postrm index f397166fe..bb442a682 100755 --- a/contrib/DEBIAN/postrm +++ b/contrib/DEBIAN/postrm @@ -4,7 +4,7 @@ # see: dh_installdeb(1) set -e -#set -x + # summary of how this script can be called: # * `remove' # * `purge' @@ -15,18 +15,12 @@ set -e # * `abort-upgrade' # * `disappear' # -# for details, see http://www.debian.org/doc/debian-policy/ or +# for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package -. /usr/share/debconf/confmodule + case "$1" in - upgrade|failed-upgrade) - ;; - - remove|abort-install|abort-upgrade|disappear) - ;; - - purge) + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) diff --git a/contrib/DEBIAN/preinst b/contrib/DEBIAN/preinst index f07c5a240..7587b4a88 100755 --- a/contrib/DEBIAN/preinst +++ b/contrib/DEBIAN/preinst @@ -4,20 +4,18 @@ # see: dh_installdeb(1) set -e -#set -x + # summary of how this script can be called: # * `install' # * `install' # * `upgrade' # * `abort-upgrade' -# for details, see http://www.debian.org/doc/debian-policy/ or +# for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package -case "$1" in - install) - ;; - upgrade) +case "$1" in + install|upgrade) ;; abort-upgrade) diff --git a/contrib/DEBIAN/prerm b/contrib/DEBIAN/prerm index 5b2697824..6a4f8c033 100755 --- a/contrib/DEBIAN/prerm +++ b/contrib/DEBIAN/prerm @@ -13,15 +13,12 @@ set -e # * `deconfigure' `in-favour' # `removing' # -# for details, see http://www.debian.org/doc/debian-policy/ or +# for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in - remove|deconfigure) - ;; - - upgrade) + remove|upgrade|deconfigure) ;; failed-upgrade) diff --git a/contrib/DEBIAN/rules b/contrib/DEBIAN/rules new file mode 100755 index 000000000..b79cce595 --- /dev/null +++ b/contrib/DEBIAN/rules @@ -0,0 +1,25 @@ +#!/usr/bin/make -f +# See debhelper(7) (uncomment to enable) +# output every command that modifies files on the build system. +#export DH_VERBOSE = 1 + + +# see FEATURE AREAS in dpkg-buildflags(1) +#export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +# see ENVIRONMENT in dpkg-buildflags(1) +# package maintainers to append CFLAGS +#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic +# package maintainers to append LDFLAGS +#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed + + +%: + dh $@ --with autotools_dev + + +# dh_make generated override targets +# This is example for Cmake (See https://bugs.debian.org/641051 ) +#override_dh_auto_configure: +# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) + diff --git a/contrib/DEBIAN/zcash.examples b/contrib/DEBIAN/zcash.examples new file mode 100644 index 000000000..924659c02 --- /dev/null +++ b/contrib/DEBIAN/zcash.examples @@ -0,0 +1 @@ +DEBIAN/examples/zcash.conf diff --git a/contrib/DEBIAN/zcash.manpages b/contrib/DEBIAN/zcash.manpages new file mode 100644 index 000000000..a1115f679 --- /dev/null +++ b/contrib/DEBIAN/zcash.manpages @@ -0,0 +1,2 @@ +DEBIAN/manpages/zcash-cli.1 +DEBIAN/manpages/zcashd.1 diff --git a/zcutil/build-debian-package.sh b/zcutil/build-debian-package.sh index 07c0e0e23..9b48b7843 100755 --- a/zcutil/build-debian-package.sh +++ b/zcutil/build-debian-package.sh @@ -1,6 +1,6 @@ #!/bin/bash ## Usage: -## ./build_DEBIAN_package.sh +## ./zcutil/build-debian-package.sh set -e set -x @@ -8,6 +8,7 @@ set -x BUILD_PATH="/tmp/zcbuild" PACKAGE_NAME="zcash" SRC_PATH=`pwd` +SRC_DEB=$SRC_PATH/contrib/DEBIAN umask 022 @@ -21,15 +22,42 @@ BUILD_DIR="$BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-amd64" if [ -d $BUILD_DIR ]; then rm -R $BUILD_DIR fi -mkdir -p $BUILD_DIR/DEBIAN $BUILD_DIR/usr/bin -cp -r $SRC_PATH/contrib/DEBIAN/* $BUILD_DIR/DEBIAN/ -cp $SRC_PATH/src/zcashd $BUILD_DIR/usr/bin/ -cp $SRC_PATH/src/zcash-cli $BUILD_DIR/usr/bin/ -cp $SRC_PATH/zcutil/fetch-params.sh $BUILD_DIR/usr/bin/zcash-fetch-params +DEB_BIN=$BUILD_DIR/usr/bin +DEB_DOC=$BUILD_DIR/usr/share/doc/$PACKAGE_NAME +DEB_MAN=$BUILD_DIR/usr/share/man/man1 +mkdir -p $BUILD_DIR/DEBIAN $DEB_BIN $DEB_DOC $DEB_MAN +chmod 0755 -R $BUILD_DIR/* -# Create the deb package -dpkg-deb --build $BUILD_DIR +# Copy control file +cp $SRC_DEB/control $BUILD_DIR/DEBIAN +# Package maintainer scripts (currently empty) +#cp $SRC_DEB/postinst $BUILD_DIR/DEBIAN +#cp $SRC_DEB/postrm $BUILD_DIR/DEBIAN +#cp $SRC_DEB/preinst $BUILD_DIR/DEBIAN +#cp $SRC_DEB/prerm $BUILD_DIR/DEBIAN +cp $SRC_DEB/rules $BUILD_DIR/DEBIAN +# Copy binaries +cp $SRC_PATH/src/zcashd $DEB_BIN +cp $SRC_PATH/src/zcash-cli $DEB_BIN +cp $SRC_PATH/zcutil/fetch-params.sh $DEB_BIN/zcash-fetch-params +# Copy docs +cp $SRC_PATH/doc/release-notes/release-notes-$PACKAGE_VERSION.md $DEB_DOC/changelog +cp $SRC_DEB/changelog $DEB_DOC/changelog.Debian +cp $SRC_DEB/copyright $DEB_DOC +cp -r $SRC_DEB/examples $DEB_DOC +# Copy manpages +cp $SRC_DEB/manpages/zcashd.1 $DEB_MAN +cp $SRC_DEB/manpages/zcash-cli.1 $DEB_MAN +# Gzip files +gzip --best -n $DEB_DOC/changelog +gzip --best -n $DEB_DOC/changelog.Debian +gzip --best -n $DEB_MAN/zcashd.1 +gzip --best -n $DEB_MAN/zcash-cli.1 + +# Create the Debian package +fakeroot dpkg-deb --build $BUILD_DIR cp $BUILD_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-amd64.deb $SRC_PATH - +# Analyze with Lintian, reporting bugs and policy violations +lintian -i $SRC_PATH/$PACKAGE_NAME-$PACKAGE_VERSION-amd64.deb exit 0